././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5769408 stripe-10.1.0/0000755000175100001770000000000014637354616012523 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/.coveragerc0000644000175100001770000000017614637354563014651 0ustar00runnerdocker[paths] source = stripe */site-packages [run] branch = true parallel = true source = stripe omit = stripe/six.py ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/.flake80000644000175100001770000000326314637354563013703 0ustar00runnerdocker[flake8] # E501 is the "Line too long" error. We disable it because we use Black for # code formatting. Black makes a best effort to keep lines under the max # length, but can go over in some cases. # W503 goes against PEP8 rules. It's disabled by default, but must be disabled # explicitly when using `ignore`. # E704 is disabled in the default configuration, but by specifying `ignore`, we wipe that out. # ruff formatting creates code that violates it, so we have to disable it manually ignore = E501, W503, E704 per-file-ignores = */__init__.py: IMP100, E402, F401 # we test various import patterns tests/test_exports.py: IMP100, IMP101, IMP102 tests/*: IMP101, IMP102, BAN100, ASY100 # backcompat with outdated import patterns stripe/api_resources/*: IMP100, E402, F401 # IMP101: Do not import stripe # breaking circular dependencies in overrides stripe/_file.py: IMP101 stripe/_account.py: IMP101 stripe/_person.py: IMP101 stripe/_quote.py: IMP101 # IMP102: Do not create public modules # contains a single deprecated class stripe/api_resources/recipient_transfer.py: IMP102 # type names conflict with existing error names in stripe stripe/oauth_error.py: IMP102 # setup.py is required for tooling setup.py: IMP102 # should not raise a deprecation warning since it needs # to be imported early in `stripe/__init__.py` to avoid # a name conflict stripe/app_info.py: IMP102 [flake8:local-plugins] extension = SPY = flake8_stripe:TypingImportsChecker IMP = flake8_stripe:StripeImportsChecker BAN = flake8_stripe:BanPublicMethodsChecker ASY = flake8_stripe:AsyncNamingConventions paths=./flake8_stripe ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/CHANGELOG.md0000644000175100001770000041050714637354563014344 0ustar00runnerdocker## 10.1.0 - 2024-06-27 * [#1353](https://github.com/stripe/stripe-python/pull/1353) Update generated code * Add support for `email_type` on parameter classes `stripe.CreditNote.CreateParams`, `stripe.CreditNote.PreviewLinesParams`, and `stripe.CreditNote.PreviewParams` * Add support for `filters` on parameter classes `stripe.Invoice.CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections`, `stripe.Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnections`, `stripe.SetupIntent.ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections`, `stripe.SetupIntent.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections`, `stripe.SetupIntent.ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnections`, `stripe.Subscription.CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections`, and `stripe.Subscription.ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections` and resource classes `stripe.Invoice.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections`, `stripe.PaymentIntent.PaymentMethodOptions.UsBankAccount.FinancialConnections`, `stripe.SetupIntent.PaymentMethodOptions.UsBankAccount.FinancialConnections`, `stripe.Subscription.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections`, and `stripe.checkout.Session.PaymentMethodOptions.UsBankAccount.FinancialConnections` * Add support for `account_subcategories` on parameter class `stripe.financial_connections.Session.CreateParamsFilters` and resource class `stripe.financial_connections.Session.Filters` * Add support for `reboot_window` on parameter classes `stripe.terminal.Configuration.CreateParams` and `stripe.terminal.Configuration.ModifyParams` and resource `stripe.terminal.Configuration` * Add support for `day` on enum `stripe.billing.Meter.ListEventSummariesParams.value_grouping_window` * Add support for `multibanco` on enums `stripe.PaymentLink.payment_method_types`, `stripe.PaymentLink.CreateParams.payment_method_types`, and `stripe.PaymentLink.ModifyParams.payment_method_types` * Add support for `twint` on enums `stripe.PaymentLink.payment_method_types`, `stripe.PaymentLink.CreateParams.payment_method_types`, and `stripe.PaymentLink.ModifyParams.payment_method_types` * Add support for `zip` on enums `stripe.PaymentLink.payment_method_types`, `stripe.PaymentLink.CreateParams.payment_method_types`, and `stripe.PaymentLink.ModifyParams.payment_method_types` ## 10.0.0 - 2024-06-24 * [#1350](https://github.com/stripe/stripe-python/pull/1350) Update generated code This release changes the pinned API version to 2024-06-20. Please read the [API Upgrade Guide](https://stripe.com/docs/upgrades#2024-06-20) and carefully review the API changes before upgrading. ### ⚠️ Breaking changes * Remove the unused resource `PlatformTaxFee` * Rename `volume_decimal` to `quantity_decimal` on parameter classes `stripe.issuing.Authorization.CaptureParamsPurchaseDetailsFuel`, `stripe.issuing.Transaction.CreateForceCaptureParamsPurchaseDetailsFuel`, and `stripe.issuing.Transaction.CreateUnlinkedRefundParamsPurchaseDetailsFuel` and resource class `stripe.issuing.Transaction.PurchaseDetails.Fuel` ### Additions * Add support for `fleet` on parameter classes `stripe.issuing.Authorization.CaptureParamsPurchaseDetails`, `stripe.issuing.Authorization.CreateParams`, `stripe.issuing.Transaction.CreateForceCaptureParamsPurchaseDetails`, and `stripe.issuing.Transaction.CreateUnlinkedRefundParamsPurchaseDetails`, resource `stripe.issuing.Authorization`, and resource class `stripe.issuing.Transaction.PurchaseDetails` * Add support for new values `platform_disabled`, `paused.inactivity` and `other` on enums `Capability.Requirements.disabled_reason` and `Capability.FutureRequirements.disabled_reason` * Add support for `industry_product_code` on parameter classes `stripe.issuing.Authorization.CaptureParamsPurchaseDetailsFuel`, `stripe.issuing.Transaction.CreateForceCaptureParamsPurchaseDetailsFuel`, and `stripe.issuing.Transaction.CreateUnlinkedRefundParamsPurchaseDetailsFuel` and resource class `stripe.issuing.Transaction.PurchaseDetails.Fuel` * Add support for `quantity_decimal` on parameter classes `stripe.issuing.Authorization.CaptureParamsPurchaseDetailsFuel`, `stripe.issuing.Transaction.CreateForceCaptureParamsPurchaseDetailsFuel`, and `stripe.issuing.Transaction.CreateUnlinkedRefundParamsPurchaseDetailsFuel` and resource class `stripe.issuing.Transaction.PurchaseDetails.Fuel` * Add support for `fuel` on parameter class `stripe.issuing.Authorization.CreateParams` and resource `stripe.issuing.Authorization` * Add support for `_cls_finalize_amount` on resource `stripe.issuing.Authorization` * Add support for `finalize_amount` on resource `stripe.issuing.Authorization` * Change type of `disabled_reason` on `stripe.Capability.FutureRequirements` and `stripe.Capability.Requirements` from `str` to `Literal['other', 'paused.inactivity', 'pending.onboarding', 'pending.review', 'platform_disabled', 'platform_paused', 'rejected.inactivity', 'rejected.other', 'rejected.unsupported_business', 'requirements.fields_needed']` * Add support for `ch_uid` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.CreatePreviewParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` * Add support for `card_canceled`, `card_expired`, `cardholder_blocked`, `insecure_authorization_method` and `pin_blocked` on enum `stripe.issuing.Authorization.RequestHistory.reason` * Add support for `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `pound`, on enums `stripe.issuing.Authorization.CaptureParamsPurchaseDetailsFuel.unit`, `stripe.issuing.Transaction.CreateForceCaptureParamsPurchaseDetailsFuel.unit`, and `stripe.issuing.Transaction.CreateUnlinkedRefundParamsPurchaseDetailsFuel.unit` * Add support for `2024-06-20` on enum `stripe.WebhookEndpoint.CreateParams.api_version` ## 9.12.0 - 2024-06-17 * [#1348](https://github.com/stripe/stripe-python/pull/1348) Update generated code * Add support for `tax_id_collection` on parameter class `stripe.PaymentLink.ModifyParams` * Add support for `mobilepay` on enums `stripe.PaymentLink.payment_method_types`, `stripe.PaymentLink.CreateParams.payment_method_types`, and `stripe.PaymentLink.ModifyParams.payment_method_types` ## 9.11.0 - 2024-06-13 * [#1342](https://github.com/stripe/stripe-python/pull/1342) Update generated code * Add support for `multibanco_payments` on resource class `stripe.Account.Capabilities` and parameter class `stripe.Account.CreateParamsCapabilities` * Add support for `twint_payments` on resource class `stripe.Account.Capabilities` and parameter class `stripe.Account.CreateParamsCapabilities` * Add support for `twint` on resource classes `stripe.Charge.PaymentMethodDetails`, `stripe.ConfirmationToken.PaymentMethodPreview`, and `stripe.PaymentIntent.PaymentMethodOptions`, parameter classes `stripe.ConfirmationToken.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptions`, `stripe.PaymentIntent.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptions`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptions`, `stripe.PaymentMethod.CreateParams`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData`, `stripe.SetupIntent.CreateParamsPaymentMethodData`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData`, and resource `stripe.PaymentMethod` * Add support for `multibanco` on parameter classes `stripe.ConfirmationToken.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptions`, `stripe.PaymentIntent.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptions`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptions`, `stripe.PaymentMethod.CreateParams`, `stripe.PaymentMethodConfiguration.CreateParams`, `stripe.PaymentMethodConfiguration.ModifyParams`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData`, `stripe.SetupIntent.CreateParamsPaymentMethodData`, `stripe.SetupIntent.ModifyParamsPaymentMethodData`, and `stripe.checkout.Session.CreateParamsPaymentMethodOptions`, resource classes `stripe.ConfirmationToken.PaymentMethodPreview`, `stripe.PaymentIntent.PaymentMethodOptions`, `stripe.Refund.DestinationDetails`, and `stripe.checkout.Session.PaymentMethodOptions`, and resources `stripe.PaymentMethod` and `stripe.PaymentMethodConfiguration` * Add support for `multibanco_display_details` on resource class `stripe.PaymentIntent.NextAction` * Add support for `invoice_settings` on resource `stripe.Subscription` * Add support for `de_stn` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.CreatePreviewParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` * Add support for `multibanco` on enums `stripe.checkout.Session.CreateParams.payment_method_types`, `stripe.ConfirmationToken.PaymentMethodPreview.type`, `stripe.ConfirmationToken.CreateParamsPaymentMethodData.type`, `stripe.Customer.ListPaymentMethodsParams.type`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData.type`, `stripe.PaymentIntent.CreateParamsPaymentMethodData.type`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData.type`, `stripe.PaymentMethod.type`, `stripe.PaymentMethod.CreateParams.type`, `stripe.PaymentMethod.ListParams.type`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData.type`, `stripe.SetupIntent.CreateParamsPaymentMethodData.type`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData.type` * Add support for `twint` on enums `stripe.checkout.Session.CreateParams.payment_method_types`, `stripe.ConfirmationToken.PaymentMethodPreview.type`, `stripe.ConfirmationToken.CreateParamsPaymentMethodData.type`, `stripe.Customer.ListPaymentMethodsParams.type`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData.type`, `stripe.PaymentIntent.CreateParamsPaymentMethodData.type`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData.type`, `stripe.PaymentMethod.type`, `stripe.PaymentMethod.CreateParams.type`, `stripe.PaymentMethod.ListParams.type`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData.type`, `stripe.SetupIntent.CreateParamsPaymentMethodData.type`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData.type` ## 9.10.0 - 2024-06-06 * [#1340](https://github.com/stripe/stripe-python/pull/1340) Update generated code * Add support for `gb_bank_transfer_payments`, `jp_bank_transfer_payments`, `mx_bank_transfer_payments`, `sepa_bank_transfer_payments`, `us_bank_transfer_payments` on resource class `stripe.Account.Capabilities` and parameter class `stripe.Account.CreateParamsCapabilities` * Add support for `swish` on enums `stripe.Invoice.PaymentSettings.payment_method_types`, `stripe.Invoice.CreateParamsPaymentSettings.payment_method_types`, `stripe.Invoice.ModifyParamsPaymentSettings.payment_method_types`, `stripe.Subscription.PaymentSettings.payment_method_types`, `stripe.Subscription.CreateParamsPaymentSettings.payment_method_types`, and `stripe.Subscription.ModifyParamsPaymentSettings.payment_method_types` ## 9.9.0 - 2024-05-30 * [#1335](https://github.com/stripe/stripe-python/pull/1335) Add method to list invoice line items * Add methods `list_lines()` and `list_lines_async()` on the class `Invoice` to list the invoice line items * [#1336](https://github.com/stripe/stripe-python/pull/1336) Update generated code * Add support for `generated_from` on resource classes `stripe.ConfirmationToken.PaymentMethodPreview.Card` and `stripe.PaymentMethod.Card` * Add support for `default_value` on parameter classes `stripe.checkout.Session.CreateParamsCustomFieldDropdown`, `stripe.checkout.Session.CreateParamsCustomFieldNumeric`, and `stripe.checkout.Session.CreateParamsCustomFieldText` and resource classes `stripe.checkout.Session.CustomField.Dropdown`, `stripe.checkout.Session.CustomField.Numeric`, and `stripe.checkout.Session.CustomField.Text` * Add support for `verification_requires_additional_proof_of_registration` on enums `stripe.Account.FutureRequirements.Error.code`, `stripe.Account.Requirements.Error.code`, `stripe.BankAccount.FutureRequirements.Error.code`, `stripe.BankAccount.Requirements.Error.code`, `stripe.Capability.FutureRequirements.Error.code`, `stripe.Capability.Requirements.Error.code`, `stripe.Person.FutureRequirements.Error.code`, and `stripe.Person.Requirements.Error.code` * Add support for `issuing_personalization_design.activated` on enums `stripe.Event.type`, `stripe.WebhookEndpoint.CreateParams.enabled_events`, and `stripe.WebhookEndpoint.ModifyParams.enabled_events` * Add support for `issuing_personalization_design.deactivated` on enums `stripe.Event.type`, `stripe.WebhookEndpoint.CreateParams.enabled_events`, and `stripe.WebhookEndpoint.ModifyParams.enabled_events` * Add support for `issuing_personalization_design.rejected` on enums `stripe.Event.type`, `stripe.WebhookEndpoint.CreateParams.enabled_events`, and `stripe.WebhookEndpoint.ModifyParams.enabled_events` * Add support for `issuing_personalization_design.updated` on enums `stripe.Event.type`, `stripe.WebhookEndpoint.CreateParams.enabled_events`, and `stripe.WebhookEndpoint.ModifyParams.enabled_events` * Add support for `en-RO` on enums `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsKlarna.preferred_locale`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsKlarna.preferred_locale`, and `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsKlarna.preferred_locale` * Add support for `ro-RO` on enums `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsKlarna.preferred_locale`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsKlarna.preferred_locale`, and `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsKlarna.preferred_locale` * Change type of `features` on `stripe.issuing.PhysicalBundle` from `Optional[Features]` to `Features` ## 9.8.0 - 2024-05-23 * [#1332](https://github.com/stripe/stripe-python/pull/1332) Update generated code * Add support for `external_account_collection` on resource classes `stripe.AccountSession.Components.Balances.Features` and `stripe.AccountSession.Components.Payouts.Features` and parameter classes `stripe.AccountSession.CreateParamsComponentsBalancesFeatures` and `stripe.AccountSession.CreateParamsComponentsPayoutsFeatures` * Add support for `payment_method_remove` on resource class `stripe.checkout.Session.SavedPaymentMethodOptions` * Add support for `terminal_reader_invalid_location_for_payment` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` ## 9.7.0 - 2024-05-16 * [#1328](https://github.com/stripe/stripe-python/pull/1328) Update generated code * Add support for `fee_source` on resource `stripe.ApplicationFee` * Add support for `net_available` on resource class `stripe.Balance.InstantAvailable` * Add support for `preferred_locales` on resource classes `stripe.Charge.PaymentMethodDetails.CardPresent`, `stripe.ConfirmationToken.PaymentMethodPreview.CardPresent`, and `stripe.PaymentMethod.CardPresent` * Add support for `klarna` on resource class `stripe.Dispute.PaymentMethodDetails` * Add support for `routing` on parameter classes `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsCardPresent`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsCardPresent`, and `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsCardPresent` and resource class `stripe.PaymentIntent.PaymentMethodOptions.CardPresent` * Add support for `application_fee` on resource `stripe.Payout` * Add support for `archived` on parameter class `stripe.entitlements.Feature.ListParams` * Add support for `lookup_key` on parameter class `stripe.entitlements.Feature.ListParams` * Add support for `no_valid_authorization` on parameter classes `stripe.issuing.Dispute.CreateParamsEvidence` and `stripe.issuing.Dispute.ModifyParamsEvidence` and resource class `stripe.issuing.Dispute.Evidence` * Add support for `loss_reason` on resource `stripe.issuing.Dispute` * Add support for `stripe_s700` on parameter classes `stripe.terminal.Configuration.CreateParams` and `stripe.terminal.Configuration.ModifyParams` and resource `stripe.terminal.Configuration` * Add support for `klarna` on enum `stripe.Dispute.PaymentMethodDetails.type` * Add support for `no_valid_authorization` on enums `stripe.issuing.Dispute.Evidence.reason`, `stripe.issuing.Dispute.CreateParamsEvidence.reason`, and `stripe.issuing.Dispute.ModifyParamsEvidence.reason` * Change type of `countries` on `stripe.financial_connections.Session.CreateParamsFilters` from `List[str]` to `NotRequired[List[str]]` * [#1329](https://github.com/stripe/stripe-python/pull/1329) Switch from `black` to `ruff` for formatting ## 9.6.0 - 2024-05-09 * [#1323](https://github.com/stripe/stripe-python/pull/1323) Update generated code * Add support for `allow_redisplay` on resource class `stripe.ConfirmationToken.PaymentMethodPreview` and resource `stripe.PaymentMethod` * Add support for `preview_mode` on parameter classes `stripe.Invoice.CreatePreviewParams`, `stripe.Invoice.UpcomingLinesParams`, and `stripe.Invoice.UpcomingParams` * Add support for `_cls_update` on resources `stripe.treasury.OutboundPayment` and `stripe.treasury.OutboundTransfer` * Add support for `tracking_details` on resources `stripe.treasury.OutboundPayment` and `stripe.treasury.OutboundTransfer` * Add support for `update` on resources `stripe.treasury.OutboundPayment` and `stripe.treasury.OutboundTransfer` * Add support for `treasury.outbound_payment.tracking_details_updated` on enums `stripe.Event.type`, `stripe.WebhookEndpoint.CreateParams.enabled_events`, and `stripe.WebhookEndpoint.ModifyParams.enabled_events` * Add support for `treasury.outbound_transfer.tracking_details_updated` on enums `stripe.Event.type`, `stripe.WebhookEndpoint.CreateParams.enabled_events`, and `stripe.WebhookEndpoint.ModifyParams.enabled_events` ## 9.5.0 - 2024-05-02 * [#1317](https://github.com/stripe/stripe-python/pull/1317) Update generated code * Add support for `paypal` on resource class `stripe.Dispute.PaymentMethodDetails` * Add support for `payment_method_types` on parameter class `stripe.PaymentIntent.ConfirmParams` * Add support for `ship_from_details` on parameter class `stripe.tax.Calculation.CreateParams` and resources `stripe.tax.Calculation` and `stripe.tax.Transaction` * Add support for `bh`, `eg`, `ge`, `ke`, `kz`, `ng`, `om` on resource class `stripe.tax.Registration.CountryOptions` and parameter class `stripe.tax.Registration.CreateParamsCountryOptions` * Add support for `paypal` on enum `stripe.Dispute.PaymentMethodDetails.type` * Add support for `shipping_address_invalid` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` * Change type of `metadata` on `stripe.entitlements.Feature.ModifyParams` from `Dict[str, str]` to `Literal['']|Dict[str, str]` * [#1319](https://github.com/stripe/stripe-python/pull/1319) Fix type change entries in Python Changelog ## 9.4.0 - 2024-04-25 * [#1316](https://github.com/stripe/stripe-python/pull/1316) Update generated code * Add support for `amazon_pay` on resource classes `stripe.Mandate.PaymentMethodDetails` and `stripe.SetupAttempt.PaymentMethodDetails` * Add support for `revolut_pay` on resource classes `stripe.Mandate.PaymentMethodDetails` and `stripe.SetupAttempt.PaymentMethodDetails` * Add support for `setup_future_usage` on resource classes `stripe.PaymentIntent.PaymentMethodOptions.AmazonPay`, `stripe.PaymentIntent.PaymentMethodOptions.RevolutPay`, `stripe.checkout.Session.PaymentMethodOptions.AmazonPay`, and `stripe.checkout.Session.PaymentMethodOptions.RevolutPay` * Add support for `mobilepay` on parameter classes `stripe.PaymentMethodConfiguration.CreateParams` and `stripe.PaymentMethodConfiguration.ModifyParams` and resource `stripe.PaymentMethodConfiguration` * Add support for `ending_before` on parameter class `stripe.PaymentMethodConfiguration.ListParams` * Add support for `limit` on parameter class `stripe.PaymentMethodConfiguration.ListParams` * Add support for `starting_after` on parameter class `stripe.PaymentMethodConfiguration.ListParams` * Change type of `feature` on `stripe.entitlements.ActiveEntitlement` from `str` to `ExpandableField[Feature]` * Add support for `amazon_pay` on enums `stripe.Invoice.PaymentSettings.payment_method_types`, `stripe.Invoice.CreateParamsPaymentSettings.payment_method_types`, `stripe.Invoice.ModifyParamsPaymentSettings.payment_method_types`, `stripe.Subscription.PaymentSettings.payment_method_types`, `stripe.Subscription.CreateParamsPaymentSettings.payment_method_types`, and `stripe.Subscription.ModifyParamsPaymentSettings.payment_method_types` * Add support for `revolut_pay` on enums `stripe.Invoice.PaymentSettings.payment_method_types`, `stripe.Invoice.CreateParamsPaymentSettings.payment_method_types`, `stripe.Invoice.ModifyParamsPaymentSettings.payment_method_types`, `stripe.Subscription.PaymentSettings.payment_method_types`, `stripe.Subscription.CreateParamsPaymentSettings.payment_method_types`, and `stripe.Subscription.ModifyParamsPaymentSettings.payment_method_types` * Remove support for inadvertently released identity verification features `email` and `phone` on parameter classes `stripe.identity.VerificationSession.CreateParamsOptions` and `stripe.identity.VerificationSession.ModifyParamsOptions` * [#1307](https://github.com/stripe/stripe-python/pull/1307) Bump aiohttp from 3.9.2 to 3.9.4 ## 9.3.0 - 2024-04-18 * [#1305](https://github.com/stripe/stripe-python/pull/1305) Update generated code * Add support for `allow_redisplay` on parameter classes `stripe.ConfirmationToken.CreateParamsPaymentMethodData`, `stripe.Customer.ListPaymentMethodsParams`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData`, `stripe.PaymentIntent.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData`, `stripe.PaymentMethod.CreateParams`, `stripe.PaymentMethod.ModifyParams`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData`, `stripe.SetupIntent.CreateParamsPaymentMethodData`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData` * Add support for `schedule_details` on parameter classes `stripe.Invoice.UpcomingLinesParams` and `stripe.Invoice.UpcomingParams` * Add support for `subscription_details` on parameter classes `stripe.Invoice.UpcomingLinesParams` and `stripe.Invoice.UpcomingParams` * Add support for `create_preview` on resource `stripe.Invoice` * Add support for `payment_method_data` on parameter class `stripe.checkout.Session.CreateParams` * Add support for `saved_payment_method_options` on parameter class `stripe.checkout.Session.CreateParams` and resource `stripe.checkout.Session` * Add support for `mobilepay` on parameter class `stripe.checkout.Session.CreateParamsPaymentMethodOptions` and resource class `stripe.checkout.Session.PaymentMethodOptions` * Add support for `mobilepay` on enum `stripe.checkout.Session.CreateParams.payment_method_types` * Add support for `other` on enums `stripe.issuing.Authorization.CaptureParamsPurchaseDetailsFuel.unit`, `stripe.issuing.Transaction.CreateForceCaptureParamsPurchaseDetailsFuel.unit`, and `stripe.issuing.Transaction.CreateUnlinkedRefundParamsPurchaseDetailsFuel.unit` * [#1306](https://github.com/stripe/stripe-python/pull/1306) Update `Quote.pdf()` to use the right base address i.e. files.stripe.com instead of api.stripe.com. Fixes [#1303](https://github.com/stripe/stripe-python/issues/1303) ## 9.2.0 - 2024-04-16 * [#1301](https://github.com/stripe/stripe-python/pull/1301) Update generated code * Add support for `balances` on resource class `stripe.AccountSession.Components` and parameter class `stripe.AccountSession.CreateParamsComponents` * Add support for `payouts_list` on resource class `stripe.AccountSession.Components` and parameter class `stripe.AccountSession.CreateParamsComponents` * Add support for `capture_method` on parameter classes `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsRevolutPay`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsRevolutPay`, and `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsRevolutPay` and resource class `stripe.PaymentIntent.PaymentMethodOptions.RevolutPay` * Add support for `swish` on parameter classes `stripe.PaymentMethodConfiguration.CreateParams` and `stripe.PaymentMethodConfiguration.ModifyParams` and resource `stripe.PaymentMethodConfiguration` * Add support for resource `stripe.entitlements.ActiveEntitlementSummary` * Remove support for `config` on parameter class `stripe.forwarding.Request.CreateParams` and resource `stripe.forwarding.Request`. This field is no longer used by the Forwarding Request API. * Change type of `destination_on_behalf_of_charge_management` on `stripe.AccountSession.Components.PaymentDetails.Features` and `stripe.AccountSession.Components.Payments.Features` from `Optional[bool]` to `bool` * Change type of `timestamp` on `stripe.billing.MeterEvent.CreateParams` from `int` to `NotRequired[int]` * Add support for `entitlements.active_entitlement_summary.updated` on enums `stripe.Event.type`, `stripe.WebhookEndpoint.CreateParams.enabled_events`, and `stripe.WebhookEndpoint.ModifyParams.enabled_events` ## 9.1.0 - 2024-04-11 * [#1300](https://github.com/stripe/stripe-python/pull/1300) Update generated code * Add support for `external_account_collection` on resource class `stripe.AccountSession.Components.AccountOnboarding.Features` and parameter class `stripe.AccountSession.CreateParamsComponentsAccountOnboardingFeatures` * Add support for `account_management` on resource class `stripe.AccountSession.Components` and parameter class `stripe.AccountSession.CreateParamsComponents` * Add support for `notification_banner` on resource class `stripe.AccountSession.Components` and parameter class `stripe.AccountSession.CreateParamsComponents` * Add support for `amazon_pay` on resource classes `stripe.Charge.PaymentMethodDetails`, `stripe.ConfirmationToken.PaymentMethodPreview`, `stripe.PaymentIntent.PaymentMethodOptions`, `stripe.Refund.DestinationDetails`, `stripe.SetupIntent.PaymentMethodOptions`, and `stripe.checkout.Session.PaymentMethodOptions`, parameter classes `stripe.ConfirmationToken.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptions`, `stripe.PaymentIntent.CreateParamsPaymentMethodData`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptions`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptions`, `stripe.PaymentMethod.CreateParams`, `stripe.PaymentMethodConfiguration.CreateParams`, `stripe.PaymentMethodConfiguration.ModifyParams`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData`, `stripe.SetupIntent.ConfirmParamsPaymentMethodOptions`, `stripe.SetupIntent.CreateParamsPaymentMethodData`, `stripe.SetupIntent.CreateParamsPaymentMethodOptions`, `stripe.SetupIntent.ModifyParamsPaymentMethodData`, `stripe.SetupIntent.ModifyParamsPaymentMethodOptions`, and `stripe.checkout.Session.CreateParamsPaymentMethodOptions`, and resources `stripe.PaymentMethod` and `stripe.PaymentMethodConfiguration` * Add support for `next_refresh_available_at` on resource class `stripe.financial_connections.Account.OwnershipRefresh` * Change type of `cancel` on `stripe.billing.MeterEventAdjustment` from `Cancel` to `Optional[Cancel]` * Change type of `identifier` on `stripe.billing.MeterEventAdjustment.Cancel` from `str` to `Optional[str]` * Change type of `identifier` on `stripe.billing.MeterEventAdjustment.CreateParamsCancel` from `str` to `NotRequired[str]` * Change type of `cancel` on `stripe.billing.MeterEventAdjustment.CreateParams` from `MeterEventAdjustment.CreateParamsCancel` to `NotRequired[MeterEventAdjustment.CreateParamsCancel]` * Change type of `type` on `stripe.billing.MeterEventAdjustment.CreateParams` from `NotRequired[Literal['cancel']]` to `Literal['cancel']` * Add support for `bh_vat` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` * Add support for `kz_bin` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` * Add support for `ng_tin` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` * Add support for `om_vat` on enums `stripe.checkout.Session.CustomerDetails.TaxId.type`, `stripe.Customer.CreateParamsTaxIdDatum.type`, `stripe.Customer.CreateTaxIdParams.type`, `stripe.Invoice.CustomerTaxId.type`, `stripe.Invoice.UpcomingParamsCustomerDetailsTaxId.type`, `stripe.Invoice.UpcomingLinesParamsCustomerDetailsTaxId.type`, `stripe.tax.Calculation.CustomerDetails.TaxId.type`, `stripe.tax.Calculation.CreateParamsCustomerDetailsTaxId.type`, `stripe.tax.Transaction.CustomerDetails.TaxId.type`, `stripe.TaxId.type`, and `stripe.TaxId.CreateParams.type` * Add support for `ownership` on enums `stripe.checkout.Session.PaymentMethodOptions.UsBankAccount.FinancialConnections.prefetch`, `stripe.checkout.Session.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections.prefetch`, `stripe.Invoice.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections.permissions`, `stripe.Invoice.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections.prefetch`, `stripe.Invoice.CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections.prefetch`, `stripe.Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections.prefetch`, `stripe.PaymentIntent.PaymentMethodOptions.UsBankAccount.FinancialConnections.prefetch`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections.prefetch`, `stripe.PaymentIntent.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections.prefetch`, `stripe.PaymentIntent.ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnections.prefetch`, `stripe.SetupIntent.PaymentMethodOptions.UsBankAccount.FinancialConnections.prefetch`, `stripe.SetupIntent.ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections.prefetch`, `stripe.SetupIntent.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections.prefetch`, `stripe.SetupIntent.ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnections.prefetch`, `stripe.Subscription.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections.permissions`, `stripe.Subscription.PaymentSettings.PaymentMethodOptions.UsBankAccount.FinancialConnections.prefetch`, `stripe.Subscription.CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections.prefetch`, and `stripe.Subscription.ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections.prefetch` * Add support for `amazon_pay` on enums `stripe.checkout.Session.CreateParams.payment_method_types`, `stripe.ConfirmationToken.PaymentMethodPreview.type`, `stripe.ConfirmationToken.CreateParamsPaymentMethodData.type`, `stripe.Customer.ListPaymentMethodsParams.type`, `stripe.PaymentIntent.ConfirmParamsPaymentMethodData.type`, `stripe.PaymentIntent.CreateParamsPaymentMethodData.type`, `stripe.PaymentIntent.ModifyParamsPaymentMethodData.type`, `stripe.PaymentMethod.type`, `stripe.PaymentMethod.CreateParams.type`, `stripe.PaymentMethod.ListParams.type`, `stripe.SetupIntent.ConfirmParamsPaymentMethodData.type`, `stripe.SetupIntent.CreateParamsPaymentMethodData.type`, and `stripe.SetupIntent.ModifyParamsPaymentMethodData.type` * Add support for `billing_policy_remote_function_response_invalid` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` * Add support for `billing_policy_remote_function_timeout` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` * Add support for `billing_policy_remote_function_unexpected_status_code` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` * Add support for `billing_policy_remote_function_unreachable` on enums `stripe.Invoice.LastFinalizationError.code`, `stripe.PaymentIntent.LastPaymentError.code`, `stripe.SetupAttempt.SetupError.code`, and `stripe.SetupIntent.LastSetupError.code` * [#1297](https://github.com/stripe/stripe-python/pull/1297) Use stdlib AsyncMock when available ## 9.0.0 - 2024-04-10 * [#1286](https://github.com/stripe/stripe-python/pull/1286) * This release changes the pinned API version to `2024-04-10`. Please read the [API Upgrade Guide](https://stripe.com/docs/upgrades#2024-04-10) and carefully review the API changes before upgrading. ### ⚠️ Breaking changes * Remove `FinancialAccountFeaturesService.CreateParams`, `FinancialAccountFeaturesService.ListParams`, `FinancialAccountFeaturesService.create()`, `FinancialAccountFeaturesService.list()` as Financial account features is a singleton and so should have retrieve and update methods instead of create and list methods. * Rename `features` to `marketing_features` on parameter classes `stripe.Product.CreateParams` and `stripe.Product.ModifyParams` and resource `stripe.Product`. #### ⚠️ Removal of enum values, properties and events that are no longer part of the publicly documented Stripe API * Remove `.subscription_pause` from the below as the feature to pause subscription on the portal has been deprecated * `Configuration.Features` * `ConfigurationService.CreateParamsFeatures` * `ConfigurationService.UpdateParamsFeatures` * Remove the below deprecated values for `BalanceTransaction.type` * `obligation_inbound` * `obligation_payout` * `obligation_payout_failure` * `obligation_reversal_outbound` * Remove the below deprecated events from `Event.type`, `WebhookEndpoint.CreateParams.enabled_events`, `WebhookEndpoint.ModifyParams.enabled_events`, `WebhookEndpointService.CreateParams.enabled_events`, `WebhookEndpointService.ModifyParams.enabled_events` * `invoiceitem.updated` * `order.created` * `recipient.created` * `recipient.deleted` * `recipient.updated` * `sku.created` * `sku.deleted` * `sku.updated` * Remove the deprecated value `include_and_require` for `Invoice.CreateParams.pending_invoice_items_behavior` and `InvoiceService.CreateParams.pending_invoice_items_behavior` * Remove the deprecated value `service_tax` for * `TaxRate.RetrieveParams.tax_type` * `TaxRate.CreateParams.tax_type` * `TaxRate.ModifyParams.tax_type` * `TaxRateService.CreateParams.tax_type` * `TaxRateService.UpdateParams.tax_type` * `InvoiceLineItem.ModifyParamsTaxAmountTaxRateData.tax_type` * `InvoiceLineItemService.UpdateParamsTaxAmountTaxRateData.tax_type` * Remove `request_incremental_authorization` from * `PaymentIntent.ConfirmParamsPaymentMethodOptionsCardPresent` * `PaymentIntent.CreateParamsPaymentMethodOptionsCardPresent` * `PaymentIntent.ModifyParamsPaymentMethodOptionsCardPresent` * `PaymentIntentService.ConfirmParamsPaymentMethodOptionsCardPresent` * `PaymentIntentService.CreateParamsPaymentMethodOptionsCardPresent` * `PaymentIntentService.ModifyParamsPaymentMethodOptionsCardPresent` * Remove support for `id_bank_transfer`, `multibanco`, `netbanking`, `pay_by_bank`, and `upi` on `PaymentMethodConfiguration` * Remove the deprecated value `challenge_only` from `SetupIntent.PaymentMethodOptions.Card.request_three_d_secure` * Remove deprecated value `various` for `Climate.Supplier.removal_pathway` * Remove the deprecated value `obligation` for `ReportRun.CreateParamsParameters.reporting_category` and `ReportRunService.CreateParamsParameters.reporting_category` * Remove the legacy field `rendering_options` on parameter classes `stripe.Invoice.CreateParams` and `stripe.Invoice.ModifyParams` and resource `stripe.Invoice`. Use `rendering` instead. ## 8.11.0 - 2024-04-09 * [#1295](https://github.com/stripe/stripe-python/pull/1295) Update generated code * Add support for `fees`, `losses`, `requirement_collection` & `stripe_dashboard` on resource class `stripe.Account.Controller` * Add support for `controller` on parameter class `stripe.Account.CreateParams` * Add support for `create_feature`, `delete_feature`, `list_features`, `retrieve_feature` on resource `stripe.Product` * Add support for resource `stripe.ProductFeature` * Add support for `event_name` on parameter class `stripe.billing.MeterEventAdjustment.CreateParams` and resource `stripe.billing.MeterEventAdjustment` * Add support for `cancel` and `type` on resource `stripe.billing.MeterEventAdjustment` * Add support for resource `stripe.entitlements.ActiveEntitlement` * Add support for resource `stripe.entitlements.Feature` * Add support for `none` on enum `stripe.Account.type` * [#1299](https://github.com/stripe/stripe-python/pull/1299) Fix README.md * [#1292](https://github.com/stripe/stripe-python/pull/1292) Tweak changelog for python async note ## 8.10.0 - 2024-04-04 * [#1288](https://github.com/stripe/stripe-python/pull/1288) Port **async support** from beta to the stable channel. To use it, add an `_async` suffix to any request-making method. ```diff - cus = stripe.Customer.create(...) + cus = await stripe.Customer.create_async(...) ``` See the [README](./README.md#async) for detailed usage instructions. Support is provided out of the box for async requests via the HTTPX (used by default) and aiohttp libraries. For other libraries, you can also provide your own `stripe.HTTPClient` implementation. Please do not hesitate to [open a Github issue](https://github.com/stripe/stripe-python/issues/new/choose) if you have any feedback on this feature. * [#1284](https://github.com/stripe/stripe-python/pull/1284) Update generated code * Add support for `subscription_item` on resource `stripe.Discount` * Add support for `promotion_code` on parameter classes `stripe.Invoice.CreateParamsDiscount`, `stripe.Invoice.ModifyParamsDiscount`, `stripe.InvoiceItem.CreateParamsDiscount`, `stripe.InvoiceItem.ModifyParamsDiscount`, `stripe.InvoiceLineItem.ModifyParamsDiscount`, `stripe.Quote.CreateParamsDiscount`, and `stripe.Quote.ModifyParamsDiscount` * Add support for `discounts` on parameter classes `stripe.Invoice.UpcomingLinesParamsSubscriptionItem`, `stripe.Invoice.UpcomingParamsSubscriptionItem`, `stripe.Quote.CreateParamsLineItem`, `stripe.Quote.ModifyParamsLineItem`, `stripe.Subscription.CreateParams`, `stripe.Subscription.CreateParamsAddInvoiceItem`, `stripe.Subscription.CreateParamsItem`, `stripe.Subscription.ModifyParams`, `stripe.Subscription.ModifyParamsAddInvoiceItem`, `stripe.Subscription.ModifyParamsItem`, `stripe.SubscriptionItem.CreateParams`, `stripe.SubscriptionItem.ModifyParams`, `stripe.SubscriptionSchedule.CreateParamsPhase`, `stripe.SubscriptionSchedule.CreateParamsPhaseAddInvoiceItem`, `stripe.SubscriptionSchedule.CreateParamsPhaseItem`, `stripe.SubscriptionSchedule.ModifyParamsPhase`, `stripe.SubscriptionSchedule.ModifyParamsPhaseAddInvoiceItem`, and `stripe.SubscriptionSchedule.ModifyParamsPhaseItem`, resources `stripe.Subscription` and `stripe.SubscriptionItem`, and resource classes `stripe.SubscriptionSchedule.Phase.AddInvoiceItem`, `stripe.SubscriptionSchedule.Phase.Item`, and `stripe.SubscriptionSchedule.Phase` * Add support for `zip` on parameter classes `stripe.PaymentMethodConfiguration.CreateParams` and `stripe.PaymentMethodConfiguration.ModifyParams` and resource `stripe.PaymentMethodConfiguration` * Add support for `offline` on resource class `stripe.SetupAttempt.PaymentMethodDetails.CardPresent` * Add support for `card_present` on parameter classes `stripe.SetupIntent.ConfirmParamsPaymentMethodOptions`, `stripe.SetupIntent.CreateParamsPaymentMethodOptions`, and `stripe.SetupIntent.ModifyParamsPaymentMethodOptions` and resource class `stripe.SetupIntent.PaymentMethodOptions` * Add support for `email` on resource `stripe.identity.VerificationReport`, parameter classes `stripe.identity.VerificationSession.CreateParamsOptions` and `stripe.identity.VerificationSession.ModifyParamsOptions`, and resource classes `stripe.identity.VerificationSession.Options` and `stripe.identity.VerificationSession.VerifiedOutputs` * Add support for `phone` on resource `stripe.identity.VerificationReport`, parameter classes `stripe.identity.VerificationSession.CreateParamsOptions` and `stripe.identity.VerificationSession.ModifyParamsOptions`, and resource classes `stripe.identity.VerificationSession.Options` and `stripe.identity.VerificationSession.VerifiedOutputs` * Add support for `verification_flow` on resources `stripe.identity.VerificationReport` and `stripe.identity.VerificationSession` and parameter class `stripe.identity.VerificationSession.CreateParams` * Add support for `provided_details` on parameter classes `stripe.identity.VerificationSession.CreateParams` and `stripe.identity.VerificationSession.ModifyParams` and resource `stripe.identity.VerificationSession` * Add support for `allowed_merchant_countries` on parameter classes `stripe.issuing.Card.CreateParamsSpendingControls`, `stripe.issuing.Card.ModifyParamsSpendingControls`, `stripe.issuing.Cardholder.CreateParamsSpendingControls`, and `stripe.issuing.Cardholder.ModifyParamsSpendingControls` and resource classes `stripe.issuing.Card.SpendingControls` and `stripe.issuing.Cardholder.SpendingControls` * Add support for `blocked_merchant_countries` on parameter classes `stripe.issuing.Card.CreateParamsSpendingControls`, `stripe.issuing.Card.ModifyParamsSpendingControls`, `stripe.issuing.Cardholder.CreateParamsSpendingControls`, and `stripe.issuing.Cardholder.ModifyParamsSpendingControls` and resource classes `stripe.issuing.Card.SpendingControls` and `stripe.issuing.Cardholder.SpendingControls` * Change type of `reference` on `stripe.checkout.Session.CreateParamsPaymentMethodOptionsSwish` from `Literal['']|str` to `str` * Add support for `verification_flow` on enums `stripe.identity.VerificationReport.type` and `stripe.identity.VerificationSession.type` * Add support for `email_unverified_other` on enum `stripe.identity.VerificationSession.LastError.code` * Add support for `email_verification_declined` on enum `stripe.identity.VerificationSession.LastError.code` * Add support for `phone_unverified_other` on enum `stripe.identity.VerificationSession.LastError.code` * Add support for `phone_verification_declined` on enum `stripe.identity.VerificationSession.LastError.code` * Add support for `mobile_phone_reader` on enums `stripe.terminal.Reader.device_type` and `stripe.terminal.Reader.ListParams.device_type` * Change type of `type` on `stripe.identity.VerificationSession.CreateParams` from `Literal['document', 'id_number']` to `NotRequired[Literal['document', 'id_number']]` * Change type of `discounts` on `stripe.Invoice` and `stripe.InvoiceLineItem` from `Optional[List[ExpandableField[Discount]]]` to `List[ExpandableField[Discount]]` * Change type of `data` on `stripe.PaymentIntent.NextAction.SwishHandleRedirectOrDisplayQrCode.QrCode` from `Optional[str]` to `str` * Change type of `image_url_png` on `stripe.PaymentIntent.NextAction.SwishHandleRedirectOrDisplayQrCode.QrCode` from `Optional[str]` to `str` * Change type of `image_url_svg` on `stripe.PaymentIntent.NextAction.SwishHandleRedirectOrDisplayQrCode.QrCode` from `Optional[str]` to `str` * Change type of `hosted_instructions_url` on `stripe.PaymentIntent.NextAction.SwishHandleRedirectOrDisplayQrCode` from `Optional[str]` to `str` * Change type of `mobile_auth_url` on `stripe.PaymentIntent.NextAction.SwishHandleRedirectOrDisplayQrCode` from `Optional[str]` to `str` * Change type of `qr_code` on `stripe.PaymentIntent.NextAction.SwishHandleRedirectOrDisplayQrCode` from `Optional[QrCode]` to `QrCode` * [#1289](https://github.com/stripe/stripe-python/pull/1289) Bump aiohttp from 3.9.0 to 3.9.2 ## 8.9.0 - 2024-03-28 * [#1276](https://github.com/stripe/stripe-python/pull/1276) Update generated code * Add support for new resources `Billing.MeterEventAdjustment`, `Billing.MeterEvent`, and `Billing.Meter` * Add support for `create`, `deactivate`, `list`, `modify`, `reactivate`, and `retrieve` methods on resource `Meter` * Add support for `create` method on resources `MeterEventAdjustment` and `MeterEvent` * Add support for `amazon_pay_payments` on `Account.Capabilities`, `Account.CreateParamsCapabilities`, `Account.UpdateParamsCapabilities`,`AccountService.CreateParamsCapabilities`, and `AccountService.UpdateParamsCapabilities` * Add support for new value `verification_failed_representative_authority` on enums `Account.FutureRequirements.Error.code`, `Account.Requirements.Errors.code`, `BankAccount.FutureRequirements.Error.code`, `BankAccount.Requirements.Errors.code`, `Capability.FutureRequirements.Error.code`, `Capability.Requirements.Errors.code`, `Person.FutureRequirements.Error.code`, `Person.Requirements.Errors.code`, * Add support for `destination_on_behalf_of_charge_management` on `AccountSession.Components.PaymentDetails.Features`, `AccountSession.Components.Payments.Features`, `AccountSession.CreateParamsComponentsPaymentDetailsFeatures`, `AccountSession.CreateParamsComponentsPaymentsFeatures`, `AccountSessionService.CreateParamsComponentsPaymentDetailsFeatures` and `AccountSessionService.CreateParamsComponentsPaymentsFeatures` * Add support for `meter` on `Plan.CreateParams`, `Plan`, `PlanService.CreateParams`, `Price.Recurring`, `Price.CreateParamsRecurring`, `Price.ListParamsRecurring`, `PriceService.CreateParamsRecurring`, and `PriceService.ListParamsRecurring` * Add support for `mandate` on `Charge.PaymentMethodDetails.USBankAccount`, `Treasury.InboundTransfer.OriginPaymentMethodDetails.USBankAccount`, `Treasury.OutboundPayment.DestinationPaymentMethodDetails.USBankAccount`, and `Treasury.OutboundTransfer.DestinationPaymentMethodDetails.USBankAccount` * Add support for `second_line` on `Issuing.Card.CreateParams` * [#1278](https://github.com/stripe/stripe-python/pull/1278) Types: remove unnecessary quotes * [#1279](https://github.com/stripe/stripe-python/pull/1279) Update README.md ## 8.8.0 - 2024-03-21 * [#1273](https://github.com/stripe/stripe-python/pull/1273) Update generated code * Add support for new resources `ConfirmationToken` and `Forwarding.Request` * Add support for `retrieve` method on resource `ConfirmationToken` * Add support for `create`, `list`, and `retrieve` methods on resource `Request` * Add support for `mobilepay_payments` on `Account.Capabilities`, `Account.CreateParamsCapabilities`, and `Account.UpdateParamsCapabilities` * Add support for new values `forwarding_api_inactive`, `forwarding_api_invalid_parameter`, `forwarding_api_upstream_connection_error`, and `forwarding_api_upstream_connection_timeout` on enums `Invoice.LastFinalizationError.code`, `PaymentIntent.LastPaymentError.code`, `SetupAttempt.SetupError.code`, `SetupIntent.LastSetupError.code`, and `StripeError.code` * Add support for `payment_reference` on `Charge.PaymentMethodDetails.UsBankAccount` * Add support for `payout` on `Treasury.ReceivedDebit.LinkedFlows` * Add support for `name` on `ConfigurationService.CreateParams`, `ConfigurationService.UpdateParams`, and `Configuration` for terminal * Add support for `confirmation_token` on `PaymentIntentService.ConfirmParams`, `PaymentIntentService.CreateParams`, `SetupIntentService.ConfirmParams`, and `SetupIntentService.CreateParams` * Add support for new value `mobilepay` on enums `Customer.ListPaymentMethodsParams.type`, `PaymentMethod.CreateParams.type`, and `PaymentMethod.ListParams.type` * Add support for `mobilepay` on `Charge.PaymentMethodDetails`, `PaymentIntent.PaymentMethodOptions`, `PaymentIntentService.ConfirmParamsPaymentMethodData`, `PaymentIntentService.ConfirmParamsPaymentMethodOptions`, `PaymentIntentService.CreateParamsPaymentMethodData`, `PaymentIntentService.CreateParamsPaymentMethodOptions`, `PaymentIntentService.UpdateParamsPaymentMethodData`, `PaymentIntentService.UpdateParamsPaymentMethodOptions`, `PaymentMethod.CreateParams`, `PaymentMethod`, `SetupIntentService.ConfirmParamsPaymentMethodData`, `SetupIntentService.CreateParamsPaymentMethodData`, and `SetupIntentService.UpdateParamsPaymentMethodData` * Add support for new value `mobilepay` on enums `PaymentIntentService.ConfirmParamsPaymentMethodData.type`, `PaymentIntentService.CreateParamsPaymentMethodData.type`, `PaymentIntentService.UpdateParamsPaymentMethodData.type`, `SetupIntentService.ConfirmParamsPaymentMethodData.type`, `SetupIntentService.CreateParamsPaymentMethodData.type`, and `SetupIntentService.UpdateParamsPaymentMethodData.type` * Add support for new value `mobilepay` on enum `PaymentMethod.type` ## 8.7.0 - 2024-03-14 * [#1269](https://github.com/stripe/stripe-python/pull/1269) Update generated code * Add support for `personalization_design` on parameter classes `CardService.CreateParams`, `CardService.ListParams`, `CardService.UpdateParams`, `stripe.issuing.Card.CreateParams`, `stripe.issuing.Card.ListParams`, and `stripe.issuing.Card.ModifyParams` and resource `stripe.issuing.Card` * Add support for `sepa_debit` on parameter classes `SubscriptionService.CreateParamsPaymentSettingsPaymentMethodOptions`, `SubscriptionService.UpdateParamsPaymentSettingsPaymentMethodOptions`, `stripe.Subscription.CreateParamsPaymentSettingsPaymentMethodOptions`, and `stripe.Subscription.ModifyParamsPaymentSettingsPaymentMethodOptions` and resource class `stripe.Subscription.PaymentSettings.PaymentMethodOptions` * Add support for resource `stripe.issuing.PersonalizationDesign` * Add support for resource `stripe.issuing.PhysicalBundle` * Change type from `float` to `Literal['']|float` of `application_fee_percent` on fields `stripe.Subscription.CreateParams`, `stripe.Subscription.ModifyParams`, `SubscriptionService.UpdateParams`, and `SubscriptionService.CreateParams` ## 8.6.0 - 2024-03-07 * [#1267](https://github.com/stripe/stripe-python/pull/1267) Update generated code * Add support for `documents` on `AccountSession.Components` * Add support for `request_three_d_secure` on `Checkout.Session.PaymentMethodOptionsCard` and `Checkout.Session.CreateParams.PaymentMethodOptionsCard` * Add support for `created` on `CreditNote.ListParams` * Add support for `sepa_debit` on `Invoice.PaymentSettings.PaymentMethodOptions`, `InvoiceCreateParams.PaymentSettings.PaymentMethodOptions`, and `InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions` * [#1268](https://github.com/stripe/stripe-python/pull/1268) Update README.md ## 8.5.0 - 2024-02-29 * [#1255](https://github.com/stripe/stripe-python/pull/1255) Update generated code * Change `identity.VerificationReport.type` to be required * Change type of `identity.VerificationSession.type` from `Optional[Literal["document", "id_number"]]` to `Literal["document", "id_number"]` * Add support for `number` on `Invoice.CreateParams` and `Invoice.ModifyParams` * Add support for `enable_customer_cancellation` on `terminal.Reader.Action.ProcessPaymentIntent.process_config`, `Terminal.Reader.Action.ProcessSetupIntent.process_config`, `Terminal.Reader.ProcessPaymentIntentParams.process_config`, and `Terminal.Reader.ProcessSetupIntentParams.process_config` * Add support for `refund_payment_config` on `Terminal.Reader.Action.refund_payment` and `Terminal.Reader.RefundPaymentParams` * Add support for `payment_method` on `Token.CreateParams.bank_account` * Add `list_refunds` and `retrieve_refund` methods on resource `Charge`. * [#1260](https://github.com/stripe/stripe-python/pull/1260) Update README to use add_beta_version * [#1250](https://github.com/stripe/stripe-python/pull/1250) Fix type of ErrorObject.code ## 8.4.0 - 2024-02-22 * [#1241](https://github.com/stripe/stripe-python/pull/1241) Update generated code - Add `InvoiceLineItem.modify` method. * [#1244](https://github.com/stripe/stripe-python/pull/1244) Add TaxIds API * Add support for `create`, `retrieve`, `delete`, and `list` methods on resource `TaxId` * The `instance_url` function on resource `TaxId` now returns the top-level `/v1/tax_ids/{id}` path instead of the `/v1/customers/{customer}/tax_ids/{id}` path. * [#1243](https://github.com/stripe/stripe-python/pull/1243) Remove http client base * [#1242](https://github.com/stripe/stripe-python/pull/1242) Testing: unify http client mock ## 8.3.0 - 2024-02-15 * [#1230](https://github.com/stripe/stripe-python/pull/1230) Update generated code * Add support for `networks` on `Card`, `PaymentMethod.CreateParamsCard`, `PaymentMethod.ModifyParamsCard`, and `Token.CreateParamsCard` * Add support for new value `no_voec` on enums `Checkout.Session.CustomerDetails.TaxId.type`, `Invoice.CustomerTaxId.type`, `Tax.Calculation.CustomerDetails.TaxId.type`, `Tax.Transaction.CustomerDetails.TaxId.type`, and `TaxId.type` * Add support for new value `no_voec` on enums `Customer.CreateParams.tax_id_data[].type`, `Invoice.UpcomingLinesParams.customer_details.tax_ids[].type`, `Invoice.UpcomingParams.customer_details.tax_ids[].type`, and `Tax.Calculation.CreateParams.customer_details.tax_ids[].type` * Add support for new value `financial_connections.account.refreshed_ownership` on enum `Event.type` * Add support for `display_brand` on `PaymentMethod.card` * Add support for new value `financial_connections.account.refreshed_ownership` on enums `WebhookEndpoint.CreateParams.enabled_events[]` and `WebhookEndpoint.UpdateParams.enabled_events[]` * [#1237](https://github.com/stripe/stripe-python/pull/1237) Remove broken child methods * Bugfix: remove support for `CreditNoteLineItem.list`, `CustomerCashBalanceTransaction.list`, and `CustomerCashBalanceTransaction.retrieve`. These methods were included in the library unintentionally and never functioned. * [#1232](https://github.com/stripe/stripe-python/pull/1232) Improve types in _http_client.py ## 8.2.0 - 2024-02-08 * [#1225](https://github.com/stripe/stripe-python/pull/1225) Update generated code * Add support for `invoices` on `Account.Settings` * Add support for new value `velobank` on various enums `PaymentMethodDetails.P24.bank` * Add support for `setup_future_usage` on `PaymentMethodOptions.Blik` * Add support for `require_cvc_recollection` on `PaymentMethodOptions.Card` * Add support for `account_tax_ids` on various `InvoiceSettings` request parameters * [#1223](https://github.com/stripe/stripe-python/pull/1223) Move StripeClient usage collection onto StripeService * [#1220](https://github.com/stripe/stripe-python/pull/1220) Measure StripeClient usage ## 8.1.0 - 2024-02-01 * [#1213](https://github.com/stripe/stripe-python/pull/1213) Update generated code * Add support for `swish` payment method throughout the API * Add support for `relationship` on parameter classes `Account.CreateParamsIndividual` and `Token.CreateParamsAccountIndividual` * Add support for `jurisdiction_level` on resource `TaxRate` * Change type from `str` to `Literal["offline", "online"]` of `status` on field `terminal.Reader` ## 8.0.0 - 2024-01-25 * [#1206](https://github.com/stripe/stripe-python/pull/1206) stripe-python v8 release This release introduces `StripeClient` and a service-based call pattern. This new interface allows you to easily call Stripe APIs and has several benefits over the existing resource-based pattern: * No global config: you can simultaneously use multiple clients with different configuration options (such as API keys) * No static methods for easier mocking For full migration instructions, please refer to the [v8 migration guide](https://github.com/stripe/stripe-python/wiki/Migration-guide-for-v8-(StripeClient)). "⚠️" symbol highlights breaking changes ### ⚠️ Changed * ⚠️ **Request options like `api_key`, `stripe_account`, `stripe_version`, and `idempotency_key` can no longer be passed in positionally on resource methods. Please pass these in as keyword arguments.** **BEFORE** ```python stripe.Customer.create( "sk_test_123", # api key "KG5LxwFBepaKHyUD", # idempotency key "2022-11-15", # stripe version "acct_123", # stripe account ) ``` **AFTER** ```python stripe.Customer.create( api_key="sk_test_123", idempotency_key="KG5LxwFBepaKHyUD", stripe_version="2022-11-15", stripe_account="acct_123", ) ``` * ⚠️ Methods that turn a response stream (`Quote.pdf`) now returns a single value of type `StripeResponseStream` instead of a tuple containing `(StripeResponseStream, api_key)`. * ⚠️ Removed public access to `APIRequestor`. `APIRequestor`'s main use is internal, and we don't have a good understanding of its external use cases. We had to make several breaking changes to its interface as part of this update, so rather than leaving it public we made it private. If you have a use case for `APIRequestor`, please open up a Github issue describing it. We'd rather you rely on something specifically designed for your use case than having to reach into the library's internals. ### ⚠️ Removed * ⚠️ Remove `api_version` from `File.create` parameters. Please use `stripe_version` instead. * ⚠️ Remove `util.read_special_variable()` utility method (importing directly from `stripe.util` is deprecated as of [v7.8.0](https://github.com/stripe/stripe-python/blob/master/CHANGELOG.md#780---2023-12-07)) * ⚠️ Remove `StripeError.construct_error_object()`. This method was intended for internal stripe-python use only. * ⚠️ Remove `ListObject.empty_list()`. This method was intended for internal stripe-python use only. * ⚠️ Remove `SearchResultObject.empty_search_result()`. This method was intended for internal stripe-python use only. * ⚠️ Remove `StripeObject.ReprJSONEncoder`. This class was intended for internal stripe-python use only. * ⚠️ Remove `StripeObject.api_base`. This property was defunct and returned `None`. ## 7.14.0 - 2024-01-25 * [#1199](https://github.com/stripe/stripe-python/pull/1199) Update generated code * Add support for `annual_revenue` and `estimated_worker_count` on `Account.business_profile`, `Account.CreateParams.business_profile`, and `Account.UpdateParams.business_profile` * Add support for new value `registered_charity` on enums `Account.CreateParams.company.structure`, `Account.UpdateParams.company.structure`, and `Token.CreateParams.account.company.structure` * Add support for `collection_options` on `AccountLink.CreateParams` * Add support for `liability` on `Checkout.Session.automatic_tax`, `PaymentLink.automatic_tax`, `PaymentLink.CreateParams.automatic_tax`, `PaymentLink.UpdateParams.automatic_tax`, `Quote.automatic_tax`, `Quote.CreateParams.automatic_tax`, `Quote.UpdateParams.automatic_tax`, `SubscriptionSchedule.default_settings.automatic_tax`, `SubscriptionSchedule.phases[].automatic_tax`, `SubscriptionSchedule.CreateParams.default_settings.automatic_tax`, `SubscriptionSchedule.CreateParams.phases[].automatic_tax`, `SubscriptionSchedule.UpdateParams.default_settings.automatic_tax`, `SubscriptionSchedule.UpdateParams.phases[].automatic_tax`, and `checkout.Session.CreateParams.automatic_tax` * Add support for `issuer` on `Checkout.Session.invoice_creation.invoice_data`, `PaymentLink.invoice_creation.invoice_data`, `PaymentLink.CreateParams.invoice_creation.invoice_data`, `PaymentLink.UpdateParams.invoice_creation.invoice_data`, `Quote.invoice_settings`, `Quote.CreateParams.invoice_settings`, `Quote.UpdateParams.invoice_settings`, `SubscriptionSchedule.default_settings.invoice_settings`, `SubscriptionSchedule.phases[].invoice_settings`, `SubscriptionSchedule.CreateParams.default_settings.invoice_settings`, `SubscriptionSchedule.CreateParams.phases[].invoice_settings`, `SubscriptionSchedule.UpdateParams.default_settings.invoice_settings`, `SubscriptionSchedule.UpdateParams.phases[].invoice_settings`, and `checkout.Session.CreateParams.invoice_creation.invoice_data` * Add support for `invoice_settings` on `PaymentLink.subscription_data`, `PaymentLink.CreateParams.subscription_data`, `PaymentLink.UpdateParams.subscription_data`, and `checkout.Session.CreateParams.subscription_data` * Add support for new value `challenge` on enums `Invoice.CreateParams.payment_settings.payment_method_options.card.request_three_d_secure`, `Invoice.UpdateParams.payment_settings.payment_method_options.card.request_three_d_secure`, `Subscription.CreateParams.payment_settings.payment_method_options.card.request_three_d_secure`, and `Subscription.UpdateParams.payment_settings.payment_method_options.card.request_three_d_secure` * Add support for `promotion_code` on `Invoice.UpcomingLinesParams.discounts[]`, `Invoice.UpcomingLinesParams.invoice_items[].discounts[]`, `Invoice.UpcomingParams.discounts[]`, and `Invoice.UpcomingParams.invoice_items[].discounts[]` * Add support for `account_type` on `PaymentMethod.UpdateParams.us_bank_account` ## 7.13.0 - 2024-01-18 * [#1193](https://github.com/stripe/stripe-python/pull/1193) Update generated code * Add support for providing details about `BankAccount`, `Card`, and `CardToken` on `Account.CreateExternalAccountParams.external_account` and `Account.CreateParams.external_account` * Add support for new value `nn` on enums `Charge.PaymentMethodDetails.Ideal.bank`, `PaymentIntent.ConfirmParamsPaymentMethodDataIdeal.bank`, `PaymentIntent.CreateParamsPaymenMethodDataIdeal.bank`, `PaymentIntent.UpdateParamsPaymentMethodDataIdeal.bank`, `PaymentMethod.Ideal.bank`, `PaymentMethod.CreateParamsIdeal.bank`, `SetupAttempt.PaymentMethodDetails.Ideal.bank`, `SetupIntent.ConfirmParamsPaymenMethodDataIdeal.bank`, `SetupIntent.CreateParamsPaymenMethodDataIdeal.bank`, and `SetupIntent.UpdateParamsPaymenMethodDataIdeal.bank` * Add support for new value `NNBANL2G` on enums `Charge.PaymentMethodDetails.Ideal.bic`, `PaymentMethod.Ideal.bic`, and `SetupAttempt.PaymentMethodDetails.Ideal.bic` * Change `CustomerSession.Components.buy_button` and `CustomerSession.Components.pricing_table` to be required * Add support for `issuer` on `Invoice.CreateParams`, `Invoice.UpcomingLinesParams`, `Invoice.UpcomingParams`, `Invoice.UpdateParams`, and `Invoice` * Add support for `liability` on `Invoice.automatic_tax`, `Invoice.CreateParams.automatic_tax`, `Invoice.UpcomingLinesParams.automatic_tax`, `Invoice.UpcomingParams.automatic_tax`, `Invoice.UpdateParams.automatic_tax`, `Subscription.automatic_tax`, `Subscription.CreateParams.automatic_tax`, and `Subscription.UpdateParams.automatic_tax` * Add support for `on_behalf_of` on `Invoice.UpcomingLinesParams` and `Invoice.UpcomingParams` * Add support for `pin` on `issuing.Card.CreateParams` * Add support for `revocation_reason` on `Mandate.PaymentMethodDetails.bacs_debit` * Add support for `customer_balance` on `PaymentMethodConfiguration.CreateParams`, `PaymentMethodConfiguration.UpdateParams`, and `PaymentMethodConfiguration` * Add support for `invoice_settings` on `Subscription.CreateParams` and `Subscription.UpdateParams` ## 7.12.0 - 2024-01-12 * [#1188](https://github.com/stripe/stripe-python/pull/1188) Update generated code * Add support for new resource `CustomerSession` * Add support for `create` method on resource `CustomerSession` * Remove support for values `obligation_inbound`, `obligation_payout_failure`, `obligation_payout`, and `obligation_reversal_outbound` from enum `BalanceTransaction.type` * Add support for new values `eps` and `p24` on enums `Invoice.payment_settings.payment_method_types[]`, `InvoiceCreateParams.payment_settings.payment_method_types[]`, `InvoiceUpdateParams.payment_settings.payment_method_types[]`, `Subscription.payment_settings.payment_method_types[]`, `SubscriptionCreateParams.payment_settings.payment_method_types[]`, and `SubscriptionUpdateParams.payment_settings.payment_method_types[]` * Remove support for value `obligation` from enum `Reporting.ReportRunCreateParams.parameters.reporting_category` * Add support for `billing_cycle_anchor_config` on `SubscriptionCreateParams` and `Subscription` ## 7.11.0 - 2024-01-04 * [#1186](https://github.com/stripe/stripe-python/pull/1186) Update generated code * Add support for `retrieve` on resource `tax.Registration` * Change type from `Optional[PaymentDetails]` to `PaymentDetails` of `payment_details` on field `AccountSession.Components` * Change type from `Optional[Payments]` to `Payments` of `payments` on field `AccountSession.Components` * Change type from `Optional[Payouts]` to `Payouts` of `payouts` on field `AccountSession.Components` * Change type from `Optional[Features]` to `Features` of `features` on fields `AccountSession.Components.PaymentDetails`, `AccountSession.Components.Payments`, and `AccountSession.Components.Payouts` * Change type from `Optional[InvoiceSettings]` to `InvoiceSettings` of `invoice_settings` on field `SubscriptionSchedule.DefaultSettings` ## 7.10.0 - 2023-12-22 * [#1176](https://github.com/stripe/stripe-python/pull/1176) Update generated code * Add support for new resource `FinancialConnections.Transaction` * Add support for `list` and `retrieve` methods on resource `Transaction` * Add support for `subscribe` and `unsubscribe` methods on resource `FinancialConnections.Account` * Add support for `features` on `AccountSessionCreateParams.components.payouts` * Add support for `edit_payout_schedule`, `instant_payouts`, and `standard_payouts` on `AccountSession.components.payouts.features` * Change type of `Checkout.Session.payment_method_options.us_bank_account.financial_connections.prefetch[]`, `Checkout.SessionCreateParams.payment_method_options.us_bank_account.financial_connections.prefetch[]`, `Invoice.payment_settings.payment_method_options.us_bank_account.financial_connections.prefetch[]`, `InvoiceCreateParams.payment_settings.payment_method_options.us_bank_account.financial_connections.prefetch[]`, `InvoiceUpdateParams.payment_settings.payment_method_options.us_bank_account.financial_connections.prefetch[]`, `PaymentIntent.payment_method_options.us_bank_account.financial_connections.prefetch[]`, `PaymentIntentConfirmParams.payment_method_options.us_bank_account.financial_connections.prefetch[]`, `PaymentIntentCreateParams.payment_method_options.us_bank_account.financial_connections.prefetch[]`, `PaymentIntentUpdateParams.payment_method_options.us_bank_account.financial_connections.prefetch[]`, `SetupIntent.payment_method_options.us_bank_account.financial_connections.prefetch[]`, `SetupIntentConfirmParams.payment_method_options.us_bank_account.financial_connections.prefetch[]`, `SetupIntentCreateParams.payment_method_options.us_bank_account.financial_connections.prefetch[]`, `SetupIntentUpdateParams.payment_method_options.us_bank_account.financial_connections.prefetch[]`, `Subscription.payment_settings.payment_method_options.us_bank_account.financial_connections.prefetch[]`, `SubscriptionCreateParams.payment_settings.payment_method_options.us_bank_account.financial_connections.prefetch[]`, and `SubscriptionUpdateParams.payment_settings.payment_method_options.us_bank_account.financial_connections.prefetch[]` from `literal('balances')` to `enum('balances'|'transactions')` * Add support for new value `financial_connections.account.refreshed_transactions` on enum `Event.type` * Add support for new value `transactions` on enum `FinancialConnections.AccountRefreshParams.features[]` * Add support for `subscriptions` and `transaction_refresh` on `FinancialConnections.Account` * Add support for `next_refresh_available_at` on `FinancialConnections.Account.balance_refresh` * Add support for new value `transactions` on enums `FinancialConnections.Session.prefetch[]` and `FinancialConnections.SessionCreateParams.prefetch[]` * Add support for new value `unknown` on enums `Issuing.Authorization.verification_data.authentication_exemption.type` and `Issuing.AuthorizationCreateParams.testHelpers.verification_data.authentication_exemption.type` * Add support for new value `challenge` on enums `PaymentIntent.payment_method_options.card.request_three_d_secure`, `PaymentIntentConfirmParams.payment_method_options.card.request_three_d_secure`, `PaymentIntentCreateParams.payment_method_options.card.request_three_d_secure`, `PaymentIntentUpdateParams.payment_method_options.card.request_three_d_secure`, `SetupIntent.payment_method_options.card.request_three_d_secure`, `SetupIntentConfirmParams.payment_method_options.card.request_three_d_secure`, `SetupIntentCreateParams.payment_method_options.card.request_three_d_secure`, and `SetupIntentUpdateParams.payment_method_options.card.request_three_d_secure` * Add support for `revolut_pay` on `PaymentMethodConfigurationCreateParams`, `PaymentMethodConfigurationUpdateParams`, and `PaymentMethodConfiguration` * Change type of `Quote.invoice_settings` from `InvoiceSettingQuoteSetting | null` to `InvoiceSettingQuoteSetting` * Add support for `destination_details` on `Refund` * Add support for new value `financial_connections.account.refreshed_transactions` on enums `WebhookEndpointCreateParams.enabled_events[]` and `WebhookEndpointUpdateParams.enabled_events[]` * [#1185](https://github.com/stripe/stripe-python/pull/1185) Update generated code * [#1184](https://github.com/stripe/stripe-python/pull/1184) Remove api_base from RequestOptions type * [#1178](https://github.com/stripe/stripe-python/pull/1178) Support accessing reserved word resource properties via attribute ## 7.9.0 - 2023-12-14 * [#1161](https://github.com/stripe/stripe-python/pull/1161) Update generated code * Add support for `payment_method_reuse_agreement` on resource classes `PaymentLink.ConsentCollection` and `checkout.Session.ConsentCollection` and parameter classes `PaymentLink.CreateParamsConsentCollection` and `checkout.Session.CreateParamsConsentCollection` * Add support for `after_submit` on parameter classes `PaymentLink.CreateParamsCustomText`, `PaymentLink.ModifyParamsCustomText`, and `checkout.Session.CreateParamsCustomText` and resource classes `PaymentLink.CustomText` and `checkout.Session.CustomText` * Add support for `created` on parameter class `radar.EarlyFraudWarning.ListParams` * [#1146](https://github.com/stripe/stripe-python/pull/1146) Track usage of deprecated `save` * Reports uses of the deprecated `.save` in `X-Stripe-Client-Telemetry`. (You can disable telemetry via `stripe.enable_telemetry = false`, see the [README](https://github.com/stripe/stripe-python/blob/master/README.md#telemetry).) * [#1101](https://github.com/stripe/stripe-python/pull/1101) Mark defunct and internal methods as deprecated * [#1169](https://github.com/stripe/stripe-python/pull/1169) Add more types to _http_client.py ## 7.8.2 - 2023-12-11 * [#1168](https://github.com/stripe/stripe-python/pull/1168) Do not raise a DeprecationWarning in `stripe.app_info` ## 7.8.1 - 2023-12-08 * [#1159](https://github.com/stripe/stripe-python/pull/1159) Fix __getattr__ to raise AttributeError rather than returning None. This fixes a regression in 7.8.0 that caused `stripe.checkout`/`stripe.issuing` etc. to return `None`. * [#1157](https://github.com/stripe/stripe-python/pull/1157) Add missing explicit reexport for `OAuth`, `Webhook`, `WebhookSignature` ## 7.8.0 - 2023-12-07 * [#1155](https://github.com/stripe/stripe-python/pull/1155) Update generated code * Add support for `payment_details`, `payments`, and `payouts` on `AccountSession.components` and `CreateParams.components` * Add support for `features` on `AccountSession.components.account_onboarding` and `CreateParams.components.account_onboarding` * Add support for new values `customer_tax_location_invalid` and `financial_connections_no_successful_transaction_refresh` on enums `Invoice.last_finalization_error.code`, `PaymentIntent.last_payment_error.code`, `SetupAttempt.setup_error.code`, `SetupIntent.last_setup_error.code`, and `StripeError.code` * Add support for new values `payment_network_reserve_hold` and `payment_network_reserve_release` on enum `BalanceTransaction.type` * Change `Climate.Product.metric_tons_available` to be required * Remove support for value `various` from enum `Climate.Supplier.removal_pathway` * Remove support for values `challenge_only` and `challenge` from enum `PaymentIntent.payment_method_options.card.request_three_d_secure` * Add support for `inactive_message` and `restrictions` on `CreateParams`, `ModifyParams`, and `PaymentLink` * Add support for `transfer_group` on `PaymentLink.payment_intent_data`, `CreateParams.payment_intent_data`, and `ModifyParams.payment_intent_data` * Add support for `trial_settings` on `PaymentLink.subscription_data`, `CreateParams.subscription_data`, and `ModifyParams.subscription_data` * [#1153](https://github.com/stripe/stripe-python/pull/1153) Move exports for more modules - `stripe.app_info`, `stripe.http_client`, `stripe.oauth`, `stripe.util`, `stripe.version`, `stripe.webhook`, modules are deprecated. All types are available directly from `stripe` module now. Before: ```python from stripe.util import convert_to_stripe_object # or stripe.util.convert_to_stripe_object ```` After: ```python from stripe import convert_to_stripe_object # or stripe.convert_to_stripe_object ``` - `stripe.api_version`, `stripe.multipart_data_generator`, `stripe.request_metrics` are deprecated and will be fully removed in the future. * [#1142](https://github.com/stripe/stripe-python/pull/1142) Move resource type exports to stripe.___ - `stripe.error`, `stripe.stripe_object`, `stripe.api_requestor`, `stripe.stripe_response`, `stripe.request_options`, `stripe.api_resources.*`, `stripe.api_resources.abstract.*` modules are deprecated. All types are available directly from `stripe` module now. Before: ```python from stripe.error import APIError # or stripe.error.APIError ```` After: ```python from stripe import APIError # or stripe.APIError ``` ## 7.7.0 - 2023-11-30 * [#1147](https://github.com/stripe/stripe-python/pull/1147) Update generated code * Add support for new resources `Climate.Order`, `Climate.Product`, and `Climate.Supplier` * Add support for `cancel`, `create`, `list`, `modify`, and `retrieve` methods on resource `Order` * Add support for `list` and `retrieve` methods on resources `Product` and `Supplier` * Add support for new value `financial_connections_account_inactive` on enums `Invoice.LastFinalizationError.code`, `PaymentIntent.LastPaymentError.code`, `SetupAttempt.SetupError.code`, and `SetupIntent.LastSetupError.code` * Add support for new values `climate_order_purchase` and `climate_order_refund` on enum `BalanceTransaction.type` * Add support for `created` on `Checkout.Session.ListParams` * Add support for `validate_location` on `Customer.CreateParamsTax` and `Customer.ModifyParamsTax` * Add support for new values `climate.order.canceled`, `climate.order.created`, `climate.order.delayed`, `climate.order.delivered`, `climate.order.product_substituted`, `climate.product.created`, and `climate.product.pricing_updated` on enum `Event.type` * Add support for new value `challenge` on enums `PaymentIntent. PaymentMethodOptions.Card.request_three_d_secure` and `SetupIntent. PaymentMethodOptions.Card.request_three_d_secure` * Add support for new values `climate_order_purchase` and `climate_order_refund` on enum `Reporting.ReportRun. CreateParamsParameters.reporting_category` * Add support for new values `climate.order.canceled`, `climate.order.created`, `climate.order.delayed`, `climate.order.delivered`, `climate.order.product_substituted`, `climate.product.created`, and `climate.product.pricing_updated` on enums `WebhookEndpoint.CreateParams.enabled_events[]` and `WebhookEndpoint.ModifyParams.enabled_events[]` * [#1145](https://github.com/stripe/stripe-python/pull/1145) Refactor integration test ## 7.6.0 - 2023-11-21 * [#1138](https://github.com/stripe/stripe-python/pull/1138) Update generated code * Add support for `electronic_commerce_indicator` on resource classes `Charge.PaymentMethodDetails.Card.ThreeDSecure` and `SetupAttempt.PaymentMethodDetails.Card.ThreeDSecure` * Add support for `exemption_indicator` on resource class `Charge.PaymentMethodDetails.Card.ThreeDSecure` * Add support for `transaction_id` on resource classes `Charge.PaymentMethodDetails.Card.ThreeDSecure`, `SetupAttempt.PaymentMethodDetails.Card.ThreeDSecure`, `issuing.Authorization.NetworkData`, and `issuing.Transaction.NetworkData` * Add support for `offline` on resource class `Charge.PaymentMethodDetails.CardPresent` * Add support for `transferred_to_balance` on resource `CustomerCashBalanceTransaction` * Add support for `three_d_secure` on parameter classes `PaymentIntent.ConfirmParamsPaymentMethodOptionsCard`, `PaymentIntent.CreateParamsPaymentMethodOptionsCard`, `PaymentIntent.ModifyParamsPaymentMethodOptionsCard`, `SetupIntent.ConfirmParamsPaymentMethodOptionsCard`, `SetupIntent.CreateParamsPaymentMethodOptionsCard`, and `SetupIntent.ModifyParamsPaymentMethodOptionsCard` * Add support for `system_trace_audit_number` on resource class `issuing.Authorization.NetworkData` * Add support for `network_risk_score` on resource classes `issuing.Authorization.PendingRequest` and `issuing.Authorization.RequestHistory` * Add support for `requested_at` on resource class `issuing.Authorization.RequestHistory` * Add support for `authorization_code` on resource class `issuing.Transaction.NetworkData` ## 7.5.0 - 2023-11-16 * [#1127](https://github.com/stripe/stripe-python/pull/1127) Update generated code * Add support for `bacs_debit_payments` on `Account.CreateParamsSettings` * Add support for `service_user_number` on `Account.Settings.BacsDebitPayments` * Add support for `capture_before` on `Charge.PaymentMethodDetails.Card.capture_before` * Add support for `Paypal` on `Checkout.Session.PaymentMethodOptions` * Add support for `tax_amounts` on `CreditNote.CreateParamsLine`, `CreditNote.PreviewParamsLine`, and `CreditNote.PreviewLinesParamsLine` * Add support for `network_data` on `Issuing.Transaction` * Add support for `status` on `Checkout.Session.ListParams` * [#1135](https://github.com/stripe/stripe-python/pull/1135) Add initial tests for exports and run them in mypy and pyright * [#1130](https://github.com/stripe/stripe-python/pull/1130) Mention types in README.md * [#1134](https://github.com/stripe/stripe-python/pull/1134) Run pyright via tox * [#1131](https://github.com/stripe/stripe-python/pull/1131) Upgrade black dependency * [#1132](https://github.com/stripe/stripe-python/pull/1132) Fix unnecessary casts from pyright 1.1.336 * [#1126](https://github.com/stripe/stripe-python/pull/1126) Suppress type errors from latest pyright * [#1125](https://github.com/stripe/stripe-python/pull/1125) Add support for Python 3.11/3.12 * [#1123](https://github.com/stripe/stripe-python/pull/1123) Move to python3 venv and update vscode settings ## 7.4.0 - 2023-11-09 * [#1119](https://github.com/stripe/stripe-python/pull/1119) Update generated code * Add support for new value `terminal_reader_hardware_fault` on enums `Invoice.last_finalization_error.code`, `PaymentIntent.last_payment_error.code`, `SetupAttempt.setup_error.code`, `SetupIntent.last_setup_error.code`, and `StripeError.code` * Add support for `metadata` on `Quote.subscription_data`, `QuoteCreateParams.subscription_data`, and `QuoteUpdateParams.subscription_data` * [#1121](https://github.com/stripe/stripe-python/pull/1121) [types] Remove `None` from optional param types ## 7.3.0 - 2023-11-02 * [#1112](https://github.com/stripe/stripe-python/pull/1112) Update generated code * Add support for new resource `Tax.Registration` * Add support for `create`, `list`, and `modify` methods on resource `Registration` ## 7.2.0 - 2023-10-31 * [#1115](https://github.com/stripe/stripe-python/pull/1115) Types: Add types for `ErrorObject`. * [#1116](https://github.com/stripe/stripe-python/pull/1116) Types: Use @staticmethod overloads instead of @classmethod to fix MyPy compatibility. ## 7.1.0 - 2023-10-26 * [#1104](https://github.com/stripe/stripe-python/pull/1104) Include `py.typed` and enable type annotations for the package * This PR includes `py.typed` and enables inline type annotations for stripe-python package. Inline type annotations will now take precedence over Typeshed for users who use a type checker or IDE. * See a detailed guide on the [Github Wiki](https://github.com/stripe/stripe-python/wiki/Inline-type-annotations). * [#1103](https://github.com/stripe/stripe-python/pull/1103) Inner resource classes * Behavior change: nested json objects will now deserialize into instances of specific classes that subclass `StripeObject`, instead of into generic `StripeObject` instances. * ⚠️ Behavior change: `PromotionCode.restrictions.currency_options` will now deserialize into `dict` and not `StripeObject`. * [#1090](https://github.com/stripe/stripe-python/pull/1090) Update generated code * Add support for new value `balance_invalid_parameter` on enums `Invoice.LastFinalizationError`, `PaymentIntent.LastPaymentError`, `SetupAttempt.SetupError`, and `SetupIntent.LastSetupError` * [#1096](https://github.com/stripe/stripe-python/pull/1096) Add @util.deprecated decorator and deprecate `save`. * [#1091](https://github.com/stripe/stripe-python/pull/1091) APIRequestor: don't mutate incoming multipart headers # Changelog ## 7.0.0 - 2023-10-16 * This release changes the pinned API version to `2023-10-16`. Please read the [API Upgrade Guide](https://stripe.com/docs/upgrades#2023-10-16) and carefully review the API changes before upgrading `stripe-python`. * [#1085](https://github.com/stripe/stripe-python/pull/1085) Update generated code - Updated pinned API version ## 6.7.0 - 2023-10-05 * [#1065](https://github.com/stripe/stripe-python/pull/1065) Update generated code * Add support for new resource `Issuing.Token` * Add support for `list`, `modify`, and `retrieve` methods on resource `Token` ## 6.6.0 - 2023-09-21 * [#1056](https://github.com/stripe/stripe-python/pull/1056) Update generated code * [#1055](https://github.com/stripe/stripe-python/pull/1055) Partially type resource methods (no **params) * [#1057](https://github.com/stripe/stripe-python/pull/1057) Add optional types to non-required fields * [#1054](https://github.com/stripe/stripe-python/pull/1054) Types: add deleted field ## 6.5.0 - 2023-09-14 * [#1052](https://github.com/stripe/stripe-python/pull/1052) Update generated code * Add support for new resource `PaymentMethodConfiguration` * Add support for `create`, `list`, `modify`, and `retrieve` methods on resource `PaymentMethodConfiguration` * [#1047](https://github.com/stripe/stripe-python/pull/1047) Update generated code * Add support for `capture`, `create`, `expire`, `increment`, and `reverse` test helper methods on resource `Issuing.Authorization` * Add support for `create_force_capture`, `create_unlinked_refund`, and `refund` test helper methods on resource `Issuing.Transaction` * [#1049](https://github.com/stripe/stripe-python/pull/1049) Types: datetimes to ints, add enum support * [#1030](https://github.com/stripe/stripe-python/pull/1030) Explicitly define CRUDL methods in each resource * [#1050](https://github.com/stripe/stripe-python/pull/1050) Generate explicit nested resource class methods ## 6.4.0 - 2023-09-07 * [#1033](https://github.com/stripe/stripe-python/pull/1033) Update generated code * Add support for new resource `PaymentMethodDomain` * Add support for `create`, `list`, `modify`, `retrieve`, and `validate` methods on resource `PaymentMethodDomain` * [#1044](https://github.com/stripe/stripe-python/pull/1044) Types: ExpandableField * [#1043](https://github.com/stripe/stripe-python/pull/1043) Types: ListObject ## 6.3.0 - 2023-09-05 * [#1042](https://github.com/stripe/stripe-python/pull/1042) Require typing_extensions >= 4.0.0 * [#1026](https://github.com/stripe/stripe-python/pull/1026) Types: annotate resource properties ## 6.2.0 - 2023-08-31 * [#1024](https://github.com/stripe/stripe-python/pull/1024) Update generated code * Add support for new resource `AccountSession` * Add support for `create` method on resource `AccountSession` * [#1032](https://github.com/stripe/stripe-python/pull/1032) Types for CRUDL methods on parents ## 6.1.0 - 2023-08-24 * [#1016](https://github.com/stripe/stripe-python/pull/1016) Update generated code * [#1020](https://github.com/stripe/stripe-python/pull/1020) Adds type annotations, and dependency on `typing_extensions`. ## 6.0.0 - 2023-08-16 **⚠️ ACTION REQUIRED: the breaking change in this release likely affects you ⚠️** * [#1001](https://github.com/stripe/stripe-python/pull/1001) [#1008](https://github.com/stripe/stripe-python/pull/1008) Remove support for Python 2. * The last version of stripe-python that supports Python 2 is 5.5.0. [The Python Software Foundation (PSF)](https://www.python.org/psf-landing/) community [announced the end of support of Python 2](https://www.python.org/doc/sunset-python-2/) on 01 January 2020. To continue to get new features and security updates, please make sure to update your Python runtime to Python 3.6+. * [#987](https://github.com/stripe/stripe-python/pull/987) ⚠️⚠️Pin to the latest API version⚠️⚠️ In this release, Stripe API Version `2023-08-16` (the latest at time of release) will be sent by default on all requests. The previous default was to use your [Stripe account's default API version](https://stripe.com/docs/development/dashboard/request-logs#view-your-default-api-version). To successfully upgrade to stripe-python v6, you must either 1. **(Recommended) Upgrade your integration to be compatible with API Version `2023-08-16`.** Please read the API Changelog carefully for each API Version from `2023-08-16` back to your [Stripe account's default API version](https://stripe.com/docs/development/dashboard/request-logs#view-your-default-api-version). Determine if you are using any of the APIs that have changed in a breaking way, and adjust your integration accordingly. Carefully test your changes with Stripe [Test Mode](https://stripe.com/docs/keys#test-live-modes) before deploying them to production. You can read the [v6 migration guide](https://github.com/stripe/stripe-python/wiki/Migration-guide-for-v6) for more detailed instructions. 2. **(Alternative option) Specify a version other than `2023-08-16` when initializing `stripe-python`.** If you were previously initializing stripe-python without an explicit API Version, you can postpone modifying your integration by specifying a version equal to your [Stripe account's default API version](https://stripe.com/docs/development/dashboard/request-logs#view-your-default-api-version). For example: ```diff import stripe stripe.api_key = "sk_test_..." + stripe.api_version = '2020-08-27' ``` If you were already initializing stripe-python with an explicit API Version, upgrading to v6 will not affect your integration. Read the [v6 migration guide](https://github.com/stripe/stripe-python/wiki/Migration-guide-for-v6) for more details. Going forward, each major release of this library will be *pinned* by default to the latest Stripe API Version at the time of release. That is, instead of upgrading stripe-python and separately upgrading your Stripe API Version through the Stripe Dashboard, whenever you upgrade major versions of stripe-python, you should also upgrade your integration to be compatible with the latest Stripe API version. * [#1013](https://github.com/stripe/stripe-python/pull/1013) ⚠️Removed @test_helper decorator * This is technically breaking but unlikely to affect most users. * [#1015](https://github.com/stripe/stripe-python/pull/1015) ⚠️Assert types of pagination responses * Pagination will raise an exception if the API response is not of the correct type. This should never happen in production use but may break tests that use mock data. ## 5.5.0 - 2023-07-13 * [#990](https://github.com/stripe/stripe-python/pull/990) Update generated code * Add support for new resource `Tax.Settings` * Add support for `modify` and `retrieve` methods on resource `Settings` ## 5.4.0 - 2023-03-30 * [#951](https://github.com/stripe/stripe-python/pull/951) Update generated code * Remove support for `create` method on resource `Tax.Transaction` * This is not a breaking change, as this method was deprecated before the Tax Transactions API was released in favor of the `create_from_calculation` method. ## 5.3.0 - 2023-03-23 * [#947](https://github.com/stripe/stripe-python/pull/947) Update generated code * Add support for new resources `Tax.CalculationLineItem`, `Tax.Calculation`, `Tax.TransactionLineItem`, and `Tax.Transaction` * Add support for `create` and `list_line_items` methods on resource `Calculation` * Add support for `create_from_calculation`, `create_reversal`, `create`, `list_line_items`, and `retrieve` methods on resource `Transaction` ## 5.2.0 - 2023-02-16 * [#924](https://github.com/stripe/stripe-python/pull/924) API Updates * Add support for `refund_payment` method on resource `Terminal.Reader` ## 5.1.1 - 2023-02-06 * [#923](https://github.com/stripe/stripe-python/pull/923) Bugfix: revert "Pass params into logger.{info,debug}" ## 5.1.0 - 2023-02-02 * [#920](https://github.com/stripe/stripe-python/pull/920) API Updates * Add support for `resume` method on resource `Subscription` * [#913](https://github.com/stripe/stripe-python/pull/913) Pass params into logger.{info,debug} ## 5.0.0 - 2022-11-16 Breaking changes that arose during code generation of the library that we postponed for the next major version. For changes to the Stripe products, read more at https://stripe.com/docs/upgrades#2022-11-15. "⚠️" symbol highlights breaking changes. * [#895](https://github.com/stripe/stripe-python/pull/895) Next major release changes * [#889](https://github.com/stripe/stripe-python/pull/889) API Updates * [#888](https://github.com/stripe/stripe-python/pull/888) Do not run Coveralls if secret token is not available * [#875](https://github.com/stripe/stripe-python/pull/875) hide misleading ssl security warning in python>=2.7.9 ### ⚠️ Changed - Dropped support for Python version 3.4 and 3.5 (#881). We now support Python 2.7 or 3.6+. - Fixed mistyped names for two OAuth exceptions: `UnsupportedGrantTypError`->`UnsupportedGrantTypeError` and `UnsupportedResponseTypError`->`UnsupportedResponseTypeError` (#872). ### Deprecated - Deprecate `save` method on resources (#887). Use `modify` instead. ```python # Before customer = stripe.Customer.retrieve("cus_123") customer.email = "example@test.com" customer.save() # After stripe.Customer.modify("cus_123", email="example@test.com") ``` ### ⚠️ Removed - Removed `Orders` resource (#882). - Removed `SKU` resource (#883). ## 4.2.0 - 2022-09-23 * [#877](https://github.com/stripe/stripe-python/pull/877) API Updates * Add `upcoming_lines` method to the `Invoice` resource. * [#873](https://github.com/stripe/stripe-python/pull/873) Add abstract methods for SearchableAPIResource * [#867](https://github.com/stripe/stripe-python/pull/867) API Updates * Update links in documentation to be absolute. ## 4.1.0 - 2022-08-19 * [#861](https://github.com/stripe/stripe-python/pull/861) API Updates * Add support for new resource `CustomerCashBalanceTransaction` * [#860](https://github.com/stripe/stripe-python/pull/860) Add a support section to the readme * [#717](https://github.com/stripe/stripe-python/pull/717) Fix test TestCharge.test_is_saveable(). ## 4.0.2 - 2022-08-03 * [#855](https://github.com/stripe/stripe-python/pull/855) Fix issue where auto_paging_iter failed on nested list objects. ## 4.0.1 - 2022-08-02 * [#850](https://github.com/stripe/stripe-python/pull/850) Fix incorrect handling of additional request parameters * Fixes issue where using special parameter like `api_key`, `idempotency_key`, `stripe_version`, `stripe_account`, `headers` can cause a `Received unknown parameter error`. ## 4.0.0 - 2022-08-02 Breaking changes that arose during code generation of the library that we postponed for the next major version. For changes to the SDK, read more detailed description at https://github.com/stripe/stripe-python/wiki/Migration-guide-for-v4. For changes to the Stripe products, read more at https://stripe.com/docs/upgrades#2022-08-01. "⚠️" symbol highlights breaking changes. * [#847](https://github.com/stripe/stripe-python/pull/847) API Updates * [#845](https://github.com/stripe/stripe-python/pull/845) Next major release changes * [#836](https://github.com/stripe/stripe-python/pull/836) API Updates. Add Price.create tests. * [#835](https://github.com/stripe/stripe-python/pull/835) API Updates. Use auto-generation for credit_note and invoice methods. ### ⚠️ Removed - Removed deprecated `AlipayAccount`, `BitcoinReceiver`, `BitcoinTransaction`, `IssuerFraudRecord`, `Recipient`, `RecipientTransfer`, and `ThreeDSecure` classes. - Removed deprecated `Charge.update_dispute` and `Charge.close_dispute` methods that were using legacy REST API endpoint. Prefer [Dispute.modify](https://stripe.com/docs/api/disputes/update?lang=python) and [Dispute.close](https://stripe.com/docs/api/disputes/close?lang=python) - Removed deprecated `Card.details` method and `CardDetails` resource. The REST API endpoint is not longer supported. - Removed the deprecated `Source.source_transactions` method. Prefer `SubscriptionItem.list_source_transactions` - Removed the deprecated `SubscriptionItem.usage_record_summaries` method. Prefer `SubscriptionItem.list_usage_record_summaries` - Removed the deprecated `Charge.refund` method. Prefer [Refund.create](https://stripe.com/docs/api/refunds/create) ### ⚠️ Changed - To be consistent with other resource methods, `ApplicationFee.refund` returns an instance of `ApplicationFee` and doesn't mutate the instance of `ApplicationFee`. - To be consistent with other resource methods, the `Customer.delete_discount` no longer resets the `discount` property to `None` and returns the deleted discount instead. If you were relying on this behavior, reset the discount property manually: - The `LineItem` resource now inherits from `StripeObject` as it has no methods of it's own. - To be consistent with other resource methods, the `Subscription.delete_discount` returns an instance of deleted discount and doesn't mutate the instance of `Subscription`. - Update the CA certificate bundle. - Request sending logic unified across standard and custom methods (https://github.com/stripe/stripe-python/pull/832) ## 3.5.0 - 2022-06-30 * [#831](https://github.com/stripe/stripe-python/pull/831) API Updates * Add support for `deliver_card`, `fail_card`, `return_card`, and `ship_card` test helper methods on resource `Issuing.Card` * Switch from using `instance_url` to computing method path in place for custom methods. * Switch from using explicit class methods for test helpers instead of using meta-programming. ## 3.4.0 - 2022-06-17 * [#824](https://github.com/stripe/stripe-python/pull/824) API Updates * Add support for `fund_cash_balance` test helper method on resource `Customer` * [#823](https://github.com/stripe/stripe-python/pull/823) Trigger workflows on beta branches ## 3.3.0 - 2022-06-08 * [#818](https://github.com/stripe/stripe-python/pull/818) fix: Update cash balance methods to no longer require nested ID. ## 3.2.0 - 2022-05-23 * [#812](https://github.com/stripe/stripe-python/pull/812) API Updates * Add support for new resource `Apps.Secret` ## 3.1.0 - 2022-05-19 * [#810](https://github.com/stripe/stripe-python/pull/810) API Updates * Add support for new resources `Treasury.CreditReversal`, `Treasury.DebitReversal`, `Treasury.FinancialAccountFeatures`, `Treasury.FinancialAccount`, `Treasury.FlowDetails`, `Treasury.InboundTransfer`, `Treasury.OutboundPayment`, `Treasury.OutboundTransfer`, `Treasury.ReceivedCredit`, `Treasury.ReceivedDebit`, `Treasury.TransactionEntry`, and `Treasury.Transaction` * Add support for `retrieve_payment_method` method on resource `Customer` * Add support for `list_owners` and `list` methods on resource `FinancialConnections.Account` * [#719](https://github.com/stripe/stripe-python/pull/719) Set daemon attribute instead of using setDaemon method that was deprecated in Python 3.10 * [#767](https://github.com/stripe/stripe-python/pull/767) Bump vendored six to 1.16.0 * [#806](https://github.com/stripe/stripe-python/pull/806) Start testing on pypy-3.8 * [#811](https://github.com/stripe/stripe-python/pull/811) Add sanitize_id method ## 3.0.0 - 2022-05-09 * [#809](https://github.com/stripe/stripe-python/pull/809) Release of major version v3.0.0. The [migration guide](https://github.com/stripe/stripe-python/wiki/Migration-Guide-for-v3) contains more information. (⚠️ = breaking changes): * ⚠️ Replace the legacy `Order` API with the new `Order` API. * New methods: `cancel`, `list_line_items`, `reopen`, and `submit` * Removed methods: `pay` and `return_order` * Removed resources: `OrderItem` and `OrderReturn` * ⚠️ Rename `financial_connections.account.refresh` to `financial_connections.refresh_account` * Add support for `amount_discount`, `amount_tax`, and `product` on `LineItem` ## 2.76.0 - 2022-05-05 * [#808](https://github.com/stripe/stripe-python/pull/808) API Updates * Add support for new resources `FinancialConnections.AccountOwner`, `FinancialConnections.AccountOwnership`, `FinancialConnections.Account`, and `FinancialConnections.Session` ## 2.75.0 - 2022-05-03 * [#805](https://github.com/stripe/stripe-python/pull/805) API Updates * Add support for new resource `CashBalance` ## 2.74.0 - 2022-04-21 * [#796](https://github.com/stripe/stripe-python/pull/796) API Updates * Add support for `expire` test helper method on resource `Refund` ## 2.73.0 - 2022-04-18 * [#792](https://github.com/stripe/stripe-python/pull/792) [#794](https://github.com/stripe/stripe-python/pull/794) [#795](https://github.com/stripe/stripe-python/pull/795) API Updates * Add support for new resources `FundingInstructions` and `Terminal.Configuration` ## 2.72.0 - 2022-04-13 * [#791](https://github.com/stripe/stripe-python/pull/791) API Updates * Add support for `increment_authorization` method on resource `PaymentIntent` ## 2.71.0 - 2022-04-08 * [#788](https://github.com/stripe/stripe-python/pull/788) API Updates * Add support for `apply_customer_balance` method on resource `PaymentIntent` ## 2.70.0 - 2022-03-30 * [#785](https://github.com/stripe/stripe-python/pull/785) API Updates * Add support for `cancel_action`, `process_payment_intent`, `process_setup_intent`, and `set_reader_display` methods on resource `Terminal.Reader` ## 2.69.0 - 2022-03-29 * [#783](https://github.com/stripe/stripe-python/pull/783) API Updates * Add support for Search API * Add support for `search` method on resources `Charge`, `Customer`, `Invoice`, `PaymentIntent`, `Price`, `Product`, and `Subscription` * [#784](https://github.com/stripe/stripe-python/pull/784) Pin click dependency to 8.0.4 to avoid breakage in black * [#773](https://github.com/stripe/stripe-python/pull/773) Add infrastructure for test-helper methods * [#782](https://github.com/stripe/stripe-python/pull/782) Revert Orders to use qualified name for upload_api_base ## 2.68.0 - 2022-03-23 * [#781](https://github.com/stripe/stripe-python/pull/781) API Updates * Add support for `cancel` method on resource `Refund` * [#777](https://github.com/stripe/stripe-python/pull/777) Add support for SearchResult. ## 2.67.0 - 2022-03-01 * [#774](https://github.com/stripe/stripe-python/pull/774) API Updates * Add support for new resource `TestHelpers.TestClock` ## 2.66.0 - 2022-02-16 * [#771](https://github.com/stripe/stripe-python/pull/771) API Updates * Add support for `verify_microdeposits` method on resources `PaymentIntent` and `SetupIntent` ## 2.65.0 - 2022-01-20 * [#766](https://github.com/stripe/stripe-python/pull/766) API Updates * Add support for new resource `PaymentLink` * [#763](https://github.com/stripe/stripe-python/pull/763) Start testing Python 3.10 ## 2.64.0 - 2021-12-21 * [#757](https://github.com/stripe/stripe-python/pull/757) Update class custom methods to save list object parameters. * [#756](https://github.com/stripe/stripe-python/pull/756) Introduce custom listing methods on objects. * [#754](https://github.com/stripe/stripe-python/pull/754) Clarify metadata deletion message. ## 2.63.0 - 2021-11-16 * [#748](https://github.com/stripe/stripe-python/pull/748) API Updates * Add support for new resource `ShippingRate` ## 2.62.0 - 2021-11-11 * [#745](https://github.com/stripe/stripe-python/pull/745) API Updates * Add support for `expire` method on resource `Checkout.Session` ## 2.61.0 - 2021-10-11 * [#738](https://github.com/stripe/stripe-python/pull/738) API Updates * Add support for `list_payment_methods` method on resource `Customer` * [#736](https://github.com/stripe/stripe-python/pull/736) Stop sending raw exception message as part of Stripe user agent. ## 2.60.0 - 2021-07-14 * [#728](https://github.com/stripe/stripe-python/pull/728) API Updates * Add support for `list_computed_upfront_line_items` method on resource `Quote` ## 2.59.0 - 2021-07-09 * [#727](https://github.com/stripe/stripe-python/pull/727) [#725](https://github.com/stripe/stripe-python/pull/725) Add support for new `Quote` API. ## 2.58.0 - 2021-06-04 * [#722](https://github.com/stripe/stripe-python/pull/722) API Updates * Add support for new `TaxCode` API. ## 2.57.0 - 2021-05-19 * [#720](https://github.com/stripe/stripe-python/pull/720) Add support for Identity VerificationSession and VerificationReport APIs ## 2.56.0 - 2021-02-22 * [#713](https://github.com/stripe/stripe-python/pull/713) Add support for the Billing Portal Configuration API ## 2.55.2 - 2021-02-05 * [#704](https://github.com/stripe/stripe-python/pull/704) Fix CA bundle path issue ## 2.55.1 - 2020-12-01 * [#698](https://github.com/stripe/stripe-python/pull/698) Fix issue where StripeObjects in lists would not be converted to dicts * [#699](https://github.com/stripe/stripe-python/pull/699) Start testing Python 3.9 * [#691](https://github.com/stripe/stripe-python/pull/691) Include the examples in the built sources ## 2.55.0 - 2020-10-14 * [#684](https://github.com/stripe/stripe-python/pull/684) Add support for the Payout Reverse API ## 2.54.0 - 2020-09-29 * [#681](https://github.com/stripe/stripe-python/pull/681) Add support for the `SetupAttempt` resource and List API * 2.52.0 and 2.53.0 were empty releases that contained no additional changes. ## 2.51.0 - 2020-09-02 * [#676](https://github.com/stripe/stripe-python/pull/676) Add support for the Issuing Dispute Submit API ## 2.50.0 - 2020-08-05 * [#669](https://github.com/stripe/stripe-python/pull/669) Add support for the `PromotionCode` resource and APIs ## 2.49.0 - 2020-07-17 * [#665](https://github.com/stripe/stripe-python/pull/665) Support stripe.File.create(stripe_version='...') ## 2.48.0 - 2020-05-11 * [#655](https://github.com/stripe/stripe-python/pull/655) Add support for the `LineItem` resource and APIs ## 2.47.0 - 2020-04-29 * [#652](https://github.com/stripe/stripe-python/pull/652) Add support for the `Price` resource and APIs ## 2.46.0 - 2020-04-22 * [#651](https://github.com/stripe/stripe-python/pull/651) Add support for `billing_portal` namespace and `Session` resource and APIs ## 2.45.0 - 2020-04-06 * [#648](https://github.com/stripe/stripe-python/pull/648) Add support for Express links in `authorize_url` for `OAuth` ## 2.44.0 - 2020-03-23 * [#646](https://github.com/stripe/stripe-python/pull/646) Allow overriding API key in OAuth methods ## 2.43.0 - 2020-02-26 * [#644](https://github.com/stripe/stripe-python/pull/644) Add support for listing Checkout `Session` ## 2.42.0 - 2020-01-14 * [#640](https://github.com/stripe/stripe-python/pull/640) Add support for `CreditNoteLineItem` * [#639](https://github.com/stripe/stripe-python/pull/639) Pin black version * [#637](https://github.com/stripe/stripe-python/pull/637) Start testing Python 3.8 ## 2.41.1 - 2019-12-30 * [#636](https://github.com/stripe/stripe-python/pull/636) Fix uploading files with Unicode names (Python 2.7) * [#635](https://github.com/stripe/stripe-python/pull/635) Update Python API docs inline link * [#631](https://github.com/stripe/stripe-python/pull/631) Update `proxy.py` ## 2.41.0 - 2019-11-26 * [#630](https://github.com/stripe/stripe-python/pull/630) Add support for `CreditNote` preview ## 2.40.0 - 2019-11-08 * [#627](https://github.com/stripe/stripe-python/pull/627) Add list_usage_record_summaries and list_source_transactions ## 2.39.0 - 2019-11-06 * [#625](https://github.com/stripe/stripe-python/pull/625) Add support for `Mandate` ## 2.38.0 - 2019-10-29 * [#623](https://github.com/stripe/stripe-python/pull/623) Add support for reverse pagination * [#624](https://github.com/stripe/stripe-python/pull/624) Contributor Convenant ## 2.37.2 - 2019-10-04 * [#621](https://github.com/stripe/stripe-python/pull/621) Implement support for stripe-should-retry and retry-after headers ## 2.37.1 - 2019-09-26 * [#620](https://github.com/stripe/stripe-python/pull/620) Check that `error` is a dict before trying to use it to create a `StripeError` ## 2.37.0 - 2019-09-26 * [#619](https://github.com/stripe/stripe-python/pull/619) Add `ErrorObject` to `StripeError` exceptions * [#616](https://github.com/stripe/stripe-python/pull/616) Pass `CFLAGS` and `LDFLAGS` when running tests ## 2.36.2 - 2019-09-12 * [#614](https://github.com/stripe/stripe-python/pull/614) Use `OrderedDict` to maintain key order in API requests and responses ## 2.36.1 - 2019-09-11 * [#612](https://github.com/stripe/stripe-python/pull/612) Use `ListObject` properties as default values in request methods ## 2.36.0 - 2019-09-10 * [#610](https://github.com/stripe/stripe-python/pull/610) Add support for header parameters in `ListObject` request methods ## 2.35.1 - 2019-08-20 * [#605](https://github.com/stripe/stripe-python/pull/605) Fix automatic retries of failed requests * [#606](https://github.com/stripe/stripe-python/pull/606) Clarify what `max_network_retries` does ## 2.35.0 - 2019-08-12 * [#607](https://github.com/stripe/stripe-python/pull/607) Add `SubscriptionItem.create_usage_record` method ## 2.34.0 - 2019-08-09 * [#604](https://github.com/stripe/stripe-python/pull/604) Remove subscription schedule revisions - This is technically a breaking change. We've chosen to release it as a minor vesion bump because the associated API is unused. ## 2.33.2 - 2019-08-06 * [#601](https://github.com/stripe/stripe-python/pull/601) Add support for passing full objects instead of IDs to custom methods * [#603](https://github.com/stripe/stripe-python/pull/603) Bump vendored six to latest version ## 2.33.1 - 2019-08-06 * [#599](https://github.com/stripe/stripe-python/pull/599) Fix `del` statement to not raise `KeyError` ## 2.33.0 - 2019-07-30 * [#595](https://github.com/stripe/stripe-python/pull/595) Listing `BalanceTransaction` objects now uses `/v1/balance_transactions` instead of `/v1/balance/history` ## 2.32.1 - 2019-07-08 * [#592](https://github.com/stripe/stripe-python/pull/592) Fix argument name conflict ## 2.32.0 - 2019-06-27 * [#590](https://github.com/stripe/stripe-python/pull/590) Add support for the `SetupIntent` resource and APIs ## 2.31.0 - 2019-06-24 * [#587](https://github.com/stripe/stripe-python/pull/587) Enable request latency telemetry by default ## 2.30.1 - 2019-06-20 * [#589](https://github.com/stripe/stripe-python/pull/589) Fix support for `CustomerBalanceTransaction` ## 2.30.0 - 2019-06-17 * [#564](https://github.com/stripe/stripe-python/pull/564) Add support for `CustomerBalanceTransaction` resource and APIs ## 2.29.4 - 2019-06-03 * [#583](https://github.com/stripe/stripe-python/pull/583) Remove Poetry and reinstate `setup.py` ## 2.29.3 - 2019-05-31 Version 2.29.2 was non-functional due to a bugged `version.py` file. This release is identical to 2.29.2 save for the version number. ## 2.29.2 - 2019-05-31 * [#561](https://github.com/stripe/stripe-python/pull/561) Replace pipenv with poetry ## 2.29.1 - 2019-05-31 * [#578](https://github.com/stripe/stripe-python/pull/578) Verify signatures before deserializing events ## 2.29.0 - 2019-05-23 * [#575](https://github.com/stripe/stripe-python/pull/575) Add support for `radar.early_fraud_warning` resource ## 2.28.2 - 2019-05-23 * [#574](https://github.com/stripe/stripe-python/pull/574) Fix a few more code quality issues ## 2.28.1 - 2019-05-20 * [#572](https://github.com/stripe/stripe-python/pull/572) Fix a few code quality issues ## 2.28.0 - 2019-05-14 * [#566](https://github.com/stripe/stripe-python/pull/566) Add support for the `Capability` resource and APIs ## 2.27.0 - 2019-04-24 * [#554](https://github.com/stripe/stripe-python/pull/554) Add support for the `TaxRate` resource and APIs ## 2.26.0 - 2019-04-22 * [#555](https://github.com/stripe/stripe-python/pull/555) Add support for the `TaxId` resource and APIs ## 2.25.0 - 2019-04-18 * [#551](https://github.com/stripe/stripe-python/pull/551) Add support for the `CreditNote` resource and APIs ## 2.24.1 - 2019-04-08 * [#550](https://github.com/stripe/stripe-python/pull/550) Fix encoding of nested parameters in multipart requests ## 2.24.0 - 2019-04-03 * [#543](https://github.com/stripe/stripe-python/pull/543) Add `delete` class method on deletable API resources * [#547](https://github.com/stripe/stripe-python/pull/547) Add class methods for all custom API requests (e.g. `Charge.capture`) ## 2.23.0 - 2019-03-18 * [#537](https://github.com/stripe/stripe-python/pull/537) Add support for the `PaymentMethod` resource and APIs * [#540](https://github.com/stripe/stripe-python/pull/540) Add support for retrieving a Checkout `Session` * [#542](https://github.com/stripe/stripe-python/pull/542) Add support for deleting a Terminal `Location` and `Reader` ## 2.22.0 - 2019-03-14 * [#541](https://github.com/stripe/stripe-python/pull/541) Add `stripe.util.convert_to_dict` method for converting `StripeObject` instances to regular `dict`s ## 2.21.0 - 2019-02-12 * [#532](https://github.com/stripe/stripe-python/pull/532) Add support for subscription schedules ## 2.20.3 - 2019-01-30 * [#530](https://github.com/stripe/stripe-python/pull/530) Fix client telemetry implementation ## 2.20.2 - 2019-01-30 * [#534](https://github.com/stripe/stripe-python/pull/534) Fix session initialization for multi-threaded environments ## 2.20.1 - 2019-01-30 * [#531](https://github.com/stripe/stripe-python/pull/531) Make `RequestsClient` thread-safe ## 2.20.0 - 2019-01-29 * [#526](https://github.com/stripe/stripe-python/pull/526) Reuse the default HTTP client by default ## 2.19.0 - 2019-01-23 * [#524](https://github.com/stripe/stripe-python/pull/524) Rename `CheckoutSession` to `Session` and move it under the `checkout` namespace. This is a breaking change, but we've reached out to affected merchants and all new merchants would use the new approach. ## 2.18.1 - 2019-01-21 * [#525](https://github.com/stripe/stripe-python/pull/525) Properly serialize `individual` on `Account` objects ## 2.18.0 - 2019-01-15 * [#518](https://github.com/stripe/stripe-python/pull/518) Add configurable telemetry to gather information on client-side request latency ## 2.17.0 - 2018-12-21 * [#510](https://github.com/stripe/stripe-python/pull/510) Add support for Checkout sessions ## 2.16.0 - 2018-12-10 * [#507](https://github.com/stripe/stripe-python/pull/507) Add support for account links ## 2.15.0 - 2018-11-30 * [#503](https://github.com/stripe/stripe-python/pull/503) Add support for providing custom CA certificate bundle ## 2.14.0 - 2018-11-28 * [#500](https://github.com/stripe/stripe-python/pull/500) Add support for `Review` for Radar ## 2.13.0 - 2018-11-27 * [#489](https://github.com/stripe/stripe-python/pull/489) Add support for `ValueList` and `ValueListItem` for Radar ## 2.12.1 - 2018-11-22 * [#495](https://github.com/stripe/stripe-python/pull/495) Make `StripeResponse` a new-style class ## 2.12.0 - 2018-11-08 * [#483](https://github.com/stripe/stripe-python/pull/483) Add new API endpoints for the `Invoice` resource. ## 2.11.1 - 2018-11-08 * [#491](https://github.com/stripe/stripe-python/pull/491) Bump minimum requests version to 2.20.0 (for [CVE-2018-18074](https://nvd.nist.gov/vuln/detail/CVE-2018-18074)) ## 2.11.0 - 2018-10-30 * [#482](https://github.com/stripe/stripe-python/pull/482) Add support for the `Person` resource * [#484](https://github.com/stripe/stripe-python/pull/484) Add support for the `WebhookEndpoint` resource ## 2.10.1 - 2018-10-02 * [#481](https://github.com/stripe/stripe-python/pull/481) Correct behavior of `stripe.max_network_retries` if it's reset after initial use ## 2.10.0 - 2018-09-24 * [#478](https://github.com/stripe/stripe-python/pull/478) Add support for Stripe Terminal ## 2.9.0 - 2018-09-24 * [#477](https://github.com/stripe/stripe-python/pull/477) Rename `FileUpload` to `File` ## 2.8.1 - 2018-09-13 * [#474](https://github.com/stripe/stripe-python/pull/474) Don't URL-encode square brackets * [#473](https://github.com/stripe/stripe-python/pull/473) Integer-index encode all arrays ## 2.8.0 - 2018-09-10 * [#470](https://github.com/stripe/stripe-python/pull/470) Add support for automatic network retries ## 2.7.0 - 2018-09-05 * [#469](https://github.com/stripe/stripe-python/pull/469) Add support for reporting resources ## 2.6.0 - 2018-08-23 * [#467](https://github.com/stripe/stripe-python/pull/467) Add support for usage record summaries ## 2.5.0 - 2018-08-16 * [#463](https://github.com/stripe/stripe-python/pull/463) Remove unsupported Bitcoin endpoints (this is technically a breaking change, but we're releasing as a minor version because none of these APIs were usable anyway) ## 2.4.0 - 2018-08-03 * [#460](https://github.com/stripe/stripe-python/pull/460) Add cancel support for topups * [#461](https://github.com/stripe/stripe-python/pull/461) Add support for file links ## 2.3.0 - 2018-07-27 * [#456](https://github.com/stripe/stripe-python/pull/456) Add support for Sigma scheduled query run objects ## 2.2.0 - 2018-07-26 * [#455](https://github.com/stripe/stripe-python/pull/455) Add support for Stripe Issuing ## 2.1.0 - 2018-07-25 * [#452](https://github.com/stripe/stripe-python/pull/452) Add `InvoiceLineItem` class ## 2.0.3 - 2018-07-19 * [#450](https://github.com/stripe/stripe-python/pull/450) Internal improvements to `ApiResource.class_url` ## 2.0.2 - 2018-07-18 * [#448](https://github.com/stripe/stripe-python/pull/448) Avoid duplicate dependency on `requests` with Python 2.7 ## 2.0.1 - 2018-07-10 * [#445](https://github.com/stripe/stripe-python/pull/445) Fix `setup.py` ## 2.0.0 - 2018-07-10 Major version release. List of backwards incompatible changes to watch out for: * The minimum Python versions are now 2.7 / 3.4. If you're using Python 2.6 or 3.3, consider upgrading to a more recent version. * Stripe exception classes should now be accessed via `stripe.error` rather than just `stripe` * Some older deprecated methods have been removed * Trying to detach an unattached source will now raise a `stripe.error.InvalidRequestError` exception instead of a `NotImplementedError` exception For more information, check out the [migration guide for v2](https://github.com/stripe/stripe-python/wiki/Migration-guide-for-v2) Pull requests included in this release: * [#385](https://github.com/stripe/stripe-python/pull/385) Drop support for Python 2.6 and 3.3 * [#384](https://github.com/stripe/stripe-python/pull/384) Use py.test for tests * [#399](https://github.com/stripe/stripe-python/pull/399) Remove deprecated code * [#402](https://github.com/stripe/stripe-python/pull/402) Remove `util.json` and use `json` module directly everywhere * [#403](https://github.com/stripe/stripe-python/pull/403) Update setup.py and test flow * [#410](https://github.com/stripe/stripe-python/pull/410) Use pipenv * [#415](https://github.com/stripe/stripe-python/pull/415) Change exception when detaching unattached sources from `NotImplementedError` to `stripe.error.InvalidRequestError` ## 1.84.2 - 2018-07-06 * [#441](https://github.com/stripe/stripe-python/pull/441) Better (hopefully) fix for serialization of empty `ListObject`s ## 1.84.1 - 2018-07-04 * [#439](https://github.com/stripe/stripe-python/pull/439) Fix serialization of empty `ListObject`s ## 1.84.0 - 2018-06-29 * [#436](https://github.com/stripe/stripe-python/pull/436) Add support for payment intents ## 1.83.0 - 2018-06-28 * [#437](https://github.com/stripe/stripe-python/pull/437) Add support for `partner_id` in `stripe.set_app_info()` ## 1.82.2 - 2018-06-19 * [#365](https://github.com/stripe/stripe-python/pull/365) Add `__repr__` methods to `StripeError` exception classes ## 1.82.1 - 2018-05-14 * [#430](https://github.com/stripe/stripe-python/pull/430) Handle the case where request ID is `None` when formatting errors ## 1.82.0 - 2018-05-13 * [#422](https://github.com/stripe/stripe-python/pull/422) Add `user_mesage` to `StripeError` for a way in Python 3 to avoid the "Request req_...:" string normally appended to error messages ## 1.81.0 - 2018-05-10 * [#425](https://github.com/stripe/stripe-python/pull/425) Add support for issuer fraud records ## 1.80.0 - 2018-04-24 * [#421](https://github.com/stripe/stripe-python/pull/421) Add support for flexible billing and usage records ## 1.79.1 - 2018-02-27 * [#401](https://github.com/stripe/stripe-python/pull/401) Drop conditional dependencies that incorrectly led to an added `simplejson` dependency in Python 3+ after switching to universal wheel ## 1.79.0 - 2018-02-23 * [#397](https://github.com/stripe/stripe-python/pull/397) Build universal wheels by default * [#398](https://github.com/stripe/stripe-python/pull/398) Add support for `code` attribute on all Stripe exceptions ## 1.78.0 - 2018-02-21 * [#396](https://github.com/stripe/stripe-python/pull/396) Add support for topups ## 1.77.2 - 2018-02-08 * [#394](https://github.com/stripe/stripe-python/pull/394) Make `last_response` available after calling `save()` ## 1.77.1 - 2018-01-12 * [#389](https://github.com/stripe/stripe-python/pull/389) Register unsaved attributes on assignment regardless of new value ## 1.77.0 - 2017-12-21 * [#371](https://github.com/stripe/stripe-python/pull/371) Add accessor `last_response` on `StripeObject` for accessing request ID and other metadata ## 1.76.0 - 2017-12-21 * [#382](https://github.com/stripe/stripe-python/pull/382) Add new `IdempotencyError` type ## 1.75.3 - 2017-12-05 * [#378](https://github.com/stripe/stripe-python/pull/378) Log encoded version of parameters instead of raw POST data ## 1.75.2 - 2017-12-05 * (Accidental no-op release. See 1.75.3.) ## 1.75.1 - 2017-11-29 * [#372](https://github.com/stripe/stripe-python/pull/372) Add only changed values to `_unsaved_values` in `StripeObject` * [#375](https://github.com/stripe/stripe-python/pull/375) Use a custom JSON encoder to handle `datetime` objects when serializing `StripeObject`s ## 1.75.0 - 2017-11-08 * [#369](https://github.com/stripe/stripe-python/pull/369) Make custom actions on various resources (e.g. `Account.reject`) more consistent with other APIs ## 1.74.0 - 2017-11-07 * [#368](https://github.com/stripe/stripe-python/pull/368) Remove API that allowed the creation of new disputes (this was an erroneous addition; it never worked because the API would not allow it) ## 1.73.0 - 2017-11-02 * [#364](https://github.com/stripe/stripe-python/pull/364) Switch to vendored version of the `six` package for compatibility between Python 2 and 3 ## 1.72.0 - 2017-10-31 * [#361](https://github.com/stripe/stripe-python/pull/361) Support for exchange rates APIs ## 1.71.2 - 2017-10-31 * [#362](https://github.com/stripe/stripe-python/pull/362) Fix balance transaction and invoice item conversion into `StripeObject`s ## 1.71.1 - 2017-10-27 * [#360](https://github.com/stripe/stripe-python/pull/360) Fix `BytesWarning` being issued on logging in Python 3 ## 1.71.0 - 2017-10-26 * [#359](https://github.com/stripe/stripe-python/pull/359) Support for listing source transactions ## 1.70.0 - 2017-10-23 * [#356](https://github.com/stripe/stripe-python/pull/356) Support uploading files with `StringIO` in addition to a file on disk ## 1.69.0 - 2017-10-20 * [#351](https://github.com/stripe/stripe-python/pull/351) Break resource.py module into separate ones for each type of resource * Classes are still into resource.py for backwards compatibility * [#353](https://github.com/stripe/stripe-python/pull/353) Fix unpickling `StripeObject` in Python 3 ## 1.68.0 - 2017-10-19 * [#350](https://github.com/stripe/stripe-python/pull/350) Add static methods to manipulate resources from parent * `Account` gains methods for external accounts and login links (e.g. `.create_account`, `create_login_link`) * `ApplicationFee` gains methods for refunds * `Customer` gains methods for sources * `Transfer` gains methods for reversals ## 1.67.0 - 2017-10-11 * [#349](https://github.com/stripe/stripe-python/pull/349) Rename source `delete` to `detach` (and deprecate the former) ## 1.66.0 - 2017-09-29 * Support length reads on list objects ## 1.65.1 - 2017-09-21 * Handle `bytearray` and `bytes` (in addition to string) in `Webhook.construct_event` ## 1.65.0 - 2017-09-07 * Add support for passing a `stripe_version` argument to all API requests ## 1.64.0 - 2017-09-01 * Error when an invalid type (i.e. non-string) passed as an API method argument ## 1.63.1 - 2017-09-01 * Fix serialization of `items` on Relay order creation and order return ## 1.63.0 - 2017-08-29 * Add support for `InvalidClientError` OAuth error ## 1.62.1 - 2017-08-07 * Change serialization of subscription items on update to encoded as an integer-indexed map ## 1.62.0 - 2017-06-27 * `pay` on invoice can now take parameter ## 1.61.0 - 2017-06-24 * Expose `code` on `InvalidRequestError` ## 1.60.0 - 2017-06-19 * Add support for ephemeral keys ## 1.59.0 - 2017-06-07 * Refactor OAuth implementation to have dedicated classes for errors ## 1.58.0 - 2017-06-02 * Re-use connections with Pycurl ## 1.57.1 - 2017-05-31 * Fix the pycurl client ## 1.57.0 - 2017-05-26 * Add `api_key` parameter to webhook's `construct_event` ## 1.56.0 - 2017-05-25 * Add support for account login links ## 1.55.2 - 2017-05-11 * Remove Requests constraint from 1.55.1 now that they've patched (as of 2.14.2) ## 1.55.1 - 2017-05-10 * Constrain Requests to < 2.13.0 if on setuptools < 18.0.0 ## 1.55.0 - 2017-04-28 * Support for checking webhook signatures ## 1.54.0 - 2017-04-28 * Add `stripe.set_app_info` for use by plugin creators ## 1.53.0 - 2017-04-06 * Add support for payouts and recipient transfers ## 1.52.0 - 2017-04-06 * No-op release: peg test suite to a specific API version ## 1.51.0 - 2017-03-20 * Support OAuth operations (getting a token and deauthorizing) ## 1.50.0 - 2017-03-17 * Support for detaching sources from customers ## 1.49.0 - 2017-03-13 * Accept `session` argument for `RequestsClient` ## 1.48.1 - 2017-02-21 * Fix encoding of parameters when fetching upcoming invoices ## 1.48.0 - 2017-02-21 * Add `Account.modify_external_account` to modify an account in one API call * Add `Customer.modify_source` to modify a source in one API call ## 1.47.0 - 2017-01-18 * Allow sources to be updated ## 1.46.0 - 2017-01-06 * Use internal session for Requests for connection pooling ## 1.45.0 - 2017-01-06 * request logging goes to stderr now * Logs properly handle unicode * Format is now the same between logging logs, and console logs ## 1.44.0 - 2016-12-16 * Add request logging and some mechanisms to enable it when debugging ## 1.43.0 - 2016-11-30 * Add support for verifying sources ## 1.42.0 - 2016-11-21 * Add retrieve method for 3-D Secure resources ## 1.41.1 - 2016-10-26 * Implement __copy__ and __deepcopy__ on StripeObject to fix these operations ## 1.41.0 - 2016-10-12 * Add `Source` model for generic payment sources ## 1.40.1 - 2016-10-10 * Return subscription model instance on subscription create/modify ## 1.40.0 - 2016-10-07 * Add configurable timeout for Requests HTTP library ## 1.39.0 - 2016-10-06 * Add support for subscription items * Add proxy support for pycurl, Requests, urlfetch, and urllib2 libraries ## 1.38.0 - 2016-09-15 * Add support for Apple Pay domains ## 1.37.0 - 2016-07-12 * Add `ThreeDSecure` model for 3-D secure payments ## 1.36.0 - 2016-06-29 * Add `update` class method to resources that can be updated ## 1.35.0 - 2016-05-24 * Add support for returning Relay orders ## 1.34.0 - 2016-05-20 * Add support for Alipay accounts ## 1.33.0 - 2016-05-04 * Add support for the new `/v1/subscriptions` endpoint * `stripe.Subscription.retrieve` * `stripe.Subscription.update` * `stripe.Subscription.create` * `stripe.Subscription.list` ## 1.32.2 - 2016-04-12 * Fix bug where file uploads could not be properly listed ## 1.32.1 - 2016-04-11 * Fix bug where request parameters were not passed between pages with `auto_paging_iter` ## 1.32.0 - 2016-03-31 * Update CA cert bundle for compatibility with OpenSSL versions below 1.0.1 ## 1.31.1 - 2016-03-24 * Fix uploading of binary files in Python 3 ## 1.31.0 - 2016-03-15 * Add `reject` on `Account` to support the new API feature ## 1.30.0 - 2016-02-27 * Add `CountrySpec` model for looking up country payment information ## 1.29.1 - 2016-02-01 * Update bundled CA certs ## 1.29.0 - 2016-01-26 * Add support for deleting Relay products and SKUs ## 1.28.0 - 2016-01-04 * Add an automatic paginating iterator to lists available via `auto_paging_iter` * List objects are now iterable * Error messages set to `None` are now handled properly * The `all` method on list objects has been deprecated in favor of `list` * Calls to `instance_url` are now side effect free ## 1.27.1 - 2015-10-02 * Official Python 3.4 & 3.5 compatibility * Add configurable HTTP client * Add ability to delete attributes ## 1.27.0 - 2015-09-14 * Products, SKUs, Orders resources ## 1.26.0 - 2015-09-11 * Add support for new 429 rate limit response ## 1.25.0 - 2015-08-17 * Added refund listing, creation and retrieval ## 1.24.1 - 2015-08-05 * Fix error handling for Python 2.6 ## 1.24.0 - 2015-08-03 * Managed accounts can now be deleted * Added dispute listing and retrieval ## 1.23.0 - 2015-07-06 * Include response headers in exceptions ## 1.22.3 - 2015-06-04 * Fix saving `additional_owners` on managed accounts ## 1.22.2 - 2015-04-08 * Fix saving manage accounts ## 1.22.1 - 2015-03-30 * Pass `stripe_account` to Balance.retrieve ## 1.22.0 - 2015-03-22 * Added methods for updating and saving arrays of objects ## 1.21.0 - 2015-02-19 * Added Bitcoin Receiver update and delete methods ## 1.20.2 - 2015-01-21 * Remove support for top-level bitcoin transactions ## 1.20.1 - 2015-01-07 * Adding bitcoin receiver and transaction objects ## 1.20.0 - 2014-12-23 * Adding support for file uploads resource ## 1.19.1 - 2014-10-23 * Remove redundant manual SSL blacklist preflight check ## 1.19.0 - 2014-07-26 * Application Fee refunds now a list instead of array ## 1.18.0 - 2014-06-17 * Add metadata for disputes and refunds ## 1.17.0 - 2014-06-10 * Remove official support for Python 2.5 ## 1.16.0 - 2014-05-28 * Support for canceling transfers ## 1.15.1 - 2014-05-21 * Support cards for recipients. ## 1.14.1 - 2014-05-19 * Disable loading the ssl module on the Google App Engine dev server. ## 1.14.0 - 2014-04-09 * Use DER encoded certificate for checksumming * Don't rely on SNI support in integration tests ## 1.13.0 - 2014-04-09 * Update bundled ca-certificates * Add certificate blacklist for CVE-2014-0160 mitigation ## 1.12.2 - 2014-03-13 * Fix syntax errors in setup.py metadata ## 1.12.1 - 2014-03-13 * Added license and other metadata in setup.py * Fix `__repr__` in Python 3 * Support pickling of responses ## 1.12.0 - 2014-01-29 * Added support for multiple subscriptions per customer ## 1.11.0 - 2013-12-05 * Added extensive unit tests * Extended functional test coverage * Refactored code into modules and out of stripe/__init__.py * Abstracted http library selection and use from the `APIRequestor` into `stripe.http_client` * Refactored `StripeObject` to inherit from `dict` and avoid direct access of `__dict__`. * PEP8ified the codebase and enforced with a test. * Proper encoding of timezone aware datetimes ### Backwards incompatible changes * The `to_dict` and `values` methods on resources no longer recursively convert objects to plain `dict`s. All resources now inherit from `dict` but are functionally different in that you cannot set a value to an empty string and cannot delete items. * The `previous_metadata` attribute on resources is now protected. * Timezone aware `datetime` objects passed to the API will now be encoded in a way that does not depend on the local system time. If you are passing timezone-aware datetimes to our API and your server time is not already in UTC, this will change the value passed to our API. ## 1.10.8 - 2013-12-02 * Add stripe.ApplicationFee resource ## 1.9.8 - 2013-10-17 * Removed incorrect test. ## 1.9.7 - 2013-10-10 * Add support for metadata. ## 1.9.6 - 2013-10-08 * Fix issue with support for closing disputes. ## 1.9.5 - 2013-09-18 * Add support for closing disputes. ## 1.9.4 - 2013-08-13 * Add stripe.Balance and stripe.BalanceTransaction resources ## 1.9.3 - 2013-08-12 * Add support for unsetting attributes by setting to None. Setting properties to a blank string is now an error. ## 1.9.2 - 2013-07-12 * Add support for multiple cards API ## 1.9.1 - 2013-05-03 * Remove 'id' from the list of permanent attributes ## 1.9.0 - 2013-04-25 * Support for Python 3 (github issue #32) ## 1.8.0 - 2013-04-11 * Allow transfers to be creatable * Add new stripe.Recipient resource ## 1.7.10 - 2013-02-21 * Add 'id' to the list of permanent attributes ## 1.7.9 - 2013-02-01 * Add support for passing options when retrieving Stripe objects; e.g., stripe.Charge.retrieve("foo", params={"expand":["customer"]}) ## 1.7.8 - 2013-01-15 * Add support for setting a Stripe API version override ## 1.7.7 - 2012-12-18 * Update requests version check to work with requests 1.x.x (github issue #24) ## 1.7.6 - 2012-11-08 * Add support for updating charge disputes ## 1.7.5 - 2012-10-30 * Add support for creating invoices * Add support for new invoice lines return format * Add support for new List objects ## 1.7.4 - 2012-08-31 * Add update and pay methods for Invoice resource ## 1.7.3 - 2012-08-15 * Add new stripe.Account resource * Remove uncaptured_charge tests (this has been deprecated from the API). ## 1.7.2 - 2012-05-31 * Fix a bug that would cause nested objects to be mis-rendered in __str__ and __repr__ methods (github issues #17, #18) ## 1.7.1 - 2012-05-21 * Prefer App Engine's urlfetch over requests, as that's the only thing that will work in App Engine's environment. Previously, if requests was available in the App Engine environment, we would attempt to use it. ## 1.7.0 - 2012-05-17 * Add new delete_discount method to stripe.Customer * Add new stripe.Transfer resource * Switch from using HTTP Basic auth to Bearer auth. (Note: Stripe will support Basic auth for the indefinite future, but recommends Bearer auth when possible going forward) * Numerous test suite improvements ## 1.6.1 - 2011-09-14 * Parameters with value None are no longer included in API requests ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/LICENSE0000644000175100001770000000210414637354563013526 0ustar00runnerdockerThe MIT License Copyright (c) 2010-2018 Stripe (http://stripe.com) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/LONG_DESCRIPTION.rst0000644000175100001770000000164614637354563015667 0ustar00runnerdockerOfficial Stripe Bindings for Python =================================== A Python library for Stripe's API. Setup ----- You can install this package by using the pip tool and installing: $ pip install stripe Or: $ easy_install stripe Setting up a Stripe Account --------------------------- Sign up for Stripe at https://dashboard.stripe.com/register. Using the Stripe API -------------------- Documentation for the python bindings can be found alongside Stripe's other bindings here: - https://stripe.com/docs - https://stripe.com/docs/api/?lang=python In the standard documentation (the first link), most of the reference pages will have examples in Stripe's official bindings (including Python). Just click on the Python tab to get the relevant documentation. In the full API reference for python (the second link), the right half of the page will provide example requests and responses for various API calls. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/MANIFEST.in0000644000175100001770000000025614637354563014265 0ustar00runnerdockerinclude .coveragerc .flake8 CHANGELOG.md LICENSE LONG_DESCRIPTION.rst README.md VERSION pytest.ini tox.ini recursive-include tests *.py recursive-include examples *.txt *.py ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5769408 stripe-10.1.0/PKG-INFO0000644000175100001770000000463514637354616013630 0ustar00runnerdockerMetadata-Version: 2.1 Name: stripe Version: 10.1.0 Summary: Python bindings for the Stripe API Home-page: https://github.com/stripe/stripe-python Author: Stripe Author-email: support@stripe.com License: MIT Project-URL: Bug Tracker, https://github.com/stripe/stripe-python/issues Project-URL: Changes, https://github.com/stripe/stripe-python/blob/master/CHANGELOG.md Project-URL: Documentation, https://stripe.com/docs/api/?lang=python Project-URL: Source Code, https://github.com/stripe/stripe-python Keywords: stripe api payments Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: MIT License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3 :: Only Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: 3.12 Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy Classifier: Topic :: Software Development :: Libraries :: Python Modules Requires-Python: >=3.6 Description-Content-Type: text/x-rst License-File: LICENSE Official Stripe Bindings for Python =================================== A Python library for Stripe's API. Setup ----- You can install this package by using the pip tool and installing: $ pip install stripe Or: $ easy_install stripe Setting up a Stripe Account --------------------------- Sign up for Stripe at https://dashboard.stripe.com/register. Using the Stripe API -------------------- Documentation for the python bindings can be found alongside Stripe's other bindings here: - https://stripe.com/docs - https://stripe.com/docs/api/?lang=python In the standard documentation (the first link), most of the reference pages will have examples in Stripe's official bindings (including Python). Just click on the Python tab to get the relevant documentation. In the full API reference for python (the second link), the right half of the page will provide example requests and responses for various API calls. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/README.md0000644000175100001770000003174214637354563014012 0ustar00runnerdocker# Stripe Python Library [![pypi](https://img.shields.io/pypi/v/stripe.svg)](https://pypi.python.org/pypi/stripe) [![Build Status](https://github.com/stripe/stripe-python/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/stripe/stripe-python/actions?query=branch%3Amaster) [![Coverage Status](https://coveralls.io/repos/github/stripe/stripe-python/badge.svg?branch=master)](https://coveralls.io/github/stripe/stripe-python?branch=master) The Stripe Python library provides convenient access to the Stripe API from applications written in the Python language. It includes a pre-defined set of classes for API resources that initialize themselves dynamically from API responses which makes it compatible with a wide range of versions of the Stripe API. ## Documentation See the [Python API docs](https://stripe.com/docs/api?lang=python). See [video demonstrations][youtube-playlist] covering how to use the library. ## Installation You don't need this source code unless you want to modify the package. If you just want to use the package, just run: ```sh pip install --upgrade stripe ``` Install from source with: ```sh python setup.py install ``` ### Requirements - Python 3.6+ (PyPy supported) #### Python 2.7 deprecation [The Python Software Foundation (PSF)](https://www.python.org/psf-landing/) community [announced the end of support of Python 2](https://www.python.org/doc/sunset-python-2/) on 01 January 2020. Starting with version 6.0.0 Stripe SDK Python packages will no longer support Python 2.7. To continue to get new features and security updates, please make sure to update your Python runtime to Python 3.6+. The last version of the Stripe SDK that supports Python 2.7 is 5.5.0. ## Usage The library needs to be configured with your account's secret key which is available in your [Stripe Dashboard][api-keys]. Set `stripe.api_key` to its value: ```python from stripe import StripeClient client = StripeClient("sk_test_...") # list customers customers = client.customers.list() # print the first customer's email print(customers.data[0].email) # retrieve specific Customer customer = client.customers.retrieve("cus_123456789") # print that customer's email print(customer.email) ``` ### Handling exceptions Unsuccessful requests raise exceptions. The class of the exception will reflect the sort of error that occurred. Please see the [Api Reference](https://stripe.com/docs/api/errors/handling) for a description of the error classes you should handle, and for information on how to inspect these errors. ### Per-request Configuration Configure individual requests with the `options` argument. For example, you can make requests with a specific [Stripe Version](https://stripe.com/docs/api#versioning) or as a [connected account](https://stripe.com/docs/connect/authentication#authentication-via-the-stripe-account-header): ```python from stripe import StripeClient client = StripeClient("sk_test_...") # list customers client.customers.list( options={ "api_key": "sk_test_...", "stripe_account": "acct_...", "stripe_version": "2019-02-19", } ) # retrieve single customer client.customers.retrieve( "cus_123456789", options={ "api_key": "sk_test_...", "stripe_account": "acct_...", "stripe_version": "2019-02-19", } ) ``` ### Configuring an HTTP Client You can configure your `StripeClient` to use `urlfetch`, `requests`, `pycurl`, or `urllib2` with the `http_client` option: ```python client = StripeClient("sk_test_...", http_client=stripe.UrlFetchClient()) client = StripeClient("sk_test_...", http_client=stripe.RequestsClient()) client = StripeClient("sk_test_...", http_client=stripe.PycurlClient()) client = StripeClient("sk_test_...", http_client=stripe.Urllib2Client()) ``` Without a configured client, by default the library will attempt to load libraries in the order above (i.e. `urlfetch` is preferred with `urllib2` used as a last resort). We usually recommend that people use `requests`. ### Configuring a Proxy A proxy can be configured with the `proxy` client option: ```python client = StripeClient("sk_test_...", proxy="https://user:pass@example.com:1234") ``` ### Configuring Automatic Retries You can enable automatic retries on requests that fail due to a transient problem by configuring the maximum number of retries: ```python client = StripeClient("sk_test_...", max_network_retries=2) ``` Various errors can trigger a retry, like a connection error or a timeout, and also certain API responses like HTTP status `409 Conflict`. [Idempotency keys][idempotency-keys] are automatically generated and added to requests, when not given, to guarantee that retries are safe. ### Logging The library can be configured to emit logging that will give you better insight into what it's doing. The `info` logging level is usually most appropriate for production use, but `debug` is also available for more verbosity. There are a few options for enabling it: 1. Set the environment variable `STRIPE_LOG` to the value `debug` or `info` ```sh $ export STRIPE_LOG=debug ``` 2. Set `stripe.log`: ```python import stripe stripe.log = 'debug' ``` 3. Enable it through Python's logging module: ```python import logging logging.basicConfig() logging.getLogger('stripe').setLevel(logging.DEBUG) ``` ### Accessing response code and headers You can access the HTTP response code and headers using the `last_response` property of the returned resource. ```python customer = client.customers.retrieve( "cus_123456789" ) print(customer.last_response.code) print(customer.last_response.headers) ``` ### Writing a Plugin If you're writing a plugin that uses the library, we'd appreciate it if you identified using `stripe.set_app_info()`: ```py stripe.set_app_info("MyAwesomePlugin", version="1.2.34", url="https://myawesomeplugin.info") ``` This information is passed along when the library makes calls to the Stripe API. ### Telemetry By default, the library sends telemetry to Stripe regarding request latency and feature usage. These numbers help Stripe improve the overall latency of its API for all users, and improve popular features. You can disable this behavior if you prefer: ```python stripe.enable_telemetry = False ``` ## Types In [v7.1.0](https://github.com/stripe/stripe-python/releases/tag/v7.1.0) and newer, the library includes type annotations. See [the wiki](https://github.com/stripe/stripe-python/wiki/Inline-type-annotations) for a detailed guide. Please note that some annotations use features that were only fairly recently accepted, such as [`Unpack[TypedDict]`](https://peps.python.org/pep-0692/#specification) that was [accepted](https://discuss.python.org/t/pep-692-using-typeddict-for-more-precise-kwargs-typing/17314/81) in January 2023. We have tested that these types are recognized properly by [Pyright](https://github.com/microsoft/pyright). Support for `Unpack` in MyPy is still experimental, but appears to degrade gracefully. Please [report an issue](https://github.com/stripe/stripe-python/issues/new/choose) if there is anything we can do to improve the types for your type checker of choice. ### Types and the Versioning Policy We release type changes in minor releases. While stripe-python follows semantic versioning, our semantic versions describe the _runtime behavior_ of the library alone. Our _type annotations are not reflected in the semantic version_. That is, upgrading to a new minor version of stripe-python might result in your type checker producing a type error that it didn't before. You can use a `~=x.x` or `x.x.*` [version specifier](https://peps.python.org/pep-0440/#examples) in your `requirements.txt` to constrain `pip` to a certain minor range of `stripe-python`. ### Types and API Versions The types describe the [Stripe API version](https://stripe.com/docs/api/versioning) that was the latest at the time of release. This is the version that your library sends by default. If you are overriding `stripe.api_version` / `stripe_version` on the `StripeClient`, or using a [webhook endpoint](https://stripe.com/docs/webhooks#api-versions) tied to an older version, be aware that the data you see at runtime may not match the types. ## Beta SDKs Stripe has features in the beta phase that can be accessed via the beta version of this package. We would love for you to try these and share feedback with us before these features reach the stable phase. To install a beta version use `pip install` with the exact version you'd like to use: ``` pip install --pre stripe ``` > **Note** > There can be breaking changes between beta versions. Therefore we recommend pinning the package version to a specific beta version in your [requirements file](https://pip.pypa.io/en/stable/user_guide/#requirements-files) or `setup.py`. This way you can install the same version each time without breaking changes unless you are intentionally looking for the latest beta version. We highly recommend keeping an eye on when the beta feature you are interested in goes from beta to stable so that you can move from using a beta version of the SDK to the stable version. If your beta feature requires a `Stripe-Version` header to be sent, set the `stripe.api_version` field using the `stripe.add_beta_version` function: ```python stripe.add_beta_version("feature_beta", "v3") ``` ### Async Asynchronous versions of request-making methods are available by suffixing the method name with `_async`. ```python # With StripeClient client = StripeClient("sk_test_...") customer = await client.customers.retrieve_async("cus_xyz") # With global client stripe.api_key = "sk_test_..." customer = await stripe.Customer.retrieve_async("cus_xyz") # .auto_paging_iter() implements both AsyncIterable and Iterable async for c in await stripe.Customer.list_async().auto_paging_iter(): ... ``` There is no `.save_async` as `.save` is [deprecated since stripe-python v5](https://github.com/stripe/stripe-python/wiki/Migration-guide-for-v5#deprecated). Please migrate to `.modify_async`. The default HTTP client uses `requests` for making synchronous requests but `httpx` for making async requests. If you're migrating to async, we recommend you to explicitly initialize your own http client and pass it to StripeClient or set it as the global default. ```python # By default, an explicitly initialized HTTPXClient will raise an exception if you # attempt to call a sync method. If you intend to only use async, this is useful to # make sure you don't unintentionally make a synchronous request. my_http_client = stripe.HTTPXClient() # If you want to use httpx to make sync requests, you can disable this # behavior. my_http_client = stripe.HTTPXClient(allow_sync_methods=True) # aiohttp is also available (does not support sync requests) my_http_client = stripe.AIOHTTPClient() # With StripeClient client = StripeClient("sk_test_...", http_client=my_http_client) # With the global client stripe.default_http_client = my_http_client ``` You can also subclass `stripe.HTTPClient` and provide your own instance. ## Support New features and bug fixes are released on the latest major version of the Stripe Python library. If you are on an older major version, we recommend that you upgrade to the latest in order to use the new features and bug fixes including those for security vulnerabilities. Older major versions of the package will continue to be available for use, but will not be receiving any updates. ## Development The test suite depends on [stripe-mock], so make sure to fetch and run it from a background terminal ([stripe-mock's README][stripe-mock] also contains instructions for installing via Homebrew and other methods): ```sh go install github.com/stripe/stripe-mock@latest stripe-mock ``` Run the following command to set up the development virtualenv: ```sh make ``` Run all tests on all supported Python versions: ```sh make test ``` Run all tests for a specific Python version (modify `-e` according to your Python target): ```sh TOX_ARGS="-e py37" make test ``` Run all tests in a single file: ```sh TOX_ARGS="-e py37 -- tests/api_resources/abstract/test_updateable_api_resource.py" make test ``` Run a single test suite: ```sh TOX_ARGS="-e py37 -- tests/api_resources/abstract/test_updateable_api_resource.py::TestUpdateableAPIResource" make test ``` Run a single test: ```sh TOX_ARGS="-e py37 -- tests/api_resources/abstract/test_updateable_api_resource.py::TestUpdateableAPIResource::test_save" make test ``` Run the linter with: ```sh make lint ``` The library uses [Ruff][ruff] for code formatting. Code must be formatted with Black before PRs are submitted, otherwise CI will fail. Run the formatter with: ```sh make fmt ``` [api-keys]: https://dashboard.stripe.com/account/apikeys [ruff]: https://github.com/astral-sh/ruff [connect]: https://stripe.com/connect [poetry]: https://github.com/sdispater/poetry [stripe-mock]: https://github.com/stripe/stripe-mock [idempotency-keys]: https://stripe.com/docs/api/idempotent_requests?lang=python [youtube-playlist]: https://www.youtube.com/playlist?list=PLy1nL-pvL2M55YVn0mGoQ5r-39A1-ZypO ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/VERSION0000644000175100001770000000000714637354563013571 0ustar00runnerdocker10.1.0 ././@PaxHeader0000000000000000000000000000003200000000000010210 xustar0026 mtime=1719523725.46894 stripe-10.1.0/examples/0000755000175100001770000000000014637354615014340 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/examples/charge.py0000644000175100001770000000041514637354563016145 0ustar00runnerdockerimport os import stripe stripe.api_key = os.environ.get("STRIPE_SECRET_KEY") print("Attempting charge...") resp = stripe.Charge.create( amount=200, currency="usd", card="tok_visa", description="customer@gmail.com", ) print("Success: %r" % (resp)) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/examples/oauth.py0000644000175100001770000000263114637354563016036 0ustar00runnerdockerimport os import stripe from flask import Flask, request, redirect stripe.api_key = os.environ.get("STRIPE_SECRET_KEY") stripe.client_id = os.environ.get("STRIPE_CLIENT_ID") app = Flask(__name__) @app.route("/") def index(): return 'Connect with Stripe' @app.route("/authorize") def authorize(): url = stripe.OAuth.authorize_url(scope="read_only") return redirect(url) @app.route("/oauth/callback") def callback(): code = request.args.get("code") try: resp = stripe.OAuth.token(grant_type="authorization_code", code=code) except stripe.oauth_error.OAuthError as e: return "Error: " + str(e) return """

Success! Account {stripe_user_id} is connected.

Click here to disconnect the account.

""".format(stripe_user_id=resp["stripe_user_id"]) @app.route("/deauthorize") def deauthorize(): stripe_user_id = request.args.get("stripe_user_id") try: stripe.OAuth.deauthorize(stripe_user_id=stripe_user_id) except stripe.oauth_error.OAuthError as e: return "Error: " + str(e) return """

Success! Account {stripe_user_id} is disconnected.

Click here to restart the OAuth flow.

""".format(stripe_user_id=stripe_user_id) if __name__ == "__main__": app.run(port=int(os.environ.get("PORT", 5000))) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/examples/proxy.py0000644000175100001770000000145514637354563016102 0ustar00runnerdockerimport os import stripe stripe.api_key = os.environ.get("STRIPE_SECRET_KEY") print("Attempting charge...") proxy = { "http": "http://:@:", "https": "http://:@:", } clients = ( stripe.http_client.RequestsClient( verify_ssl_certs=stripe.verify_ssl_certs, proxy=proxy ), stripe.http_client.PycurlClient( verify_ssl_certs=stripe.verify_ssl_certs, proxy=proxy ), stripe.http_client.Urllib2Client( verify_ssl_certs=stripe.verify_ssl_certs, proxy=proxy ), ) for c in clients: stripe.default_http_client = c resp = stripe.Charge.create( amount=200, currency="usd", card="tok_visa", description="customer@gmail.com", ) print("Success: %s, %r" % (c.name, resp)) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/examples/webhooks.py0000644000175100001770000000163314637354563016540 0ustar00runnerdockerimport os import stripe from flask import Flask, request stripe.api_key = os.environ.get("STRIPE_SECRET_KEY") webhook_secret = os.environ.get("WEBHOOK_SECRET") app = Flask(__name__) @app.route("/webhooks", methods=["POST"]) def webhooks(): payload = request.data.decode("utf-8") received_sig = request.headers.get("Stripe-Signature", None) try: event = stripe.Webhook.construct_event( payload, received_sig, webhook_secret ) except ValueError: print("Error while decoding event!") return "Bad payload", 400 except stripe.error.SignatureVerificationError: print("Invalid signature!") return "Bad signature", 400 print( "Received event: id={id}, type={type}".format( id=event.id, type=event.type ) ) return "", 200 if __name__ == "__main__": app.run(port=int(os.environ.get("PORT", 5000))) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/pyproject.toml0000644000175100001770000000163514637354563015445 0ustar00runnerdocker[tool.ruff] # same as our black config line-length = 79 extend-exclude = ["build"] [tool.ruff.format] # currently the default value, but opt-out in the future docstring-code-format = false [tool.pyright] include = [ "stripe", "tests/test_generated_examples.py", "tests/test_exports.py", "tests/test_http_client.py", ] exclude = ["build", "**/__pycache__"] reportMissingTypeArgument = true reportUnnecessaryCast = true reportUnnecessaryComparison = true reportUnnecessaryContains = true reportUnnecessaryIsInstance = true reportPrivateImportUsage = true reportUnnecessaryTypeIgnoreComment = true [tool.mypy] follow_imports = "silent" python_version = "3.10" files = ["tests/test_generated_examples.py", "tests/test_exports.py"] disallow_untyped_calls = true disallow_untyped_defs = true warn_unused_ignores = true no_implicit_reexport = true [tool.pytest.ini_options] filterwarnings = "ignore::DeprecationWarning" ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5769408 stripe-10.1.0/setup.cfg0000644000175100001770000000014614637354616014345 0ustar00runnerdocker[bdist_wheel] universal = 1 [metadata] license_file = LICENSE [egg_info] tag_build = tag_date = 0 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/setup.py0000644000175100001770000000502014637354563014233 0ustar00runnerdockerimport os from codecs import open from setuptools import setup, find_packages here = os.path.abspath(os.path.dirname(__file__)) os.chdir(here) with open( os.path.join(here, "LONG_DESCRIPTION.rst"), "r", encoding="utf-8" ) as fp: long_description = fp.read() version_contents = {} with open(os.path.join(here, "stripe", "_version.py"), encoding="utf-8") as f: exec(f.read(), version_contents) setup( name="stripe", version=version_contents["VERSION"], description="Python bindings for the Stripe API", long_description=long_description, long_description_content_type="text/x-rst", author="Stripe", author_email="support@stripe.com", url="https://github.com/stripe/stripe-python", license="MIT", keywords="stripe api payments", packages=find_packages(exclude=["tests", "tests.*"]), package_data={"stripe": ["data/ca-certificates.crt", "py.typed"]}, zip_safe=False, install_requires=[ 'typing_extensions <= 4.2.0, > 3.7.2; python_version < "3.7"', # The best typing support comes from 4.5.0+ but we can support down to # 3.7.2 without throwing exceptions. 'typing_extensions >= 4.5.0; python_version >= "3.7"', 'requests >= 2.20; python_version >= "3.0"', ], python_requires=">=3.6", project_urls={ "Bug Tracker": "https://github.com/stripe/stripe-python/issues", "Changes": "https://github.com/stripe/stripe-python/blob/master/CHANGELOG.md", "Documentation": "https://stripe.com/docs/api/?lang=python", "Source Code": "https://github.com/stripe/stripe-python", }, classifiers=[ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3 :: Only", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Libraries :: Python Modules", ], setup_requires=["wheel"], ) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5049403 stripe-10.1.0/stripe/0000755000175100001770000000000014637354616014031 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/__init__.py0000644000175100001770000005032514637354563016150 0ustar00runnerdockerfrom typing_extensions import TYPE_CHECKING, Literal from typing import Optional import sys as _sys import os # Stripe Python bindings # API docs at http://stripe.com/docs/api # Authors: # Patrick Collison # Greg Brockman # Andrew Metcalf # Configuration variables from stripe._api_version import _ApiVersion from stripe._api_requestor import _APIRequestor # We must import the app_info module early to populate it into # `sys.modules`; otherwise doing `import stripe.app_info` will end up # importing that module, and not the global `AppInfo` name from below. import stripe.app_info from stripe._app_info import AppInfo as AppInfo from stripe._version import VERSION as VERSION # Constants DEFAULT_API_BASE: str = "https://api.stripe.com" DEFAULT_CONNECT_API_BASE: str = "https://connect.stripe.com" DEFAULT_UPLOAD_API_BASE: str = "https://files.stripe.com" api_key: Optional[str] = None client_id: Optional[str] = None api_base: str = DEFAULT_API_BASE connect_api_base: str = DEFAULT_CONNECT_API_BASE upload_api_base: str = DEFAULT_UPLOAD_API_BASE api_version: str = _ApiVersion.CURRENT verify_ssl_certs: bool = True proxy: Optional[str] = None default_http_client: Optional["HTTPClient"] = None app_info: Optional[AppInfo] = None enable_telemetry: bool = True max_network_retries: int = 0 ca_bundle_path: str = os.path.join( os.path.dirname(__file__), "data", "ca-certificates.crt" ) # Set to either 'debug' or 'info', controls console logging log: Optional[Literal["debug", "info"]] = None # OAuth from stripe._oauth import OAuth as OAuth # Webhooks from stripe._webhook import ( Webhook as Webhook, WebhookSignature as WebhookSignature, ) # StripeClient from stripe._stripe_client import StripeClient as StripeClient # noqa # Sets some basic information about the running application that's sent along # with API requests. Useful for plugin authors to identify their plugin when # communicating with Stripe. # # Takes a name and optional version and plugin URL. def set_app_info( name: str, partner_id: Optional[str] = None, url: Optional[str] = None, version: Optional[str] = None, ): global app_info app_info = { "name": name, "partner_id": partner_id, "url": url, "version": version, } # Infrastructure types from stripe._api_resource import APIResource as APIResource from stripe._error_object import ErrorObject as ErrorObject from stripe._error_object import OAuthErrorObject as OAuthErrorObject from stripe._list_object import ListObject as ListObject from stripe._search_result_object import ( SearchResultObject as SearchResultObject, ) from stripe._stripe_object import StripeObject as StripeObject from stripe._request_options import RequestOptions as RequestOptions from stripe._createable_api_resource import ( CreateableAPIResource as CreateableAPIResource, ) from stripe._custom_method import ( custom_method as custom_method, ) from stripe._deletable_api_resource import ( DeletableAPIResource as DeletableAPIResource, ) from stripe._listable_api_resource import ( ListableAPIResource as ListableAPIResource, ) from stripe._nested_resource_class_methods import ( nested_resource_class_methods as nested_resource_class_methods, ) from stripe._searchable_api_resource import ( SearchableAPIResource as SearchableAPIResource, ) from stripe._singleton_api_resource import ( SingletonAPIResource as SingletonAPIResource, ) from stripe._test_helpers import ( APIResourceTestHelpers as APIResourceTestHelpers, ) from stripe._updateable_api_resource import ( UpdateableAPIResource as UpdateableAPIResource, ) from stripe._verify_mixin import ( VerifyMixin as VerifyMixin, ) from stripe._requestor_options import ( RequestorOptions as RequestorOptions, ) from stripe._api_mode import ( ApiMode as ApiMode, ) from stripe._base_address import ( BaseAddress as BaseAddress, ) # Response types from stripe._stripe_response import StripeResponse as StripeResponse from stripe._stripe_response import StripeResponseBase as StripeResponseBase from stripe._stripe_response import ( StripeStreamResponse as StripeStreamResponse, StripeStreamResponseAsync as StripeStreamResponseAsync, ) # Error types from stripe._error import StripeError as StripeError from stripe._error import APIError as APIError from stripe._error import APIConnectionError as APIConnectionError from stripe._error import StripeErrorWithParamCode as StripeErrorWithParamCode from stripe._error import CardError as CardError from stripe._error import IdempotencyError as IdempotencyError from stripe._error import InvalidRequestError as InvalidRequestError from stripe._error import AuthenticationError as AuthenticationError from stripe._error import PermissionError as PermissionError from stripe._error import RateLimitError as RateLimitError from stripe._error import ( SignatureVerificationError as SignatureVerificationError, ) # HttpClient from stripe._http_client import ( HTTPClient as HTTPClient, PycurlClient as PycurlClient, RequestsClient as RequestsClient, UrlFetchClient as UrlFetchClient, HTTPXClient as HTTPXClient, AIOHTTPClient as AIOHTTPClient, new_default_http_client as new_default_http_client, ) # Util from stripe._util import convert_to_stripe_object as convert_to_stripe_object # Backwards compatibility re-exports if not TYPE_CHECKING: from stripe import _stripe_response as stripe_response from stripe import _stripe_object as stripe_object from stripe import _error_object as error_object from stripe import _error as error from stripe import _http_client as http_client from stripe import _util as util from stripe import _oauth as oauth from stripe import _webhook as webhook from stripe import _multipart_data_generator as multipart_data_generator from stripe import _request_metrics as request_metrics from stripe._file import File as FileUpload import warnings # Python 3.7+ supports module level __getattr__ that allows us to lazy load deprecated modules # this matters because if we pre-load all modules from api_resources while suppressing warning # users will never see those warnings if _sys.version_info[:2] >= (3, 7): def __getattr__(name): if name == "abstract": import stripe.api_resources.abstract as _abstract return _abstract if name == "api_resources": import stripe.api_resources as _api_resources return _api_resources raise AttributeError( f"module {__name__!r} has no attribute {name!r}" ) else: with warnings.catch_warnings(): warnings.filterwarnings("ignore", category=DeprecationWarning) import stripe.api_resources.abstract as abstract import stripe.api_resources as api_resources # API resources # The beginning of the section generated from our OpenAPI spec from stripe import ( apps as apps, billing as billing, billing_portal as billing_portal, checkout as checkout, climate as climate, entitlements as entitlements, financial_connections as financial_connections, forwarding as forwarding, identity as identity, issuing as issuing, radar as radar, reporting as reporting, sigma as sigma, tax as tax, terminal as terminal, test_helpers as test_helpers, treasury as treasury, ) from stripe._account import Account as Account from stripe._account_capability_service import ( AccountCapabilityService as AccountCapabilityService, ) from stripe._account_external_account_service import ( AccountExternalAccountService as AccountExternalAccountService, ) from stripe._account_link import AccountLink as AccountLink from stripe._account_link_service import ( AccountLinkService as AccountLinkService, ) from stripe._account_login_link_service import ( AccountLoginLinkService as AccountLoginLinkService, ) from stripe._account_person_service import ( AccountPersonService as AccountPersonService, ) from stripe._account_service import AccountService as AccountService from stripe._account_session import AccountSession as AccountSession from stripe._account_session_service import ( AccountSessionService as AccountSessionService, ) from stripe._apple_pay_domain import ApplePayDomain as ApplePayDomain from stripe._apple_pay_domain_service import ( ApplePayDomainService as ApplePayDomainService, ) from stripe._application import Application as Application from stripe._application_fee import ApplicationFee as ApplicationFee from stripe._application_fee_refund import ( ApplicationFeeRefund as ApplicationFeeRefund, ) from stripe._application_fee_refund_service import ( ApplicationFeeRefundService as ApplicationFeeRefundService, ) from stripe._application_fee_service import ( ApplicationFeeService as ApplicationFeeService, ) from stripe._apps_service import AppsService as AppsService from stripe._balance import Balance as Balance from stripe._balance_service import BalanceService as BalanceService from stripe._balance_transaction import ( BalanceTransaction as BalanceTransaction, ) from stripe._balance_transaction_service import ( BalanceTransactionService as BalanceTransactionService, ) from stripe._bank_account import BankAccount as BankAccount from stripe._billing_portal_service import ( BillingPortalService as BillingPortalService, ) from stripe._billing_service import BillingService as BillingService from stripe._capability import Capability as Capability from stripe._card import Card as Card from stripe._cash_balance import CashBalance as CashBalance from stripe._charge import Charge as Charge from stripe._charge_service import ChargeService as ChargeService from stripe._checkout_service import CheckoutService as CheckoutService from stripe._climate_service import ClimateService as ClimateService from stripe._confirmation_token import ConfirmationToken as ConfirmationToken from stripe._confirmation_token_service import ( ConfirmationTokenService as ConfirmationTokenService, ) from stripe._connect_collection_transfer import ( ConnectCollectionTransfer as ConnectCollectionTransfer, ) from stripe._country_spec import CountrySpec as CountrySpec from stripe._country_spec_service import ( CountrySpecService as CountrySpecService, ) from stripe._coupon import Coupon as Coupon from stripe._coupon_service import CouponService as CouponService from stripe._credit_note import CreditNote as CreditNote from stripe._credit_note_line_item import ( CreditNoteLineItem as CreditNoteLineItem, ) from stripe._credit_note_line_item_service import ( CreditNoteLineItemService as CreditNoteLineItemService, ) from stripe._credit_note_preview_lines_service import ( CreditNotePreviewLinesService as CreditNotePreviewLinesService, ) from stripe._credit_note_service import CreditNoteService as CreditNoteService from stripe._customer import Customer as Customer from stripe._customer_balance_transaction import ( CustomerBalanceTransaction as CustomerBalanceTransaction, ) from stripe._customer_balance_transaction_service import ( CustomerBalanceTransactionService as CustomerBalanceTransactionService, ) from stripe._customer_cash_balance_service import ( CustomerCashBalanceService as CustomerCashBalanceService, ) from stripe._customer_cash_balance_transaction import ( CustomerCashBalanceTransaction as CustomerCashBalanceTransaction, ) from stripe._customer_cash_balance_transaction_service import ( CustomerCashBalanceTransactionService as CustomerCashBalanceTransactionService, ) from stripe._customer_funding_instructions_service import ( CustomerFundingInstructionsService as CustomerFundingInstructionsService, ) from stripe._customer_payment_method_service import ( CustomerPaymentMethodService as CustomerPaymentMethodService, ) from stripe._customer_payment_source_service import ( CustomerPaymentSourceService as CustomerPaymentSourceService, ) from stripe._customer_service import CustomerService as CustomerService from stripe._customer_session import CustomerSession as CustomerSession from stripe._customer_session_service import ( CustomerSessionService as CustomerSessionService, ) from stripe._customer_tax_id_service import ( CustomerTaxIdService as CustomerTaxIdService, ) from stripe._discount import Discount as Discount from stripe._dispute import Dispute as Dispute from stripe._dispute_service import DisputeService as DisputeService from stripe._entitlements_service import ( EntitlementsService as EntitlementsService, ) from stripe._ephemeral_key import EphemeralKey as EphemeralKey from stripe._ephemeral_key_service import ( EphemeralKeyService as EphemeralKeyService, ) from stripe._event import Event as Event from stripe._event_service import EventService as EventService from stripe._exchange_rate import ExchangeRate as ExchangeRate from stripe._exchange_rate_service import ( ExchangeRateService as ExchangeRateService, ) from stripe._file import File as File from stripe._file_link import FileLink as FileLink from stripe._file_link_service import FileLinkService as FileLinkService from stripe._file_service import FileService as FileService from stripe._financial_connections_service import ( FinancialConnectionsService as FinancialConnectionsService, ) from stripe._forwarding_service import ForwardingService as ForwardingService from stripe._funding_instructions import ( FundingInstructions as FundingInstructions, ) from stripe._identity_service import IdentityService as IdentityService from stripe._invoice import Invoice as Invoice from stripe._invoice_item import InvoiceItem as InvoiceItem from stripe._invoice_item_service import ( InvoiceItemService as InvoiceItemService, ) from stripe._invoice_line_item import InvoiceLineItem as InvoiceLineItem from stripe._invoice_line_item_service import ( InvoiceLineItemService as InvoiceLineItemService, ) from stripe._invoice_service import InvoiceService as InvoiceService from stripe._invoice_upcoming_lines_service import ( InvoiceUpcomingLinesService as InvoiceUpcomingLinesService, ) from stripe._issuing_service import IssuingService as IssuingService from stripe._line_item import LineItem as LineItem from stripe._login_link import LoginLink as LoginLink from stripe._mandate import Mandate as Mandate from stripe._mandate_service import MandateService as MandateService from stripe._payment_intent import PaymentIntent as PaymentIntent from stripe._payment_intent_service import ( PaymentIntentService as PaymentIntentService, ) from stripe._payment_link import PaymentLink as PaymentLink from stripe._payment_link_line_item_service import ( PaymentLinkLineItemService as PaymentLinkLineItemService, ) from stripe._payment_link_service import ( PaymentLinkService as PaymentLinkService, ) from stripe._payment_method import PaymentMethod as PaymentMethod from stripe._payment_method_configuration import ( PaymentMethodConfiguration as PaymentMethodConfiguration, ) from stripe._payment_method_configuration_service import ( PaymentMethodConfigurationService as PaymentMethodConfigurationService, ) from stripe._payment_method_domain import ( PaymentMethodDomain as PaymentMethodDomain, ) from stripe._payment_method_domain_service import ( PaymentMethodDomainService as PaymentMethodDomainService, ) from stripe._payment_method_service import ( PaymentMethodService as PaymentMethodService, ) from stripe._payout import Payout as Payout from stripe._payout_service import PayoutService as PayoutService from stripe._person import Person as Person from stripe._plan import Plan as Plan from stripe._plan_service import PlanService as PlanService from stripe._price import Price as Price from stripe._price_service import PriceService as PriceService from stripe._product import Product as Product from stripe._product_feature import ProductFeature as ProductFeature from stripe._product_feature_service import ( ProductFeatureService as ProductFeatureService, ) from stripe._product_service import ProductService as ProductService from stripe._promotion_code import PromotionCode as PromotionCode from stripe._promotion_code_service import ( PromotionCodeService as PromotionCodeService, ) from stripe._quote import Quote as Quote from stripe._quote_computed_upfront_line_items_service import ( QuoteComputedUpfrontLineItemsService as QuoteComputedUpfrontLineItemsService, ) from stripe._quote_line_item_service import ( QuoteLineItemService as QuoteLineItemService, ) from stripe._quote_service import QuoteService as QuoteService from stripe._radar_service import RadarService as RadarService from stripe._refund import Refund as Refund from stripe._refund_service import RefundService as RefundService from stripe._reporting_service import ReportingService as ReportingService from stripe._reserve_transaction import ( ReserveTransaction as ReserveTransaction, ) from stripe._reversal import Reversal as Reversal from stripe._review import Review as Review from stripe._review_service import ReviewService as ReviewService from stripe._setup_attempt import SetupAttempt as SetupAttempt from stripe._setup_attempt_service import ( SetupAttemptService as SetupAttemptService, ) from stripe._setup_intent import SetupIntent as SetupIntent from stripe._setup_intent_service import ( SetupIntentService as SetupIntentService, ) from stripe._shipping_rate import ShippingRate as ShippingRate from stripe._shipping_rate_service import ( ShippingRateService as ShippingRateService, ) from stripe._sigma_service import SigmaService as SigmaService from stripe._source import Source as Source from stripe._source_mandate_notification import ( SourceMandateNotification as SourceMandateNotification, ) from stripe._source_service import SourceService as SourceService from stripe._source_transaction import SourceTransaction as SourceTransaction from stripe._source_transaction_service import ( SourceTransactionService as SourceTransactionService, ) from stripe._subscription import Subscription as Subscription from stripe._subscription_item import SubscriptionItem as SubscriptionItem from stripe._subscription_item_service import ( SubscriptionItemService as SubscriptionItemService, ) from stripe._subscription_item_usage_record_service import ( SubscriptionItemUsageRecordService as SubscriptionItemUsageRecordService, ) from stripe._subscription_item_usage_record_summary_service import ( SubscriptionItemUsageRecordSummaryService as SubscriptionItemUsageRecordSummaryService, ) from stripe._subscription_schedule import ( SubscriptionSchedule as SubscriptionSchedule, ) from stripe._subscription_schedule_service import ( SubscriptionScheduleService as SubscriptionScheduleService, ) from stripe._subscription_service import ( SubscriptionService as SubscriptionService, ) from stripe._tax_code import TaxCode as TaxCode from stripe._tax_code_service import TaxCodeService as TaxCodeService from stripe._tax_deducted_at_source import ( TaxDeductedAtSource as TaxDeductedAtSource, ) from stripe._tax_id import TaxId as TaxId from stripe._tax_id_service import TaxIdService as TaxIdService from stripe._tax_rate import TaxRate as TaxRate from stripe._tax_rate_service import TaxRateService as TaxRateService from stripe._tax_service import TaxService as TaxService from stripe._terminal_service import TerminalService as TerminalService from stripe._test_helpers_service import ( TestHelpersService as TestHelpersService, ) from stripe._token import Token as Token from stripe._token_service import TokenService as TokenService from stripe._topup import Topup as Topup from stripe._topup_service import TopupService as TopupService from stripe._transfer import Transfer as Transfer from stripe._transfer_reversal_service import ( TransferReversalService as TransferReversalService, ) from stripe._transfer_service import TransferService as TransferService from stripe._treasury_service import TreasuryService as TreasuryService from stripe._usage_record import UsageRecord as UsageRecord from stripe._usage_record_summary import ( UsageRecordSummary as UsageRecordSummary, ) from stripe._webhook_endpoint import WebhookEndpoint as WebhookEndpoint from stripe._webhook_endpoint_service import ( WebhookEndpointService as WebhookEndpointService, ) # The end of the section generated from our OpenAPI spec ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_account.py0000644000175100001770000065552014637354563016214 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._deletable_api_resource import DeletableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._nested_resource_class_methods import nested_resource_class_methods from stripe._oauth import OAuth from stripe._person import Person from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, Union, cast, overload from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._bank_account import BankAccount from stripe._capability import Capability from stripe._card import Card from stripe._file import File from stripe._login_link import LoginLink from stripe._tax_id import TaxId @nested_resource_class_methods("capability") @nested_resource_class_methods("external_account") @nested_resource_class_methods("login_link") @nested_resource_class_methods("person") class Account( CreateableAPIResource["Account"], DeletableAPIResource["Account"], ListableAPIResource["Account"], UpdateableAPIResource["Account"], ): """ This is an object representing a Stripe account. You can retrieve it to see properties on the account like its current requirements or if the account is enabled to make live charges or receive payouts. For accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts, the properties below are always returned. For accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `stripe`, which includes Standard and Express accounts, some properties are only returned until you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions) to start Connect Onboarding. Learn about the [differences between accounts](https://stripe.com/connect/accounts). """ OBJECT_NAME: ClassVar[Literal["account"]] = "account" class BusinessProfile(StripeObject): class AnnualRevenue(StripeObject): amount: Optional[int] """ A non-negative integer representing the amount in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). """ currency: Optional[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). """ fiscal_year_end: Optional[str] """ The close-out date of the preceding fiscal year in ISO 8601 format. E.g. 2023-12-31 for the 31st of December, 2023. """ class MonthlyEstimatedRevenue(StripeObject): amount: int """ A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). """ 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). """ class SupportAddress(StripeObject): city: Optional[str] """ City, district, suburb, town, or village. """ country: Optional[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: Optional[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State, county, province, or region. """ annual_revenue: Optional[AnnualRevenue] """ The applicant's gross annual revenue for its preceding fiscal year. """ estimated_worker_count: Optional[int] """ An estimated upper bound of employees, contractors, vendors, etc. currently working for the business. """ mcc: Optional[str] """ [The merchant category code for the account](https://stripe.com/docs/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide. """ monthly_estimated_revenue: Optional[MonthlyEstimatedRevenue] name: Optional[str] """ The customer-facing business name. """ product_description: Optional[str] """ Internal-only description of the product sold or service provided by the business. It's used by Stripe for risk and underwriting purposes. """ support_address: Optional[SupportAddress] """ A publicly available mailing address for sending support issues to. """ support_email: Optional[str] """ A publicly available email address for sending support issues to. """ support_phone: Optional[str] """ A publicly available phone number to call with support issues. """ support_url: Optional[str] """ A publicly available website for handling support issues. """ url: Optional[str] """ The business's publicly available website. """ _inner_class_types = { "annual_revenue": AnnualRevenue, "monthly_estimated_revenue": MonthlyEstimatedRevenue, "support_address": SupportAddress, } class Capabilities(StripeObject): acss_debit_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the Canadian pre-authorized debits payments capability of the account, or whether the account can directly process Canadian pre-authorized debits charges. """ affirm_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the Affirm capability of the account, or whether the account can directly process Affirm charges. """ afterpay_clearpay_payments: Optional[ Literal["active", "inactive", "pending"] ] """ The status of the Afterpay Clearpay capability of the account, or whether the account can directly process Afterpay Clearpay charges. """ amazon_pay_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the AmazonPay capability of the account, or whether the account can directly process AmazonPay payments. """ au_becs_debit_payments: Optional[ Literal["active", "inactive", "pending"] ] """ The status of the BECS Direct Debit (AU) payments capability of the account, or whether the account can directly process BECS Direct Debit (AU) charges. """ bacs_debit_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the Bacs Direct Debits payments capability of the account, or whether the account can directly process Bacs Direct Debits charges. """ bancontact_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the Bancontact payments capability of the account, or whether the account can directly process Bancontact charges. """ bank_transfer_payments: Optional[ Literal["active", "inactive", "pending"] ] """ The status of the customer_balance payments capability of the account, or whether the account can directly process customer_balance charges. """ blik_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the blik payments capability of the account, or whether the account can directly process blik charges. """ boleto_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the boleto payments capability of the account, or whether the account can directly process boleto charges. """ card_issuing: Optional[Literal["active", "inactive", "pending"]] """ The status of the card issuing capability of the account, or whether you can use Issuing to distribute funds on cards """ card_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the card payments capability of the account, or whether the account can directly process credit and debit card charges. """ cartes_bancaires_payments: Optional[ Literal["active", "inactive", "pending"] ] """ The status of the Cartes Bancaires payments capability of the account, or whether the account can directly process Cartes Bancaires card charges in EUR currency. """ cashapp_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the Cash App Pay capability of the account, or whether the account can directly process Cash App Pay payments. """ eps_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the EPS payments capability of the account, or whether the account can directly process EPS charges. """ fpx_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the FPX payments capability of the account, or whether the account can directly process FPX charges. """ gb_bank_transfer_payments: Optional[ Literal["active", "inactive", "pending"] ] """ The status of the GB customer_balance payments (GBP currency) capability of the account, or whether the account can directly process GB customer_balance charges. """ giropay_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the giropay payments capability of the account, or whether the account can directly process giropay charges. """ grabpay_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the GrabPay payments capability of the account, or whether the account can directly process GrabPay charges. """ ideal_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the iDEAL payments capability of the account, or whether the account can directly process iDEAL charges. """ india_international_payments: Optional[ Literal["active", "inactive", "pending"] ] """ The status of the india_international_payments capability of the account, or whether the account can process international charges (non INR) in India. """ jcb_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the JCB payments capability of the account, or whether the account (Japan only) can directly process JCB credit card charges in JPY currency. """ jp_bank_transfer_payments: Optional[ Literal["active", "inactive", "pending"] ] """ The status of the Japanese customer_balance payments (JPY currency) capability of the account, or whether the account can directly process Japanese customer_balance charges. """ klarna_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the Klarna payments capability of the account, or whether the account can directly process Klarna charges. """ konbini_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the konbini payments capability of the account, or whether the account can directly process konbini charges. """ legacy_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the legacy payments capability of the account. """ link_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the link_payments capability of the account, or whether the account can directly process Link charges. """ mobilepay_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the MobilePay capability of the account, or whether the account can directly process MobilePay charges. """ multibanco_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the Multibanco payments capability of the account, or whether the account can directly process Multibanco charges. """ mx_bank_transfer_payments: Optional[ Literal["active", "inactive", "pending"] ] """ The status of the Mexican customer_balance payments (MXN currency) capability of the account, or whether the account can directly process Mexican customer_balance charges. """ oxxo_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the OXXO payments capability of the account, or whether the account can directly process OXXO charges. """ p24_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the P24 payments capability of the account, or whether the account can directly process P24 charges. """ paynow_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the paynow payments capability of the account, or whether the account can directly process paynow charges. """ promptpay_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the promptpay payments capability of the account, or whether the account can directly process promptpay charges. """ revolut_pay_payments: Optional[ Literal["active", "inactive", "pending"] ] """ The status of the RevolutPay capability of the account, or whether the account can directly process RevolutPay payments. """ sepa_bank_transfer_payments: Optional[ Literal["active", "inactive", "pending"] ] """ The status of the SEPA customer_balance payments (EUR currency) capability of the account, or whether the account can directly process SEPA customer_balance charges. """ sepa_debit_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the SEPA Direct Debits payments capability of the account, or whether the account can directly process SEPA Direct Debits charges. """ sofort_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the Sofort payments capability of the account, or whether the account can directly process Sofort charges. """ swish_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the Swish capability of the account, or whether the account can directly process Swish payments. """ tax_reporting_us_1099_k: Optional[ Literal["active", "inactive", "pending"] ] """ The status of the tax reporting 1099-K (US) capability of the account. """ tax_reporting_us_1099_misc: Optional[ Literal["active", "inactive", "pending"] ] """ The status of the tax reporting 1099-MISC (US) capability of the account. """ transfers: Optional[Literal["active", "inactive", "pending"]] """ The status of the transfers capability of the account, or whether your platform can transfer funds to the account. """ treasury: Optional[Literal["active", "inactive", "pending"]] """ The status of the banking capability, or whether the account can have bank accounts. """ twint_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the TWINT capability of the account, or whether the account can directly process TWINT charges. """ us_bank_account_ach_payments: Optional[ Literal["active", "inactive", "pending"] ] """ The status of the US bank account ACH payments capability of the account, or whether the account can directly process US bank account charges. """ us_bank_transfer_payments: Optional[ Literal["active", "inactive", "pending"] ] """ The status of the US customer_balance payments (USD currency) capability of the account, or whether the account can directly process US customer_balance charges. """ zip_payments: Optional[Literal["active", "inactive", "pending"]] """ The status of the Zip capability of the account, or whether the account can directly process Zip charges. """ class Company(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 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State, county, province, or region. """ class AddressKana(StripeObject): city: Optional[str] """ City/Ward. """ 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] """ Block/Building number. """ line2: Optional[str] """ Building details. """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ Prefecture. """ town: Optional[str] """ Town/cho-me. """ class AddressKanji(StripeObject): city: Optional[str] """ City/Ward. """ 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] """ Block/Building number. """ line2: Optional[str] """ Building details. """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ Prefecture. """ town: Optional[str] """ Town/cho-me. """ class OwnershipDeclaration(StripeObject): date: Optional[int] """ The Unix timestamp marking when the beneficial owner attestation was made. """ ip: Optional[str] """ The IP address from which the beneficial owner attestation was made. """ user_agent: Optional[str] """ The user-agent string from the browser where the beneficial owner attestation was made. """ class Verification(StripeObject): class Document(StripeObject): back: Optional[ExpandableField["File"]] """ The back of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. """ details: Optional[str] """ A user-displayable string describing the verification state of this document. """ details_code: Optional[str] """ One of `document_corrupt`, `document_expired`, `document_failed_copy`, `document_failed_greyscale`, `document_failed_other`, `document_failed_test_mode`, `document_fraudulent`, `document_incomplete`, `document_invalid`, `document_manipulated`, `document_not_readable`, `document_not_uploaded`, `document_type_not_supported`, or `document_too_large`. A machine-readable code specifying the verification state for this document. """ front: Optional[ExpandableField["File"]] """ The front of a document returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `additional_verification`. """ document: Document _inner_class_types = {"document": Document} address: Optional[Address] address_kana: Optional[AddressKana] """ The Kana variation of the company's primary address (Japan only). """ address_kanji: Optional[AddressKanji] """ The Kanji variation of the company's primary address (Japan only). """ directors_provided: Optional[bool] """ Whether the company's directors have been provided. This Boolean will be `true` if you've manually indicated that all directors are provided via [the `directors_provided` parameter](https://stripe.com/docs/api/accounts/update#update_account-company-directors_provided). """ executives_provided: Optional[bool] """ Whether the company's executives have been provided. This Boolean will be `true` if you've manually indicated that all executives are provided via [the `executives_provided` parameter](https://stripe.com/docs/api/accounts/update#update_account-company-executives_provided), or if Stripe determined that sufficient executives were provided. """ export_license_id: Optional[str] """ The export license ID number of the company, also referred as Import Export Code (India only). """ export_purpose_code: Optional[str] """ The purpose code to use for export transactions (India only). """ name: Optional[str] """ The company's legal name. """ name_kana: Optional[str] """ The Kana variation of the company's legal name (Japan only). """ name_kanji: Optional[str] """ The Kanji variation of the company's legal name (Japan only). """ owners_provided: Optional[bool] """ Whether the company's owners have been provided. This Boolean will be `true` if you've manually indicated that all owners are provided via [the `owners_provided` parameter](https://stripe.com/docs/api/accounts/update#update_account-company-owners_provided), or if Stripe determined that sufficient owners were provided. Stripe determines ownership requirements using both the number of owners provided and their total percent ownership (calculated by adding the `percent_ownership` of each owner together). """ ownership_declaration: Optional[OwnershipDeclaration] """ This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. """ phone: Optional[str] """ The company's phone number (used for verification). """ structure: Optional[ Literal[ "free_zone_establishment", "free_zone_llc", "government_instrumentality", "governmental_unit", "incorporated_non_profit", "incorporated_partnership", "limited_liability_partnership", "llc", "multi_member_llc", "private_company", "private_corporation", "private_partnership", "public_company", "public_corporation", "public_partnership", "registered_charity", "single_member_llc", "sole_establishment", "sole_proprietorship", "tax_exempt_government_instrumentality", "unincorporated_association", "unincorporated_non_profit", "unincorporated_partnership", ] ] """ The category identifying the legal structure of the company or legal entity. See [Business structure](https://stripe.com/docs/connect/identity-verification#business-structure) for more details. """ tax_id_provided: Optional[bool] """ Whether the company's business ID number was provided. """ tax_id_registrar: Optional[str] """ The jurisdiction in which the `tax_id` is registered (Germany-based companies only). """ vat_id_provided: Optional[bool] """ Whether the company's business VAT number was provided. """ verification: Optional[Verification] """ Information on the verification state of the company. """ _inner_class_types = { "address": Address, "address_kana": AddressKana, "address_kanji": AddressKanji, "ownership_declaration": OwnershipDeclaration, "verification": Verification, } class Controller(StripeObject): class Fees(StripeObject): payer: Literal[ "account", "application", "application_custom", "application_express", ] """ A value indicating the responsible payer of a bundle of Stripe fees for pricing-control eligible products on this account. Learn more about [fee behavior on connected accounts](https://docs.stripe.com/connect/direct-charges-fee-payer-behavior). """ class Losses(StripeObject): payments: Literal["application", "stripe"] """ A value indicating who is liable when this account can't pay back negative balances from payments. """ class StripeDashboard(StripeObject): type: Literal["express", "full", "none"] """ A value indicating the Stripe dashboard this account has access to independent of the Connect application. """ fees: Optional[Fees] is_controller: Optional[bool] """ `true` if the Connect application retrieving the resource controls the account and can therefore exercise [platform controls](https://stripe.com/docs/connect/platform-controls-for-standard-accounts). Otherwise, this field is null. """ losses: Optional[Losses] requirement_collection: Optional[Literal["application", "stripe"]] """ A value indicating responsibility for collecting requirements on this account. Only returned when the Connect application retrieving the resource controls the account. """ stripe_dashboard: Optional[StripeDashboard] type: Literal["account", "application"] """ The controller type. Can be `application`, if a Connect application controls the account, or `account`, if the account controls itself. """ _inner_class_types = { "fees": Fees, "losses": Losses, "stripe_dashboard": StripeDashboard, } class FutureRequirements(StripeObject): class Alternative(StripeObject): alternative_fields_due: List[str] """ Fields that can be provided to satisfy all fields in `original_fields_due`. """ original_fields_due: List[str] """ Fields that are due and can be satisfied by providing all fields in `alternative_fields_due`. """ class Error(StripeObject): code: Literal[ "invalid_address_city_state_postal_code", "invalid_address_highway_contract_box", "invalid_address_private_mailbox", "invalid_business_profile_name", "invalid_business_profile_name_denylisted", "invalid_company_name_denylisted", "invalid_dob_age_over_maximum", "invalid_dob_age_under_18", "invalid_dob_age_under_minimum", "invalid_product_description_length", "invalid_product_description_url_match", "invalid_representative_country", "invalid_statement_descriptor_business_mismatch", "invalid_statement_descriptor_denylisted", "invalid_statement_descriptor_length", "invalid_statement_descriptor_prefix_denylisted", "invalid_statement_descriptor_prefix_mismatch", "invalid_street_address", "invalid_tax_id", "invalid_tax_id_format", "invalid_tos_acceptance", "invalid_url_denylisted", "invalid_url_format", "invalid_url_length", "invalid_url_web_presence_detected", "invalid_url_website_business_information_mismatch", "invalid_url_website_empty", "invalid_url_website_inaccessible", "invalid_url_website_inaccessible_geoblocked", "invalid_url_website_inaccessible_password_protected", "invalid_url_website_incomplete", "invalid_url_website_incomplete_cancellation_policy", "invalid_url_website_incomplete_customer_service_details", "invalid_url_website_incomplete_legal_restrictions", "invalid_url_website_incomplete_refund_policy", "invalid_url_website_incomplete_return_policy", "invalid_url_website_incomplete_terms_and_conditions", "invalid_url_website_incomplete_under_construction", "invalid_url_website_other", "invalid_value_other", "verification_directors_mismatch", "verification_document_address_mismatch", "verification_document_address_missing", "verification_document_corrupt", "verification_document_country_not_supported", "verification_document_directors_mismatch", "verification_document_dob_mismatch", "verification_document_duplicate_type", "verification_document_expired", "verification_document_failed_copy", "verification_document_failed_greyscale", "verification_document_failed_other", "verification_document_failed_test_mode", "verification_document_fraudulent", "verification_document_id_number_mismatch", "verification_document_id_number_missing", "verification_document_incomplete", "verification_document_invalid", "verification_document_issue_or_expiry_date_missing", "verification_document_manipulated", "verification_document_missing_back", "verification_document_missing_front", "verification_document_name_mismatch", "verification_document_name_missing", "verification_document_nationality_mismatch", "verification_document_not_readable", "verification_document_not_signed", "verification_document_not_uploaded", "verification_document_photo_mismatch", "verification_document_too_large", "verification_document_type_not_supported", "verification_extraneous_directors", "verification_failed_address_match", "verification_failed_business_iec_number", "verification_failed_document_match", "verification_failed_id_number_match", "verification_failed_keyed_identity", "verification_failed_keyed_match", "verification_failed_name_match", "verification_failed_other", "verification_failed_representative_authority", "verification_failed_residential_address", "verification_failed_tax_id_match", "verification_failed_tax_id_not_issued", "verification_missing_directors", "verification_missing_executives", "verification_missing_owners", "verification_requires_additional_memorandum_of_associations", "verification_requires_additional_proof_of_registration", ] """ The code for the type of error. """ reason: str """ An informative message that indicates the error type and provides additional details about the error. """ requirement: str """ The specific user onboarding requirement field (in the requirements hash) that needs to be resolved. """ alternatives: Optional[List[Alternative]] """ Fields that are due and can be satisfied by providing the corresponding alternative fields instead. """ current_deadline: Optional[int] """ Date on which `future_requirements` merges with the main `requirements` hash and `future_requirements` becomes empty. After the transition, `currently_due` requirements may immediately become `past_due`, but the account may also be given a grace period depending on its enablement state prior to transitioning. """ currently_due: Optional[List[str]] """ Fields that need to be collected to keep the account enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. """ disabled_reason: Optional[str] """ This is typed as a string for consistency with `requirements.disabled_reason`. """ errors: Optional[List[Error]] """ Fields that are `currently_due` and need to be collected again because validation or verification failed. """ eventually_due: Optional[List[str]] """ Fields that need to be collected assuming all volume thresholds are reached. As they become required, they appear in `currently_due` as well. """ past_due: Optional[List[str]] """ Fields that weren't collected by `requirements.current_deadline`. These fields need to be collected to enable the capability on the account. New fields will never appear here; `future_requirements.past_due` will always be a subset of `requirements.past_due`. """ pending_verification: Optional[List[str]] """ Fields that might become required depending on the results of verification or review. It's an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due` or `currently_due`. Fields might appear in `eventually_due` or `currently_due` and in `pending_verification` if verification fails but another verification is still pending. """ _inner_class_types = {"alternatives": Alternative, "errors": Error} class Requirements(StripeObject): class Alternative(StripeObject): alternative_fields_due: List[str] """ Fields that can be provided to satisfy all fields in `original_fields_due`. """ original_fields_due: List[str] """ Fields that are due and can be satisfied by providing all fields in `alternative_fields_due`. """ class Error(StripeObject): code: Literal[ "invalid_address_city_state_postal_code", "invalid_address_highway_contract_box", "invalid_address_private_mailbox", "invalid_business_profile_name", "invalid_business_profile_name_denylisted", "invalid_company_name_denylisted", "invalid_dob_age_over_maximum", "invalid_dob_age_under_18", "invalid_dob_age_under_minimum", "invalid_product_description_length", "invalid_product_description_url_match", "invalid_representative_country", "invalid_statement_descriptor_business_mismatch", "invalid_statement_descriptor_denylisted", "invalid_statement_descriptor_length", "invalid_statement_descriptor_prefix_denylisted", "invalid_statement_descriptor_prefix_mismatch", "invalid_street_address", "invalid_tax_id", "invalid_tax_id_format", "invalid_tos_acceptance", "invalid_url_denylisted", "invalid_url_format", "invalid_url_length", "invalid_url_web_presence_detected", "invalid_url_website_business_information_mismatch", "invalid_url_website_empty", "invalid_url_website_inaccessible", "invalid_url_website_inaccessible_geoblocked", "invalid_url_website_inaccessible_password_protected", "invalid_url_website_incomplete", "invalid_url_website_incomplete_cancellation_policy", "invalid_url_website_incomplete_customer_service_details", "invalid_url_website_incomplete_legal_restrictions", "invalid_url_website_incomplete_refund_policy", "invalid_url_website_incomplete_return_policy", "invalid_url_website_incomplete_terms_and_conditions", "invalid_url_website_incomplete_under_construction", "invalid_url_website_other", "invalid_value_other", "verification_directors_mismatch", "verification_document_address_mismatch", "verification_document_address_missing", "verification_document_corrupt", "verification_document_country_not_supported", "verification_document_directors_mismatch", "verification_document_dob_mismatch", "verification_document_duplicate_type", "verification_document_expired", "verification_document_failed_copy", "verification_document_failed_greyscale", "verification_document_failed_other", "verification_document_failed_test_mode", "verification_document_fraudulent", "verification_document_id_number_mismatch", "verification_document_id_number_missing", "verification_document_incomplete", "verification_document_invalid", "verification_document_issue_or_expiry_date_missing", "verification_document_manipulated", "verification_document_missing_back", "verification_document_missing_front", "verification_document_name_mismatch", "verification_document_name_missing", "verification_document_nationality_mismatch", "verification_document_not_readable", "verification_document_not_signed", "verification_document_not_uploaded", "verification_document_photo_mismatch", "verification_document_too_large", "verification_document_type_not_supported", "verification_extraneous_directors", "verification_failed_address_match", "verification_failed_business_iec_number", "verification_failed_document_match", "verification_failed_id_number_match", "verification_failed_keyed_identity", "verification_failed_keyed_match", "verification_failed_name_match", "verification_failed_other", "verification_failed_representative_authority", "verification_failed_residential_address", "verification_failed_tax_id_match", "verification_failed_tax_id_not_issued", "verification_missing_directors", "verification_missing_executives", "verification_missing_owners", "verification_requires_additional_memorandum_of_associations", "verification_requires_additional_proof_of_registration", ] """ The code for the type of error. """ reason: str """ An informative message that indicates the error type and provides additional details about the error. """ requirement: str """ The specific user onboarding requirement field (in the requirements hash) that needs to be resolved. """ alternatives: Optional[List[Alternative]] """ Fields that are due and can be satisfied by providing the corresponding alternative fields instead. """ current_deadline: Optional[int] """ Date by which the fields in `currently_due` must be collected to keep the account enabled. These fields may disable the account sooner if the next threshold is reached before they are collected. """ currently_due: Optional[List[str]] """ Fields that need to be collected to keep the account enabled. If not collected by `current_deadline`, these fields appear in `past_due` as well, and the account is disabled. """ disabled_reason: Optional[str] """ If the account is disabled, this string describes why. [Learn more about handling verification issues](https://stripe.com/docs/connect/handling-api-verification). Can be `action_required.requested_capabilities`, `requirements.past_due`, `requirements.pending_verification`, `listed`, `platform_paused`, `rejected.fraud`, `rejected.incomplete_verification`, `rejected.listed`, `rejected.other`, `rejected.terms_of_service`, `under_review`, or `other`. """ errors: Optional[List[Error]] """ Fields that are `currently_due` and need to be collected again because validation or verification failed. """ eventually_due: Optional[List[str]] """ Fields that need to be collected assuming all volume thresholds are reached. As they become required, they appear in `currently_due` as well, and `current_deadline` becomes set. """ past_due: Optional[List[str]] """ Fields that weren't collected by `current_deadline`. These fields need to be collected to enable the account. """ pending_verification: Optional[List[str]] """ Fields that might become required depending on the results of verification or review. It's an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. Fields might appear in `eventually_due`, `currently_due`, or `past_due` and in `pending_verification` if verification fails but another verification is still pending. """ _inner_class_types = {"alternatives": Alternative, "errors": Error} class Settings(StripeObject): class BacsDebitPayments(StripeObject): display_name: Optional[str] """ The Bacs Direct Debit display name for this account. For payments made with Bacs Direct Debit, this name appears on the mandate as the statement descriptor. Mobile banking apps display it as the name of the business. To use custom branding, set the Bacs Direct Debit Display Name during or right after creation. Custom branding incurs an additional monthly fee for the platform. The fee appears 5 business days after requesting Bacs. If you don't set the display name before requesting Bacs capability, it's automatically set as "Stripe" and the account is onboarded to Stripe branding, which is free. """ service_user_number: Optional[str] """ The Bacs Direct Debit Service user number for this account. For payments made with Bacs Direct Debit, this number is a unique identifier of the account with our banking partners. """ class Branding(StripeObject): icon: Optional[ExpandableField["File"]] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) An icon for the account. Must be square and at least 128px x 128px. """ logo: Optional[ExpandableField["File"]] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A logo for the account that will be used in Checkout instead of the icon and without the account's name next to it if provided. Must be at least 128px x 128px. """ primary_color: Optional[str] """ A CSS hex color value representing the primary branding color for this account """ secondary_color: Optional[str] """ A CSS hex color value representing the secondary branding color for this account """ class CardIssuing(StripeObject): class TosAcceptance(StripeObject): date: Optional[int] """ The Unix timestamp marking when the account representative accepted the service agreement. """ ip: Optional[str] """ The IP address from which the account representative accepted the service agreement. """ user_agent: Optional[str] """ The user agent of the browser from which the account representative accepted the service agreement. """ tos_acceptance: Optional[TosAcceptance] _inner_class_types = {"tos_acceptance": TosAcceptance} class CardPayments(StripeObject): class DeclineOn(StripeObject): avs_failure: bool """ Whether Stripe automatically declines charges with an incorrect ZIP or postal code. This setting only applies when a ZIP or postal code is provided and they fail bank verification. """ cvc_failure: bool """ Whether Stripe automatically declines charges with an incorrect CVC. This setting only applies when a CVC is provided and it fails bank verification. """ decline_on: Optional[DeclineOn] statement_descriptor_prefix: Optional[str] """ The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. `statement_descriptor_prefix` is useful for maximizing descriptor space for the dynamic portion. """ statement_descriptor_prefix_kana: Optional[str] """ The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kana` specified on the charge. `statement_descriptor_prefix_kana` is useful for maximizing descriptor space for the dynamic portion. """ statement_descriptor_prefix_kanji: Optional[str] """ The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kanji` specified on the charge. `statement_descriptor_prefix_kanji` is useful for maximizing descriptor space for the dynamic portion. """ _inner_class_types = {"decline_on": DeclineOn} class Dashboard(StripeObject): display_name: Optional[str] """ The display name for this account. This is used on the Stripe Dashboard to differentiate between accounts. """ timezone: Optional[str] """ The timezone used in the Stripe Dashboard for this account. A list of possible time zone values is maintained at the [IANA Time Zone Database](http://www.iana.org/time-zones). """ class Invoices(StripeObject): default_account_tax_ids: Optional[List[ExpandableField["TaxId"]]] """ The list of default Account Tax IDs to automatically include on invoices. Account Tax IDs get added when an invoice is finalized. """ class Payments(StripeObject): statement_descriptor: Optional[str] """ The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. """ statement_descriptor_kana: Optional[str] """ The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only) """ statement_descriptor_kanji: Optional[str] """ The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only) """ statement_descriptor_prefix_kana: Optional[str] """ The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kana` specified on the charge. `statement_descriptor_prefix_kana` is useful for maximizing descriptor space for the dynamic portion. """ statement_descriptor_prefix_kanji: Optional[str] """ The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kanji` specified on the charge. `statement_descriptor_prefix_kanji` is useful for maximizing descriptor space for the dynamic portion. """ class Payouts(StripeObject): class Schedule(StripeObject): delay_days: int """ The number of days charges for the account will be held before being paid out. """ interval: str """ How frequently funds will be paid out. One of `manual` (payouts only created via API call), `daily`, `weekly`, or `monthly`. """ monthly_anchor: Optional[int] """ The day of the month funds will be paid out. Only shown if `interval` is monthly. Payouts scheduled between the 29th and 31st of the month are sent on the last day of shorter months. """ weekly_anchor: Optional[str] """ The day of the week funds will be paid out, of the style 'monday', 'tuesday', etc. Only shown if `interval` is weekly. """ debit_negative_balances: bool """ A Boolean indicating if Stripe should try to reclaim negative balances from an attached bank account. See [Understanding Connect account balances](https://stripe.com/connect/account-balances) for details. The default value is `false` when [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts, otherwise `true`. """ schedule: Schedule statement_descriptor: Optional[str] """ The text that appears on the bank account statement for payouts. If not set, this defaults to the platform's bank descriptor as set in the Dashboard. """ _inner_class_types = {"schedule": Schedule} class SepaDebitPayments(StripeObject): creditor_id: Optional[str] """ SEPA creditor identifier that identifies the company making the payment. """ class Treasury(StripeObject): class TosAcceptance(StripeObject): date: Optional[int] """ The Unix timestamp marking when the account representative accepted the service agreement. """ ip: Optional[str] """ The IP address from which the account representative accepted the service agreement. """ user_agent: Optional[str] """ The user agent of the browser from which the account representative accepted the service agreement. """ tos_acceptance: Optional[TosAcceptance] _inner_class_types = {"tos_acceptance": TosAcceptance} bacs_debit_payments: Optional[BacsDebitPayments] branding: Branding card_issuing: Optional[CardIssuing] card_payments: CardPayments dashboard: Dashboard invoices: Optional[Invoices] payments: Payments payouts: Optional[Payouts] sepa_debit_payments: Optional[SepaDebitPayments] treasury: Optional[Treasury] _inner_class_types = { "bacs_debit_payments": BacsDebitPayments, "branding": Branding, "card_issuing": CardIssuing, "card_payments": CardPayments, "dashboard": Dashboard, "invoices": Invoices, "payments": Payments, "payouts": Payouts, "sepa_debit_payments": SepaDebitPayments, "treasury": Treasury, } class TosAcceptance(StripeObject): date: Optional[int] """ The Unix timestamp marking when the account representative accepted their service agreement """ ip: Optional[str] """ The IP address from which the account representative accepted their service agreement """ service_agreement: Optional[str] """ The user's service agreement type """ user_agent: Optional[str] """ The user agent of the browser from which the account representative accepted their service agreement """ class CreateExternalAccountParams(RequestOptions): default_for_currency: NotRequired[bool] """ When set to true, or if this is the first external account added in this currency, this account becomes the default external account for its currency. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ external_account: Union[ str, "Account.CreateExternalAccountParamsCard", "Account.CreateExternalAccountParamsBankAccount", "Account.CreateExternalAccountParamsCardToken", ] """ Please refer to full [documentation](https://stripe.com/docs/api) instead. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ class CreateExternalAccountParamsBankAccount(TypedDict): object: Literal["bank_account"] account_holder_name: NotRequired[str] """ The name of the person or business that owns the bank account.This field is required when attaching the bank account to a `Customer` object. """ account_holder_type: NotRequired[Literal["company", "individual"]] """ The type of entity that holds the account. It can be `company` or `individual`. This field is required when attaching the bank account to a `Customer` object. """ account_number: str """ The account number for the bank account, in string form. Must be a checking account. """ country: str """ The country in which the bank account is located. """ currency: NotRequired[str] """ The currency the bank account is in. This must be a country/currency pairing that [Stripe supports.](docs/payouts) """ routing_number: NotRequired[str] """ The routing number, sort code, or other country-appropriateinstitution number for the bank account. For US bank accounts, this is required and should bethe ACH routing number, not the wire routing number. If you are providing an IBAN for`account_number`, this field is not required. """ class CreateExternalAccountParamsCard(TypedDict): object: Literal["card"] address_city: NotRequired[str] address_country: NotRequired[str] address_line1: NotRequired[str] address_line2: NotRequired[str] address_state: NotRequired[str] address_zip: NotRequired[str] currency: NotRequired[str] cvc: NotRequired[str] exp_month: int exp_year: int name: NotRequired[str] number: str metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ class CreateExternalAccountParamsCardToken(TypedDict): object: Literal["card"] currency: NotRequired[str] token: str class CreateLoginLinkParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CreateParams(RequestOptions): account_token: NotRequired[str] """ An [account token](https://stripe.com/docs/api#create_account_token), used to securely provide details to the account. """ business_profile: NotRequired["Account.CreateParamsBusinessProfile"] """ Business information about the account. """ business_type: NotRequired[ Literal["company", "government_entity", "individual", "non_profit"] ] """ The business type. Once you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. """ capabilities: NotRequired["Account.CreateParamsCapabilities"] """ Each key of the dictionary represents a capability, and each capability maps to its settings (for example, whether it has been requested or not). Each capability is inactive until you have provided its specific requirements and Stripe has verified them. An account might have some of its requested capabilities be active and some be inactive. Required when [account.controller.stripe_dashboard.type](https://stripe.com/api/accounts/create#create_account-controller-dashboard-type) is `none`, which includes Custom accounts. """ company: NotRequired["Account.CreateParamsCompany"] """ Information about the company or business. This field is available for any `business_type`. Once you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. """ controller: NotRequired["Account.CreateParamsController"] """ A hash of configuration describing the account controller's attributes. """ country: NotRequired[str] """ The country in which the account holder resides, or in which the business is legally established. This should be an ISO 3166-1 alpha-2 country code. For example, if you are in the United States and the business for which you're creating an account is legally represented in Canada, you would use `CA` as the country for the account being created. Available countries include [Stripe's global markets](https://stripe.com/global) as well as countries where [cross-border payouts](https://stripe.com/docs/connect/cross-border-payouts) are supported. """ default_currency: NotRequired[str] """ Three-letter ISO currency code representing the default currency for the account. This must be a currency that [Stripe supports in the account's country](https://docs.stripe.com/payouts). """ documents: NotRequired["Account.CreateParamsDocuments"] """ Documents that may be submitted to satisfy various informational requests. """ email: NotRequired[str] """ The email address of the account holder. This is only to make the account easier to identify to you. If [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts, Stripe doesn't email the account without your consent. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ external_account: NotRequired[ "str|Account.CreateParamsBankAccount|Account.CreateParamsCard|Account.CreateParamsCardToken" ] """ A card or bank account to attach to the account for receiving [payouts](https://stripe.com/connect/bank-debit-card-payouts) (you won't be able to use it for top-ups). You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://stripe.com/api#account_create_bank_account) creation. By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/api#account_create_bank_account) or [card creation](https://stripe.com/api#account_create_card) APIs. After you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. """ individual: NotRequired["Account.CreateParamsIndividual"] """ Information about the person represented by the account. This field is null unless `business_type` is set to `individual`. Once you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ settings: NotRequired["Account.CreateParamsSettings"] """ Options for customizing how the account functions within Stripe. """ tos_acceptance: NotRequired["Account.CreateParamsTosAcceptance"] """ Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/connect/updating-accounts#tos-acceptance). This property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. This property defaults to a `full` service agreement when empty. """ type: NotRequired[Literal["custom", "express", "standard"]] """ The type of Stripe account to create. May be one of `custom`, `express` or `standard`. """ class CreateParamsBankAccount(TypedDict): object: Literal["bank_account"] account_holder_name: NotRequired[str] """ The name of the person or business that owns the bank account.This field is required when attaching the bank account to a `Customer` object. """ account_holder_type: NotRequired[Literal["company", "individual"]] """ The type of entity that holds the account. It can be `company` or `individual`. This field is required when attaching the bank account to a `Customer` object. """ account_number: str """ The account number for the bank account, in string form. Must be a checking account. """ country: str """ The country in which the bank account is located. """ currency: NotRequired[str] """ The currency the bank account is in. This must be a country/currency pairing that [Stripe supports.](docs/payouts) """ routing_number: NotRequired[str] """ The routing number, sort code, or other country-appropriateinstitution number for the bank account. For US bank accounts, this is required and should bethe ACH routing number, not the wire routing number. If you are providing an IBAN for`account_number`, this field is not required. """ class CreateParamsBusinessProfile(TypedDict): annual_revenue: NotRequired[ "Account.CreateParamsBusinessProfileAnnualRevenue" ] """ The applicant's gross annual revenue for its preceding fiscal year. """ estimated_worker_count: NotRequired[int] """ An estimated upper bound of employees, contractors, vendors, etc. currently working for the business. """ mcc: NotRequired[str] """ [The merchant category code for the account](https://docs.stripe.com/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide. """ monthly_estimated_revenue: NotRequired[ "Account.CreateParamsBusinessProfileMonthlyEstimatedRevenue" ] """ An estimate of the monthly revenue of the business. Only accepted for accounts in Brazil and India. """ name: NotRequired[str] """ The customer-facing business name. """ product_description: NotRequired[str] """ Internal-only description of the product sold by, or service provided by, the business. Used by Stripe for risk and underwriting purposes. """ support_address: NotRequired[ "Account.CreateParamsBusinessProfileSupportAddress" ] """ A publicly available mailing address for sending support issues to. """ support_email: NotRequired[str] """ A publicly available email address for sending support issues to. """ support_phone: NotRequired[str] """ A publicly available phone number to call with support issues. """ support_url: NotRequired["Literal['']|str"] """ A publicly available website for handling support issues. """ url: NotRequired[str] """ The business's publicly available website. """ class CreateParamsBusinessProfileAnnualRevenue(TypedDict): amount: int """ A non-negative integer representing the amount in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). """ 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). """ fiscal_year_end: str """ The close-out date of the preceding fiscal year in ISO 8601 format. E.g. 2023-12-31 for the 31st of December, 2023. """ class CreateParamsBusinessProfileMonthlyEstimatedRevenue(TypedDict): amount: int """ A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). """ 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). """ class CreateParamsBusinessProfileSupportAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsCapabilities(TypedDict): acss_debit_payments: NotRequired[ "Account.CreateParamsCapabilitiesAcssDebitPayments" ] """ The acss_debit_payments capability. """ affirm_payments: NotRequired[ "Account.CreateParamsCapabilitiesAffirmPayments" ] """ The affirm_payments capability. """ afterpay_clearpay_payments: NotRequired[ "Account.CreateParamsCapabilitiesAfterpayClearpayPayments" ] """ The afterpay_clearpay_payments capability. """ amazon_pay_payments: NotRequired[ "Account.CreateParamsCapabilitiesAmazonPayPayments" ] """ The amazon_pay_payments capability. """ au_becs_debit_payments: NotRequired[ "Account.CreateParamsCapabilitiesAuBecsDebitPayments" ] """ The au_becs_debit_payments capability. """ bacs_debit_payments: NotRequired[ "Account.CreateParamsCapabilitiesBacsDebitPayments" ] """ The bacs_debit_payments capability. """ bancontact_payments: NotRequired[ "Account.CreateParamsCapabilitiesBancontactPayments" ] """ The bancontact_payments capability. """ bank_transfer_payments: NotRequired[ "Account.CreateParamsCapabilitiesBankTransferPayments" ] """ The bank_transfer_payments capability. """ blik_payments: NotRequired[ "Account.CreateParamsCapabilitiesBlikPayments" ] """ The blik_payments capability. """ boleto_payments: NotRequired[ "Account.CreateParamsCapabilitiesBoletoPayments" ] """ The boleto_payments capability. """ card_issuing: NotRequired[ "Account.CreateParamsCapabilitiesCardIssuing" ] """ The card_issuing capability. """ card_payments: NotRequired[ "Account.CreateParamsCapabilitiesCardPayments" ] """ The card_payments capability. """ cartes_bancaires_payments: NotRequired[ "Account.CreateParamsCapabilitiesCartesBancairesPayments" ] """ The cartes_bancaires_payments capability. """ cashapp_payments: NotRequired[ "Account.CreateParamsCapabilitiesCashappPayments" ] """ The cashapp_payments capability. """ eps_payments: NotRequired[ "Account.CreateParamsCapabilitiesEpsPayments" ] """ The eps_payments capability. """ fpx_payments: NotRequired[ "Account.CreateParamsCapabilitiesFpxPayments" ] """ The fpx_payments capability. """ gb_bank_transfer_payments: NotRequired[ "Account.CreateParamsCapabilitiesGbBankTransferPayments" ] """ The gb_bank_transfer_payments capability. """ giropay_payments: NotRequired[ "Account.CreateParamsCapabilitiesGiropayPayments" ] """ The giropay_payments capability. """ grabpay_payments: NotRequired[ "Account.CreateParamsCapabilitiesGrabpayPayments" ] """ The grabpay_payments capability. """ ideal_payments: NotRequired[ "Account.CreateParamsCapabilitiesIdealPayments" ] """ The ideal_payments capability. """ india_international_payments: NotRequired[ "Account.CreateParamsCapabilitiesIndiaInternationalPayments" ] """ The india_international_payments capability. """ jcb_payments: NotRequired[ "Account.CreateParamsCapabilitiesJcbPayments" ] """ The jcb_payments capability. """ jp_bank_transfer_payments: NotRequired[ "Account.CreateParamsCapabilitiesJpBankTransferPayments" ] """ The jp_bank_transfer_payments capability. """ klarna_payments: NotRequired[ "Account.CreateParamsCapabilitiesKlarnaPayments" ] """ The klarna_payments capability. """ konbini_payments: NotRequired[ "Account.CreateParamsCapabilitiesKonbiniPayments" ] """ The konbini_payments capability. """ legacy_payments: NotRequired[ "Account.CreateParamsCapabilitiesLegacyPayments" ] """ The legacy_payments capability. """ link_payments: NotRequired[ "Account.CreateParamsCapabilitiesLinkPayments" ] """ The link_payments capability. """ mobilepay_payments: NotRequired[ "Account.CreateParamsCapabilitiesMobilepayPayments" ] """ The mobilepay_payments capability. """ multibanco_payments: NotRequired[ "Account.CreateParamsCapabilitiesMultibancoPayments" ] """ The multibanco_payments capability. """ mx_bank_transfer_payments: NotRequired[ "Account.CreateParamsCapabilitiesMxBankTransferPayments" ] """ The mx_bank_transfer_payments capability. """ oxxo_payments: NotRequired[ "Account.CreateParamsCapabilitiesOxxoPayments" ] """ The oxxo_payments capability. """ p24_payments: NotRequired[ "Account.CreateParamsCapabilitiesP24Payments" ] """ The p24_payments capability. """ paynow_payments: NotRequired[ "Account.CreateParamsCapabilitiesPaynowPayments" ] """ The paynow_payments capability. """ promptpay_payments: NotRequired[ "Account.CreateParamsCapabilitiesPromptpayPayments" ] """ The promptpay_payments capability. """ revolut_pay_payments: NotRequired[ "Account.CreateParamsCapabilitiesRevolutPayPayments" ] """ The revolut_pay_payments capability. """ sepa_bank_transfer_payments: NotRequired[ "Account.CreateParamsCapabilitiesSepaBankTransferPayments" ] """ The sepa_bank_transfer_payments capability. """ sepa_debit_payments: NotRequired[ "Account.CreateParamsCapabilitiesSepaDebitPayments" ] """ The sepa_debit_payments capability. """ sofort_payments: NotRequired[ "Account.CreateParamsCapabilitiesSofortPayments" ] """ The sofort_payments capability. """ swish_payments: NotRequired[ "Account.CreateParamsCapabilitiesSwishPayments" ] """ The swish_payments capability. """ tax_reporting_us_1099_k: NotRequired[ "Account.CreateParamsCapabilitiesTaxReportingUs1099K" ] """ The tax_reporting_us_1099_k capability. """ tax_reporting_us_1099_misc: NotRequired[ "Account.CreateParamsCapabilitiesTaxReportingUs1099Misc" ] """ The tax_reporting_us_1099_misc capability. """ transfers: NotRequired["Account.CreateParamsCapabilitiesTransfers"] """ The transfers capability. """ treasury: NotRequired["Account.CreateParamsCapabilitiesTreasury"] """ The treasury capability. """ twint_payments: NotRequired[ "Account.CreateParamsCapabilitiesTwintPayments" ] """ The twint_payments capability. """ us_bank_account_ach_payments: NotRequired[ "Account.CreateParamsCapabilitiesUsBankAccountAchPayments" ] """ The us_bank_account_ach_payments capability. """ us_bank_transfer_payments: NotRequired[ "Account.CreateParamsCapabilitiesUsBankTransferPayments" ] """ The us_bank_transfer_payments capability. """ zip_payments: NotRequired[ "Account.CreateParamsCapabilitiesZipPayments" ] """ The zip_payments capability. """ class CreateParamsCapabilitiesAcssDebitPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesAffirmPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesAfterpayClearpayPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesAmazonPayPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesAuBecsDebitPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesBacsDebitPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesBancontactPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesBankTransferPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesBlikPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesBoletoPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesCardIssuing(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesCardPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesCartesBancairesPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesCashappPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesEpsPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesFpxPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesGbBankTransferPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesGiropayPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesGrabpayPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesIdealPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesIndiaInternationalPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesJcbPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesJpBankTransferPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesKlarnaPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesKonbiniPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesLegacyPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesLinkPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesMobilepayPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesMultibancoPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesMxBankTransferPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesOxxoPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesP24Payments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesPaynowPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesPromptpayPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesRevolutPayPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesSepaBankTransferPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesSepaDebitPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesSofortPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesSwishPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesTaxReportingUs1099K(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesTaxReportingUs1099Misc(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesTransfers(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesTreasury(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesTwintPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesUsBankAccountAchPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesUsBankTransferPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesZipPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCard(TypedDict): object: Literal["card"] address_city: NotRequired[str] address_country: NotRequired[str] address_line1: NotRequired[str] address_line2: NotRequired[str] address_state: NotRequired[str] address_zip: NotRequired[str] currency: NotRequired[str] cvc: NotRequired[str] exp_month: int exp_year: int name: NotRequired[str] number: str metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ default_for_currency: NotRequired[bool] class CreateParamsCardToken(TypedDict): object: Literal["card"] currency: NotRequired[str] token: str class CreateParamsCompany(TypedDict): address: NotRequired["Account.CreateParamsCompanyAddress"] """ The company's primary address. """ address_kana: NotRequired["Account.CreateParamsCompanyAddressKana"] """ The Kana variation of the company's primary address (Japan only). """ address_kanji: NotRequired["Account.CreateParamsCompanyAddressKanji"] """ The Kanji variation of the company's primary address (Japan only). """ directors_provided: NotRequired[bool] """ Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. """ executives_provided: NotRequired[bool] """ Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.executive` requirement. """ export_license_id: NotRequired[str] """ The export license ID number of the company, also referred as Import Export Code (India only). """ export_purpose_code: NotRequired[str] """ The purpose code to use for export transactions (India only). """ name: NotRequired[str] """ The company's legal name. """ name_kana: NotRequired[str] """ The Kana variation of the company's legal name (Japan only). """ name_kanji: NotRequired[str] """ The Kanji variation of the company's legal name (Japan only). """ owners_provided: NotRequired[bool] """ Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.owner` requirement. """ ownership_declaration: NotRequired[ "Account.CreateParamsCompanyOwnershipDeclaration" ] """ This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. """ phone: NotRequired[str] """ The company's phone number (used for verification). """ registration_number: NotRequired[str] """ The identification number given to a company when it is registered or incorporated, if distinct from the identification number used for filing taxes. (Examples are the CIN for companies and LLP IN for partnerships in India, and the Company Registration Number in Hong Kong). """ structure: NotRequired[ "Literal['']|Literal['free_zone_establishment', 'free_zone_llc', 'government_instrumentality', 'governmental_unit', 'incorporated_non_profit', 'incorporated_partnership', 'limited_liability_partnership', 'llc', 'multi_member_llc', 'private_company', 'private_corporation', 'private_partnership', 'public_company', 'public_corporation', 'public_partnership', 'registered_charity', 'single_member_llc', 'sole_establishment', 'sole_proprietorship', 'tax_exempt_government_instrumentality', 'unincorporated_association', 'unincorporated_non_profit', 'unincorporated_partnership']" ] """ The category identifying the legal structure of the company or legal entity. See [Business structure](https://docs.stripe.com/connect/identity-verification#business-structure) for more details. Pass an empty string to unset this value. """ tax_id: NotRequired[str] """ The business ID number of the company, as appropriate for the company's country. (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.) """ tax_id_registrar: NotRequired[str] """ The jurisdiction in which the `tax_id` is registered (Germany-based companies only). """ vat_id: NotRequired[str] """ The VAT number of the company. """ verification: NotRequired["Account.CreateParamsCompanyVerification"] """ Information on the verification state of the company. """ class CreateParamsCompanyAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsCompanyAddressKana(TypedDict): city: NotRequired[str] """ City or ward. """ 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] """ Block or building number. """ line2: NotRequired[str] """ Building details. """ postal_code: NotRequired[str] """ Postal code. """ state: NotRequired[str] """ Prefecture. """ town: NotRequired[str] """ Town or cho-me. """ class CreateParamsCompanyAddressKanji(TypedDict): city: NotRequired[str] """ City or ward. """ 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] """ Block or building number. """ line2: NotRequired[str] """ Building details. """ postal_code: NotRequired[str] """ Postal code. """ state: NotRequired[str] """ Prefecture. """ town: NotRequired[str] """ Town or cho-me. """ class CreateParamsCompanyOwnershipDeclaration(TypedDict): date: NotRequired[int] """ The Unix timestamp marking when the beneficial owner attestation was made. """ ip: NotRequired[str] """ The IP address from which the beneficial owner attestation was made. """ user_agent: NotRequired[str] """ The user agent of the browser from which the beneficial owner attestation was made. """ class CreateParamsCompanyVerification(TypedDict): document: NotRequired[ "Account.CreateParamsCompanyVerificationDocument" ] """ A document verifying the business. """ class CreateParamsCompanyVerificationDocument(TypedDict): back: NotRequired[str] """ The back of a document returned by a [file upload](https://stripe.com/docs/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://stripe.com/docs/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. """ class CreateParamsController(TypedDict): fees: NotRequired["Account.CreateParamsControllerFees"] """ A hash of configuration for who pays Stripe fees for product usage on this account. """ losses: NotRequired["Account.CreateParamsControllerLosses"] """ A hash of configuration for products that have negative balance liability, and whether Stripe or a Connect application is responsible for them. """ requirement_collection: NotRequired[Literal["application", "stripe"]] """ A value indicating responsibility for collecting updated information when requirements on the account are due or change. Defaults to `stripe`. """ stripe_dashboard: NotRequired[ "Account.CreateParamsControllerStripeDashboard" ] """ A hash of configuration for Stripe-hosted dashboards. """ class CreateParamsControllerFees(TypedDict): payer: NotRequired[Literal["account", "application"]] """ A value indicating the responsible payer of Stripe fees on this account. Defaults to `account`. Learn more about [fee behavior on connected accounts](https://docs.stripe.com/connect/direct-charges-fee-payer-behavior). """ class CreateParamsControllerLosses(TypedDict): payments: NotRequired[Literal["application", "stripe"]] """ A value indicating who is liable when this account can't pay back negative balances resulting from payments. Defaults to `stripe`. """ class CreateParamsControllerStripeDashboard(TypedDict): type: NotRequired[Literal["express", "full", "none"]] """ Whether this account should have access to the full Stripe Dashboard (`full`), to the Express Dashboard (`express`), or to no Stripe-hosted dashboard (`none`). Defaults to `full`. """ class CreateParamsDocuments(TypedDict): bank_account_ownership_verification: NotRequired[ "Account.CreateParamsDocumentsBankAccountOwnershipVerification" ] """ One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. Must be a document associated with the account's primary active bank account that displays the last 4 digits of the account number, either a statement or a voided check. """ company_license: NotRequired[ "Account.CreateParamsDocumentsCompanyLicense" ] """ One or more documents that demonstrate proof of a company's license to operate. """ company_memorandum_of_association: NotRequired[ "Account.CreateParamsDocumentsCompanyMemorandumOfAssociation" ] """ One or more documents showing the company's Memorandum of Association. """ company_ministerial_decree: NotRequired[ "Account.CreateParamsDocumentsCompanyMinisterialDecree" ] """ (Certain countries only) One or more documents showing the ministerial decree legalizing the company's establishment. """ company_registration_verification: NotRequired[ "Account.CreateParamsDocumentsCompanyRegistrationVerification" ] """ One or more documents that demonstrate proof of a company's registration with the appropriate local authorities. """ company_tax_id_verification: NotRequired[ "Account.CreateParamsDocumentsCompanyTaxIdVerification" ] """ One or more documents that demonstrate proof of a company's tax ID. """ proof_of_registration: NotRequired[ "Account.CreateParamsDocumentsProofOfRegistration" ] """ One or more documents showing the company's proof of registration with the national business registry. """ class CreateParamsDocumentsBankAccountOwnershipVerification(TypedDict): files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreateParamsDocumentsCompanyLicense(TypedDict): files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreateParamsDocumentsCompanyMemorandumOfAssociation(TypedDict): files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreateParamsDocumentsCompanyMinisterialDecree(TypedDict): files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreateParamsDocumentsCompanyRegistrationVerification(TypedDict): files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreateParamsDocumentsCompanyTaxIdVerification(TypedDict): files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreateParamsDocumentsProofOfRegistration(TypedDict): files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreateParamsIndividual(TypedDict): address: NotRequired["Account.CreateParamsIndividualAddress"] """ The individual's primary address. """ address_kana: NotRequired["Account.CreateParamsIndividualAddressKana"] """ The Kana variation of the individual's primary address (Japan only). """ address_kanji: NotRequired[ "Account.CreateParamsIndividualAddressKanji" ] """ The Kanji variation of the individual's primary address (Japan only). """ dob: NotRequired["Literal['']|Account.CreateParamsIndividualDob"] """ The individual's date of birth. """ email: NotRequired[str] """ The individual's email address. """ first_name: NotRequired[str] """ The individual's first name. """ first_name_kana: NotRequired[str] """ The Kana variation of the individual's first name (Japan only). """ first_name_kanji: NotRequired[str] """ The Kanji variation of the individual's first name (Japan only). """ full_name_aliases: NotRequired["Literal['']|List[str]"] """ A list of alternate names or aliases that the individual is known by. """ gender: NotRequired[str] """ The individual's gender (International regulations require either "male" or "female"). """ id_number: NotRequired[str] """ The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). """ id_number_secondary: NotRequired[str] """ The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). """ last_name: NotRequired[str] """ The individual's last name. """ last_name_kana: NotRequired[str] """ The Kana variation of the individual's last name (Japan only). """ last_name_kanji: NotRequired[str] """ The Kanji variation of the individual's last name (Japan only). """ maiden_name: NotRequired[str] """ The individual's maiden name. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ phone: NotRequired[str] """ The individual's phone number. """ political_exposure: NotRequired[Literal["existing", "none"]] """ Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. """ registered_address: NotRequired[ "Account.CreateParamsIndividualRegisteredAddress" ] """ The individual's registered address. """ relationship: NotRequired["Account.CreateParamsIndividualRelationship"] """ Describes the person's relationship to the account. """ ssn_last_4: NotRequired[str] """ The last four digits of the individual's Social Security Number (U.S. only). """ verification: NotRequired["Account.CreateParamsIndividualVerification"] """ The individual's verification document information. """ class CreateParamsIndividualAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsIndividualAddressKana(TypedDict): city: NotRequired[str] """ City or ward. """ 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] """ Block or building number. """ line2: NotRequired[str] """ Building details. """ postal_code: NotRequired[str] """ Postal code. """ state: NotRequired[str] """ Prefecture. """ town: NotRequired[str] """ Town or cho-me. """ class CreateParamsIndividualAddressKanji(TypedDict): city: NotRequired[str] """ City or ward. """ 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] """ Block or building number. """ line2: NotRequired[str] """ Building details. """ postal_code: NotRequired[str] """ Postal code. """ state: NotRequired[str] """ Prefecture. """ town: NotRequired[str] """ Town or cho-me. """ class CreateParamsIndividualDob(TypedDict): day: int """ The day of birth, between 1 and 31. """ month: int """ The month of birth, between 1 and 12. """ year: int """ The four-digit year of birth. """ class CreateParamsIndividualRegisteredAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsIndividualRelationship(TypedDict): director: NotRequired[bool] """ Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. """ executive: NotRequired[bool] """ Whether the person has significant responsibility to control, manage, or direct the organization. """ owner: NotRequired[bool] """ Whether the person is an owner of the account's legal entity. """ percent_ownership: NotRequired["Literal['']|float"] """ The percent owned by the person of the account's legal entity. """ title: NotRequired[str] """ The person's title (e.g., CEO, Support Engineer). """ class CreateParamsIndividualVerification(TypedDict): additional_document: NotRequired[ "Account.CreateParamsIndividualVerificationAdditionalDocument" ] """ A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. """ document: NotRequired[ "Account.CreateParamsIndividualVerificationDocument" ] """ An identifying document, either a passport or local ID card. """ class CreateParamsIndividualVerificationAdditionalDocument(TypedDict): back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/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://stripe.com/docs/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 CreateParamsIndividualVerificationDocument(TypedDict): back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/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://stripe.com/docs/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 CreateParamsSettings(TypedDict): bacs_debit_payments: NotRequired[ "Account.CreateParamsSettingsBacsDebitPayments" ] """ Settings specific to Bacs Direct Debit. """ branding: NotRequired["Account.CreateParamsSettingsBranding"] """ Settings used to apply the account's branding to email receipts, invoices, Checkout, and other products. """ card_issuing: NotRequired["Account.CreateParamsSettingsCardIssuing"] """ Settings specific to the account's use of the Card Issuing product. """ card_payments: NotRequired["Account.CreateParamsSettingsCardPayments"] """ Settings specific to card charging on the account. """ payments: NotRequired["Account.CreateParamsSettingsPayments"] """ Settings that apply across payment methods for charging on the account. """ payouts: NotRequired["Account.CreateParamsSettingsPayouts"] """ Settings specific to the account's payouts. """ treasury: NotRequired["Account.CreateParamsSettingsTreasury"] """ Settings specific to the account's Treasury FinancialAccounts. """ class CreateParamsSettingsBacsDebitPayments(TypedDict): display_name: NotRequired[str] """ The Bacs Direct Debit Display Name for this account. For payments made with Bacs Direct Debit, this name appears on the mandate as the statement descriptor. Mobile banking apps display it as the name of the business. To use custom branding, set the Bacs Direct Debit Display Name during or right after creation. Custom branding incurs an additional monthly fee for the platform. If you don't set the display name before requesting Bacs capability, it's automatically set as "Stripe" and the account is onboarded to Stripe branding, which is free. """ class CreateParamsSettingsBranding(TypedDict): icon: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) An icon for the account. Must be square and at least 128px x 128px. """ logo: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A logo for the account that will be used in Checkout instead of the icon and without the account's name next to it if provided. Must be at least 128px x 128px. """ primary_color: NotRequired[str] """ A CSS hex color value representing the primary branding color for this account. """ secondary_color: NotRequired[str] """ A CSS hex color value representing the secondary branding color for this account. """ class CreateParamsSettingsCardIssuing(TypedDict): tos_acceptance: NotRequired[ "Account.CreateParamsSettingsCardIssuingTosAcceptance" ] """ Details on the account's acceptance of the [Stripe Issuing Terms and Disclosures](https://docs.stripe.com/issuing/connect/tos_acceptance). """ class CreateParamsSettingsCardIssuingTosAcceptance(TypedDict): date: NotRequired[int] """ The Unix timestamp marking when the account representative accepted the service agreement. """ ip: NotRequired[str] """ The IP address from which the account representative accepted the service agreement. """ user_agent: NotRequired["Literal['']|str"] """ The user agent of the browser from which the account representative accepted the service agreement. """ class CreateParamsSettingsCardPayments(TypedDict): decline_on: NotRequired[ "Account.CreateParamsSettingsCardPaymentsDeclineOn" ] """ Automatically declines certain charge types regardless of whether the card issuer accepted or declined the charge. """ statement_descriptor_prefix: NotRequired[str] """ The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. `statement_descriptor_prefix` is useful for maximizing descriptor space for the dynamic portion. """ statement_descriptor_prefix_kana: NotRequired["Literal['']|str"] """ The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kana` specified on the charge. `statement_descriptor_prefix_kana` is useful for maximizing descriptor space for the dynamic portion. """ statement_descriptor_prefix_kanji: NotRequired["Literal['']|str"] """ The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kanji` specified on the charge. `statement_descriptor_prefix_kanji` is useful for maximizing descriptor space for the dynamic portion. """ class CreateParamsSettingsCardPaymentsDeclineOn(TypedDict): avs_failure: NotRequired[bool] """ Whether Stripe automatically declines charges with an incorrect ZIP or postal code. This setting only applies when a ZIP or postal code is provided and they fail bank verification. """ cvc_failure: NotRequired[bool] """ Whether Stripe automatically declines charges with an incorrect CVC. This setting only applies when a CVC is provided and it fails bank verification. """ class CreateParamsSettingsPayments(TypedDict): statement_descriptor: NotRequired[str] """ The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. """ statement_descriptor_kana: NotRequired[str] """ The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). """ statement_descriptor_kanji: NotRequired[str] """ The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). """ class CreateParamsSettingsPayouts(TypedDict): debit_negative_balances: NotRequired[bool] """ A Boolean indicating whether Stripe should try to reclaim negative balances from an attached bank account. For details, see [Understanding Connect Account Balances](https://docs.stripe.com/connect/account-balances). """ schedule: NotRequired["Account.CreateParamsSettingsPayoutsSchedule"] """ Details on when funds from charges are available, and when they are paid out to an external account. For details, see our [Setting Bank and Debit Card Payouts](https://docs.stripe.com/connect/bank-transfers#payout-information) documentation. """ statement_descriptor: NotRequired[str] """ The text that appears on the bank account statement for payouts. If not set, this defaults to the platform's bank descriptor as set in the Dashboard. """ class CreateParamsSettingsPayoutsSchedule(TypedDict): delay_days: NotRequired["Literal['minimum']|int"] """ The number of days charge funds are held before being paid out. May also be set to `minimum`, representing the lowest available value for the account country. Default is `minimum`. The `delay_days` parameter remains at the last configured value if `interval` is `manual`. [Learn more about controlling payout delay days](https://docs.stripe.com/connect/manage-payout-schedule). """ interval: NotRequired[Literal["daily", "manual", "monthly", "weekly"]] """ How frequently available funds are paid out. One of: `daily`, `manual`, `weekly`, or `monthly`. Default is `daily`. """ monthly_anchor: NotRequired[int] """ The day of the month when available funds are paid out, specified as a number between 1--31. Payouts nominally scheduled between the 29th and 31st of the month are instead sent on the last day of a shorter month. Required and applicable only if `interval` is `monthly`. """ weekly_anchor: NotRequired[ Literal[ "friday", "monday", "saturday", "sunday", "thursday", "tuesday", "wednesday", ] ] """ The day of the week when available funds are paid out, specified as `monday`, `tuesday`, etc. (required and applicable only if `interval` is `weekly`.) """ class CreateParamsSettingsTreasury(TypedDict): tos_acceptance: NotRequired[ "Account.CreateParamsSettingsTreasuryTosAcceptance" ] """ Details on the account's acceptance of the Stripe Treasury Services Agreement. """ class CreateParamsSettingsTreasuryTosAcceptance(TypedDict): date: NotRequired[int] """ The Unix timestamp marking when the account representative accepted the service agreement. """ ip: NotRequired[str] """ The IP address from which the account representative accepted the service agreement. """ user_agent: NotRequired["Literal['']|str"] """ The user agent of the browser from which the account representative accepted the service agreement. """ class CreateParamsTosAcceptance(TypedDict): date: NotRequired[int] """ The Unix timestamp marking when the account representative accepted their service agreement. """ ip: NotRequired[str] """ The IP address from which the account representative accepted their service agreement. """ service_agreement: NotRequired[str] """ The user's service agreement type. """ user_agent: NotRequired[str] """ The user agent of the browser from which the account representative accepted their service agreement. """ class CreatePersonParams(RequestOptions): additional_tos_acceptances: NotRequired[ "Account.CreatePersonParamsAdditionalTosAcceptances" ] """ Details on the legal guardian's acceptance of the required Stripe agreements. """ address: NotRequired["Account.CreatePersonParamsAddress"] """ The person's address. """ address_kana: NotRequired["Account.CreatePersonParamsAddressKana"] """ The Kana variation of the person's address (Japan only). """ address_kanji: NotRequired["Account.CreatePersonParamsAddressKanji"] """ The Kanji variation of the person's address (Japan only). """ dob: NotRequired["Literal['']|Account.CreatePersonParamsDob"] """ The person's date of birth. """ documents: NotRequired["Account.CreatePersonParamsDocuments"] """ Documents that may be submitted to satisfy various informational requests. """ email: NotRequired[str] """ The person's email address. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ first_name: NotRequired[str] """ The person's first name. """ first_name_kana: NotRequired[str] """ The Kana variation of the person's first name (Japan only). """ first_name_kanji: NotRequired[str] """ The Kanji variation of the person's first name (Japan only). """ full_name_aliases: NotRequired["Literal['']|List[str]"] """ A list of alternate names or aliases that the person is known by. """ gender: NotRequired[str] """ The person's gender (International regulations require either "male" or "female"). """ id_number: NotRequired[str] """ The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). """ id_number_secondary: NotRequired[str] """ The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). """ last_name: NotRequired[str] """ The person's last name. """ last_name_kana: NotRequired[str] """ The Kana variation of the person's last name (Japan only). """ last_name_kanji: NotRequired[str] """ The Kanji variation of the person's last name (Japan only). """ maiden_name: NotRequired[str] """ The person's maiden name. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ nationality: NotRequired[str] """ The country where the person is a national. Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)), or "XX" if unavailable. """ person_token: NotRequired[str] """ A [person token](https://docs.stripe.com/connect/account-tokens), used to securely provide details to the person. """ phone: NotRequired[str] """ The person's phone number. """ political_exposure: NotRequired[str] """ Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. """ registered_address: NotRequired[ "Account.CreatePersonParamsRegisteredAddress" ] """ The person's registered address. """ relationship: NotRequired["Account.CreatePersonParamsRelationship"] """ The relationship that this person has with the account's legal entity. """ ssn_last_4: NotRequired[str] """ The last four digits of the person's Social Security number (U.S. only). """ verification: NotRequired["Account.CreatePersonParamsVerification"] """ The person's verification status. """ class CreatePersonParamsAdditionalTosAcceptances(TypedDict): account: NotRequired[ "Account.CreatePersonParamsAdditionalTosAcceptancesAccount" ] """ Details on the legal guardian's acceptance of the main Stripe service agreement. """ class CreatePersonParamsAdditionalTosAcceptancesAccount(TypedDict): date: NotRequired[int] """ The Unix timestamp marking when the account representative accepted the service agreement. """ ip: NotRequired[str] """ The IP address from which the account representative accepted the service agreement. """ user_agent: NotRequired["Literal['']|str"] """ The user agent of the browser from which the account representative accepted the service agreement. """ class CreatePersonParamsAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreatePersonParamsAddressKana(TypedDict): city: NotRequired[str] """ City or ward. """ 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] """ Block or building number. """ line2: NotRequired[str] """ Building details. """ postal_code: NotRequired[str] """ Postal code. """ state: NotRequired[str] """ Prefecture. """ town: NotRequired[str] """ Town or cho-me. """ class CreatePersonParamsAddressKanji(TypedDict): city: NotRequired[str] """ City or ward. """ 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] """ Block or building number. """ line2: NotRequired[str] """ Building details. """ postal_code: NotRequired[str] """ Postal code. """ state: NotRequired[str] """ Prefecture. """ town: NotRequired[str] """ Town or cho-me. """ class CreatePersonParamsDob(TypedDict): day: int """ The day of birth, between 1 and 31. """ month: int """ The month of birth, between 1 and 12. """ year: int """ The four-digit year of birth. """ class CreatePersonParamsDocuments(TypedDict): company_authorization: NotRequired[ "Account.CreatePersonParamsDocumentsCompanyAuthorization" ] """ One or more documents that demonstrate proof that this person is authorized to represent the company. """ passport: NotRequired["Account.CreatePersonParamsDocumentsPassport"] """ One or more documents showing the person's passport page with photo and personal data. """ visa: NotRequired["Account.CreatePersonParamsDocumentsVisa"] """ One or more documents showing the person's visa required for living in the country where they are residing. """ class CreatePersonParamsDocumentsCompanyAuthorization(TypedDict): files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreatePersonParamsDocumentsPassport(TypedDict): files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreatePersonParamsDocumentsVisa(TypedDict): files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreatePersonParamsRegisteredAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreatePersonParamsRelationship(TypedDict): director: NotRequired[bool] """ Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. """ executive: NotRequired[bool] """ Whether the person has significant responsibility to control, manage, or direct the organization. """ legal_guardian: NotRequired[bool] """ Whether the person is the legal guardian of the account's representative. """ owner: NotRequired[bool] """ Whether the person is an owner of the account's legal entity. """ percent_ownership: NotRequired["Literal['']|float"] """ The percent owned by the person of the account's legal entity. """ representative: NotRequired[bool] """ Whether the person is authorized as the primary representative of the account. This is the person nominated by the business to provide information about themselves, and general information about the account. There can only be one representative at any given time. At the time the account is created, this person should be set to the person responsible for opening the account. """ title: NotRequired[str] """ The person's title (e.g., CEO, Support Engineer). """ class CreatePersonParamsVerification(TypedDict): additional_document: NotRequired[ "Account.CreatePersonParamsVerificationAdditionalDocument" ] """ A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. """ document: NotRequired["Account.CreatePersonParamsVerificationDocument"] """ An identifying document, either a passport or local ID card. """ class CreatePersonParamsVerificationAdditionalDocument(TypedDict): back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/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://stripe.com/docs/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 CreatePersonParamsVerificationDocument(TypedDict): back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/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://stripe.com/docs/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 DeleteExternalAccountParams(RequestOptions): pass class DeleteParams(RequestOptions): pass class DeletePersonParams(RequestOptions): pass class ListCapabilitiesParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ListExternalAccountsParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ object: NotRequired[Literal["bank_account", "card"]] """ Filter external accounts according to a particular object type. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParams(RequestOptions): created: NotRequired["Account.ListParamsCreated|int"] """ Only return connected accounts that were created during the given date interval. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListPersonsParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ relationship: NotRequired["Account.ListPersonsParamsRelationship"] """ Filters on the list of people returned based on the person's relationship to the account's company. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListPersonsParamsRelationship(TypedDict): director: NotRequired[bool] """ A filter on the list of people returned based on whether these people are directors of the account's company. """ executive: NotRequired[bool] """ A filter on the list of people returned based on whether these people are executives of the account's company. """ legal_guardian: NotRequired[bool] """ A filter on the list of people returned based on whether these people are legal guardians of the account's representative. """ owner: NotRequired[bool] """ A filter on the list of people returned based on whether these people are owners of the account's company. """ representative: NotRequired[bool] """ A filter on the list of people returned based on whether these people are the representative of the account's company. """ class ModifyCapabilityParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ requested: NotRequired[bool] """ To request a new capability for an account, pass true. There can be a delay before the requested capability becomes active. If the capability has any activation requirements, the response includes them in the `requirements` arrays. If a capability isn't permanent, you can remove it from the account by passing false. Some capabilities are permanent after they've been requested. Attempting to remove a permanent capability returns an error. """ class ModifyExternalAccountParams(RequestOptions): account_holder_name: NotRequired[str] """ The name of the person or business that owns the bank account. """ account_holder_type: NotRequired[ "Literal['']|Literal['company', 'individual']" ] """ The type of entity that holds the account. This can be either `individual` or `company`. """ account_type: NotRequired[ Literal["checking", "futsu", "savings", "toza"] ] """ The bank account type. This can only be `checking` or `savings` in most countries. In Japan, this can only be `futsu` or `toza`. """ address_city: NotRequired[str] """ City/District/Suburb/Town/Village. """ address_country: NotRequired[str] """ Billing address country, if provided when creating card. """ address_line1: NotRequired[str] """ Address line 1 (Street address/PO Box/Company name). """ address_line2: NotRequired[str] """ Address line 2 (Apartment/Suite/Unit/Building). """ address_state: NotRequired[str] """ State/County/Province/Region. """ address_zip: NotRequired[str] """ ZIP or postal code. """ default_for_currency: NotRequired[bool] """ When set to true, this becomes the default external account for its currency. """ documents: NotRequired["Account.ModifyExternalAccountParamsDocuments"] """ Documents that may be submitted to satisfy various informational requests. """ exp_month: NotRequired[str] """ Two digit number representing the card's expiration month. """ exp_year: NotRequired[str] """ Four digit number representing the card's expiration year. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ name: NotRequired[str] """ Cardholder name. """ class ModifyExternalAccountParamsDocuments(TypedDict): bank_account_ownership_verification: NotRequired[ "Account.ModifyExternalAccountParamsDocumentsBankAccountOwnershipVerification" ] """ One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. Must be a document associated with the bank account that displays the last 4 digits of the account number, either a statement or a voided check. """ class ModifyExternalAccountParamsDocumentsBankAccountOwnershipVerification( TypedDict, ): files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class ModifyPersonParams(RequestOptions): additional_tos_acceptances: NotRequired[ "Account.ModifyPersonParamsAdditionalTosAcceptances" ] """ Details on the legal guardian's acceptance of the required Stripe agreements. """ address: NotRequired["Account.ModifyPersonParamsAddress"] """ The person's address. """ address_kana: NotRequired["Account.ModifyPersonParamsAddressKana"] """ The Kana variation of the person's address (Japan only). """ address_kanji: NotRequired["Account.ModifyPersonParamsAddressKanji"] """ The Kanji variation of the person's address (Japan only). """ dob: NotRequired["Literal['']|Account.ModifyPersonParamsDob"] """ The person's date of birth. """ documents: NotRequired["Account.ModifyPersonParamsDocuments"] """ Documents that may be submitted to satisfy various informational requests. """ email: NotRequired[str] """ The person's email address. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ first_name: NotRequired[str] """ The person's first name. """ first_name_kana: NotRequired[str] """ The Kana variation of the person's first name (Japan only). """ first_name_kanji: NotRequired[str] """ The Kanji variation of the person's first name (Japan only). """ full_name_aliases: NotRequired["Literal['']|List[str]"] """ A list of alternate names or aliases that the person is known by. """ gender: NotRequired[str] """ The person's gender (International regulations require either "male" or "female"). """ id_number: NotRequired[str] """ The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). """ id_number_secondary: NotRequired[str] """ The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). """ last_name: NotRequired[str] """ The person's last name. """ last_name_kana: NotRequired[str] """ The Kana variation of the person's last name (Japan only). """ last_name_kanji: NotRequired[str] """ The Kanji variation of the person's last name (Japan only). """ maiden_name: NotRequired[str] """ The person's maiden name. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ nationality: NotRequired[str] """ The country where the person is a national. Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)), or "XX" if unavailable. """ person_token: NotRequired[str] """ A [person token](https://docs.stripe.com/connect/account-tokens), used to securely provide details to the person. """ phone: NotRequired[str] """ The person's phone number. """ political_exposure: NotRequired[str] """ Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. """ registered_address: NotRequired[ "Account.ModifyPersonParamsRegisteredAddress" ] """ The person's registered address. """ relationship: NotRequired["Account.ModifyPersonParamsRelationship"] """ The relationship that this person has with the account's legal entity. """ ssn_last_4: NotRequired[str] """ The last four digits of the person's Social Security number (U.S. only). """ verification: NotRequired["Account.ModifyPersonParamsVerification"] """ The person's verification status. """ class ModifyPersonParamsAdditionalTosAcceptances(TypedDict): account: NotRequired[ "Account.ModifyPersonParamsAdditionalTosAcceptancesAccount" ] """ Details on the legal guardian's acceptance of the main Stripe service agreement. """ class ModifyPersonParamsAdditionalTosAcceptancesAccount(TypedDict): date: NotRequired[int] """ The Unix timestamp marking when the account representative accepted the service agreement. """ ip: NotRequired[str] """ The IP address from which the account representative accepted the service agreement. """ user_agent: NotRequired["Literal['']|str"] """ The user agent of the browser from which the account representative accepted the service agreement. """ class ModifyPersonParamsAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class ModifyPersonParamsAddressKana(TypedDict): city: NotRequired[str] """ City or ward. """ 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] """ Block or building number. """ line2: NotRequired[str] """ Building details. """ postal_code: NotRequired[str] """ Postal code. """ state: NotRequired[str] """ Prefecture. """ town: NotRequired[str] """ Town or cho-me. """ class ModifyPersonParamsAddressKanji(TypedDict): city: NotRequired[str] """ City or ward. """ 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] """ Block or building number. """ line2: NotRequired[str] """ Building details. """ postal_code: NotRequired[str] """ Postal code. """ state: NotRequired[str] """ Prefecture. """ town: NotRequired[str] """ Town or cho-me. """ class ModifyPersonParamsDob(TypedDict): day: int """ The day of birth, between 1 and 31. """ month: int """ The month of birth, between 1 and 12. """ year: int """ The four-digit year of birth. """ class ModifyPersonParamsDocuments(TypedDict): company_authorization: NotRequired[ "Account.ModifyPersonParamsDocumentsCompanyAuthorization" ] """ One or more documents that demonstrate proof that this person is authorized to represent the company. """ passport: NotRequired["Account.ModifyPersonParamsDocumentsPassport"] """ One or more documents showing the person's passport page with photo and personal data. """ visa: NotRequired["Account.ModifyPersonParamsDocumentsVisa"] """ One or more documents showing the person's visa required for living in the country where they are residing. """ class ModifyPersonParamsDocumentsCompanyAuthorization(TypedDict): files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class ModifyPersonParamsDocumentsPassport(TypedDict): files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class ModifyPersonParamsDocumentsVisa(TypedDict): files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class ModifyPersonParamsRegisteredAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class ModifyPersonParamsRelationship(TypedDict): director: NotRequired[bool] """ Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. """ executive: NotRequired[bool] """ Whether the person has significant responsibility to control, manage, or direct the organization. """ legal_guardian: NotRequired[bool] """ Whether the person is the legal guardian of the account's representative. """ owner: NotRequired[bool] """ Whether the person is an owner of the account's legal entity. """ percent_ownership: NotRequired["Literal['']|float"] """ The percent owned by the person of the account's legal entity. """ representative: NotRequired[bool] """ Whether the person is authorized as the primary representative of the account. This is the person nominated by the business to provide information about themselves, and general information about the account. There can only be one representative at any given time. At the time the account is created, this person should be set to the person responsible for opening the account. """ title: NotRequired[str] """ The person's title (e.g., CEO, Support Engineer). """ class ModifyPersonParamsVerification(TypedDict): additional_document: NotRequired[ "Account.ModifyPersonParamsVerificationAdditionalDocument" ] """ A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. """ document: NotRequired["Account.ModifyPersonParamsVerificationDocument"] """ An identifying document, either a passport or local ID card. """ class ModifyPersonParamsVerificationAdditionalDocument(TypedDict): back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/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://stripe.com/docs/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 ModifyPersonParamsVerificationDocument(TypedDict): back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/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://stripe.com/docs/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 PersonsParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ relationship: NotRequired["Account.PersonsParamsRelationship"] """ Filters on the list of people returned based on the person's relationship to the account's company. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class PersonsParamsRelationship(TypedDict): director: NotRequired[bool] """ A filter on the list of people returned based on whether these people are directors of the account's company. """ executive: NotRequired[bool] """ A filter on the list of people returned based on whether these people are executives of the account's company. """ legal_guardian: NotRequired[bool] """ A filter on the list of people returned based on whether these people are legal guardians of the account's representative. """ owner: NotRequired[bool] """ A filter on the list of people returned based on whether these people are owners of the account's company. """ representative: NotRequired[bool] """ A filter on the list of people returned based on whether these people are the representative of the account's company. """ class RejectParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ reason: str """ The reason for rejecting the account. Can be `fraud`, `terms_of_service`, or `other`. """ class RetrieveCapabilityParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveExternalAccountParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrievePersonParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ business_profile: Optional[BusinessProfile] """ Business information about the account. """ business_type: Optional[ Literal["company", "government_entity", "individual", "non_profit"] ] """ The business type. After you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions), this property is only returned for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. """ capabilities: Optional[Capabilities] charges_enabled: Optional[bool] """ Whether the account can create live charges. """ company: Optional[Company] controller: Optional[Controller] country: Optional[str] """ The account's country. """ created: Optional[int] """ Time at which the account was connected. Measured in seconds since the Unix epoch. """ default_currency: Optional[str] """ Three-letter ISO currency code representing the default currency for the account. This must be a currency that [Stripe supports in the account's country](https://stripe.com/docs/payouts). """ details_submitted: Optional[bool] """ Whether account details have been submitted. Accounts with Stripe Dashboard access, which includes Standard accounts, cannot receive payouts before this is true. Accounts where this is false should be directed to [an onboarding flow](https://stripe.com/connect/onboarding) to finish submitting account details. """ email: Optional[str] """ An email address associated with the account. It's not used for authentication and Stripe doesn't market to this field without explicit approval from the platform. """ external_accounts: Optional[ListObject[Union["BankAccount", "Card"]]] """ External accounts (bank accounts and debit cards) currently attached to this account. External accounts are only returned for requests where `controller[is_controller]` is true. """ future_requirements: Optional[FutureRequirements] id: str """ Unique identifier for the object. """ individual: Optional["Person"] """ This is an object representing a person associated with a Stripe account. A platform cannot access a person for an account where [account.controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `stripe`, which includes Standard and Express accounts, after creating an Account Link or Account Session to start Connect onboarding. See the [Standard onboarding](https://stripe.com/connect/standard-accounts) or [Express onboarding](https://stripe.com/connect/express-accounts) documentation for information about prefilling information and account onboarding steps. Learn more about [handling identity verification with the API](https://stripe.com/connect/handling-api-verification#person-information). """ metadata: Optional[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ object: Literal["account"] """ String representing the object's type. Objects of the same type share the same value. """ payouts_enabled: Optional[bool] """ Whether Stripe can send payouts to this account. """ requirements: Optional[Requirements] settings: Optional[Settings] """ Options for customizing how the account functions within Stripe. """ tos_acceptance: Optional[TosAcceptance] type: Optional[Literal["custom", "express", "none", "standard"]] """ The Stripe account type. Can be `standard`, `express`, `custom`, or `none`. """ deleted: Optional[Literal[True]] """ Always true for a deleted object """ @classmethod def create(cls, **params: Unpack["Account.CreateParams"]) -> "Account": """ With [Connect](https://stripe.com/docs/connect), you can create Stripe accounts for your users. To do this, you'll first need to [register your platform](https://dashboard.stripe.com/account/applications/settings). If you've already collected information for your connected accounts, you [can prefill that information](https://stripe.com/docs/connect/best-practices#onboarding) when creating the account. Connect Onboarding won't ask for the prefilled information during account onboarding. You can prefill any information on the account. """ return cast( "Account", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["Account.CreateParams"] ) -> "Account": """ With [Connect](https://stripe.com/docs/connect), you can create Stripe accounts for your users. To do this, you'll first need to [register your platform](https://dashboard.stripe.com/account/applications/settings). If you've already collected information for your connected accounts, you [can prefill that information](https://stripe.com/docs/connect/best-practices#onboarding) when creating the account. Connect Onboarding won't ask for the prefilled information during account onboarding. You can prefill any information on the account. """ return cast( "Account", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def _cls_delete( cls, sid: str, **params: Unpack["Account.DeleteParams"] ) -> "Account": """ With [Connect](https://stripe.com/connect), you can delete accounts you manage. Test-mode accounts can be deleted at any time. Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balanace_object) are zero. If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead. """ url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "Account", cls._static_request( "delete", url, params=params, ), ) @overload @staticmethod def delete( sid: str, **params: Unpack["Account.DeleteParams"] ) -> "Account": """ With [Connect](https://stripe.com/connect), you can delete accounts you manage. Test-mode accounts can be deleted at any time. Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balanace_object) are zero. If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead. """ ... @overload def delete(self, **params: Unpack["Account.DeleteParams"]) -> "Account": """ With [Connect](https://stripe.com/connect), you can delete accounts you manage. Test-mode accounts can be deleted at any time. Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balanace_object) are zero. If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead. """ ... @class_method_variant("_cls_delete") def delete( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Account.DeleteParams"] ) -> "Account": """ With [Connect](https://stripe.com/connect), you can delete accounts you manage. Test-mode accounts can be deleted at any time. Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balanace_object) are zero. If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead. """ return self._request_and_refresh( "delete", self.instance_url(), params=params, ) @classmethod async def _cls_delete_async( cls, sid: str, **params: Unpack["Account.DeleteParams"] ) -> "Account": """ With [Connect](https://stripe.com/connect), you can delete accounts you manage. Test-mode accounts can be deleted at any time. Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balanace_object) are zero. If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead. """ url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "Account", await cls._static_request_async( "delete", url, params=params, ), ) @overload @staticmethod async def delete_async( sid: str, **params: Unpack["Account.DeleteParams"] ) -> "Account": """ With [Connect](https://stripe.com/connect), you can delete accounts you manage. Test-mode accounts can be deleted at any time. Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balanace_object) are zero. If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead. """ ... @overload async def delete_async( self, **params: Unpack["Account.DeleteParams"] ) -> "Account": """ With [Connect](https://stripe.com/connect), you can delete accounts you manage. Test-mode accounts can be deleted at any time. Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balanace_object) are zero. If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead. """ ... @class_method_variant("_cls_delete_async") async def delete_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Account.DeleteParams"] ) -> "Account": """ With [Connect](https://stripe.com/connect), you can delete accounts you manage. Test-mode accounts can be deleted at any time. Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balanace_object) are zero. If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead. """ return await self._request_and_refresh_async( "delete", self.instance_url(), params=params, ) @classmethod def list( cls, **params: Unpack["Account.ListParams"] ) -> ListObject["Account"]: """ Returns a list of accounts connected to your platform via [Connect](https://stripe.com/docs/connect). If you're not a platform, the list is empty. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["Account.ListParams"] ) -> ListObject["Account"]: """ Returns a list of accounts connected to your platform via [Connect](https://stripe.com/docs/connect). If you're not a platform, the list is empty. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def _cls_persons( cls, account: str, **params: Unpack["Account.PersonsParams"] ) -> ListObject["Person"]: """ Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first. """ return cast( ListObject["Person"], cls._static_request( "get", "/v1/accounts/{account}/persons".format( account=sanitize_id(account) ), params=params, ), ) @overload @staticmethod def persons( account: str, **params: Unpack["Account.PersonsParams"] ) -> ListObject["Person"]: """ Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first. """ ... @overload def persons( self, **params: Unpack["Account.PersonsParams"] ) -> ListObject["Person"]: """ Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first. """ ... @class_method_variant("_cls_persons") def persons( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Account.PersonsParams"] ) -> ListObject["Person"]: """ Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first. """ return cast( ListObject["Person"], self._request( "get", "/v1/accounts/{account}/persons".format( account=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_persons_async( cls, account: str, **params: Unpack["Account.PersonsParams"] ) -> ListObject["Person"]: """ Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first. """ return cast( ListObject["Person"], await cls._static_request_async( "get", "/v1/accounts/{account}/persons".format( account=sanitize_id(account) ), params=params, ), ) @overload @staticmethod async def persons_async( account: str, **params: Unpack["Account.PersonsParams"] ) -> ListObject["Person"]: """ Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first. """ ... @overload async def persons_async( self, **params: Unpack["Account.PersonsParams"] ) -> ListObject["Person"]: """ Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first. """ ... @class_method_variant("_cls_persons_async") async def persons_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Account.PersonsParams"] ) -> ListObject["Person"]: """ Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first. """ return cast( ListObject["Person"], await self._request_async( "get", "/v1/accounts/{account}/persons".format( account=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def _cls_reject( cls, account: str, **params: Unpack["Account.RejectParams"] ) -> "Account": """ With [Connect](https://stripe.com/connect), you can reject accounts that you have flagged as suspicious. Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero. """ return cast( "Account", cls._static_request( "post", "/v1/accounts/{account}/reject".format( account=sanitize_id(account) ), params=params, ), ) @overload @staticmethod def reject( account: str, **params: Unpack["Account.RejectParams"] ) -> "Account": """ With [Connect](https://stripe.com/connect), you can reject accounts that you have flagged as suspicious. Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero. """ ... @overload def reject(self, **params: Unpack["Account.RejectParams"]) -> "Account": """ With [Connect](https://stripe.com/connect), you can reject accounts that you have flagged as suspicious. Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero. """ ... @class_method_variant("_cls_reject") def reject( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Account.RejectParams"] ) -> "Account": """ With [Connect](https://stripe.com/connect), you can reject accounts that you have flagged as suspicious. Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero. """ return cast( "Account", self._request( "post", "/v1/accounts/{account}/reject".format( account=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_reject_async( cls, account: str, **params: Unpack["Account.RejectParams"] ) -> "Account": """ With [Connect](https://stripe.com/connect), you can reject accounts that you have flagged as suspicious. Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero. """ return cast( "Account", await cls._static_request_async( "post", "/v1/accounts/{account}/reject".format( account=sanitize_id(account) ), params=params, ), ) @overload @staticmethod async def reject_async( account: str, **params: Unpack["Account.RejectParams"] ) -> "Account": """ With [Connect](https://stripe.com/connect), you can reject accounts that you have flagged as suspicious. Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero. """ ... @overload async def reject_async( self, **params: Unpack["Account.RejectParams"] ) -> "Account": """ With [Connect](https://stripe.com/connect), you can reject accounts that you have flagged as suspicious. Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero. """ ... @class_method_variant("_cls_reject_async") async def reject_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Account.RejectParams"] ) -> "Account": """ With [Connect](https://stripe.com/connect), you can reject accounts that you have flagged as suspicious. Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero. """ return cast( "Account", await self._request_async( "post", "/v1/accounts/{account}/reject".format( account=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def retrieve(cls, id=None, **params) -> "Account": instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async(cls, id=None, **params) -> "Account": instance = cls(id, **params) await instance.refresh_async() return instance @classmethod def modify(cls, id=None, **params) -> "Account": url = cls._build_instance_url(id) return cast("Account", cls._static_request("post", url, params=params)) @classmethod async def modify_async(cls, id=None, **params) -> "Account": url = cls._build_instance_url(id) return cast( "Account", await cls._static_request_async("post", url, params=params), ) @classmethod def _build_instance_url(cls, sid): if not sid: return "/v1/account" base = cls.class_url() extn = sanitize_id(sid) return "%s/%s" % (base, extn) def instance_url(self): return self._build_instance_url(self.get("id")) def deauthorize(self, **params): params["stripe_user_id"] = self.id return OAuth.deauthorize(**params) def serialize(self, previous): params = super(Account, self).serialize(previous) previous = previous or self._previous or {} for k, v in iter(self.items()): if k == "individual" and isinstance(v, Person) and k not in params: params[k] = v.serialize(previous.get(k, None)) return params @classmethod def retrieve_capability( cls, account: str, capability: str, **params: Unpack["Account.RetrieveCapabilityParams"], ) -> "Capability": """ Retrieves information about the specified Account Capability. """ return cast( "Capability", cls._static_request( "get", "/v1/accounts/{account}/capabilities/{capability}".format( account=sanitize_id(account), capability=sanitize_id(capability), ), params=params, ), ) @classmethod async def retrieve_capability_async( cls, account: str, capability: str, **params: Unpack["Account.RetrieveCapabilityParams"], ) -> "Capability": """ Retrieves information about the specified Account Capability. """ return cast( "Capability", await cls._static_request_async( "get", "/v1/accounts/{account}/capabilities/{capability}".format( account=sanitize_id(account), capability=sanitize_id(capability), ), params=params, ), ) @classmethod def modify_capability( cls, account: str, capability: str, **params: Unpack["Account.ModifyCapabilityParams"], ) -> "Capability": """ Updates an existing Account Capability. Request or remove a capability by updating its requested parameter. """ return cast( "Capability", cls._static_request( "post", "/v1/accounts/{account}/capabilities/{capability}".format( account=sanitize_id(account), capability=sanitize_id(capability), ), params=params, ), ) @classmethod async def modify_capability_async( cls, account: str, capability: str, **params: Unpack["Account.ModifyCapabilityParams"], ) -> "Capability": """ Updates an existing Account Capability. Request or remove a capability by updating its requested parameter. """ return cast( "Capability", await cls._static_request_async( "post", "/v1/accounts/{account}/capabilities/{capability}".format( account=sanitize_id(account), capability=sanitize_id(capability), ), params=params, ), ) @classmethod def list_capabilities( cls, account: str, **params: Unpack["Account.ListCapabilitiesParams"] ) -> ListObject["Capability"]: """ Returns a list of capabilities associated with the account. The capabilities are returned sorted by creation date, with the most recent capability appearing first. """ return cast( ListObject["Capability"], cls._static_request( "get", "/v1/accounts/{account}/capabilities".format( account=sanitize_id(account) ), params=params, ), ) @classmethod async def list_capabilities_async( cls, account: str, **params: Unpack["Account.ListCapabilitiesParams"] ) -> ListObject["Capability"]: """ Returns a list of capabilities associated with the account. The capabilities are returned sorted by creation date, with the most recent capability appearing first. """ return cast( ListObject["Capability"], await cls._static_request_async( "get", "/v1/accounts/{account}/capabilities".format( account=sanitize_id(account) ), params=params, ), ) @classmethod def create_external_account( cls, account: str, **params: Unpack["Account.CreateExternalAccountParams"], ) -> Union["BankAccount", "Card"]: """ Create an external account for a given account. """ return cast( Union["BankAccount", "Card"], cls._static_request( "post", "/v1/accounts/{account}/external_accounts".format( account=sanitize_id(account) ), params=params, ), ) @classmethod async def create_external_account_async( cls, account: str, **params: Unpack["Account.CreateExternalAccountParams"], ) -> Union["BankAccount", "Card"]: """ Create an external account for a given account. """ return cast( Union["BankAccount", "Card"], await cls._static_request_async( "post", "/v1/accounts/{account}/external_accounts".format( account=sanitize_id(account) ), params=params, ), ) @classmethod def retrieve_external_account( cls, account: str, id: str, **params: Unpack["Account.RetrieveExternalAccountParams"], ) -> Union["BankAccount", "Card"]: """ Retrieve a specified external account for a given account. """ return cast( Union["BankAccount", "Card"], cls._static_request( "get", "/v1/accounts/{account}/external_accounts/{id}".format( account=sanitize_id(account), id=sanitize_id(id) ), params=params, ), ) @classmethod async def retrieve_external_account_async( cls, account: str, id: str, **params: Unpack["Account.RetrieveExternalAccountParams"], ) -> Union["BankAccount", "Card"]: """ Retrieve a specified external account for a given account. """ return cast( Union["BankAccount", "Card"], await cls._static_request_async( "get", "/v1/accounts/{account}/external_accounts/{id}".format( account=sanitize_id(account), id=sanitize_id(id) ), params=params, ), ) @classmethod def modify_external_account( cls, account: str, id: str, **params: Unpack["Account.ModifyExternalAccountParams"], ) -> Union["BankAccount", "Card"]: """ Updates the metadata, account holder name, account holder type of a bank account belonging to a connected account and optionally sets it as the default for its currency. Other bank account details are not editable by design. You can only update bank accounts when [account.controller.requirement_collection is application, which includes Custom accounts](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection). You can re-enable a disabled bank account by performing an update call without providing any arguments or changes. """ return cast( Union["BankAccount", "Card"], cls._static_request( "post", "/v1/accounts/{account}/external_accounts/{id}".format( account=sanitize_id(account), id=sanitize_id(id) ), params=params, ), ) @classmethod async def modify_external_account_async( cls, account: str, id: str, **params: Unpack["Account.ModifyExternalAccountParams"], ) -> Union["BankAccount", "Card"]: """ Updates the metadata, account holder name, account holder type of a bank account belonging to a connected account and optionally sets it as the default for its currency. Other bank account details are not editable by design. You can only update bank accounts when [account.controller.requirement_collection is application, which includes Custom accounts](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection). You can re-enable a disabled bank account by performing an update call without providing any arguments or changes. """ return cast( Union["BankAccount", "Card"], await cls._static_request_async( "post", "/v1/accounts/{account}/external_accounts/{id}".format( account=sanitize_id(account), id=sanitize_id(id) ), params=params, ), ) @classmethod def delete_external_account( cls, account: str, id: str, **params: Unpack["Account.DeleteExternalAccountParams"], ) -> Union["BankAccount", "Card"]: """ Delete a specified external account for a given account. """ return cast( Union["BankAccount", "Card"], cls._static_request( "delete", "/v1/accounts/{account}/external_accounts/{id}".format( account=sanitize_id(account), id=sanitize_id(id) ), params=params, ), ) @classmethod async def delete_external_account_async( cls, account: str, id: str, **params: Unpack["Account.DeleteExternalAccountParams"], ) -> Union["BankAccount", "Card"]: """ Delete a specified external account for a given account. """ return cast( Union["BankAccount", "Card"], await cls._static_request_async( "delete", "/v1/accounts/{account}/external_accounts/{id}".format( account=sanitize_id(account), id=sanitize_id(id) ), params=params, ), ) @classmethod def list_external_accounts( cls, account: str, **params: Unpack["Account.ListExternalAccountsParams"], ) -> ListObject[Union["BankAccount", "Card"]]: """ List external accounts for an account. """ return cast( ListObject[Union["BankAccount", "Card"]], cls._static_request( "get", "/v1/accounts/{account}/external_accounts".format( account=sanitize_id(account) ), params=params, ), ) @classmethod async def list_external_accounts_async( cls, account: str, **params: Unpack["Account.ListExternalAccountsParams"], ) -> ListObject[Union["BankAccount", "Card"]]: """ List external accounts for an account. """ return cast( ListObject[Union["BankAccount", "Card"]], await cls._static_request_async( "get", "/v1/accounts/{account}/external_accounts".format( account=sanitize_id(account) ), params=params, ), ) @classmethod def create_login_link( cls, account: str, **params: Unpack["Account.CreateLoginLinkParams"] ) -> "LoginLink": """ Creates a single-use login link for a connected account to access the Express Dashboard. You can only create login links for accounts that use the [Express Dashboard](https://stripe.com/connect/express-dashboard) and are connected to your platform. """ return cast( "LoginLink", cls._static_request( "post", "/v1/accounts/{account}/login_links".format( account=sanitize_id(account) ), params=params, ), ) @classmethod async def create_login_link_async( cls, account: str, **params: Unpack["Account.CreateLoginLinkParams"] ) -> "LoginLink": """ Creates a single-use login link for a connected account to access the Express Dashboard. You can only create login links for accounts that use the [Express Dashboard](https://stripe.com/connect/express-dashboard) and are connected to your platform. """ return cast( "LoginLink", await cls._static_request_async( "post", "/v1/accounts/{account}/login_links".format( account=sanitize_id(account) ), params=params, ), ) @classmethod def create_person( cls, account: str, **params: Unpack["Account.CreatePersonParams"] ) -> "Person": """ Creates a new person. """ return cast( "Person", cls._static_request( "post", "/v1/accounts/{account}/persons".format( account=sanitize_id(account) ), params=params, ), ) @classmethod async def create_person_async( cls, account: str, **params: Unpack["Account.CreatePersonParams"] ) -> "Person": """ Creates a new person. """ return cast( "Person", await cls._static_request_async( "post", "/v1/accounts/{account}/persons".format( account=sanitize_id(account) ), params=params, ), ) @classmethod def retrieve_person( cls, account: str, person: str, **params: Unpack["Account.RetrievePersonParams"], ) -> "Person": """ Retrieves an existing person. """ return cast( "Person", cls._static_request( "get", "/v1/accounts/{account}/persons/{person}".format( account=sanitize_id(account), person=sanitize_id(person) ), params=params, ), ) @classmethod async def retrieve_person_async( cls, account: str, person: str, **params: Unpack["Account.RetrievePersonParams"], ) -> "Person": """ Retrieves an existing person. """ return cast( "Person", await cls._static_request_async( "get", "/v1/accounts/{account}/persons/{person}".format( account=sanitize_id(account), person=sanitize_id(person) ), params=params, ), ) @classmethod def modify_person( cls, account: str, person: str, **params: Unpack["Account.ModifyPersonParams"], ) -> "Person": """ Updates an existing person. """ return cast( "Person", cls._static_request( "post", "/v1/accounts/{account}/persons/{person}".format( account=sanitize_id(account), person=sanitize_id(person) ), params=params, ), ) @classmethod async def modify_person_async( cls, account: str, person: str, **params: Unpack["Account.ModifyPersonParams"], ) -> "Person": """ Updates an existing person. """ return cast( "Person", await cls._static_request_async( "post", "/v1/accounts/{account}/persons/{person}".format( account=sanitize_id(account), person=sanitize_id(person) ), params=params, ), ) @classmethod def delete_person( cls, account: str, person: str, **params: Unpack["Account.DeletePersonParams"], ) -> "Person": """ Deletes an existing person's relationship to the account's legal entity. Any person with a relationship for an account can be deleted through the API, except if the person is the account_opener. If your integration is using the executive parameter, you cannot delete the only verified executive on file. """ return cast( "Person", cls._static_request( "delete", "/v1/accounts/{account}/persons/{person}".format( account=sanitize_id(account), person=sanitize_id(person) ), params=params, ), ) @classmethod async def delete_person_async( cls, account: str, person: str, **params: Unpack["Account.DeletePersonParams"], ) -> "Person": """ Deletes an existing person's relationship to the account's legal entity. Any person with a relationship for an account can be deleted through the API, except if the person is the account_opener. If your integration is using the executive parameter, you cannot delete the only verified executive on file. """ return cast( "Person", await cls._static_request_async( "delete", "/v1/accounts/{account}/persons/{person}".format( account=sanitize_id(account), person=sanitize_id(person) ), params=params, ), ) @classmethod def list_persons( cls, account: str, **params: Unpack["Account.ListPersonsParams"] ) -> ListObject["Person"]: """ Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first. """ return cast( ListObject["Person"], cls._static_request( "get", "/v1/accounts/{account}/persons".format( account=sanitize_id(account) ), params=params, ), ) @classmethod async def list_persons_async( cls, account: str, **params: Unpack["Account.ListPersonsParams"] ) -> ListObject["Person"]: """ Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first. """ return cast( ListObject["Person"], await cls._static_request_async( "get", "/v1/accounts/{account}/persons".format( account=sanitize_id(account) ), params=params, ), ) _inner_class_types = { "business_profile": BusinessProfile, "capabilities": Capabilities, "company": Company, "controller": Controller, "future_requirements": FutureRequirements, "requirements": Requirements, "settings": Settings, "tos_acceptance": TosAcceptance, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_account_capability_service.py0000644000175100001770000001376014637354563022127 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._capability import Capability from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict class AccountCapabilityService(StripeService): class ListParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ requested: NotRequired[bool] """ To request a new capability for an account, pass true. There can be a delay before the requested capability becomes active. If the capability has any activation requirements, the response includes them in the `requirements` arrays. If a capability isn't permanent, you can remove it from the account by passing false. Some capabilities are permanent after they've been requested. Attempting to remove a permanent capability returns an error. """ def list( self, account: str, params: "AccountCapabilityService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Capability]: """ Returns a list of capabilities associated with the account. The capabilities are returned sorted by creation date, with the most recent capability appearing first. """ return cast( ListObject[Capability], self._request( "get", "/v1/accounts/{account}/capabilities".format( account=sanitize_id(account), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, account: str, params: "AccountCapabilityService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Capability]: """ Returns a list of capabilities associated with the account. The capabilities are returned sorted by creation date, with the most recent capability appearing first. """ return cast( ListObject[Capability], await self._request_async( "get", "/v1/accounts/{account}/capabilities".format( account=sanitize_id(account), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, account: str, capability: str, params: "AccountCapabilityService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Capability: """ Retrieves information about the specified Account Capability. """ return cast( Capability, self._request( "get", "/v1/accounts/{account}/capabilities/{capability}".format( account=sanitize_id(account), capability=sanitize_id(capability), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, account: str, capability: str, params: "AccountCapabilityService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Capability: """ Retrieves information about the specified Account Capability. """ return cast( Capability, await self._request_async( "get", "/v1/accounts/{account}/capabilities/{capability}".format( account=sanitize_id(account), capability=sanitize_id(capability), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, account: str, capability: str, params: "AccountCapabilityService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Capability: """ Updates an existing Account Capability. Request or remove a capability by updating its requested parameter. """ return cast( Capability, self._request( "post", "/v1/accounts/{account}/capabilities/{capability}".format( account=sanitize_id(account), capability=sanitize_id(capability), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, account: str, capability: str, params: "AccountCapabilityService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Capability: """ Updates an existing Account Capability. Request or remove a capability by updating its requested parameter. """ return cast( Capability, await self._request_async( "post", "/v1/accounts/{account}/capabilities/{capability}".format( account=sanitize_id(account), capability=sanitize_id(capability), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_account_external_account_service.py0000644000175100001770000004151614637354563023344 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._bank_account import BankAccount from stripe._card import Card from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import Dict, List, Union, cast from typing_extensions import Literal, NotRequired, TypedDict class AccountExternalAccountService(StripeService): class CreateParams(TypedDict): default_for_currency: NotRequired[bool] """ When set to true, or if this is the first external account added in this currency, this account becomes the default external account for its currency. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ external_account: Union[ str, "AccountExternalAccountService.CreateParamsCard", "AccountExternalAccountService.CreateParamsBankAccount", "AccountExternalAccountService.CreateParamsCardToken", ] """ Please refer to full [documentation](https://stripe.com/docs/api) instead. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ class CreateParamsBankAccount(TypedDict): object: Literal["bank_account"] account_holder_name: NotRequired[str] """ The name of the person or business that owns the bank account.This field is required when attaching the bank account to a `Customer` object. """ account_holder_type: NotRequired[Literal["company", "individual"]] """ The type of entity that holds the account. It can be `company` or `individual`. This field is required when attaching the bank account to a `Customer` object. """ account_number: str """ The account number for the bank account, in string form. Must be a checking account. """ country: str """ The country in which the bank account is located. """ currency: NotRequired[str] """ The currency the bank account is in. This must be a country/currency pairing that [Stripe supports.](docs/payouts) """ routing_number: NotRequired[str] """ The routing number, sort code, or other country-appropriateinstitution number for the bank account. For US bank accounts, this is required and should bethe ACH routing number, not the wire routing number. If you are providing an IBAN for`account_number`, this field is not required. """ class CreateParamsCard(TypedDict): object: Literal["card"] address_city: NotRequired[str] address_country: NotRequired[str] address_line1: NotRequired[str] address_line2: NotRequired[str] address_state: NotRequired[str] address_zip: NotRequired[str] currency: NotRequired[str] cvc: NotRequired[str] exp_month: int exp_year: int name: NotRequired[str] number: str metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ class CreateParamsCardToken(TypedDict): object: Literal["card"] currency: NotRequired[str] token: str class DeleteParams(TypedDict): pass class ListParams(TypedDict): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ object: NotRequired[Literal["bank_account", "card"]] """ Filter external accounts according to a particular object type. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): account_holder_name: NotRequired[str] """ The name of the person or business that owns the bank account. """ account_holder_type: NotRequired[ "Literal['']|Literal['company', 'individual']" ] """ The type of entity that holds the account. This can be either `individual` or `company`. """ account_type: NotRequired[ Literal["checking", "futsu", "savings", "toza"] ] """ The bank account type. This can only be `checking` or `savings` in most countries. In Japan, this can only be `futsu` or `toza`. """ address_city: NotRequired[str] """ City/District/Suburb/Town/Village. """ address_country: NotRequired[str] """ Billing address country, if provided when creating card. """ address_line1: NotRequired[str] """ Address line 1 (Street address/PO Box/Company name). """ address_line2: NotRequired[str] """ Address line 2 (Apartment/Suite/Unit/Building). """ address_state: NotRequired[str] """ State/County/Province/Region. """ address_zip: NotRequired[str] """ ZIP or postal code. """ default_for_currency: NotRequired[bool] """ When set to true, this becomes the default external account for its currency. """ documents: NotRequired[ "AccountExternalAccountService.UpdateParamsDocuments" ] """ Documents that may be submitted to satisfy various informational requests. """ exp_month: NotRequired[str] """ Two digit number representing the card's expiration month. """ exp_year: NotRequired[str] """ Four digit number representing the card's expiration year. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ name: NotRequired[str] """ Cardholder name. """ class UpdateParamsDocuments(TypedDict): bank_account_ownership_verification: NotRequired[ "AccountExternalAccountService.UpdateParamsDocumentsBankAccountOwnershipVerification" ] """ One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. Must be a document associated with the bank account that displays the last 4 digits of the account number, either a statement or a voided check. """ class UpdateParamsDocumentsBankAccountOwnershipVerification(TypedDict): files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ def delete( self, account: str, id: str, params: "AccountExternalAccountService.DeleteParams" = {}, options: RequestOptions = {}, ) -> Union[BankAccount, Card]: """ Delete a specified external account for a given account. """ return cast( Union[BankAccount, Card], self._request( "delete", "/v1/accounts/{account}/external_accounts/{id}".format( account=sanitize_id(account), id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def delete_async( self, account: str, id: str, params: "AccountExternalAccountService.DeleteParams" = {}, options: RequestOptions = {}, ) -> Union[BankAccount, Card]: """ Delete a specified external account for a given account. """ return cast( Union[BankAccount, Card], await self._request_async( "delete", "/v1/accounts/{account}/external_accounts/{id}".format( account=sanitize_id(account), id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, account: str, id: str, params: "AccountExternalAccountService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Union[BankAccount, Card]: """ Retrieve a specified external account for a given account. """ return cast( Union[BankAccount, Card], self._request( "get", "/v1/accounts/{account}/external_accounts/{id}".format( account=sanitize_id(account), id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, account: str, id: str, params: "AccountExternalAccountService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Union[BankAccount, Card]: """ Retrieve a specified external account for a given account. """ return cast( Union[BankAccount, Card], await self._request_async( "get", "/v1/accounts/{account}/external_accounts/{id}".format( account=sanitize_id(account), id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, account: str, id: str, params: "AccountExternalAccountService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Union[BankAccount, Card]: """ Updates the metadata, account holder name, account holder type of a bank account belonging to a connected account and optionally sets it as the default for its currency. Other bank account details are not editable by design. You can only update bank accounts when [account.controller.requirement_collection is application, which includes Custom accounts](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection). You can re-enable a disabled bank account by performing an update call without providing any arguments or changes. """ return cast( Union[BankAccount, Card], self._request( "post", "/v1/accounts/{account}/external_accounts/{id}".format( account=sanitize_id(account), id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, account: str, id: str, params: "AccountExternalAccountService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Union[BankAccount, Card]: """ Updates the metadata, account holder name, account holder type of a bank account belonging to a connected account and optionally sets it as the default for its currency. Other bank account details are not editable by design. You can only update bank accounts when [account.controller.requirement_collection is application, which includes Custom accounts](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection). You can re-enable a disabled bank account by performing an update call without providing any arguments or changes. """ return cast( Union[BankAccount, Card], await self._request_async( "post", "/v1/accounts/{account}/external_accounts/{id}".format( account=sanitize_id(account), id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def list( self, account: str, params: "AccountExternalAccountService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Union[BankAccount, Card]]: """ List external accounts for an account. """ return cast( ListObject[Union[BankAccount, Card]], self._request( "get", "/v1/accounts/{account}/external_accounts".format( account=sanitize_id(account), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, account: str, params: "AccountExternalAccountService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Union[BankAccount, Card]]: """ List external accounts for an account. """ return cast( ListObject[Union[BankAccount, Card]], await self._request_async( "get", "/v1/accounts/{account}/external_accounts".format( account=sanitize_id(account), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, account: str, params: "AccountExternalAccountService.CreateParams", options: RequestOptions = {}, ) -> Union[BankAccount, Card]: """ Create an external account for a given account. """ return cast( Union[BankAccount, Card], self._request( "post", "/v1/accounts/{account}/external_accounts".format( account=sanitize_id(account), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, account: str, params: "AccountExternalAccountService.CreateParams", options: RequestOptions = {}, ) -> Union[BankAccount, Card]: """ Create an external account for a given account. """ return cast( Union[BankAccount, Card], await self._request_async( "post", "/v1/accounts/{account}/external_accounts".format( account=sanitize_id(account), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_account_link.py0000644000175100001770000001046414637354563017221 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._request_options import RequestOptions from typing import ClassVar, List, cast from typing_extensions import Literal, NotRequired, TypedDict, Unpack class AccountLink(CreateableAPIResource["AccountLink"]): """ Account Links are the means by which a Connect platform grants a connected account permission to access Stripe-hosted applications, such as Connect Onboarding. Related guide: [Connect Onboarding](https://stripe.com/docs/connect/custom/hosted-onboarding) """ OBJECT_NAME: ClassVar[Literal["account_link"]] = "account_link" class CreateParams(RequestOptions): account: str """ The identifier of the account to create an account link for. """ collect: NotRequired[Literal["currently_due", "eventually_due"]] """ The collect parameter is deprecated. Use `collection_options` instead. """ collection_options: NotRequired[ "AccountLink.CreateParamsCollectionOptions" ] """ Specifies the requirements that Stripe collects from connected accounts in the Connect Onboarding flow. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ refresh_url: NotRequired[str] """ The URL the user will be redirected to if the account link is expired, has been previously-visited, or is otherwise invalid. The URL you specify should attempt to generate a new account link with the same parameters used to create the original account link, then redirect the user to the new account link's URL so they can continue with Connect Onboarding. If a new account link cannot be generated or the redirect fails you should display a useful error to the user. """ return_url: NotRequired[str] """ The URL that the user will be redirected to upon leaving or completing the linked flow. """ type: Literal["account_onboarding", "account_update"] """ The type of account link the user is requesting. Possible values are `account_onboarding` or `account_update`. """ class CreateParamsCollectionOptions(TypedDict): fields: Literal["currently_due", "eventually_due"] """ Specifies whether the platform collects only currently_due requirements (`currently_due`) or both currently_due and eventually_due requirements (`eventually_due`). If you don't specify `collection_options`, the default value is `currently_due`. """ future_requirements: NotRequired[Literal["include", "omit"]] """ Specifies whether the platform collects future_requirements in addition to requirements in Connect Onboarding. The default value is `omit`. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ expires_at: int """ The timestamp at which this account link will expire. """ object: Literal["account_link"] """ String representing the object's type. Objects of the same type share the same value. """ url: str """ The URL for the account link. """ @classmethod def create( cls, **params: Unpack["AccountLink.CreateParams"] ) -> "AccountLink": """ Creates an AccountLink object that includes a single-use Stripe URL that the platform can redirect their user to in order to take them through the Connect Onboarding flow. """ return cast( "AccountLink", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["AccountLink.CreateParams"] ) -> "AccountLink": """ Creates an AccountLink object that includes a single-use Stripe URL that the platform can redirect their user to in order to take them through the Connect Onboarding flow. """ return cast( "AccountLink", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_account_link_service.py0000644000175100001770000000744214637354563020743 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._account_link import AccountLink from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict class AccountLinkService(StripeService): class CreateParams(TypedDict): account: str """ The identifier of the account to create an account link for. """ collect: NotRequired[Literal["currently_due", "eventually_due"]] """ The collect parameter is deprecated. Use `collection_options` instead. """ collection_options: NotRequired[ "AccountLinkService.CreateParamsCollectionOptions" ] """ Specifies the requirements that Stripe collects from connected accounts in the Connect Onboarding flow. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ refresh_url: NotRequired[str] """ The URL the user will be redirected to if the account link is expired, has been previously-visited, or is otherwise invalid. The URL you specify should attempt to generate a new account link with the same parameters used to create the original account link, then redirect the user to the new account link's URL so they can continue with Connect Onboarding. If a new account link cannot be generated or the redirect fails you should display a useful error to the user. """ return_url: NotRequired[str] """ The URL that the user will be redirected to upon leaving or completing the linked flow. """ type: Literal["account_onboarding", "account_update"] """ The type of account link the user is requesting. Possible values are `account_onboarding` or `account_update`. """ class CreateParamsCollectionOptions(TypedDict): fields: Literal["currently_due", "eventually_due"] """ Specifies whether the platform collects only currently_due requirements (`currently_due`) or both currently_due and eventually_due requirements (`eventually_due`). If you don't specify `collection_options`, the default value is `currently_due`. """ future_requirements: NotRequired[Literal["include", "omit"]] """ Specifies whether the platform collects future_requirements in addition to requirements in Connect Onboarding. The default value is `omit`. """ def create( self, params: "AccountLinkService.CreateParams", options: RequestOptions = {}, ) -> AccountLink: """ Creates an AccountLink object that includes a single-use Stripe URL that the platform can redirect their user to in order to take them through the Connect Onboarding flow. """ return cast( AccountLink, self._request( "post", "/v1/account_links", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "AccountLinkService.CreateParams", options: RequestOptions = {}, ) -> AccountLink: """ Creates an AccountLink object that includes a single-use Stripe URL that the platform can redirect their user to in order to take them through the Connect Onboarding flow. """ return cast( AccountLink, await self._request_async( "post", "/v1/account_links", api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_account_login_link_service.py0000644000175100001770000000430714637354563022130 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._login_link import LoginLink from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict class AccountLoginLinkService(StripeService): class CreateParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def create( self, account: str, params: "AccountLoginLinkService.CreateParams" = {}, options: RequestOptions = {}, ) -> LoginLink: """ Creates a single-use login link for a connected account to access the Express Dashboard. You can only create login links for accounts that use the [Express Dashboard](https://stripe.com/connect/express-dashboard) and are connected to your platform. """ return cast( LoginLink, self._request( "post", "/v1/accounts/{account}/login_links".format( account=sanitize_id(account), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, account: str, params: "AccountLoginLinkService.CreateParams" = {}, options: RequestOptions = {}, ) -> LoginLink: """ Creates a single-use login link for a connected account to access the Express Dashboard. You can only create login links for accounts that use the [Express Dashboard](https://stripe.com/connect/express-dashboard) and are connected to your platform. """ return cast( LoginLink, await self._request_async( "post", "/v1/accounts/{account}/login_links".format( account=sanitize_id(account), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_account_person_service.py0000644000175100001770000011355714637354563021321 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._person import Person from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class AccountPersonService(StripeService): class CreateParams(TypedDict): additional_tos_acceptances: NotRequired[ "AccountPersonService.CreateParamsAdditionalTosAcceptances" ] """ Details on the legal guardian's acceptance of the required Stripe agreements. """ address: NotRequired["AccountPersonService.CreateParamsAddress"] """ The person's address. """ address_kana: NotRequired[ "AccountPersonService.CreateParamsAddressKana" ] """ The Kana variation of the person's address (Japan only). """ address_kanji: NotRequired[ "AccountPersonService.CreateParamsAddressKanji" ] """ The Kanji variation of the person's address (Japan only). """ dob: NotRequired["Literal['']|AccountPersonService.CreateParamsDob"] """ The person's date of birth. """ documents: NotRequired["AccountPersonService.CreateParamsDocuments"] """ Documents that may be submitted to satisfy various informational requests. """ email: NotRequired[str] """ The person's email address. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ first_name: NotRequired[str] """ The person's first name. """ first_name_kana: NotRequired[str] """ The Kana variation of the person's first name (Japan only). """ first_name_kanji: NotRequired[str] """ The Kanji variation of the person's first name (Japan only). """ full_name_aliases: NotRequired["Literal['']|List[str]"] """ A list of alternate names or aliases that the person is known by. """ gender: NotRequired[str] """ The person's gender (International regulations require either "male" or "female"). """ id_number: NotRequired[str] """ The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). """ id_number_secondary: NotRequired[str] """ The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). """ last_name: NotRequired[str] """ The person's last name. """ last_name_kana: NotRequired[str] """ The Kana variation of the person's last name (Japan only). """ last_name_kanji: NotRequired[str] """ The Kanji variation of the person's last name (Japan only). """ maiden_name: NotRequired[str] """ The person's maiden name. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ nationality: NotRequired[str] """ The country where the person is a national. Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)), or "XX" if unavailable. """ person_token: NotRequired[str] """ A [person token](https://docs.stripe.com/connect/account-tokens), used to securely provide details to the person. """ phone: NotRequired[str] """ The person's phone number. """ political_exposure: NotRequired[str] """ Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. """ registered_address: NotRequired[ "AccountPersonService.CreateParamsRegisteredAddress" ] """ The person's registered address. """ relationship: NotRequired[ "AccountPersonService.CreateParamsRelationship" ] """ The relationship that this person has with the account's legal entity. """ ssn_last_4: NotRequired[str] """ The last four digits of the person's Social Security number (U.S. only). """ verification: NotRequired[ "AccountPersonService.CreateParamsVerification" ] """ The person's verification status. """ class CreateParamsAdditionalTosAcceptances(TypedDict): account: NotRequired[ "AccountPersonService.CreateParamsAdditionalTosAcceptancesAccount" ] """ Details on the legal guardian's acceptance of the main Stripe service agreement. """ class CreateParamsAdditionalTosAcceptancesAccount(TypedDict): date: NotRequired[int] """ The Unix timestamp marking when the account representative accepted the service agreement. """ ip: NotRequired[str] """ The IP address from which the account representative accepted the service agreement. """ user_agent: NotRequired["Literal['']|str"] """ The user agent of the browser from which the account representative accepted the service agreement. """ class CreateParamsAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsAddressKana(TypedDict): city: NotRequired[str] """ City or ward. """ 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] """ Block or building number. """ line2: NotRequired[str] """ Building details. """ postal_code: NotRequired[str] """ Postal code. """ state: NotRequired[str] """ Prefecture. """ town: NotRequired[str] """ Town or cho-me. """ class CreateParamsAddressKanji(TypedDict): city: NotRequired[str] """ City or ward. """ 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] """ Block or building number. """ line2: NotRequired[str] """ Building details. """ postal_code: NotRequired[str] """ Postal code. """ state: NotRequired[str] """ Prefecture. """ town: NotRequired[str] """ Town or cho-me. """ class CreateParamsDob(TypedDict): day: int """ The day of birth, between 1 and 31. """ month: int """ The month of birth, between 1 and 12. """ year: int """ The four-digit year of birth. """ class CreateParamsDocuments(TypedDict): company_authorization: NotRequired[ "AccountPersonService.CreateParamsDocumentsCompanyAuthorization" ] """ One or more documents that demonstrate proof that this person is authorized to represent the company. """ passport: NotRequired[ "AccountPersonService.CreateParamsDocumentsPassport" ] """ One or more documents showing the person's passport page with photo and personal data. """ visa: NotRequired["AccountPersonService.CreateParamsDocumentsVisa"] """ One or more documents showing the person's visa required for living in the country where they are residing. """ class CreateParamsDocumentsCompanyAuthorization(TypedDict): files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreateParamsDocumentsPassport(TypedDict): files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreateParamsDocumentsVisa(TypedDict): files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreateParamsRegisteredAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsRelationship(TypedDict): director: NotRequired[bool] """ Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. """ executive: NotRequired[bool] """ Whether the person has significant responsibility to control, manage, or direct the organization. """ legal_guardian: NotRequired[bool] """ Whether the person is the legal guardian of the account's representative. """ owner: NotRequired[bool] """ Whether the person is an owner of the account's legal entity. """ percent_ownership: NotRequired["Literal['']|float"] """ The percent owned by the person of the account's legal entity. """ representative: NotRequired[bool] """ Whether the person is authorized as the primary representative of the account. This is the person nominated by the business to provide information about themselves, and general information about the account. There can only be one representative at any given time. At the time the account is created, this person should be set to the person responsible for opening the account. """ title: NotRequired[str] """ The person's title (e.g., CEO, Support Engineer). """ class CreateParamsVerification(TypedDict): additional_document: NotRequired[ "AccountPersonService.CreateParamsVerificationAdditionalDocument" ] """ A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. """ document: NotRequired[ "AccountPersonService.CreateParamsVerificationDocument" ] """ An identifying document, either a passport or local ID card. """ class CreateParamsVerificationAdditionalDocument(TypedDict): back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/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://stripe.com/docs/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 CreateParamsVerificationDocument(TypedDict): back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/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://stripe.com/docs/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 DeleteParams(TypedDict): pass class ListParams(TypedDict): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ relationship: NotRequired[ "AccountPersonService.ListParamsRelationship" ] """ Filters on the list of people returned based on the person's relationship to the account's company. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsRelationship(TypedDict): director: NotRequired[bool] """ A filter on the list of people returned based on whether these people are directors of the account's company. """ executive: NotRequired[bool] """ A filter on the list of people returned based on whether these people are executives of the account's company. """ legal_guardian: NotRequired[bool] """ A filter on the list of people returned based on whether these people are legal guardians of the account's representative. """ owner: NotRequired[bool] """ A filter on the list of people returned based on whether these people are owners of the account's company. """ representative: NotRequired[bool] """ A filter on the list of people returned based on whether these people are the representative of the account's company. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): additional_tos_acceptances: NotRequired[ "AccountPersonService.UpdateParamsAdditionalTosAcceptances" ] """ Details on the legal guardian's acceptance of the required Stripe agreements. """ address: NotRequired["AccountPersonService.UpdateParamsAddress"] """ The person's address. """ address_kana: NotRequired[ "AccountPersonService.UpdateParamsAddressKana" ] """ The Kana variation of the person's address (Japan only). """ address_kanji: NotRequired[ "AccountPersonService.UpdateParamsAddressKanji" ] """ The Kanji variation of the person's address (Japan only). """ dob: NotRequired["Literal['']|AccountPersonService.UpdateParamsDob"] """ The person's date of birth. """ documents: NotRequired["AccountPersonService.UpdateParamsDocuments"] """ Documents that may be submitted to satisfy various informational requests. """ email: NotRequired[str] """ The person's email address. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ first_name: NotRequired[str] """ The person's first name. """ first_name_kana: NotRequired[str] """ The Kana variation of the person's first name (Japan only). """ first_name_kanji: NotRequired[str] """ The Kanji variation of the person's first name (Japan only). """ full_name_aliases: NotRequired["Literal['']|List[str]"] """ A list of alternate names or aliases that the person is known by. """ gender: NotRequired[str] """ The person's gender (International regulations require either "male" or "female"). """ id_number: NotRequired[str] """ The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). """ id_number_secondary: NotRequired[str] """ The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). """ last_name: NotRequired[str] """ The person's last name. """ last_name_kana: NotRequired[str] """ The Kana variation of the person's last name (Japan only). """ last_name_kanji: NotRequired[str] """ The Kanji variation of the person's last name (Japan only). """ maiden_name: NotRequired[str] """ The person's maiden name. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ nationality: NotRequired[str] """ The country where the person is a national. Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)), or "XX" if unavailable. """ person_token: NotRequired[str] """ A [person token](https://docs.stripe.com/connect/account-tokens), used to securely provide details to the person. """ phone: NotRequired[str] """ The person's phone number. """ political_exposure: NotRequired[str] """ Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. """ registered_address: NotRequired[ "AccountPersonService.UpdateParamsRegisteredAddress" ] """ The person's registered address. """ relationship: NotRequired[ "AccountPersonService.UpdateParamsRelationship" ] """ The relationship that this person has with the account's legal entity. """ ssn_last_4: NotRequired[str] """ The last four digits of the person's Social Security number (U.S. only). """ verification: NotRequired[ "AccountPersonService.UpdateParamsVerification" ] """ The person's verification status. """ class UpdateParamsAdditionalTosAcceptances(TypedDict): account: NotRequired[ "AccountPersonService.UpdateParamsAdditionalTosAcceptancesAccount" ] """ Details on the legal guardian's acceptance of the main Stripe service agreement. """ class UpdateParamsAdditionalTosAcceptancesAccount(TypedDict): date: NotRequired[int] """ The Unix timestamp marking when the account representative accepted the service agreement. """ ip: NotRequired[str] """ The IP address from which the account representative accepted the service agreement. """ user_agent: NotRequired["Literal['']|str"] """ The user agent of the browser from which the account representative accepted the service agreement. """ class UpdateParamsAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class UpdateParamsAddressKana(TypedDict): city: NotRequired[str] """ City or ward. """ 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] """ Block or building number. """ line2: NotRequired[str] """ Building details. """ postal_code: NotRequired[str] """ Postal code. """ state: NotRequired[str] """ Prefecture. """ town: NotRequired[str] """ Town or cho-me. """ class UpdateParamsAddressKanji(TypedDict): city: NotRequired[str] """ City or ward. """ 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] """ Block or building number. """ line2: NotRequired[str] """ Building details. """ postal_code: NotRequired[str] """ Postal code. """ state: NotRequired[str] """ Prefecture. """ town: NotRequired[str] """ Town or cho-me. """ class UpdateParamsDob(TypedDict): day: int """ The day of birth, between 1 and 31. """ month: int """ The month of birth, between 1 and 12. """ year: int """ The four-digit year of birth. """ class UpdateParamsDocuments(TypedDict): company_authorization: NotRequired[ "AccountPersonService.UpdateParamsDocumentsCompanyAuthorization" ] """ One or more documents that demonstrate proof that this person is authorized to represent the company. """ passport: NotRequired[ "AccountPersonService.UpdateParamsDocumentsPassport" ] """ One or more documents showing the person's passport page with photo and personal data. """ visa: NotRequired["AccountPersonService.UpdateParamsDocumentsVisa"] """ One or more documents showing the person's visa required for living in the country where they are residing. """ class UpdateParamsDocumentsCompanyAuthorization(TypedDict): files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class UpdateParamsDocumentsPassport(TypedDict): files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class UpdateParamsDocumentsVisa(TypedDict): files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class UpdateParamsRegisteredAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class UpdateParamsRelationship(TypedDict): director: NotRequired[bool] """ Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. """ executive: NotRequired[bool] """ Whether the person has significant responsibility to control, manage, or direct the organization. """ legal_guardian: NotRequired[bool] """ Whether the person is the legal guardian of the account's representative. """ owner: NotRequired[bool] """ Whether the person is an owner of the account's legal entity. """ percent_ownership: NotRequired["Literal['']|float"] """ The percent owned by the person of the account's legal entity. """ representative: NotRequired[bool] """ Whether the person is authorized as the primary representative of the account. This is the person nominated by the business to provide information about themselves, and general information about the account. There can only be one representative at any given time. At the time the account is created, this person should be set to the person responsible for opening the account. """ title: NotRequired[str] """ The person's title (e.g., CEO, Support Engineer). """ class UpdateParamsVerification(TypedDict): additional_document: NotRequired[ "AccountPersonService.UpdateParamsVerificationAdditionalDocument" ] """ A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. """ document: NotRequired[ "AccountPersonService.UpdateParamsVerificationDocument" ] """ An identifying document, either a passport or local ID card. """ class UpdateParamsVerificationAdditionalDocument(TypedDict): back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/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://stripe.com/docs/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 UpdateParamsVerificationDocument(TypedDict): back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/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://stripe.com/docs/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. """ def delete( self, account: str, person: str, params: "AccountPersonService.DeleteParams" = {}, options: RequestOptions = {}, ) -> Person: """ Deletes an existing person's relationship to the account's legal entity. Any person with a relationship for an account can be deleted through the API, except if the person is the account_opener. If your integration is using the executive parameter, you cannot delete the only verified executive on file. """ return cast( Person, self._request( "delete", "/v1/accounts/{account}/persons/{person}".format( account=sanitize_id(account), person=sanitize_id(person), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def delete_async( self, account: str, person: str, params: "AccountPersonService.DeleteParams" = {}, options: RequestOptions = {}, ) -> Person: """ Deletes an existing person's relationship to the account's legal entity. Any person with a relationship for an account can be deleted through the API, except if the person is the account_opener. If your integration is using the executive parameter, you cannot delete the only verified executive on file. """ return cast( Person, await self._request_async( "delete", "/v1/accounts/{account}/persons/{person}".format( account=sanitize_id(account), person=sanitize_id(person), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, account: str, person: str, params: "AccountPersonService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Person: """ Retrieves an existing person. """ return cast( Person, self._request( "get", "/v1/accounts/{account}/persons/{person}".format( account=sanitize_id(account), person=sanitize_id(person), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, account: str, person: str, params: "AccountPersonService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Person: """ Retrieves an existing person. """ return cast( Person, await self._request_async( "get", "/v1/accounts/{account}/persons/{person}".format( account=sanitize_id(account), person=sanitize_id(person), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, account: str, person: str, params: "AccountPersonService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Person: """ Updates an existing person. """ return cast( Person, self._request( "post", "/v1/accounts/{account}/persons/{person}".format( account=sanitize_id(account), person=sanitize_id(person), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, account: str, person: str, params: "AccountPersonService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Person: """ Updates an existing person. """ return cast( Person, await self._request_async( "post", "/v1/accounts/{account}/persons/{person}".format( account=sanitize_id(account), person=sanitize_id(person), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def list( self, account: str, params: "AccountPersonService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Person]: """ Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first. """ return cast( ListObject[Person], self._request( "get", "/v1/accounts/{account}/persons".format( account=sanitize_id(account), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, account: str, params: "AccountPersonService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Person]: """ Returns a list of people associated with the account's legal entity. The people are returned sorted by creation date, with the most recent people appearing first. """ return cast( ListObject[Person], await self._request_async( "get", "/v1/accounts/{account}/persons".format( account=sanitize_id(account), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, account: str, params: "AccountPersonService.CreateParams" = {}, options: RequestOptions = {}, ) -> Person: """ Creates a new person. """ return cast( Person, self._request( "post", "/v1/accounts/{account}/persons".format( account=sanitize_id(account), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, account: str, params: "AccountPersonService.CreateParams" = {}, options: RequestOptions = {}, ) -> Person: """ Creates a new person. """ return cast( Person, await self._request_async( "post", "/v1/accounts/{account}/persons".format( account=sanitize_id(account), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_account_service.py0000644000175100001770000047746414637354563017745 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._account import Account from stripe._account_capability_service import AccountCapabilityService from stripe._account_external_account_service import ( AccountExternalAccountService, ) from stripe._account_login_link_service import AccountLoginLinkService from stripe._account_person_service import AccountPersonService from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class AccountService(StripeService): def __init__(self, requestor): super().__init__(requestor) self.capabilities = AccountCapabilityService(self._requestor) self.external_accounts = AccountExternalAccountService(self._requestor) self.login_links = AccountLoginLinkService(self._requestor) self.persons = AccountPersonService(self._requestor) class CreateParams(TypedDict): account_token: NotRequired[str] """ An [account token](https://stripe.com/docs/api#create_account_token), used to securely provide details to the account. """ business_profile: NotRequired[ "AccountService.CreateParamsBusinessProfile" ] """ Business information about the account. """ business_type: NotRequired[ Literal["company", "government_entity", "individual", "non_profit"] ] """ The business type. Once you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. """ capabilities: NotRequired["AccountService.CreateParamsCapabilities"] """ Each key of the dictionary represents a capability, and each capability maps to its settings (for example, whether it has been requested or not). Each capability is inactive until you have provided its specific requirements and Stripe has verified them. An account might have some of its requested capabilities be active and some be inactive. Required when [account.controller.stripe_dashboard.type](https://stripe.com/api/accounts/create#create_account-controller-dashboard-type) is `none`, which includes Custom accounts. """ company: NotRequired["AccountService.CreateParamsCompany"] """ Information about the company or business. This field is available for any `business_type`. Once you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. """ controller: NotRequired["AccountService.CreateParamsController"] """ A hash of configuration describing the account controller's attributes. """ country: NotRequired[str] """ The country in which the account holder resides, or in which the business is legally established. This should be an ISO 3166-1 alpha-2 country code. For example, if you are in the United States and the business for which you're creating an account is legally represented in Canada, you would use `CA` as the country for the account being created. Available countries include [Stripe's global markets](https://stripe.com/global) as well as countries where [cross-border payouts](https://stripe.com/docs/connect/cross-border-payouts) are supported. """ default_currency: NotRequired[str] """ Three-letter ISO currency code representing the default currency for the account. This must be a currency that [Stripe supports in the account's country](https://docs.stripe.com/payouts). """ documents: NotRequired["AccountService.CreateParamsDocuments"] """ Documents that may be submitted to satisfy various informational requests. """ email: NotRequired[str] """ The email address of the account holder. This is only to make the account easier to identify to you. If [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts, Stripe doesn't email the account without your consent. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ external_account: NotRequired[ "str|AccountService.CreateParamsBankAccount|AccountService.CreateParamsCard|AccountService.CreateParamsCardToken" ] """ A card or bank account to attach to the account for receiving [payouts](https://stripe.com/connect/bank-debit-card-payouts) (you won't be able to use it for top-ups). You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://stripe.com/api#account_create_bank_account) creation. By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/api#account_create_bank_account) or [card creation](https://stripe.com/api#account_create_card) APIs. After you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. """ individual: NotRequired["AccountService.CreateParamsIndividual"] """ Information about the person represented by the account. This field is null unless `business_type` is set to `individual`. Once you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ settings: NotRequired["AccountService.CreateParamsSettings"] """ Options for customizing how the account functions within Stripe. """ tos_acceptance: NotRequired["AccountService.CreateParamsTosAcceptance"] """ Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/connect/updating-accounts#tos-acceptance). This property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. This property defaults to a `full` service agreement when empty. """ type: NotRequired[Literal["custom", "express", "standard"]] """ The type of Stripe account to create. May be one of `custom`, `express` or `standard`. """ class CreateParamsBankAccount(TypedDict): object: Literal["bank_account"] account_holder_name: NotRequired[str] """ The name of the person or business that owns the bank account.This field is required when attaching the bank account to a `Customer` object. """ account_holder_type: NotRequired[Literal["company", "individual"]] """ The type of entity that holds the account. It can be `company` or `individual`. This field is required when attaching the bank account to a `Customer` object. """ account_number: str """ The account number for the bank account, in string form. Must be a checking account. """ country: str """ The country in which the bank account is located. """ currency: NotRequired[str] """ The currency the bank account is in. This must be a country/currency pairing that [Stripe supports.](docs/payouts) """ routing_number: NotRequired[str] """ The routing number, sort code, or other country-appropriateinstitution number for the bank account. For US bank accounts, this is required and should bethe ACH routing number, not the wire routing number. If you are providing an IBAN for`account_number`, this field is not required. """ class CreateParamsBusinessProfile(TypedDict): annual_revenue: NotRequired[ "AccountService.CreateParamsBusinessProfileAnnualRevenue" ] """ The applicant's gross annual revenue for its preceding fiscal year. """ estimated_worker_count: NotRequired[int] """ An estimated upper bound of employees, contractors, vendors, etc. currently working for the business. """ mcc: NotRequired[str] """ [The merchant category code for the account](https://docs.stripe.com/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide. """ monthly_estimated_revenue: NotRequired[ "AccountService.CreateParamsBusinessProfileMonthlyEstimatedRevenue" ] """ An estimate of the monthly revenue of the business. Only accepted for accounts in Brazil and India. """ name: NotRequired[str] """ The customer-facing business name. """ product_description: NotRequired[str] """ Internal-only description of the product sold by, or service provided by, the business. Used by Stripe for risk and underwriting purposes. """ support_address: NotRequired[ "AccountService.CreateParamsBusinessProfileSupportAddress" ] """ A publicly available mailing address for sending support issues to. """ support_email: NotRequired[str] """ A publicly available email address for sending support issues to. """ support_phone: NotRequired[str] """ A publicly available phone number to call with support issues. """ support_url: NotRequired["Literal['']|str"] """ A publicly available website for handling support issues. """ url: NotRequired[str] """ The business's publicly available website. """ class CreateParamsBusinessProfileAnnualRevenue(TypedDict): amount: int """ A non-negative integer representing the amount in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). """ 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). """ fiscal_year_end: str """ The close-out date of the preceding fiscal year in ISO 8601 format. E.g. 2023-12-31 for the 31st of December, 2023. """ class CreateParamsBusinessProfileMonthlyEstimatedRevenue(TypedDict): amount: int """ A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). """ 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). """ class CreateParamsBusinessProfileSupportAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsCapabilities(TypedDict): acss_debit_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesAcssDebitPayments" ] """ The acss_debit_payments capability. """ affirm_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesAffirmPayments" ] """ The affirm_payments capability. """ afterpay_clearpay_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesAfterpayClearpayPayments" ] """ The afterpay_clearpay_payments capability. """ amazon_pay_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesAmazonPayPayments" ] """ The amazon_pay_payments capability. """ au_becs_debit_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesAuBecsDebitPayments" ] """ The au_becs_debit_payments capability. """ bacs_debit_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesBacsDebitPayments" ] """ The bacs_debit_payments capability. """ bancontact_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesBancontactPayments" ] """ The bancontact_payments capability. """ bank_transfer_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesBankTransferPayments" ] """ The bank_transfer_payments capability. """ blik_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesBlikPayments" ] """ The blik_payments capability. """ boleto_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesBoletoPayments" ] """ The boleto_payments capability. """ card_issuing: NotRequired[ "AccountService.CreateParamsCapabilitiesCardIssuing" ] """ The card_issuing capability. """ card_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesCardPayments" ] """ The card_payments capability. """ cartes_bancaires_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesCartesBancairesPayments" ] """ The cartes_bancaires_payments capability. """ cashapp_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesCashappPayments" ] """ The cashapp_payments capability. """ eps_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesEpsPayments" ] """ The eps_payments capability. """ fpx_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesFpxPayments" ] """ The fpx_payments capability. """ gb_bank_transfer_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesGbBankTransferPayments" ] """ The gb_bank_transfer_payments capability. """ giropay_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesGiropayPayments" ] """ The giropay_payments capability. """ grabpay_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesGrabpayPayments" ] """ The grabpay_payments capability. """ ideal_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesIdealPayments" ] """ The ideal_payments capability. """ india_international_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesIndiaInternationalPayments" ] """ The india_international_payments capability. """ jcb_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesJcbPayments" ] """ The jcb_payments capability. """ jp_bank_transfer_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesJpBankTransferPayments" ] """ The jp_bank_transfer_payments capability. """ klarna_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesKlarnaPayments" ] """ The klarna_payments capability. """ konbini_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesKonbiniPayments" ] """ The konbini_payments capability. """ legacy_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesLegacyPayments" ] """ The legacy_payments capability. """ link_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesLinkPayments" ] """ The link_payments capability. """ mobilepay_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesMobilepayPayments" ] """ The mobilepay_payments capability. """ multibanco_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesMultibancoPayments" ] """ The multibanco_payments capability. """ mx_bank_transfer_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesMxBankTransferPayments" ] """ The mx_bank_transfer_payments capability. """ oxxo_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesOxxoPayments" ] """ The oxxo_payments capability. """ p24_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesP24Payments" ] """ The p24_payments capability. """ paynow_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesPaynowPayments" ] """ The paynow_payments capability. """ promptpay_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesPromptpayPayments" ] """ The promptpay_payments capability. """ revolut_pay_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesRevolutPayPayments" ] """ The revolut_pay_payments capability. """ sepa_bank_transfer_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesSepaBankTransferPayments" ] """ The sepa_bank_transfer_payments capability. """ sepa_debit_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesSepaDebitPayments" ] """ The sepa_debit_payments capability. """ sofort_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesSofortPayments" ] """ The sofort_payments capability. """ swish_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesSwishPayments" ] """ The swish_payments capability. """ tax_reporting_us_1099_k: NotRequired[ "AccountService.CreateParamsCapabilitiesTaxReportingUs1099K" ] """ The tax_reporting_us_1099_k capability. """ tax_reporting_us_1099_misc: NotRequired[ "AccountService.CreateParamsCapabilitiesTaxReportingUs1099Misc" ] """ The tax_reporting_us_1099_misc capability. """ transfers: NotRequired[ "AccountService.CreateParamsCapabilitiesTransfers" ] """ The transfers capability. """ treasury: NotRequired[ "AccountService.CreateParamsCapabilitiesTreasury" ] """ The treasury capability. """ twint_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesTwintPayments" ] """ The twint_payments capability. """ us_bank_account_ach_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesUsBankAccountAchPayments" ] """ The us_bank_account_ach_payments capability. """ us_bank_transfer_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesUsBankTransferPayments" ] """ The us_bank_transfer_payments capability. """ zip_payments: NotRequired[ "AccountService.CreateParamsCapabilitiesZipPayments" ] """ The zip_payments capability. """ class CreateParamsCapabilitiesAcssDebitPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesAffirmPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesAfterpayClearpayPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesAmazonPayPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesAuBecsDebitPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesBacsDebitPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesBancontactPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesBankTransferPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesBlikPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesBoletoPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesCardIssuing(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesCardPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesCartesBancairesPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesCashappPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesEpsPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesFpxPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesGbBankTransferPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesGiropayPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesGrabpayPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesIdealPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesIndiaInternationalPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesJcbPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesJpBankTransferPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesKlarnaPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesKonbiniPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesLegacyPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesLinkPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesMobilepayPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesMultibancoPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesMxBankTransferPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesOxxoPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesP24Payments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesPaynowPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesPromptpayPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesRevolutPayPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesSepaBankTransferPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesSepaDebitPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesSofortPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesSwishPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesTaxReportingUs1099K(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesTaxReportingUs1099Misc(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesTransfers(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesTreasury(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesTwintPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesUsBankAccountAchPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesUsBankTransferPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCapabilitiesZipPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class CreateParamsCard(TypedDict): object: Literal["card"] address_city: NotRequired[str] address_country: NotRequired[str] address_line1: NotRequired[str] address_line2: NotRequired[str] address_state: NotRequired[str] address_zip: NotRequired[str] currency: NotRequired[str] cvc: NotRequired[str] exp_month: int exp_year: int name: NotRequired[str] number: str metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ default_for_currency: NotRequired[bool] class CreateParamsCardToken(TypedDict): object: Literal["card"] currency: NotRequired[str] token: str class CreateParamsCompany(TypedDict): address: NotRequired["AccountService.CreateParamsCompanyAddress"] """ The company's primary address. """ address_kana: NotRequired[ "AccountService.CreateParamsCompanyAddressKana" ] """ The Kana variation of the company's primary address (Japan only). """ address_kanji: NotRequired[ "AccountService.CreateParamsCompanyAddressKanji" ] """ The Kanji variation of the company's primary address (Japan only). """ directors_provided: NotRequired[bool] """ Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. """ executives_provided: NotRequired[bool] """ Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.executive` requirement. """ export_license_id: NotRequired[str] """ The export license ID number of the company, also referred as Import Export Code (India only). """ export_purpose_code: NotRequired[str] """ The purpose code to use for export transactions (India only). """ name: NotRequired[str] """ The company's legal name. """ name_kana: NotRequired[str] """ The Kana variation of the company's legal name (Japan only). """ name_kanji: NotRequired[str] """ The Kanji variation of the company's legal name (Japan only). """ owners_provided: NotRequired[bool] """ Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.owner` requirement. """ ownership_declaration: NotRequired[ "AccountService.CreateParamsCompanyOwnershipDeclaration" ] """ This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. """ phone: NotRequired[str] """ The company's phone number (used for verification). """ registration_number: NotRequired[str] """ The identification number given to a company when it is registered or incorporated, if distinct from the identification number used for filing taxes. (Examples are the CIN for companies and LLP IN for partnerships in India, and the Company Registration Number in Hong Kong). """ structure: NotRequired[ "Literal['']|Literal['free_zone_establishment', 'free_zone_llc', 'government_instrumentality', 'governmental_unit', 'incorporated_non_profit', 'incorporated_partnership', 'limited_liability_partnership', 'llc', 'multi_member_llc', 'private_company', 'private_corporation', 'private_partnership', 'public_company', 'public_corporation', 'public_partnership', 'registered_charity', 'single_member_llc', 'sole_establishment', 'sole_proprietorship', 'tax_exempt_government_instrumentality', 'unincorporated_association', 'unincorporated_non_profit', 'unincorporated_partnership']" ] """ The category identifying the legal structure of the company or legal entity. See [Business structure](https://docs.stripe.com/connect/identity-verification#business-structure) for more details. Pass an empty string to unset this value. """ tax_id: NotRequired[str] """ The business ID number of the company, as appropriate for the company's country. (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.) """ tax_id_registrar: NotRequired[str] """ The jurisdiction in which the `tax_id` is registered (Germany-based companies only). """ vat_id: NotRequired[str] """ The VAT number of the company. """ verification: NotRequired[ "AccountService.CreateParamsCompanyVerification" ] """ Information on the verification state of the company. """ class CreateParamsCompanyAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsCompanyAddressKana(TypedDict): city: NotRequired[str] """ City or ward. """ 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] """ Block or building number. """ line2: NotRequired[str] """ Building details. """ postal_code: NotRequired[str] """ Postal code. """ state: NotRequired[str] """ Prefecture. """ town: NotRequired[str] """ Town or cho-me. """ class CreateParamsCompanyAddressKanji(TypedDict): city: NotRequired[str] """ City or ward. """ 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] """ Block or building number. """ line2: NotRequired[str] """ Building details. """ postal_code: NotRequired[str] """ Postal code. """ state: NotRequired[str] """ Prefecture. """ town: NotRequired[str] """ Town or cho-me. """ class CreateParamsCompanyOwnershipDeclaration(TypedDict): date: NotRequired[int] """ The Unix timestamp marking when the beneficial owner attestation was made. """ ip: NotRequired[str] """ The IP address from which the beneficial owner attestation was made. """ user_agent: NotRequired[str] """ The user agent of the browser from which the beneficial owner attestation was made. """ class CreateParamsCompanyVerification(TypedDict): document: NotRequired[ "AccountService.CreateParamsCompanyVerificationDocument" ] """ A document verifying the business. """ class CreateParamsCompanyVerificationDocument(TypedDict): back: NotRequired[str] """ The back of a document returned by a [file upload](https://stripe.com/docs/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://stripe.com/docs/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. """ class CreateParamsController(TypedDict): fees: NotRequired["AccountService.CreateParamsControllerFees"] """ A hash of configuration for who pays Stripe fees for product usage on this account. """ losses: NotRequired["AccountService.CreateParamsControllerLosses"] """ A hash of configuration for products that have negative balance liability, and whether Stripe or a Connect application is responsible for them. """ requirement_collection: NotRequired[Literal["application", "stripe"]] """ A value indicating responsibility for collecting updated information when requirements on the account are due or change. Defaults to `stripe`. """ stripe_dashboard: NotRequired[ "AccountService.CreateParamsControllerStripeDashboard" ] """ A hash of configuration for Stripe-hosted dashboards. """ class CreateParamsControllerFees(TypedDict): payer: NotRequired[Literal["account", "application"]] """ A value indicating the responsible payer of Stripe fees on this account. Defaults to `account`. Learn more about [fee behavior on connected accounts](https://docs.stripe.com/connect/direct-charges-fee-payer-behavior). """ class CreateParamsControllerLosses(TypedDict): payments: NotRequired[Literal["application", "stripe"]] """ A value indicating who is liable when this account can't pay back negative balances resulting from payments. Defaults to `stripe`. """ class CreateParamsControllerStripeDashboard(TypedDict): type: NotRequired[Literal["express", "full", "none"]] """ Whether this account should have access to the full Stripe Dashboard (`full`), to the Express Dashboard (`express`), or to no Stripe-hosted dashboard (`none`). Defaults to `full`. """ class CreateParamsDocuments(TypedDict): bank_account_ownership_verification: NotRequired[ "AccountService.CreateParamsDocumentsBankAccountOwnershipVerification" ] """ One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. Must be a document associated with the account's primary active bank account that displays the last 4 digits of the account number, either a statement or a voided check. """ company_license: NotRequired[ "AccountService.CreateParamsDocumentsCompanyLicense" ] """ One or more documents that demonstrate proof of a company's license to operate. """ company_memorandum_of_association: NotRequired[ "AccountService.CreateParamsDocumentsCompanyMemorandumOfAssociation" ] """ One or more documents showing the company's Memorandum of Association. """ company_ministerial_decree: NotRequired[ "AccountService.CreateParamsDocumentsCompanyMinisterialDecree" ] """ (Certain countries only) One or more documents showing the ministerial decree legalizing the company's establishment. """ company_registration_verification: NotRequired[ "AccountService.CreateParamsDocumentsCompanyRegistrationVerification" ] """ One or more documents that demonstrate proof of a company's registration with the appropriate local authorities. """ company_tax_id_verification: NotRequired[ "AccountService.CreateParamsDocumentsCompanyTaxIdVerification" ] """ One or more documents that demonstrate proof of a company's tax ID. """ proof_of_registration: NotRequired[ "AccountService.CreateParamsDocumentsProofOfRegistration" ] """ One or more documents showing the company's proof of registration with the national business registry. """ class CreateParamsDocumentsBankAccountOwnershipVerification(TypedDict): files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreateParamsDocumentsCompanyLicense(TypedDict): files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreateParamsDocumentsCompanyMemorandumOfAssociation(TypedDict): files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreateParamsDocumentsCompanyMinisterialDecree(TypedDict): files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreateParamsDocumentsCompanyRegistrationVerification(TypedDict): files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreateParamsDocumentsCompanyTaxIdVerification(TypedDict): files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreateParamsDocumentsProofOfRegistration(TypedDict): files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreateParamsIndividual(TypedDict): address: NotRequired["AccountService.CreateParamsIndividualAddress"] """ The individual's primary address. """ address_kana: NotRequired[ "AccountService.CreateParamsIndividualAddressKana" ] """ The Kana variation of the individual's primary address (Japan only). """ address_kanji: NotRequired[ "AccountService.CreateParamsIndividualAddressKanji" ] """ The Kanji variation of the individual's primary address (Japan only). """ dob: NotRequired[ "Literal['']|AccountService.CreateParamsIndividualDob" ] """ The individual's date of birth. """ email: NotRequired[str] """ The individual's email address. """ first_name: NotRequired[str] """ The individual's first name. """ first_name_kana: NotRequired[str] """ The Kana variation of the individual's first name (Japan only). """ first_name_kanji: NotRequired[str] """ The Kanji variation of the individual's first name (Japan only). """ full_name_aliases: NotRequired["Literal['']|List[str]"] """ A list of alternate names or aliases that the individual is known by. """ gender: NotRequired[str] """ The individual's gender (International regulations require either "male" or "female"). """ id_number: NotRequired[str] """ The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). """ id_number_secondary: NotRequired[str] """ The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). """ last_name: NotRequired[str] """ The individual's last name. """ last_name_kana: NotRequired[str] """ The Kana variation of the individual's last name (Japan only). """ last_name_kanji: NotRequired[str] """ The Kanji variation of the individual's last name (Japan only). """ maiden_name: NotRequired[str] """ The individual's maiden name. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ phone: NotRequired[str] """ The individual's phone number. """ political_exposure: NotRequired[Literal["existing", "none"]] """ Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. """ registered_address: NotRequired[ "AccountService.CreateParamsIndividualRegisteredAddress" ] """ The individual's registered address. """ relationship: NotRequired[ "AccountService.CreateParamsIndividualRelationship" ] """ Describes the person's relationship to the account. """ ssn_last_4: NotRequired[str] """ The last four digits of the individual's Social Security Number (U.S. only). """ verification: NotRequired[ "AccountService.CreateParamsIndividualVerification" ] """ The individual's verification document information. """ class CreateParamsIndividualAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsIndividualAddressKana(TypedDict): city: NotRequired[str] """ City or ward. """ 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] """ Block or building number. """ line2: NotRequired[str] """ Building details. """ postal_code: NotRequired[str] """ Postal code. """ state: NotRequired[str] """ Prefecture. """ town: NotRequired[str] """ Town or cho-me. """ class CreateParamsIndividualAddressKanji(TypedDict): city: NotRequired[str] """ City or ward. """ 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] """ Block or building number. """ line2: NotRequired[str] """ Building details. """ postal_code: NotRequired[str] """ Postal code. """ state: NotRequired[str] """ Prefecture. """ town: NotRequired[str] """ Town or cho-me. """ class CreateParamsIndividualDob(TypedDict): day: int """ The day of birth, between 1 and 31. """ month: int """ The month of birth, between 1 and 12. """ year: int """ The four-digit year of birth. """ class CreateParamsIndividualRegisteredAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsIndividualRelationship(TypedDict): director: NotRequired[bool] """ Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. """ executive: NotRequired[bool] """ Whether the person has significant responsibility to control, manage, or direct the organization. """ owner: NotRequired[bool] """ Whether the person is an owner of the account's legal entity. """ percent_ownership: NotRequired["Literal['']|float"] """ The percent owned by the person of the account's legal entity. """ title: NotRequired[str] """ The person's title (e.g., CEO, Support Engineer). """ class CreateParamsIndividualVerification(TypedDict): additional_document: NotRequired[ "AccountService.CreateParamsIndividualVerificationAdditionalDocument" ] """ A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. """ document: NotRequired[ "AccountService.CreateParamsIndividualVerificationDocument" ] """ An identifying document, either a passport or local ID card. """ class CreateParamsIndividualVerificationAdditionalDocument(TypedDict): back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/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://stripe.com/docs/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 CreateParamsIndividualVerificationDocument(TypedDict): back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/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://stripe.com/docs/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 CreateParamsSettings(TypedDict): bacs_debit_payments: NotRequired[ "AccountService.CreateParamsSettingsBacsDebitPayments" ] """ Settings specific to Bacs Direct Debit. """ branding: NotRequired["AccountService.CreateParamsSettingsBranding"] """ Settings used to apply the account's branding to email receipts, invoices, Checkout, and other products. """ card_issuing: NotRequired[ "AccountService.CreateParamsSettingsCardIssuing" ] """ Settings specific to the account's use of the Card Issuing product. """ card_payments: NotRequired[ "AccountService.CreateParamsSettingsCardPayments" ] """ Settings specific to card charging on the account. """ payments: NotRequired["AccountService.CreateParamsSettingsPayments"] """ Settings that apply across payment methods for charging on the account. """ payouts: NotRequired["AccountService.CreateParamsSettingsPayouts"] """ Settings specific to the account's payouts. """ treasury: NotRequired["AccountService.CreateParamsSettingsTreasury"] """ Settings specific to the account's Treasury FinancialAccounts. """ class CreateParamsSettingsBacsDebitPayments(TypedDict): display_name: NotRequired[str] """ The Bacs Direct Debit Display Name for this account. For payments made with Bacs Direct Debit, this name appears on the mandate as the statement descriptor. Mobile banking apps display it as the name of the business. To use custom branding, set the Bacs Direct Debit Display Name during or right after creation. Custom branding incurs an additional monthly fee for the platform. If you don't set the display name before requesting Bacs capability, it's automatically set as "Stripe" and the account is onboarded to Stripe branding, which is free. """ class CreateParamsSettingsBranding(TypedDict): icon: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) An icon for the account. Must be square and at least 128px x 128px. """ logo: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A logo for the account that will be used in Checkout instead of the icon and without the account's name next to it if provided. Must be at least 128px x 128px. """ primary_color: NotRequired[str] """ A CSS hex color value representing the primary branding color for this account. """ secondary_color: NotRequired[str] """ A CSS hex color value representing the secondary branding color for this account. """ class CreateParamsSettingsCardIssuing(TypedDict): tos_acceptance: NotRequired[ "AccountService.CreateParamsSettingsCardIssuingTosAcceptance" ] """ Details on the account's acceptance of the [Stripe Issuing Terms and Disclosures](https://docs.stripe.com/issuing/connect/tos_acceptance). """ class CreateParamsSettingsCardIssuingTosAcceptance(TypedDict): date: NotRequired[int] """ The Unix timestamp marking when the account representative accepted the service agreement. """ ip: NotRequired[str] """ The IP address from which the account representative accepted the service agreement. """ user_agent: NotRequired["Literal['']|str"] """ The user agent of the browser from which the account representative accepted the service agreement. """ class CreateParamsSettingsCardPayments(TypedDict): decline_on: NotRequired[ "AccountService.CreateParamsSettingsCardPaymentsDeclineOn" ] """ Automatically declines certain charge types regardless of whether the card issuer accepted or declined the charge. """ statement_descriptor_prefix: NotRequired[str] """ The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. `statement_descriptor_prefix` is useful for maximizing descriptor space for the dynamic portion. """ statement_descriptor_prefix_kana: NotRequired["Literal['']|str"] """ The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kana` specified on the charge. `statement_descriptor_prefix_kana` is useful for maximizing descriptor space for the dynamic portion. """ statement_descriptor_prefix_kanji: NotRequired["Literal['']|str"] """ The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kanji` specified on the charge. `statement_descriptor_prefix_kanji` is useful for maximizing descriptor space for the dynamic portion. """ class CreateParamsSettingsCardPaymentsDeclineOn(TypedDict): avs_failure: NotRequired[bool] """ Whether Stripe automatically declines charges with an incorrect ZIP or postal code. This setting only applies when a ZIP or postal code is provided and they fail bank verification. """ cvc_failure: NotRequired[bool] """ Whether Stripe automatically declines charges with an incorrect CVC. This setting only applies when a CVC is provided and it fails bank verification. """ class CreateParamsSettingsPayments(TypedDict): statement_descriptor: NotRequired[str] """ The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. """ statement_descriptor_kana: NotRequired[str] """ The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). """ statement_descriptor_kanji: NotRequired[str] """ The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). """ class CreateParamsSettingsPayouts(TypedDict): debit_negative_balances: NotRequired[bool] """ A Boolean indicating whether Stripe should try to reclaim negative balances from an attached bank account. For details, see [Understanding Connect Account Balances](https://docs.stripe.com/connect/account-balances). """ schedule: NotRequired[ "AccountService.CreateParamsSettingsPayoutsSchedule" ] """ Details on when funds from charges are available, and when they are paid out to an external account. For details, see our [Setting Bank and Debit Card Payouts](https://docs.stripe.com/connect/bank-transfers#payout-information) documentation. """ statement_descriptor: NotRequired[str] """ The text that appears on the bank account statement for payouts. If not set, this defaults to the platform's bank descriptor as set in the Dashboard. """ class CreateParamsSettingsPayoutsSchedule(TypedDict): delay_days: NotRequired["Literal['minimum']|int"] """ The number of days charge funds are held before being paid out. May also be set to `minimum`, representing the lowest available value for the account country. Default is `minimum`. The `delay_days` parameter remains at the last configured value if `interval` is `manual`. [Learn more about controlling payout delay days](https://docs.stripe.com/connect/manage-payout-schedule). """ interval: NotRequired[Literal["daily", "manual", "monthly", "weekly"]] """ How frequently available funds are paid out. One of: `daily`, `manual`, `weekly`, or `monthly`. Default is `daily`. """ monthly_anchor: NotRequired[int] """ The day of the month when available funds are paid out, specified as a number between 1--31. Payouts nominally scheduled between the 29th and 31st of the month are instead sent on the last day of a shorter month. Required and applicable only if `interval` is `monthly`. """ weekly_anchor: NotRequired[ Literal[ "friday", "monday", "saturday", "sunday", "thursday", "tuesday", "wednesday", ] ] """ The day of the week when available funds are paid out, specified as `monday`, `tuesday`, etc. (required and applicable only if `interval` is `weekly`.) """ class CreateParamsSettingsTreasury(TypedDict): tos_acceptance: NotRequired[ "AccountService.CreateParamsSettingsTreasuryTosAcceptance" ] """ Details on the account's acceptance of the Stripe Treasury Services Agreement. """ class CreateParamsSettingsTreasuryTosAcceptance(TypedDict): date: NotRequired[int] """ The Unix timestamp marking when the account representative accepted the service agreement. """ ip: NotRequired[str] """ The IP address from which the account representative accepted the service agreement. """ user_agent: NotRequired["Literal['']|str"] """ The user agent of the browser from which the account representative accepted the service agreement. """ class CreateParamsTosAcceptance(TypedDict): date: NotRequired[int] """ The Unix timestamp marking when the account representative accepted their service agreement. """ ip: NotRequired[str] """ The IP address from which the account representative accepted their service agreement. """ service_agreement: NotRequired[str] """ The user's service agreement type. """ user_agent: NotRequired[str] """ The user agent of the browser from which the account representative accepted their service agreement. """ class DeleteParams(TypedDict): pass class ListParams(TypedDict): created: NotRequired["AccountService.ListParamsCreated|int"] """ Only return connected accounts that were created during the given date interval. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RejectParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ reason: str """ The reason for rejecting the account. Can be `fraud`, `terms_of_service`, or `other`. """ class RetrieveCurrentParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): account_token: NotRequired[str] """ An [account token](https://stripe.com/docs/api#create_account_token), used to securely provide details to the account. """ business_profile: NotRequired[ "AccountService.UpdateParamsBusinessProfile" ] """ Business information about the account. """ business_type: NotRequired[ Literal["company", "government_entity", "individual", "non_profit"] ] """ The business type. Once you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. """ capabilities: NotRequired["AccountService.UpdateParamsCapabilities"] """ Each key of the dictionary represents a capability, and each capability maps to its settings (for example, whether it has been requested or not). Each capability is inactive until you have provided its specific requirements and Stripe has verified them. An account might have some of its requested capabilities be active and some be inactive. Required when [account.controller.stripe_dashboard.type](https://stripe.com/api/accounts/create#create_account-controller-dashboard-type) is `none`, which includes Custom accounts. """ company: NotRequired["AccountService.UpdateParamsCompany"] """ Information about the company or business. This field is available for any `business_type`. Once you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. """ default_currency: NotRequired[str] """ Three-letter ISO currency code representing the default currency for the account. This must be a currency that [Stripe supports in the account's country](https://docs.stripe.com/payouts). """ documents: NotRequired["AccountService.UpdateParamsDocuments"] """ Documents that may be submitted to satisfy various informational requests. """ email: NotRequired[str] """ The email address of the account holder. This is only to make the account easier to identify to you. If [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts, Stripe doesn't email the account without your consent. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ external_account: NotRequired[ "Literal['']|str|AccountService.UpdateParamsBankAccount|AccountService.UpdateParamsCard|AccountService.UpdateParamsCardToken" ] """ A card or bank account to attach to the account for receiving [payouts](https://stripe.com/connect/bank-debit-card-payouts) (you won't be able to use it for top-ups). You can provide either a token, like the ones returned by [Stripe.js](https://stripe.com/js), or a dictionary, as documented in the `external_account` parameter for [bank account](https://stripe.com/api#account_create_bank_account) creation. By default, providing an external account sets it as the new default external account for its currency, and deletes the old default if one exists. To add additional external accounts without replacing the existing default for the currency, use the [bank account](https://stripe.com/api#account_create_bank_account) or [card creation](https://stripe.com/api#account_create_card) APIs. After you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. """ individual: NotRequired["AccountService.UpdateParamsIndividual"] """ Information about the person represented by the account. This field is null unless `business_type` is set to `individual`. Once you create an [Account Link](https://stripe.com/api/account_links) or [Account Session](https://stripe.com/api/account_sessions), this property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ settings: NotRequired["AccountService.UpdateParamsSettings"] """ Options for customizing how the account functions within Stripe. """ tos_acceptance: NotRequired["AccountService.UpdateParamsTosAcceptance"] """ Details on the account's acceptance of the [Stripe Services Agreement](https://stripe.com/connect/updating-accounts#tos-acceptance). This property can only be updated for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. This property defaults to a `full` service agreement when empty. """ class UpdateParamsBankAccount(TypedDict): object: Literal["bank_account"] account_holder_name: NotRequired[str] """ The name of the person or business that owns the bank account.This field is required when attaching the bank account to a `Customer` object. """ account_holder_type: NotRequired[Literal["company", "individual"]] """ The type of entity that holds the account. It can be `company` or `individual`. This field is required when attaching the bank account to a `Customer` object. """ account_number: str """ The account number for the bank account, in string form. Must be a checking account. """ country: str """ The country in which the bank account is located. """ currency: NotRequired[str] """ The currency the bank account is in. This must be a country/currency pairing that [Stripe supports.](docs/payouts) """ routing_number: NotRequired[str] """ The routing number, sort code, or other country-appropriateinstitution number for the bank account. For US bank accounts, this is required and should bethe ACH routing number, not the wire routing number. If you are providing an IBAN for`account_number`, this field is not required. """ class UpdateParamsBusinessProfile(TypedDict): annual_revenue: NotRequired[ "AccountService.UpdateParamsBusinessProfileAnnualRevenue" ] """ The applicant's gross annual revenue for its preceding fiscal year. """ estimated_worker_count: NotRequired[int] """ An estimated upper bound of employees, contractors, vendors, etc. currently working for the business. """ mcc: NotRequired[str] """ [The merchant category code for the account](https://docs.stripe.com/connect/setting-mcc). MCCs are used to classify businesses based on the goods or services they provide. """ monthly_estimated_revenue: NotRequired[ "AccountService.UpdateParamsBusinessProfileMonthlyEstimatedRevenue" ] """ An estimate of the monthly revenue of the business. Only accepted for accounts in Brazil and India. """ name: NotRequired[str] """ The customer-facing business name. """ product_description: NotRequired[str] """ Internal-only description of the product sold by, or service provided by, the business. Used by Stripe for risk and underwriting purposes. """ support_address: NotRequired[ "AccountService.UpdateParamsBusinessProfileSupportAddress" ] """ A publicly available mailing address for sending support issues to. """ support_email: NotRequired[str] """ A publicly available email address for sending support issues to. """ support_phone: NotRequired[str] """ A publicly available phone number to call with support issues. """ support_url: NotRequired["Literal['']|str"] """ A publicly available website for handling support issues. """ url: NotRequired[str] """ The business's publicly available website. """ class UpdateParamsBusinessProfileAnnualRevenue(TypedDict): amount: int """ A non-negative integer representing the amount in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). """ 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). """ fiscal_year_end: str """ The close-out date of the preceding fiscal year in ISO 8601 format. E.g. 2023-12-31 for the 31st of December, 2023. """ class UpdateParamsBusinessProfileMonthlyEstimatedRevenue(TypedDict): amount: int """ A non-negative integer representing how much to charge in the [smallest currency unit](https://docs.stripe.com/currencies#zero-decimal). """ 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). """ class UpdateParamsBusinessProfileSupportAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class UpdateParamsCapabilities(TypedDict): acss_debit_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesAcssDebitPayments" ] """ The acss_debit_payments capability. """ affirm_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesAffirmPayments" ] """ The affirm_payments capability. """ afterpay_clearpay_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesAfterpayClearpayPayments" ] """ The afterpay_clearpay_payments capability. """ amazon_pay_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesAmazonPayPayments" ] """ The amazon_pay_payments capability. """ au_becs_debit_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesAuBecsDebitPayments" ] """ The au_becs_debit_payments capability. """ bacs_debit_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesBacsDebitPayments" ] """ The bacs_debit_payments capability. """ bancontact_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesBancontactPayments" ] """ The bancontact_payments capability. """ bank_transfer_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesBankTransferPayments" ] """ The bank_transfer_payments capability. """ blik_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesBlikPayments" ] """ The blik_payments capability. """ boleto_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesBoletoPayments" ] """ The boleto_payments capability. """ card_issuing: NotRequired[ "AccountService.UpdateParamsCapabilitiesCardIssuing" ] """ The card_issuing capability. """ card_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesCardPayments" ] """ The card_payments capability. """ cartes_bancaires_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesCartesBancairesPayments" ] """ The cartes_bancaires_payments capability. """ cashapp_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesCashappPayments" ] """ The cashapp_payments capability. """ eps_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesEpsPayments" ] """ The eps_payments capability. """ fpx_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesFpxPayments" ] """ The fpx_payments capability. """ gb_bank_transfer_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesGbBankTransferPayments" ] """ The gb_bank_transfer_payments capability. """ giropay_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesGiropayPayments" ] """ The giropay_payments capability. """ grabpay_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesGrabpayPayments" ] """ The grabpay_payments capability. """ ideal_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesIdealPayments" ] """ The ideal_payments capability. """ india_international_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesIndiaInternationalPayments" ] """ The india_international_payments capability. """ jcb_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesJcbPayments" ] """ The jcb_payments capability. """ jp_bank_transfer_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesJpBankTransferPayments" ] """ The jp_bank_transfer_payments capability. """ klarna_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesKlarnaPayments" ] """ The klarna_payments capability. """ konbini_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesKonbiniPayments" ] """ The konbini_payments capability. """ legacy_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesLegacyPayments" ] """ The legacy_payments capability. """ link_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesLinkPayments" ] """ The link_payments capability. """ mobilepay_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesMobilepayPayments" ] """ The mobilepay_payments capability. """ multibanco_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesMultibancoPayments" ] """ The multibanco_payments capability. """ mx_bank_transfer_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesMxBankTransferPayments" ] """ The mx_bank_transfer_payments capability. """ oxxo_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesOxxoPayments" ] """ The oxxo_payments capability. """ p24_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesP24Payments" ] """ The p24_payments capability. """ paynow_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesPaynowPayments" ] """ The paynow_payments capability. """ promptpay_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesPromptpayPayments" ] """ The promptpay_payments capability. """ revolut_pay_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesRevolutPayPayments" ] """ The revolut_pay_payments capability. """ sepa_bank_transfer_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesSepaBankTransferPayments" ] """ The sepa_bank_transfer_payments capability. """ sepa_debit_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesSepaDebitPayments" ] """ The sepa_debit_payments capability. """ sofort_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesSofortPayments" ] """ The sofort_payments capability. """ swish_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesSwishPayments" ] """ The swish_payments capability. """ tax_reporting_us_1099_k: NotRequired[ "AccountService.UpdateParamsCapabilitiesTaxReportingUs1099K" ] """ The tax_reporting_us_1099_k capability. """ tax_reporting_us_1099_misc: NotRequired[ "AccountService.UpdateParamsCapabilitiesTaxReportingUs1099Misc" ] """ The tax_reporting_us_1099_misc capability. """ transfers: NotRequired[ "AccountService.UpdateParamsCapabilitiesTransfers" ] """ The transfers capability. """ treasury: NotRequired[ "AccountService.UpdateParamsCapabilitiesTreasury" ] """ The treasury capability. """ twint_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesTwintPayments" ] """ The twint_payments capability. """ us_bank_account_ach_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesUsBankAccountAchPayments" ] """ The us_bank_account_ach_payments capability. """ us_bank_transfer_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesUsBankTransferPayments" ] """ The us_bank_transfer_payments capability. """ zip_payments: NotRequired[ "AccountService.UpdateParamsCapabilitiesZipPayments" ] """ The zip_payments capability. """ class UpdateParamsCapabilitiesAcssDebitPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesAffirmPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesAfterpayClearpayPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesAmazonPayPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesAuBecsDebitPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesBacsDebitPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesBancontactPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesBankTransferPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesBlikPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesBoletoPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesCardIssuing(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesCardPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesCartesBancairesPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesCashappPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesEpsPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesFpxPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesGbBankTransferPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesGiropayPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesGrabpayPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesIdealPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesIndiaInternationalPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesJcbPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesJpBankTransferPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesKlarnaPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesKonbiniPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesLegacyPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesLinkPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesMobilepayPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesMultibancoPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesMxBankTransferPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesOxxoPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesP24Payments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesPaynowPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesPromptpayPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesRevolutPayPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesSepaBankTransferPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesSepaDebitPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesSofortPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesSwishPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesTaxReportingUs1099K(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesTaxReportingUs1099Misc(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesTransfers(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesTreasury(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesTwintPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesUsBankAccountAchPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesUsBankTransferPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCapabilitiesZipPayments(TypedDict): requested: NotRequired[bool] """ Passing true requests the capability for the account, if it is not already requested. A requested capability may not immediately become active. Any requirements to activate the capability are returned in the `requirements` arrays. """ class UpdateParamsCard(TypedDict): object: Literal["card"] address_city: NotRequired[str] address_country: NotRequired[str] address_line1: NotRequired[str] address_line2: NotRequired[str] address_state: NotRequired[str] address_zip: NotRequired[str] currency: NotRequired[str] cvc: NotRequired[str] exp_month: int exp_year: int name: NotRequired[str] number: str metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ default_for_currency: NotRequired[bool] class UpdateParamsCardToken(TypedDict): object: Literal["card"] currency: NotRequired[str] token: str class UpdateParamsCompany(TypedDict): address: NotRequired["AccountService.UpdateParamsCompanyAddress"] """ The company's primary address. """ address_kana: NotRequired[ "AccountService.UpdateParamsCompanyAddressKana" ] """ The Kana variation of the company's primary address (Japan only). """ address_kanji: NotRequired[ "AccountService.UpdateParamsCompanyAddressKanji" ] """ The Kanji variation of the company's primary address (Japan only). """ directors_provided: NotRequired[bool] """ Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. """ executives_provided: NotRequired[bool] """ Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.executive` requirement. """ export_license_id: NotRequired[str] """ The export license ID number of the company, also referred as Import Export Code (India only). """ export_purpose_code: NotRequired[str] """ The purpose code to use for export transactions (India only). """ name: NotRequired[str] """ The company's legal name. """ name_kana: NotRequired[str] """ The Kana variation of the company's legal name (Japan only). """ name_kanji: NotRequired[str] """ The Kanji variation of the company's legal name (Japan only). """ owners_provided: NotRequired[bool] """ Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.owner` requirement. """ ownership_declaration: NotRequired[ "AccountService.UpdateParamsCompanyOwnershipDeclaration" ] """ This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. """ phone: NotRequired[str] """ The company's phone number (used for verification). """ registration_number: NotRequired[str] """ The identification number given to a company when it is registered or incorporated, if distinct from the identification number used for filing taxes. (Examples are the CIN for companies and LLP IN for partnerships in India, and the Company Registration Number in Hong Kong). """ structure: NotRequired[ "Literal['']|Literal['free_zone_establishment', 'free_zone_llc', 'government_instrumentality', 'governmental_unit', 'incorporated_non_profit', 'incorporated_partnership', 'limited_liability_partnership', 'llc', 'multi_member_llc', 'private_company', 'private_corporation', 'private_partnership', 'public_company', 'public_corporation', 'public_partnership', 'registered_charity', 'single_member_llc', 'sole_establishment', 'sole_proprietorship', 'tax_exempt_government_instrumentality', 'unincorporated_association', 'unincorporated_non_profit', 'unincorporated_partnership']" ] """ The category identifying the legal structure of the company or legal entity. See [Business structure](https://docs.stripe.com/connect/identity-verification#business-structure) for more details. Pass an empty string to unset this value. """ tax_id: NotRequired[str] """ The business ID number of the company, as appropriate for the company's country. (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.) """ tax_id_registrar: NotRequired[str] """ The jurisdiction in which the `tax_id` is registered (Germany-based companies only). """ vat_id: NotRequired[str] """ The VAT number of the company. """ verification: NotRequired[ "AccountService.UpdateParamsCompanyVerification" ] """ Information on the verification state of the company. """ class UpdateParamsCompanyAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class UpdateParamsCompanyAddressKana(TypedDict): city: NotRequired[str] """ City or ward. """ 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] """ Block or building number. """ line2: NotRequired[str] """ Building details. """ postal_code: NotRequired[str] """ Postal code. """ state: NotRequired[str] """ Prefecture. """ town: NotRequired[str] """ Town or cho-me. """ class UpdateParamsCompanyAddressKanji(TypedDict): city: NotRequired[str] """ City or ward. """ 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] """ Block or building number. """ line2: NotRequired[str] """ Building details. """ postal_code: NotRequired[str] """ Postal code. """ state: NotRequired[str] """ Prefecture. """ town: NotRequired[str] """ Town or cho-me. """ class UpdateParamsCompanyOwnershipDeclaration(TypedDict): date: NotRequired[int] """ The Unix timestamp marking when the beneficial owner attestation was made. """ ip: NotRequired[str] """ The IP address from which the beneficial owner attestation was made. """ user_agent: NotRequired[str] """ The user agent of the browser from which the beneficial owner attestation was made. """ class UpdateParamsCompanyVerification(TypedDict): document: NotRequired[ "AccountService.UpdateParamsCompanyVerificationDocument" ] """ A document verifying the business. """ class UpdateParamsCompanyVerificationDocument(TypedDict): back: NotRequired[str] """ The back of a document returned by a [file upload](https://stripe.com/docs/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://stripe.com/docs/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. """ class UpdateParamsDocuments(TypedDict): bank_account_ownership_verification: NotRequired[ "AccountService.UpdateParamsDocumentsBankAccountOwnershipVerification" ] """ One or more documents that support the [Bank account ownership verification](https://support.stripe.com/questions/bank-account-ownership-verification) requirement. Must be a document associated with the account's primary active bank account that displays the last 4 digits of the account number, either a statement or a voided check. """ company_license: NotRequired[ "AccountService.UpdateParamsDocumentsCompanyLicense" ] """ One or more documents that demonstrate proof of a company's license to operate. """ company_memorandum_of_association: NotRequired[ "AccountService.UpdateParamsDocumentsCompanyMemorandumOfAssociation" ] """ One or more documents showing the company's Memorandum of Association. """ company_ministerial_decree: NotRequired[ "AccountService.UpdateParamsDocumentsCompanyMinisterialDecree" ] """ (Certain countries only) One or more documents showing the ministerial decree legalizing the company's establishment. """ company_registration_verification: NotRequired[ "AccountService.UpdateParamsDocumentsCompanyRegistrationVerification" ] """ One or more documents that demonstrate proof of a company's registration with the appropriate local authorities. """ company_tax_id_verification: NotRequired[ "AccountService.UpdateParamsDocumentsCompanyTaxIdVerification" ] """ One or more documents that demonstrate proof of a company's tax ID. """ proof_of_registration: NotRequired[ "AccountService.UpdateParamsDocumentsProofOfRegistration" ] """ One or more documents showing the company's proof of registration with the national business registry. """ class UpdateParamsDocumentsBankAccountOwnershipVerification(TypedDict): files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class UpdateParamsDocumentsCompanyLicense(TypedDict): files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class UpdateParamsDocumentsCompanyMemorandumOfAssociation(TypedDict): files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class UpdateParamsDocumentsCompanyMinisterialDecree(TypedDict): files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class UpdateParamsDocumentsCompanyRegistrationVerification(TypedDict): files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class UpdateParamsDocumentsCompanyTaxIdVerification(TypedDict): files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class UpdateParamsDocumentsProofOfRegistration(TypedDict): files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class UpdateParamsIndividual(TypedDict): address: NotRequired["AccountService.UpdateParamsIndividualAddress"] """ The individual's primary address. """ address_kana: NotRequired[ "AccountService.UpdateParamsIndividualAddressKana" ] """ The Kana variation of the individual's primary address (Japan only). """ address_kanji: NotRequired[ "AccountService.UpdateParamsIndividualAddressKanji" ] """ The Kanji variation of the individual's primary address (Japan only). """ dob: NotRequired[ "Literal['']|AccountService.UpdateParamsIndividualDob" ] """ The individual's date of birth. """ email: NotRequired[str] """ The individual's email address. """ first_name: NotRequired[str] """ The individual's first name. """ first_name_kana: NotRequired[str] """ The Kana variation of the individual's first name (Japan only). """ first_name_kanji: NotRequired[str] """ The Kanji variation of the individual's first name (Japan only). """ full_name_aliases: NotRequired["Literal['']|List[str]"] """ A list of alternate names or aliases that the individual is known by. """ gender: NotRequired[str] """ The individual's gender (International regulations require either "male" or "female"). """ id_number: NotRequired[str] """ The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). """ id_number_secondary: NotRequired[str] """ The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). """ last_name: NotRequired[str] """ The individual's last name. """ last_name_kana: NotRequired[str] """ The Kana variation of the individual's last name (Japan only). """ last_name_kanji: NotRequired[str] """ The Kanji variation of the individual's last name (Japan only). """ maiden_name: NotRequired[str] """ The individual's maiden name. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ phone: NotRequired[str] """ The individual's phone number. """ political_exposure: NotRequired[Literal["existing", "none"]] """ Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. """ registered_address: NotRequired[ "AccountService.UpdateParamsIndividualRegisteredAddress" ] """ The individual's registered address. """ relationship: NotRequired[ "AccountService.UpdateParamsIndividualRelationship" ] """ Describes the person's relationship to the account. """ ssn_last_4: NotRequired[str] """ The last four digits of the individual's Social Security Number (U.S. only). """ verification: NotRequired[ "AccountService.UpdateParamsIndividualVerification" ] """ The individual's verification document information. """ class UpdateParamsIndividualAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class UpdateParamsIndividualAddressKana(TypedDict): city: NotRequired[str] """ City or ward. """ 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] """ Block or building number. """ line2: NotRequired[str] """ Building details. """ postal_code: NotRequired[str] """ Postal code. """ state: NotRequired[str] """ Prefecture. """ town: NotRequired[str] """ Town or cho-me. """ class UpdateParamsIndividualAddressKanji(TypedDict): city: NotRequired[str] """ City or ward. """ 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] """ Block or building number. """ line2: NotRequired[str] """ Building details. """ postal_code: NotRequired[str] """ Postal code. """ state: NotRequired[str] """ Prefecture. """ town: NotRequired[str] """ Town or cho-me. """ class UpdateParamsIndividualDob(TypedDict): day: int """ The day of birth, between 1 and 31. """ month: int """ The month of birth, between 1 and 12. """ year: int """ The four-digit year of birth. """ class UpdateParamsIndividualRegisteredAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class UpdateParamsIndividualRelationship(TypedDict): director: NotRequired[bool] """ Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. """ executive: NotRequired[bool] """ Whether the person has significant responsibility to control, manage, or direct the organization. """ owner: NotRequired[bool] """ Whether the person is an owner of the account's legal entity. """ percent_ownership: NotRequired["Literal['']|float"] """ The percent owned by the person of the account's legal entity. """ title: NotRequired[str] """ The person's title (e.g., CEO, Support Engineer). """ class UpdateParamsIndividualVerification(TypedDict): additional_document: NotRequired[ "AccountService.UpdateParamsIndividualVerificationAdditionalDocument" ] """ A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. """ document: NotRequired[ "AccountService.UpdateParamsIndividualVerificationDocument" ] """ An identifying document, either a passport or local ID card. """ class UpdateParamsIndividualVerificationAdditionalDocument(TypedDict): back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/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://stripe.com/docs/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 UpdateParamsIndividualVerificationDocument(TypedDict): back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/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://stripe.com/docs/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 UpdateParamsSettings(TypedDict): bacs_debit_payments: NotRequired[ "AccountService.UpdateParamsSettingsBacsDebitPayments" ] """ Settings specific to Bacs Direct Debit payments. """ branding: NotRequired["AccountService.UpdateParamsSettingsBranding"] """ Settings used to apply the account's branding to email receipts, invoices, Checkout, and other products. """ card_issuing: NotRequired[ "AccountService.UpdateParamsSettingsCardIssuing" ] """ Settings specific to the account's use of the Card Issuing product. """ card_payments: NotRequired[ "AccountService.UpdateParamsSettingsCardPayments" ] """ Settings specific to card charging on the account. """ invoices: NotRequired["AccountService.UpdateParamsSettingsInvoices"] """ Settings specific to the account's use of Invoices. """ payments: NotRequired["AccountService.UpdateParamsSettingsPayments"] """ Settings that apply across payment methods for charging on the account. """ payouts: NotRequired["AccountService.UpdateParamsSettingsPayouts"] """ Settings specific to the account's payouts. """ treasury: NotRequired["AccountService.UpdateParamsSettingsTreasury"] """ Settings specific to the account's Treasury FinancialAccounts. """ class UpdateParamsSettingsBacsDebitPayments(TypedDict): display_name: NotRequired[str] """ The Bacs Direct Debit Display Name for this account. For payments made with Bacs Direct Debit, this name appears on the mandate as the statement descriptor. Mobile banking apps display it as the name of the business. To use custom branding, set the Bacs Direct Debit Display Name during or right after creation. Custom branding incurs an additional monthly fee for the platform. If you don't set the display name before requesting Bacs capability, it's automatically set as "Stripe" and the account is onboarded to Stripe branding, which is free. """ class UpdateParamsSettingsBranding(TypedDict): icon: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) An icon for the account. Must be square and at least 128px x 128px. """ logo: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A logo for the account that will be used in Checkout instead of the icon and without the account's name next to it if provided. Must be at least 128px x 128px. """ primary_color: NotRequired[str] """ A CSS hex color value representing the primary branding color for this account. """ secondary_color: NotRequired[str] """ A CSS hex color value representing the secondary branding color for this account. """ class UpdateParamsSettingsCardIssuing(TypedDict): tos_acceptance: NotRequired[ "AccountService.UpdateParamsSettingsCardIssuingTosAcceptance" ] """ Details on the account's acceptance of the [Stripe Issuing Terms and Disclosures](https://docs.stripe.com/issuing/connect/tos_acceptance). """ class UpdateParamsSettingsCardIssuingTosAcceptance(TypedDict): date: NotRequired[int] """ The Unix timestamp marking when the account representative accepted the service agreement. """ ip: NotRequired[str] """ The IP address from which the account representative accepted the service agreement. """ user_agent: NotRequired["Literal['']|str"] """ The user agent of the browser from which the account representative accepted the service agreement. """ class UpdateParamsSettingsCardPayments(TypedDict): decline_on: NotRequired[ "AccountService.UpdateParamsSettingsCardPaymentsDeclineOn" ] """ Automatically declines certain charge types regardless of whether the card issuer accepted or declined the charge. """ statement_descriptor_prefix: NotRequired[str] """ The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. `statement_descriptor_prefix` is useful for maximizing descriptor space for the dynamic portion. """ statement_descriptor_prefix_kana: NotRequired["Literal['']|str"] """ The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kana` specified on the charge. `statement_descriptor_prefix_kana` is useful for maximizing descriptor space for the dynamic portion. """ statement_descriptor_prefix_kanji: NotRequired["Literal['']|str"] """ The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). This field prefixes any dynamic `statement_descriptor_suffix_kanji` specified on the charge. `statement_descriptor_prefix_kanji` is useful for maximizing descriptor space for the dynamic portion. """ class UpdateParamsSettingsCardPaymentsDeclineOn(TypedDict): avs_failure: NotRequired[bool] """ Whether Stripe automatically declines charges with an incorrect ZIP or postal code. This setting only applies when a ZIP or postal code is provided and they fail bank verification. """ cvc_failure: NotRequired[bool] """ Whether Stripe automatically declines charges with an incorrect CVC. This setting only applies when a CVC is provided and it fails bank verification. """ class UpdateParamsSettingsInvoices(TypedDict): default_account_tax_ids: NotRequired["Literal['']|List[str]"] """ The list of default Account Tax IDs to automatically include on invoices. Account Tax IDs get added when an invoice is finalized. """ class UpdateParamsSettingsPayments(TypedDict): statement_descriptor: NotRequired[str] """ The default text that appears on credit card statements when a charge is made. This field prefixes any dynamic `statement_descriptor` specified on the charge. """ statement_descriptor_kana: NotRequired[str] """ The Kana variation of the default text that appears on credit card statements when a charge is made (Japan only). """ statement_descriptor_kanji: NotRequired[str] """ The Kanji variation of the default text that appears on credit card statements when a charge is made (Japan only). """ class UpdateParamsSettingsPayouts(TypedDict): debit_negative_balances: NotRequired[bool] """ A Boolean indicating whether Stripe should try to reclaim negative balances from an attached bank account. For details, see [Understanding Connect Account Balances](https://docs.stripe.com/connect/account-balances). """ schedule: NotRequired[ "AccountService.UpdateParamsSettingsPayoutsSchedule" ] """ Details on when funds from charges are available, and when they are paid out to an external account. For details, see our [Setting Bank and Debit Card Payouts](https://docs.stripe.com/connect/bank-transfers#payout-information) documentation. """ statement_descriptor: NotRequired[str] """ The text that appears on the bank account statement for payouts. If not set, this defaults to the platform's bank descriptor as set in the Dashboard. """ class UpdateParamsSettingsPayoutsSchedule(TypedDict): delay_days: NotRequired["Literal['minimum']|int"] """ The number of days charge funds are held before being paid out. May also be set to `minimum`, representing the lowest available value for the account country. Default is `minimum`. The `delay_days` parameter remains at the last configured value if `interval` is `manual`. [Learn more about controlling payout delay days](https://docs.stripe.com/connect/manage-payout-schedule). """ interval: NotRequired[Literal["daily", "manual", "monthly", "weekly"]] """ How frequently available funds are paid out. One of: `daily`, `manual`, `weekly`, or `monthly`. Default is `daily`. """ monthly_anchor: NotRequired[int] """ The day of the month when available funds are paid out, specified as a number between 1--31. Payouts nominally scheduled between the 29th and 31st of the month are instead sent on the last day of a shorter month. Required and applicable only if `interval` is `monthly`. """ weekly_anchor: NotRequired[ Literal[ "friday", "monday", "saturday", "sunday", "thursday", "tuesday", "wednesday", ] ] """ The day of the week when available funds are paid out, specified as `monday`, `tuesday`, etc. (required and applicable only if `interval` is `weekly`.) """ class UpdateParamsSettingsTreasury(TypedDict): tos_acceptance: NotRequired[ "AccountService.UpdateParamsSettingsTreasuryTosAcceptance" ] """ Details on the account's acceptance of the Stripe Treasury Services Agreement. """ class UpdateParamsSettingsTreasuryTosAcceptance(TypedDict): date: NotRequired[int] """ The Unix timestamp marking when the account representative accepted the service agreement. """ ip: NotRequired[str] """ The IP address from which the account representative accepted the service agreement. """ user_agent: NotRequired["Literal['']|str"] """ The user agent of the browser from which the account representative accepted the service agreement. """ class UpdateParamsTosAcceptance(TypedDict): date: NotRequired[int] """ The Unix timestamp marking when the account representative accepted their service agreement. """ ip: NotRequired[str] """ The IP address from which the account representative accepted their service agreement. """ service_agreement: NotRequired[str] """ The user's service agreement type. """ user_agent: NotRequired[str] """ The user agent of the browser from which the account representative accepted their service agreement. """ def delete( self, account: str, params: "AccountService.DeleteParams" = {}, options: RequestOptions = {}, ) -> Account: """ With [Connect](https://stripe.com/connect), you can delete accounts you manage. Test-mode accounts can be deleted at any time. Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balanace_object) are zero. If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead. """ return cast( Account, self._request( "delete", "/v1/accounts/{account}".format(account=sanitize_id(account)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def delete_async( self, account: str, params: "AccountService.DeleteParams" = {}, options: RequestOptions = {}, ) -> Account: """ With [Connect](https://stripe.com/connect), you can delete accounts you manage. Test-mode accounts can be deleted at any time. Live-mode accounts where Stripe is responsible for negative account balances cannot be deleted, which includes Standard accounts. Live-mode accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be deleted when all [balances](https://stripe.com/api/balance/balanace_object) are zero. If you want to delete your own account, use the [account information tab in your account settings](https://dashboard.stripe.com/settings/account) instead. """ return cast( Account, await self._request_async( "delete", "/v1/accounts/{account}".format(account=sanitize_id(account)), api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, account: str, params: "AccountService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Account: """ Retrieves the details of an account. """ return cast( Account, self._request( "get", "/v1/accounts/{account}".format(account=sanitize_id(account)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, account: str, params: "AccountService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Account: """ Retrieves the details of an account. """ return cast( Account, await self._request_async( "get", "/v1/accounts/{account}".format(account=sanitize_id(account)), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, account: str, params: "AccountService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Account: """ Updates a [connected account](https://stripe.com/connect/accounts) by setting the values of the parameters passed. Any parameters not provided are left unchanged. For accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is application, which includes Custom accounts, you can update any information on the account. For accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is stripe, which includes Standard and Express accounts, you can update all information until you create an [Account Link or Account Session](https://stripe.com/api/account_links) to start Connect onboarding, after which some properties can no longer be updated. To update your own account, use the [Dashboard](https://dashboard.stripe.com/settings/account). Refer to our [Connect](https://stripe.com/docs/connect/updating-accounts) documentation to learn more about updating accounts. """ return cast( Account, self._request( "post", "/v1/accounts/{account}".format(account=sanitize_id(account)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, account: str, params: "AccountService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Account: """ Updates a [connected account](https://stripe.com/connect/accounts) by setting the values of the parameters passed. Any parameters not provided are left unchanged. For accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is application, which includes Custom accounts, you can update any information on the account. For accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is stripe, which includes Standard and Express accounts, you can update all information until you create an [Account Link or Account Session](https://stripe.com/api/account_links) to start Connect onboarding, after which some properties can no longer be updated. To update your own account, use the [Dashboard](https://dashboard.stripe.com/settings/account). Refer to our [Connect](https://stripe.com/docs/connect/updating-accounts) documentation to learn more about updating accounts. """ return cast( Account, await self._request_async( "post", "/v1/accounts/{account}".format(account=sanitize_id(account)), api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve_current( self, params: "AccountService.RetrieveCurrentParams" = {}, options: RequestOptions = {}, ) -> Account: """ Retrieves the details of an account. """ return cast( Account, self._request( "get", "/v1/account", api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_current_async( self, params: "AccountService.RetrieveCurrentParams" = {}, options: RequestOptions = {}, ) -> Account: """ Retrieves the details of an account. """ return cast( Account, await self._request_async( "get", "/v1/account", api_mode="V1", base_address="api", params=params, options=options, ), ) def list( self, params: "AccountService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Account]: """ Returns a list of accounts connected to your platform via [Connect](https://stripe.com/docs/connect). If you're not a platform, the list is empty. """ return cast( ListObject[Account], self._request( "get", "/v1/accounts", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "AccountService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Account]: """ Returns a list of accounts connected to your platform via [Connect](https://stripe.com/docs/connect). If you're not a platform, the list is empty. """ return cast( ListObject[Account], await self._request_async( "get", "/v1/accounts", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "AccountService.CreateParams" = {}, options: RequestOptions = {}, ) -> Account: """ With [Connect](https://stripe.com/docs/connect), you can create Stripe accounts for your users. To do this, you'll first need to [register your platform](https://dashboard.stripe.com/account/applications/settings). If you've already collected information for your connected accounts, you [can prefill that information](https://stripe.com/docs/connect/best-practices#onboarding) when creating the account. Connect Onboarding won't ask for the prefilled information during account onboarding. You can prefill any information on the account. """ return cast( Account, self._request( "post", "/v1/accounts", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "AccountService.CreateParams" = {}, options: RequestOptions = {}, ) -> Account: """ With [Connect](https://stripe.com/docs/connect), you can create Stripe accounts for your users. To do this, you'll first need to [register your platform](https://dashboard.stripe.com/account/applications/settings). If you've already collected information for your connected accounts, you [can prefill that information](https://stripe.com/docs/connect/best-practices#onboarding) when creating the account. Connect Onboarding won't ask for the prefilled information during account onboarding. You can prefill any information on the account. """ return cast( Account, await self._request_async( "post", "/v1/accounts", api_mode="V1", base_address="api", params=params, options=options, ), ) def reject( self, account: str, params: "AccountService.RejectParams", options: RequestOptions = {}, ) -> Account: """ With [Connect](https://stripe.com/connect), you can reject accounts that you have flagged as suspicious. Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero. """ return cast( Account, self._request( "post", "/v1/accounts/{account}/reject".format( account=sanitize_id(account), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def reject_async( self, account: str, params: "AccountService.RejectParams", options: RequestOptions = {}, ) -> Account: """ With [Connect](https://stripe.com/connect), you can reject accounts that you have flagged as suspicious. Only accounts where your platform is liable for negative account balances, which includes Custom and Express accounts, can be rejected. Test-mode accounts can be rejected at any time. Live-mode accounts can only be rejected after all balances are zero. """ return cast( Account, await self._request_async( "post", "/v1/accounts/{account}/reject".format( account=sanitize_id(account), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_account_session.py0000644000175100001770000005271214637354563017751 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from typing import ClassVar, List, cast from typing_extensions import Literal, NotRequired, TypedDict, Unpack class AccountSession(CreateableAPIResource["AccountSession"]): """ An AccountSession allows a Connect platform to grant access to a connected account in Connect embedded components. We recommend that you create an AccountSession each time you need to display an embedded component to your user. Do not save AccountSessions to your database as they expire relatively quickly, and cannot be used more than once. Related guide: [Connect embedded components](https://stripe.com/docs/connect/get-started-connect-embedded-components) """ OBJECT_NAME: ClassVar[Literal["account_session"]] = "account_session" class Components(StripeObject): class AccountManagement(StripeObject): class Features(StripeObject): external_account_collection: bool """ Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. """ enabled: bool """ Whether the embedded component is enabled. """ features: Features _inner_class_types = {"features": Features} class AccountOnboarding(StripeObject): class Features(StripeObject): external_account_collection: bool """ Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. """ enabled: bool """ Whether the embedded component is enabled. """ features: Features _inner_class_types = {"features": Features} class Balances(StripeObject): class Features(StripeObject): edit_payout_schedule: bool """ Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise. """ external_account_collection: bool """ Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. """ instant_payouts: bool """ Whether to allow creation of instant payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. """ standard_payouts: bool """ Whether to allow creation of standard payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. """ enabled: bool """ Whether the embedded component is enabled. """ features: Features _inner_class_types = {"features": Features} class Documents(StripeObject): class Features(StripeObject): pass enabled: bool """ Whether the embedded component is enabled. """ features: Features _inner_class_types = {"features": Features} class NotificationBanner(StripeObject): class Features(StripeObject): external_account_collection: bool """ Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. """ enabled: bool """ Whether the embedded component is enabled. """ features: Features _inner_class_types = {"features": Features} class PaymentDetails(StripeObject): class Features(StripeObject): capture_payments: bool """ Whether to allow capturing and cancelling payment intents. This is `true` by default. """ destination_on_behalf_of_charge_management: bool """ Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default. """ dispute_management: bool """ Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. """ refund_management: bool """ Whether to allow sending refunds. This is `true` by default. """ enabled: bool """ Whether the embedded component is enabled. """ features: Features _inner_class_types = {"features": Features} class Payments(StripeObject): class Features(StripeObject): capture_payments: bool """ Whether to allow capturing and cancelling payment intents. This is `true` by default. """ destination_on_behalf_of_charge_management: bool """ Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default. """ dispute_management: bool """ Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. """ refund_management: bool """ Whether to allow sending refunds. This is `true` by default. """ enabled: bool """ Whether the embedded component is enabled. """ features: Features _inner_class_types = {"features": Features} class Payouts(StripeObject): class Features(StripeObject): edit_payout_schedule: bool """ Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise. """ external_account_collection: bool """ Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. """ instant_payouts: bool """ Whether to allow creation of instant payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. """ standard_payouts: bool """ Whether to allow creation of standard payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. """ enabled: bool """ Whether the embedded component is enabled. """ features: Features _inner_class_types = {"features": Features} class PayoutsList(StripeObject): class Features(StripeObject): pass enabled: bool """ Whether the embedded component is enabled. """ features: Features _inner_class_types = {"features": Features} account_management: AccountManagement account_onboarding: AccountOnboarding balances: Balances documents: Documents notification_banner: NotificationBanner payment_details: PaymentDetails payments: Payments payouts: Payouts payouts_list: PayoutsList _inner_class_types = { "account_management": AccountManagement, "account_onboarding": AccountOnboarding, "balances": Balances, "documents": Documents, "notification_banner": NotificationBanner, "payment_details": PaymentDetails, "payments": Payments, "payouts": Payouts, "payouts_list": PayoutsList, } class CreateParams(RequestOptions): account: str """ The identifier of the account to create an Account Session for. """ components: "AccountSession.CreateParamsComponents" """ Each key of the dictionary represents an embedded component, and each embedded component maps to its configuration (e.g. whether it has been enabled or not). """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CreateParamsComponents(TypedDict): account_management: NotRequired[ "AccountSession.CreateParamsComponentsAccountManagement" ] """ Configuration for the account management embedded component. """ account_onboarding: NotRequired[ "AccountSession.CreateParamsComponentsAccountOnboarding" ] """ Configuration for the account onboarding embedded component. """ balances: NotRequired["AccountSession.CreateParamsComponentsBalances"] """ Configuration for the balances embedded component. """ documents: NotRequired[ "AccountSession.CreateParamsComponentsDocuments" ] """ Configuration for the documents embedded component. """ notification_banner: NotRequired[ "AccountSession.CreateParamsComponentsNotificationBanner" ] """ Configuration for the notification banner embedded component. """ payment_details: NotRequired[ "AccountSession.CreateParamsComponentsPaymentDetails" ] """ Configuration for the payment details embedded component. """ payments: NotRequired["AccountSession.CreateParamsComponentsPayments"] """ Configuration for the payments embedded component. """ payouts: NotRequired["AccountSession.CreateParamsComponentsPayouts"] """ Configuration for the payouts embedded component. """ payouts_list: NotRequired[ "AccountSession.CreateParamsComponentsPayoutsList" ] """ Configuration for the payouts list embedded component. """ class CreateParamsComponentsAccountManagement(TypedDict): enabled: bool """ Whether the embedded component is enabled. """ features: NotRequired[ "AccountSession.CreateParamsComponentsAccountManagementFeatures" ] """ The list of features enabled in the embedded component. """ class CreateParamsComponentsAccountManagementFeatures(TypedDict): external_account_collection: NotRequired[bool] """ Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. """ class CreateParamsComponentsAccountOnboarding(TypedDict): enabled: bool """ Whether the embedded component is enabled. """ features: NotRequired[ "AccountSession.CreateParamsComponentsAccountOnboardingFeatures" ] """ The list of features enabled in the embedded component. """ class CreateParamsComponentsAccountOnboardingFeatures(TypedDict): external_account_collection: NotRequired[bool] """ Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. """ class CreateParamsComponentsBalances(TypedDict): enabled: bool """ Whether the embedded component is enabled. """ features: NotRequired[ "AccountSession.CreateParamsComponentsBalancesFeatures" ] """ The list of features enabled in the embedded component. """ class CreateParamsComponentsBalancesFeatures(TypedDict): edit_payout_schedule: NotRequired[bool] """ Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise. """ external_account_collection: NotRequired[bool] """ Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. """ instant_payouts: NotRequired[bool] """ Whether to allow creation of instant payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. """ standard_payouts: NotRequired[bool] """ Whether to allow creation of standard payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. """ class CreateParamsComponentsDocuments(TypedDict): enabled: bool """ Whether the embedded component is enabled. """ features: NotRequired[ "AccountSession.CreateParamsComponentsDocumentsFeatures" ] """ The list of features enabled in the embedded component. """ class CreateParamsComponentsDocumentsFeatures(TypedDict): pass class CreateParamsComponentsNotificationBanner(TypedDict): enabled: bool """ Whether the embedded component is enabled. """ features: NotRequired[ "AccountSession.CreateParamsComponentsNotificationBannerFeatures" ] """ The list of features enabled in the embedded component. """ class CreateParamsComponentsNotificationBannerFeatures(TypedDict): external_account_collection: NotRequired[bool] """ Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. """ class CreateParamsComponentsPaymentDetails(TypedDict): enabled: bool """ Whether the embedded component is enabled. """ features: NotRequired[ "AccountSession.CreateParamsComponentsPaymentDetailsFeatures" ] """ The list of features enabled in the embedded component. """ class CreateParamsComponentsPaymentDetailsFeatures(TypedDict): capture_payments: NotRequired[bool] """ Whether to allow capturing and cancelling payment intents. This is `true` by default. """ destination_on_behalf_of_charge_management: NotRequired[bool] """ Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default. """ dispute_management: NotRequired[bool] """ Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. """ refund_management: NotRequired[bool] """ Whether to allow sending refunds. This is `true` by default. """ class CreateParamsComponentsPayments(TypedDict): enabled: bool """ Whether the embedded component is enabled. """ features: NotRequired[ "AccountSession.CreateParamsComponentsPaymentsFeatures" ] """ The list of features enabled in the embedded component. """ class CreateParamsComponentsPaymentsFeatures(TypedDict): capture_payments: NotRequired[bool] """ Whether to allow capturing and cancelling payment intents. This is `true` by default. """ destination_on_behalf_of_charge_management: NotRequired[bool] """ Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default. """ dispute_management: NotRequired[bool] """ Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. """ refund_management: NotRequired[bool] """ Whether to allow sending refunds. This is `true` by default. """ class CreateParamsComponentsPayouts(TypedDict): enabled: bool """ Whether the embedded component is enabled. """ features: NotRequired[ "AccountSession.CreateParamsComponentsPayoutsFeatures" ] """ The list of features enabled in the embedded component. """ class CreateParamsComponentsPayoutsFeatures(TypedDict): edit_payout_schedule: NotRequired[bool] """ Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise. """ external_account_collection: NotRequired[bool] """ Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. """ instant_payouts: NotRequired[bool] """ Whether to allow creation of instant payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. """ standard_payouts: NotRequired[bool] """ Whether to allow creation of standard payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. """ class CreateParamsComponentsPayoutsList(TypedDict): enabled: bool """ Whether the embedded component is enabled. """ features: NotRequired[ "AccountSession.CreateParamsComponentsPayoutsListFeatures" ] """ The list of features enabled in the embedded component. """ class CreateParamsComponentsPayoutsListFeatures(TypedDict): pass account: str """ The ID of the account the AccountSession was created for """ client_secret: str """ The client secret of this AccountSession. Used on the client to set up secure access to the given `account`. The client secret can be used to provide access to `account` from your frontend. It should not be stored, logged, or exposed to anyone other than the connected account. Make sure that you have TLS enabled on any page that includes the client secret. Refer to our docs to [setup Connect embedded components](https://stripe.com/docs/connect/get-started-connect-embedded-components) and learn about how `client_secret` should be handled. """ components: Components expires_at: int """ The timestamp at which this AccountSession will expire. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ object: Literal["account_session"] """ String representing the object's type. Objects of the same type share the same value. """ @classmethod def create( cls, **params: Unpack["AccountSession.CreateParams"] ) -> "AccountSession": """ Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access. """ return cast( "AccountSession", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["AccountSession.CreateParams"] ) -> "AccountSession": """ Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access. """ return cast( "AccountSession", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) _inner_class_types = {"components": Components} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_account_session_service.py0000644000175100001770000003013714637354563021466 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._account_session import AccountSession from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from typing import List, cast from typing_extensions import NotRequired, TypedDict class AccountSessionService(StripeService): class CreateParams(TypedDict): account: str """ The identifier of the account to create an Account Session for. """ components: "AccountSessionService.CreateParamsComponents" """ Each key of the dictionary represents an embedded component, and each embedded component maps to its configuration (e.g. whether it has been enabled or not). """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CreateParamsComponents(TypedDict): account_management: NotRequired[ "AccountSessionService.CreateParamsComponentsAccountManagement" ] """ Configuration for the account management embedded component. """ account_onboarding: NotRequired[ "AccountSessionService.CreateParamsComponentsAccountOnboarding" ] """ Configuration for the account onboarding embedded component. """ balances: NotRequired[ "AccountSessionService.CreateParamsComponentsBalances" ] """ Configuration for the balances embedded component. """ documents: NotRequired[ "AccountSessionService.CreateParamsComponentsDocuments" ] """ Configuration for the documents embedded component. """ notification_banner: NotRequired[ "AccountSessionService.CreateParamsComponentsNotificationBanner" ] """ Configuration for the notification banner embedded component. """ payment_details: NotRequired[ "AccountSessionService.CreateParamsComponentsPaymentDetails" ] """ Configuration for the payment details embedded component. """ payments: NotRequired[ "AccountSessionService.CreateParamsComponentsPayments" ] """ Configuration for the payments embedded component. """ payouts: NotRequired[ "AccountSessionService.CreateParamsComponentsPayouts" ] """ Configuration for the payouts embedded component. """ payouts_list: NotRequired[ "AccountSessionService.CreateParamsComponentsPayoutsList" ] """ Configuration for the payouts list embedded component. """ class CreateParamsComponentsAccountManagement(TypedDict): enabled: bool """ Whether the embedded component is enabled. """ features: NotRequired[ "AccountSessionService.CreateParamsComponentsAccountManagementFeatures" ] """ The list of features enabled in the embedded component. """ class CreateParamsComponentsAccountManagementFeatures(TypedDict): external_account_collection: NotRequired[bool] """ Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. """ class CreateParamsComponentsAccountOnboarding(TypedDict): enabled: bool """ Whether the embedded component is enabled. """ features: NotRequired[ "AccountSessionService.CreateParamsComponentsAccountOnboardingFeatures" ] """ The list of features enabled in the embedded component. """ class CreateParamsComponentsAccountOnboardingFeatures(TypedDict): external_account_collection: NotRequired[bool] """ Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. """ class CreateParamsComponentsBalances(TypedDict): enabled: bool """ Whether the embedded component is enabled. """ features: NotRequired[ "AccountSessionService.CreateParamsComponentsBalancesFeatures" ] """ The list of features enabled in the embedded component. """ class CreateParamsComponentsBalancesFeatures(TypedDict): edit_payout_schedule: NotRequired[bool] """ Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise. """ external_account_collection: NotRequired[bool] """ Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. """ instant_payouts: NotRequired[bool] """ Whether to allow creation of instant payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. """ standard_payouts: NotRequired[bool] """ Whether to allow creation of standard payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. """ class CreateParamsComponentsDocuments(TypedDict): enabled: bool """ Whether the embedded component is enabled. """ features: NotRequired[ "AccountSessionService.CreateParamsComponentsDocumentsFeatures" ] """ The list of features enabled in the embedded component. """ class CreateParamsComponentsDocumentsFeatures(TypedDict): pass class CreateParamsComponentsNotificationBanner(TypedDict): enabled: bool """ Whether the embedded component is enabled. """ features: NotRequired[ "AccountSessionService.CreateParamsComponentsNotificationBannerFeatures" ] """ The list of features enabled in the embedded component. """ class CreateParamsComponentsNotificationBannerFeatures(TypedDict): external_account_collection: NotRequired[bool] """ Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. """ class CreateParamsComponentsPaymentDetails(TypedDict): enabled: bool """ Whether the embedded component is enabled. """ features: NotRequired[ "AccountSessionService.CreateParamsComponentsPaymentDetailsFeatures" ] """ The list of features enabled in the embedded component. """ class CreateParamsComponentsPaymentDetailsFeatures(TypedDict): capture_payments: NotRequired[bool] """ Whether to allow capturing and cancelling payment intents. This is `true` by default. """ destination_on_behalf_of_charge_management: NotRequired[bool] """ Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default. """ dispute_management: NotRequired[bool] """ Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. """ refund_management: NotRequired[bool] """ Whether to allow sending refunds. This is `true` by default. """ class CreateParamsComponentsPayments(TypedDict): enabled: bool """ Whether the embedded component is enabled. """ features: NotRequired[ "AccountSessionService.CreateParamsComponentsPaymentsFeatures" ] """ The list of features enabled in the embedded component. """ class CreateParamsComponentsPaymentsFeatures(TypedDict): capture_payments: NotRequired[bool] """ Whether to allow capturing and cancelling payment intents. This is `true` by default. """ destination_on_behalf_of_charge_management: NotRequired[bool] """ Whether to allow connected accounts to manage destination charges that are created on behalf of them. This is `false` by default. """ dispute_management: NotRequired[bool] """ Whether to allow responding to disputes, including submitting evidence and accepting disputes. This is `true` by default. """ refund_management: NotRequired[bool] """ Whether to allow sending refunds. This is `true` by default. """ class CreateParamsComponentsPayouts(TypedDict): enabled: bool """ Whether the embedded component is enabled. """ features: NotRequired[ "AccountSessionService.CreateParamsComponentsPayoutsFeatures" ] """ The list of features enabled in the embedded component. """ class CreateParamsComponentsPayoutsFeatures(TypedDict): edit_payout_schedule: NotRequired[bool] """ Whether to allow payout schedule to be changed. Default `true` when Stripe owns Loss Liability, default `false` otherwise. """ external_account_collection: NotRequired[bool] """ Whether to allow platforms to control bank account collection for their connected accounts. This feature can only be false for custom accounts (or accounts where the platform is compliance owner). Otherwise, bank account collection is determined by compliance requirements. """ instant_payouts: NotRequired[bool] """ Whether to allow creation of instant payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. """ standard_payouts: NotRequired[bool] """ Whether to allow creation of standard payouts. Default `true` when Stripe owns Loss Liability, default `false` otherwise. """ class CreateParamsComponentsPayoutsList(TypedDict): enabled: bool """ Whether the embedded component is enabled. """ features: NotRequired[ "AccountSessionService.CreateParamsComponentsPayoutsListFeatures" ] """ The list of features enabled in the embedded component. """ class CreateParamsComponentsPayoutsListFeatures(TypedDict): pass def create( self, params: "AccountSessionService.CreateParams", options: RequestOptions = {}, ) -> AccountSession: """ Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access. """ return cast( AccountSession, self._request( "post", "/v1/account_sessions", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "AccountSessionService.CreateParams", options: RequestOptions = {}, ) -> AccountSession: """ Creates a AccountSession object that includes a single-use token that the platform can use on their front-end to grant client-side API access. """ return cast( AccountSession, await self._request_async( "post", "/v1/account_sessions", api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_any_iterator.py0000644000175100001770000000203514637354563017243 0ustar00runnerdockerfrom typing import TypeVar, Iterator, AsyncIterator T = TypeVar("T") class AnyIterator(Iterator[T], AsyncIterator[T]): """ AnyIterator supports iteration through both `for ... in ` and `async for ... in syntaxes. """ def __init__( self, iterator: Iterator[T], async_iterator: AsyncIterator[T] ) -> None: self._iterator = iterator self._async_iterator = async_iterator self._sync_iterated = False self._async_iterated = False def __next__(self) -> T: if self._async_iterated: raise RuntimeError( "AnyIterator error: cannot mix sync and async iteration" ) self._sync_iterated = True return self._iterator.__next__() async def __anext__(self) -> T: if self._sync_iterated: raise RuntimeError( "AnyIterator error: cannot mix sync and async iteration" ) self._async_iterated = True return await self._async_iterator.__anext__() ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_api_mode.py0000644000175100001770000000011314637354563016313 0ustar00runnerdockerfrom typing_extensions import Literal ApiMode = Literal["V1", "V1FILES"] ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_api_requestor.py0000644000175100001770000006071614637354563017437 0ustar00runnerdockerfrom io import BytesIO, IOBase import json import platform from typing import ( Any, AsyncIterable, Dict, List, Mapping, Optional, Tuple, Union, cast, ClassVar, ) from typing_extensions import ( TYPE_CHECKING, Literal, NoReturn, Unpack, ) import uuid from urllib.parse import urlsplit, urlunsplit # breaking circular dependency import stripe # noqa: IMP101 from stripe._util import ( log_debug, log_info, dashboard_link, _convert_to_stripe_object, ) from stripe._version import VERSION import stripe._error as error import stripe.oauth_error as oauth_error from stripe._multipart_data_generator import MultipartDataGenerator from urllib.parse import urlencode from stripe._encode import ( _api_encode, ) from stripe._stripe_response import ( StripeResponse, StripeStreamResponse, StripeStreamResponseAsync, ) from stripe._request_options import RequestOptions, merge_options from stripe._requestor_options import ( RequestorOptions, _GlobalRequestorOptions, ) from stripe._http_client import ( HTTPClient, new_default_http_client, new_http_client_async_fallback, ) from stripe._app_info import AppInfo from stripe._base_address import BaseAddress from stripe._api_mode import ApiMode if TYPE_CHECKING: from stripe._stripe_object import StripeObject HttpVerb = Literal["get", "post", "delete"] # Lazily initialized _default_proxy: Optional[str] = None class _APIRequestor(object): _instance: ClassVar["_APIRequestor|None"] = None def __init__( self, options: RequestorOptions = RequestorOptions(), client: Optional[HTTPClient] = None, ): self._options = options self._client = client # In the case of client=None, we should use the current value of stripe.default_http_client # or lazily initialize it. Since stripe.default_http_client can change throughout the lifetime of # an _APIRequestor, we shouldn't set it as stripe._client and should access it only through this # getter. def _get_http_client(self) -> HTTPClient: client = self._client if client is None: global _default_proxy if not stripe.default_http_client: kwargs = { "verify_ssl_certs": stripe.verify_ssl_certs, "proxy": stripe.proxy, } # If the stripe.default_http_client has not been set by the user # yet, we'll set it here. This way, we aren't creating a new # HttpClient for every request. stripe.default_http_client = new_default_http_client( async_fallback_client=new_http_client_async_fallback( **kwargs ), **kwargs, ) _default_proxy = stripe.proxy elif stripe.proxy != _default_proxy: import warnings warnings.warn( "stripe.proxy was updated after sending a " "request - this is a no-op. To use a different proxy, " "set stripe.default_http_client to a new client " "configured with the proxy." ) assert stripe.default_http_client is not None return stripe.default_http_client return client def _replace_options( self, options: Optional[RequestOptions] ) -> "_APIRequestor": options = options or {} new_options = self._options.to_dict() for key in ["api_key", "stripe_account", "stripe_version"]: if key in options and options[key] is not None: new_options[key] = options[key] return _APIRequestor( options=RequestorOptions(**new_options), client=self._client ) @property def api_key(self): return self._options.api_key @property def stripe_account(self): return self._options.stripe_account @property def stripe_version(self): return self._options.stripe_version @property def base_addresses(self): return self._options.base_addresses @classmethod def _global_instance(cls): """ Returns the singleton instance of _APIRequestor, to be used when calling a static method such as stripe.Customer.create(...) """ # Lazily initialize. if cls._instance is None: cls._instance = cls(options=_GlobalRequestorOptions(), client=None) return cls._instance @staticmethod def _global_with_options( **params: Unpack[RequestOptions], ) -> "_APIRequestor": return _APIRequestor._global_instance()._replace_options(params) @classmethod def _format_app_info(cls, info): str = info["name"] if info["version"]: str += "/%s" % (info["version"],) if info["url"]: str += " (%s)" % (info["url"],) return str def request( self, method: str, url: str, params: Optional[Mapping[str, Any]] = None, options: Optional[RequestOptions] = None, *, base_address: BaseAddress, api_mode: ApiMode, usage: Optional[List[str]] = None, ) -> "StripeObject": requestor = self._replace_options(options) rbody, rcode, rheaders = requestor.request_raw( method.lower(), url, params, is_streaming=False, api_mode=api_mode, base_address=base_address, options=options, usage=usage, ) resp = requestor._interpret_response(rbody, rcode, rheaders) return _convert_to_stripe_object( resp=resp, params=params, requestor=requestor, api_mode=api_mode, ) async def request_async( self, method: str, url: str, params: Optional[Mapping[str, Any]] = None, options: Optional[RequestOptions] = None, *, base_address: BaseAddress, api_mode: ApiMode, usage: Optional[List[str]] = None, ) -> "StripeObject": requestor = self._replace_options(options) rbody, rcode, rheaders = await requestor.request_raw_async( method.lower(), url, params, is_streaming=False, api_mode=api_mode, base_address=base_address, options=options, usage=usage, ) resp = requestor._interpret_response(rbody, rcode, rheaders) return _convert_to_stripe_object( resp=resp, params=params, requestor=requestor, api_mode=api_mode, ) def request_stream( self, method: str, url: str, params: Optional[Mapping[str, Any]] = None, options: Optional[RequestOptions] = None, *, base_address: BaseAddress, api_mode: ApiMode, usage: Optional[List[str]] = None, ) -> StripeStreamResponse: stream, rcode, rheaders = self.request_raw( method.lower(), url, params, is_streaming=True, api_mode=api_mode, base_address=base_address, options=options, usage=usage, ) resp = self._interpret_streaming_response( # TODO: should be able to remove this cast once self._client.request_stream_with_retries # returns a more specific type. cast(IOBase, stream), rcode, rheaders, ) return resp async def request_stream_async( self, method: str, url: str, params: Optional[Mapping[str, Any]] = None, options: Optional[RequestOptions] = None, *, base_address: BaseAddress, api_mode: ApiMode, usage: Optional[List[str]] = None, ) -> StripeStreamResponseAsync: stream, rcode, rheaders = await self.request_raw_async( method.lower(), url, params, is_streaming=True, api_mode=api_mode, base_address=base_address, options=options, usage=usage, ) resp = await self._interpret_streaming_response_async( stream, rcode, rheaders, ) return resp def handle_error_response(self, rbody, rcode, resp, rheaders) -> NoReturn: try: error_data = resp["error"] except (KeyError, TypeError): raise error.APIError( "Invalid response object from API: %r (HTTP response code " "was %d)" % (rbody, rcode), rbody, rcode, resp, ) err = None # OAuth errors are a JSON object where `error` is a string. In # contrast, in API errors, `error` is a hash with sub-keys. We use # this property to distinguish between OAuth and API errors. if isinstance(error_data, str): err = self.specific_oauth_error( rbody, rcode, resp, rheaders, error_data ) if err is None: err = self.specific_api_error( rbody, rcode, resp, rheaders, error_data ) raise err def specific_api_error(self, rbody, rcode, resp, rheaders, error_data): log_info( "Stripe API error received", error_code=error_data.get("code"), error_type=error_data.get("type"), error_message=error_data.get("message"), error_param=error_data.get("param"), ) # Rate limits were previously coded as 400's with code 'rate_limit' if rcode == 429 or ( rcode == 400 and error_data.get("code") == "rate_limit" ): return error.RateLimitError( error_data.get("message"), rbody, rcode, resp, rheaders ) elif rcode in [400, 404]: if error_data.get("type") == "idempotency_error": return error.IdempotencyError( error_data.get("message"), rbody, rcode, resp, rheaders ) else: return error.InvalidRequestError( error_data.get("message"), error_data.get("param"), error_data.get("code"), rbody, rcode, resp, rheaders, ) elif rcode == 401: return error.AuthenticationError( error_data.get("message"), rbody, rcode, resp, rheaders ) elif rcode == 402: return error.CardError( error_data.get("message"), error_data.get("param"), error_data.get("code"), rbody, rcode, resp, rheaders, ) elif rcode == 403: return error.PermissionError( error_data.get("message"), rbody, rcode, resp, rheaders ) else: return error.APIError( error_data.get("message"), rbody, rcode, resp, rheaders ) def specific_oauth_error(self, rbody, rcode, resp, rheaders, error_code): description = resp.get("error_description", error_code) log_info( "Stripe OAuth error received", error_code=error_code, error_description=description, ) args = [error_code, description, rbody, rcode, resp, rheaders] if error_code == "invalid_client": return oauth_error.InvalidClientError(*args) elif error_code == "invalid_grant": return oauth_error.InvalidGrantError(*args) elif error_code == "invalid_request": return oauth_error.InvalidRequestError(*args) elif error_code == "invalid_scope": return oauth_error.InvalidScopeError(*args) elif error_code == "unsupported_grant_type": return oauth_error.UnsupportedGrantTypeError(*args) elif error_code == "unsupported_response_type": return oauth_error.UnsupportedResponseTypeError(*args) return None def request_headers(self, method, options: RequestOptions): user_agent = "Stripe/v1 PythonBindings/%s" % (VERSION,) if stripe.app_info: user_agent += " " + self._format_app_info(stripe.app_info) ua: Dict[str, Union[str, AppInfo]] = { "bindings_version": VERSION, "lang": "python", "publisher": "stripe", "httplib": self._get_http_client().name, } for attr, func in [ ["lang_version", platform.python_version], ["platform", platform.platform], ["uname", lambda: " ".join(platform.uname())], ]: try: val = func() except Exception: val = "(disabled)" ua[attr] = val if stripe.app_info: ua["application"] = stripe.app_info headers: Dict[str, str] = { "X-Stripe-Client-User-Agent": json.dumps(ua), "User-Agent": user_agent, "Authorization": "Bearer %s" % (options.get("api_key"),), } stripe_account = options.get("stripe_account") if stripe_account: headers["Stripe-Account"] = stripe_account idempotency_key = options.get("idempotency_key") if idempotency_key: headers["Idempotency-Key"] = idempotency_key if method == "post": headers.setdefault("Idempotency-Key", str(uuid.uuid4())) headers["Content-Type"] = "application/x-www-form-urlencoded" stripe_version = options.get("stripe_version") if stripe_version: headers["Stripe-Version"] = stripe_version return headers def _args_for_request_with_retries( self, method: str, url: str, params: Optional[Mapping[str, Any]] = None, options: Optional[RequestOptions] = None, *, base_address: BaseAddress, api_mode: ApiMode, usage: Optional[List[str]] = None, ): """ Mechanism for issuing an API call """ request_options = merge_options(self._options, options) if request_options.get("api_key") is None: raise error.AuthenticationError( "No API key provided. (HINT: set your API key using " '"stripe.api_key = "). You can generate API keys ' "from the Stripe web interface. See https://stripe.com/api " "for details, or email support@stripe.com if you have any " "questions." ) abs_url = "%s%s" % ( self._options.base_addresses.get(base_address), url, ) encoded_params = urlencode(list(_api_encode(params or {}))) # Don't use strict form encoding by changing the square bracket control # characters back to their literals. This is fine by the server, and # makes these parameter strings easier to read. encoded_params = encoded_params.replace("%5B", "[").replace("%5D", "]") encoded_body = encoded_params supplied_headers = None if ( "headers" in request_options and request_options["headers"] is not None ): supplied_headers = dict(request_options["headers"]) headers = self.request_headers(method, request_options) if method == "get" or method == "delete": if params: query = encoded_params scheme, netloc, path, base_query, fragment = urlsplit(abs_url) if base_query: query = "%s&%s" % (base_query, query) abs_url = urlunsplit((scheme, netloc, path, query, fragment)) post_data = None elif method == "post": if api_mode == "V1FILES": generator = MultipartDataGenerator() generator.add_params(params or {}) post_data = generator.get_post_data() headers["Content-Type"] = ( "multipart/form-data; boundary=%s" % (generator.boundary,) ) else: post_data = encoded_body else: raise error.APIConnectionError( "Unrecognized HTTP method %r. This may indicate a bug in the " "Stripe bindings. Please contact support@stripe.com for " "assistance." % (method,) ) if supplied_headers is not None: for key, value in supplied_headers.items(): headers[key] = value max_network_retries = request_options.get("max_network_retries") return ( # Actual args method, abs_url, headers, post_data, max_network_retries, usage, # For logging encoded_params, request_options.get("stripe_version"), ) def request_raw( self, method: str, url: str, params: Optional[Mapping[str, Any]] = None, options: Optional[RequestOptions] = None, is_streaming: bool = False, *, base_address: BaseAddress, api_mode: ApiMode, usage: Optional[List[str]] = None, ) -> Tuple[object, int, Mapping[str, str]]: ( method, abs_url, headers, post_data, max_network_retries, usage, encoded_params, api_version, ) = self._args_for_request_with_retries( method, url, params, options, base_address=base_address, api_mode=api_mode, usage=usage, ) log_info("Request to Stripe api", method=method, url=abs_url) log_debug( "Post details", post_data=encoded_params, api_version=api_version ) if is_streaming: ( rcontent, rcode, rheaders, ) = self._get_http_client().request_stream_with_retries( method, abs_url, headers, post_data, max_network_retries=max_network_retries, _usage=usage, ) else: ( rcontent, rcode, rheaders, ) = self._get_http_client().request_with_retries( method, abs_url, headers, post_data, max_network_retries=max_network_retries, _usage=usage, ) log_info("Stripe API response", path=abs_url, response_code=rcode) log_debug("API response body", body=rcontent) if "Request-Id" in rheaders: request_id = rheaders["Request-Id"] log_debug( "Dashboard link for request", link=dashboard_link(request_id), ) return rcontent, rcode, rheaders async def request_raw_async( self, method: str, url: str, params: Optional[Mapping[str, Any]] = None, options: Optional[RequestOptions] = None, is_streaming: bool = False, *, base_address: BaseAddress, api_mode: ApiMode, usage: Optional[List[str]] = None, ) -> Tuple[AsyncIterable[bytes], int, Mapping[str, str]]: """ Mechanism for issuing an API call """ usage = usage or [] usage = usage + ["async"] ( method, abs_url, headers, post_data, max_network_retries, usage, encoded_params, api_version, ) = self._args_for_request_with_retries( method, url, params, options, base_address=base_address, api_mode=api_mode, usage=usage, ) log_info("Request to Stripe api", method=method, url=abs_url) log_debug( "Post details", post_data=encoded_params, api_version=api_version, ) if is_streaming: ( rcontent, rcode, rheaders, ) = await self._get_http_client().request_stream_with_retries_async( method, abs_url, headers, post_data, max_network_retries=max_network_retries, _usage=usage, ) else: ( rcontent, rcode, rheaders, ) = await self._get_http_client().request_with_retries_async( method, abs_url, headers, post_data, max_network_retries=max_network_retries, _usage=usage, ) log_info("Stripe API response", path=abs_url, response_code=rcode) log_debug("API response body", body=rcontent) if "Request-Id" in rheaders: request_id = rheaders["Request-Id"] log_debug( "Dashboard link for request", link=dashboard_link(request_id), ) return rcontent, rcode, rheaders def _should_handle_code_as_error(self, rcode): return not 200 <= rcode < 300 def _interpret_response( self, rbody: object, rcode: int, rheaders: Mapping[str, str], ) -> StripeResponse: try: if hasattr(rbody, "decode"): # TODO: should be able to remove this cast once self._client.request_with_retries # returns a more specific type. rbody = cast(bytes, rbody).decode("utf-8") resp = StripeResponse( cast(str, rbody), rcode, rheaders, ) except Exception: raise error.APIError( "Invalid response body from API: %s " "(HTTP response code was %d)" % (rbody, rcode), cast(bytes, rbody), rcode, rheaders, ) if self._should_handle_code_as_error(rcode): self.handle_error_response(rbody, rcode, resp.data, rheaders) return resp async def _interpret_streaming_response_async( self, stream: AsyncIterable[bytes], rcode: int, rheaders: Mapping[str, str], ) -> StripeStreamResponseAsync: if self._should_handle_code_as_error(rcode): json_content = b"".join([chunk async for chunk in stream]) self._interpret_response(json_content, rcode, rheaders) # _interpret_response is guaranteed to throw since we've checked self._should_handle_code_as_error raise RuntimeError( "_interpret_response should have raised an error" ) else: return StripeStreamResponseAsync(stream, rcode, rheaders) def _interpret_streaming_response( self, stream: IOBase, rcode: int, rheaders: Mapping[str, str], ) -> StripeStreamResponse: # Streaming response are handled with minimal processing for the success # case (ie. we don't want to read the content). When an error is # received, we need to read from the stream and parse the received JSON, # treating it like a standard JSON response. if self._should_handle_code_as_error(rcode): if hasattr(stream, "getvalue"): json_content = cast(BytesIO, stream).getvalue() elif hasattr(stream, "read"): json_content = stream.read() else: raise NotImplementedError( "HTTP client %s does not return an IOBase object which " "can be consumed when streaming a response." % self._get_http_client().name ) self._interpret_response(json_content, rcode, rheaders) # _interpret_response is guaranteed to throw since we've checked self._should_handle_code_as_error raise RuntimeError( "_interpret_response should have raised an error" ) else: return StripeStreamResponse(stream, rcode, rheaders) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_api_resource.py0000644000175100001770000001544014637354563017227 0ustar00runnerdockerfrom typing_extensions import Literal, Self from stripe._error import InvalidRequestError from stripe._stripe_object import StripeObject from stripe._request_options import extract_options_from_dict from stripe._api_mode import ApiMode from stripe._base_address import BaseAddress from stripe._api_requestor import _APIRequestor from stripe import _util from urllib.parse import quote_plus from typing import ( Any, ClassVar, Generic, List, Optional, TypeVar, cast, Mapping, ) T = TypeVar("T", bound=StripeObject) class APIResource(StripeObject, Generic[T]): OBJECT_NAME: ClassVar[str] @classmethod @_util.deprecated( "This method is deprecated and will be removed in a future version of stripe-python. Child classes of APIResource should define their own `retrieve` and use APIResource._request directly." ) def retrieve(cls, id, **params) -> T: instance = cls(id, **params) instance.refresh() return cast(T, instance) def refresh(self) -> Self: return self._request_and_refresh("get", self.instance_url()) async def refresh_async(self) -> Self: return await self._request_and_refresh_async( "get", self.instance_url() ) @classmethod def class_url(cls) -> str: if cls == APIResource: raise NotImplementedError( "APIResource is an abstract class. You should perform " "actions on its subclasses (e.g. Charge, Customer)" ) # Namespaces are separated in object names with periods (.) and in URLs # with forward slashes (/), so replace the former with the latter. base = cls.OBJECT_NAME.replace(".", "/") return "/v1/%ss" % (base,) def instance_url(self) -> str: id = self.get("id") if not isinstance(id, str): raise InvalidRequestError( "Could not determine which URL to request: %s instance " "has invalid ID: %r, %s. ID should be of type `str` (or" " `unicode`)" % (type(self).__name__, id, type(id)), "id", ) base = self.class_url() extn = quote_plus(id) return "%s/%s" % (base, extn) def _request( self, method, url, params=None, *, base_address: BaseAddress = "api", api_mode: ApiMode = "V1", ) -> StripeObject: obj = StripeObject._request( self, method, url, params=params, base_address=base_address, api_mode=api_mode, ) if type(self) is type(obj): self._refresh_from(values=obj, api_mode=api_mode) return self else: return obj async def _request_async( self, method, url, params=None, *, base_address: BaseAddress = "api", api_mode: ApiMode = "V1", ) -> StripeObject: obj = await StripeObject._request_async( self, method, url, params=params, base_address=base_address, api_mode=api_mode, ) if type(self) is type(obj): self._refresh_from(values=obj, api_mode=api_mode) return self else: return obj def _request_and_refresh( self, method: Literal["get", "post", "delete"], url: str, params: Optional[Mapping[str, Any]] = None, usage: Optional[List[str]] = None, *, base_address: BaseAddress = "api", api_mode: ApiMode = "V1", ) -> Self: obj = StripeObject._request( self, method, url, params=params, base_address=base_address, api_mode=api_mode, usage=usage, ) self._refresh_from(values=obj, api_mode=api_mode) return self async def _request_and_refresh_async( self, method: Literal["get", "post", "delete"], url: str, params: Optional[Mapping[str, Any]] = None, usage: Optional[List[str]] = None, *, base_address: BaseAddress = "api", api_mode: ApiMode = "V1", ) -> Self: obj = await StripeObject._request_async( self, method, url, params=params, base_address=base_address, api_mode=api_mode, usage=usage, ) self._refresh_from(values=obj, api_mode=api_mode) return self @classmethod def _static_request( cls, method_, url_, params: Optional[Mapping[str, Any]] = None, *, base_address: BaseAddress = "api", api_mode: ApiMode = "V1", ): request_options, request_params = extract_options_from_dict(params) return _APIRequestor._global_instance().request( method_, url_, params=request_params, options=request_options, base_address=base_address, api_mode=api_mode, ) @classmethod async def _static_request_async( cls, method_, url_, params: Optional[Mapping[str, Any]] = None, *, base_address: BaseAddress = "api", api_mode: ApiMode = "V1", ): request_options, request_params = extract_options_from_dict(params) return await _APIRequestor._global_instance().request_async( method_, url_, params=request_params, options=request_options, base_address=base_address, api_mode=api_mode, ) @classmethod def _static_request_stream( cls, method, url, params: Optional[Mapping[str, Any]] = None, *, base_address: BaseAddress = "api", api_mode: ApiMode = "V1", ): request_options, request_params = extract_options_from_dict(params) return _APIRequestor._global_instance().request_stream( method, url, params=request_params, options=request_options, base_address=base_address, api_mode=api_mode, ) @classmethod async def _static_request_stream_async( cls, method, url, params: Optional[Mapping[str, Any]] = None, *, base_address: BaseAddress = "api", api_mode: ApiMode = "V1", ): request_options, request_params = extract_options_from_dict(params) return await _APIRequestor._global_instance().request_stream_async( method, url, params=request_params, options=request_options, base_address=base_address, api_mode=api_mode, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_api_version.py0000644000175100001770000000015514637354563017062 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec class _ApiVersion: CURRENT = "2024-06-20" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_app_info.py0000644000175100001770000000027614637354563016343 0ustar00runnerdockerfrom typing import Optional from typing_extensions import TypedDict class AppInfo(TypedDict): name: str partner_id: Optional[str] url: Optional[str] version: Optional[str] ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_apple_pay_domain.py0000644000175100001770000001743014637354563020051 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._deletable_api_resource import DeletableAPIResource from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, List, Optional, cast, overload from typing_extensions import Literal, NotRequired, Unpack class ApplePayDomain( CreateableAPIResource["ApplePayDomain"], DeletableAPIResource["ApplePayDomain"], ListableAPIResource["ApplePayDomain"], ): OBJECT_NAME: ClassVar[Literal["apple_pay_domain"]] = "apple_pay_domain" class CreateParams(RequestOptions): domain_name: str expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class DeleteParams(RequestOptions): pass class ListParams(RequestOptions): domain_name: NotRequired[str] ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ domain_name: str id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ object: Literal["apple_pay_domain"] """ String representing the object's type. Objects of the same type share the same value. """ deleted: Optional[Literal[True]] """ Always true for a deleted object """ @classmethod def create( cls, **params: Unpack["ApplePayDomain.CreateParams"] ) -> "ApplePayDomain": """ Create an apple pay domain. """ return cast( "ApplePayDomain", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["ApplePayDomain.CreateParams"] ) -> "ApplePayDomain": """ Create an apple pay domain. """ return cast( "ApplePayDomain", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def _cls_delete( cls, sid: str, **params: Unpack["ApplePayDomain.DeleteParams"] ) -> "ApplePayDomain": """ Delete an apple pay domain. """ url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "ApplePayDomain", cls._static_request( "delete", url, params=params, ), ) @overload @staticmethod def delete( sid: str, **params: Unpack["ApplePayDomain.DeleteParams"] ) -> "ApplePayDomain": """ Delete an apple pay domain. """ ... @overload def delete( self, **params: Unpack["ApplePayDomain.DeleteParams"] ) -> "ApplePayDomain": """ Delete an apple pay domain. """ ... @class_method_variant("_cls_delete") def delete( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["ApplePayDomain.DeleteParams"] ) -> "ApplePayDomain": """ Delete an apple pay domain. """ return self._request_and_refresh( "delete", self.instance_url(), params=params, ) @classmethod async def _cls_delete_async( cls, sid: str, **params: Unpack["ApplePayDomain.DeleteParams"] ) -> "ApplePayDomain": """ Delete an apple pay domain. """ url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "ApplePayDomain", await cls._static_request_async( "delete", url, params=params, ), ) @overload @staticmethod async def delete_async( sid: str, **params: Unpack["ApplePayDomain.DeleteParams"] ) -> "ApplePayDomain": """ Delete an apple pay domain. """ ... @overload async def delete_async( self, **params: Unpack["ApplePayDomain.DeleteParams"] ) -> "ApplePayDomain": """ Delete an apple pay domain. """ ... @class_method_variant("_cls_delete_async") async def delete_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["ApplePayDomain.DeleteParams"] ) -> "ApplePayDomain": """ Delete an apple pay domain. """ return await self._request_and_refresh_async( "delete", self.instance_url(), params=params, ) @classmethod def list( cls, **params: Unpack["ApplePayDomain.ListParams"] ) -> ListObject["ApplePayDomain"]: """ List apple pay domains. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["ApplePayDomain.ListParams"] ) -> ListObject["ApplePayDomain"]: """ List apple pay domains. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def retrieve( cls, id: str, **params: Unpack["ApplePayDomain.RetrieveParams"] ) -> "ApplePayDomain": """ Retrieve an apple pay domain. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["ApplePayDomain.RetrieveParams"] ) -> "ApplePayDomain": """ Retrieve an apple pay domain. """ instance = cls(id, **params) await instance.refresh_async() return instance @classmethod def class_url(cls): return "/v1/apple_pay/domains" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_apple_pay_domain_service.py0000644000175100001770000001464714637354563021600 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._apple_pay_domain import ApplePayDomain from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict class ApplePayDomainService(StripeService): class CreateParams(TypedDict): domain_name: str expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class DeleteParams(TypedDict): pass class ListParams(TypedDict): domain_name: NotRequired[str] ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def delete( self, domain: str, params: "ApplePayDomainService.DeleteParams" = {}, options: RequestOptions = {}, ) -> ApplePayDomain: """ Delete an apple pay domain. """ return cast( ApplePayDomain, self._request( "delete", "/v1/apple_pay/domains/{domain}".format( domain=sanitize_id(domain), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def delete_async( self, domain: str, params: "ApplePayDomainService.DeleteParams" = {}, options: RequestOptions = {}, ) -> ApplePayDomain: """ Delete an apple pay domain. """ return cast( ApplePayDomain, await self._request_async( "delete", "/v1/apple_pay/domains/{domain}".format( domain=sanitize_id(domain), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, domain: str, params: "ApplePayDomainService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> ApplePayDomain: """ Retrieve an apple pay domain. """ return cast( ApplePayDomain, self._request( "get", "/v1/apple_pay/domains/{domain}".format( domain=sanitize_id(domain), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, domain: str, params: "ApplePayDomainService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> ApplePayDomain: """ Retrieve an apple pay domain. """ return cast( ApplePayDomain, await self._request_async( "get", "/v1/apple_pay/domains/{domain}".format( domain=sanitize_id(domain), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def list( self, params: "ApplePayDomainService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[ApplePayDomain]: """ List apple pay domains. """ return cast( ListObject[ApplePayDomain], self._request( "get", "/v1/apple_pay/domains", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "ApplePayDomainService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[ApplePayDomain]: """ List apple pay domains. """ return cast( ListObject[ApplePayDomain], await self._request_async( "get", "/v1/apple_pay/domains", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "ApplePayDomainService.CreateParams", options: RequestOptions = {}, ) -> ApplePayDomain: """ Create an apple pay domain. """ return cast( ApplePayDomain, self._request( "post", "/v1/apple_pay/domains", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "ApplePayDomainService.CreateParams", options: RequestOptions = {}, ) -> ApplePayDomain: """ Create an apple pay domain. """ return cast( ApplePayDomain, await self._request_async( "post", "/v1/apple_pay/domains", api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_application.py0000644000175100001770000000122114637354563017042 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject from typing import ClassVar, Optional from typing_extensions import Literal class Application(StripeObject): OBJECT_NAME: ClassVar[Literal["application"]] = "application" id: str """ Unique identifier for the object. """ name: Optional[str] """ The name of the application. """ object: Literal["application"] """ String representing the object's type. Objects of the same type share the same value. """ deleted: Optional[Literal[True]] """ Always true for a deleted object """ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_application_fee.py0000644000175100001770000006117414637354563017676 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._nested_resource_class_methods import nested_resource_class_methods from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._account import Account from stripe._application import Application from stripe._application_fee_refund import ApplicationFeeRefund from stripe._balance_transaction import BalanceTransaction from stripe._charge import Charge @nested_resource_class_methods("refund") class ApplicationFee(ListableAPIResource["ApplicationFee"]): OBJECT_NAME: ClassVar[Literal["application_fee"]] = "application_fee" class FeeSource(StripeObject): charge: Optional[str] """ Charge ID that created this application fee. """ payout: Optional[str] """ Payout ID that created this application fee. """ type: Literal["charge", "payout"] """ Type of object that created the application fee, either `charge` or `payout`. """ class CreateRefundParams(RequestOptions): amount: NotRequired[int] """ A positive integer, in _cents (or local equivalent)_, representing how much of this fee to refund. Can refund only up to the remaining unrefunded amount of the fee. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ class ListParams(RequestOptions): charge: NotRequired[str] """ Only return application fees for the charge specified by this charge ID. """ created: NotRequired["ApplicationFee.ListParamsCreated|int"] """ Only return applications fees that were created during the given date interval. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListRefundsParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ModifyRefundParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ class RefundParams(RequestOptions): amount: NotRequired[int] """ A positive integer, in _cents (or local equivalent)_, representing how much of this fee to refund. Can refund only up to the remaining unrefunded amount of the fee. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveRefundParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ account: ExpandableField["Account"] """ ID of the Stripe account this fee was taken from. """ amount: int """ Amount earned, in cents (or local equivalent). """ amount_refunded: int """ Amount in cents (or local equivalent) refunded (can be less than the amount attribute on the fee if a partial refund was issued) """ application: ExpandableField["Application"] """ ID of the Connect application that earned the fee. """ balance_transaction: Optional[ExpandableField["BalanceTransaction"]] """ Balance transaction that describes the impact of this collected application fee on your account balance (not including refunds). """ charge: ExpandableField["Charge"] """ ID of the charge that the application fee was taken from. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ 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). """ fee_source: Optional[FeeSource] """ Polymorphic source of the application fee. Includes the ID of the object the application fee was created from. """ id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ object: Literal["application_fee"] """ String representing the object's type. Objects of the same type share the same value. """ originating_transaction: Optional[ExpandableField["Charge"]] """ ID of the corresponding charge on the platform account, if this fee was the result of a charge using the `destination` parameter. """ refunded: bool """ Whether the fee has been fully refunded. If the fee is only partially refunded, this attribute will still be false. """ refunds: ListObject["ApplicationFeeRefund"] """ A list of refunds that have been applied to the fee. """ @classmethod def list( cls, **params: Unpack["ApplicationFee.ListParams"] ) -> ListObject["ApplicationFee"]: """ Returns a list of application fees you've previously collected. The application fees are returned in sorted order, with the most recent fees appearing first. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["ApplicationFee.ListParams"] ) -> ListObject["ApplicationFee"]: """ Returns a list of application fees you've previously collected. The application fees are returned in sorted order, with the most recent fees appearing first. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def _cls_refund( cls, id: str, **params: Unpack["ApplicationFee.RefundParams"] ) -> "ApplicationFeeRefund": """ Refunds an application fee that has previously been collected but not yet refunded. Funds will be refunded to the Stripe account from which the fee was originally collected. You can optionally refund only part of an application fee. You can do so multiple times, until the entire fee has been refunded. Once entirely refunded, an application fee can't be refunded again. This method will raise an error when called on an already-refunded application fee, or when trying to refund more money than is left on an application fee. """ return cast( "ApplicationFeeRefund", cls._static_request( "post", "/v1/application_fees/{id}/refunds".format(id=sanitize_id(id)), params=params, ), ) @overload @staticmethod def refund( id: str, **params: Unpack["ApplicationFee.RefundParams"] ) -> "ApplicationFeeRefund": """ Refunds an application fee that has previously been collected but not yet refunded. Funds will be refunded to the Stripe account from which the fee was originally collected. You can optionally refund only part of an application fee. You can do so multiple times, until the entire fee has been refunded. Once entirely refunded, an application fee can't be refunded again. This method will raise an error when called on an already-refunded application fee, or when trying to refund more money than is left on an application fee. """ ... @overload def refund( self, **params: Unpack["ApplicationFee.RefundParams"] ) -> "ApplicationFeeRefund": """ Refunds an application fee that has previously been collected but not yet refunded. Funds will be refunded to the Stripe account from which the fee was originally collected. You can optionally refund only part of an application fee. You can do so multiple times, until the entire fee has been refunded. Once entirely refunded, an application fee can't be refunded again. This method will raise an error when called on an already-refunded application fee, or when trying to refund more money than is left on an application fee. """ ... @class_method_variant("_cls_refund") def refund( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["ApplicationFee.RefundParams"] ) -> "ApplicationFeeRefund": """ Refunds an application fee that has previously been collected but not yet refunded. Funds will be refunded to the Stripe account from which the fee was originally collected. You can optionally refund only part of an application fee. You can do so multiple times, until the entire fee has been refunded. Once entirely refunded, an application fee can't be refunded again. This method will raise an error when called on an already-refunded application fee, or when trying to refund more money than is left on an application fee. """ return cast( "ApplicationFeeRefund", self._request( "post", "/v1/application_fees/{id}/refunds".format( id=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_refund_async( cls, id: str, **params: Unpack["ApplicationFee.RefundParams"] ) -> "ApplicationFeeRefund": """ Refunds an application fee that has previously been collected but not yet refunded. Funds will be refunded to the Stripe account from which the fee was originally collected. You can optionally refund only part of an application fee. You can do so multiple times, until the entire fee has been refunded. Once entirely refunded, an application fee can't be refunded again. This method will raise an error when called on an already-refunded application fee, or when trying to refund more money than is left on an application fee. """ return cast( "ApplicationFeeRefund", await cls._static_request_async( "post", "/v1/application_fees/{id}/refunds".format(id=sanitize_id(id)), params=params, ), ) @overload @staticmethod async def refund_async( id: str, **params: Unpack["ApplicationFee.RefundParams"] ) -> "ApplicationFeeRefund": """ Refunds an application fee that has previously been collected but not yet refunded. Funds will be refunded to the Stripe account from which the fee was originally collected. You can optionally refund only part of an application fee. You can do so multiple times, until the entire fee has been refunded. Once entirely refunded, an application fee can't be refunded again. This method will raise an error when called on an already-refunded application fee, or when trying to refund more money than is left on an application fee. """ ... @overload async def refund_async( self, **params: Unpack["ApplicationFee.RefundParams"] ) -> "ApplicationFeeRefund": """ Refunds an application fee that has previously been collected but not yet refunded. Funds will be refunded to the Stripe account from which the fee was originally collected. You can optionally refund only part of an application fee. You can do so multiple times, until the entire fee has been refunded. Once entirely refunded, an application fee can't be refunded again. This method will raise an error when called on an already-refunded application fee, or when trying to refund more money than is left on an application fee. """ ... @class_method_variant("_cls_refund_async") async def refund_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["ApplicationFee.RefundParams"] ) -> "ApplicationFeeRefund": """ Refunds an application fee that has previously been collected but not yet refunded. Funds will be refunded to the Stripe account from which the fee was originally collected. You can optionally refund only part of an application fee. You can do so multiple times, until the entire fee has been refunded. Once entirely refunded, an application fee can't be refunded again. This method will raise an error when called on an already-refunded application fee, or when trying to refund more money than is left on an application fee. """ return cast( "ApplicationFeeRefund", await self._request_async( "post", "/v1/application_fees/{id}/refunds".format( id=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["ApplicationFee.RetrieveParams"] ) -> "ApplicationFee": """ Retrieves the details of an application fee that your account has collected. The same information is returned when refunding the application fee. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["ApplicationFee.RetrieveParams"] ) -> "ApplicationFee": """ Retrieves the details of an application fee that your account has collected. The same information is returned when refunding the application fee. """ instance = cls(id, **params) await instance.refresh_async() return instance @classmethod def create_refund( cls, id: str, **params: Unpack["ApplicationFee.CreateRefundParams"] ) -> "ApplicationFeeRefund": """ Refunds an application fee that has previously been collected but not yet refunded. Funds will be refunded to the Stripe account from which the fee was originally collected. You can optionally refund only part of an application fee. You can do so multiple times, until the entire fee has been refunded. Once entirely refunded, an application fee can't be refunded again. This method will raise an error when called on an already-refunded application fee, or when trying to refund more money than is left on an application fee. """ return cast( "ApplicationFeeRefund", cls._static_request( "post", "/v1/application_fees/{id}/refunds".format(id=sanitize_id(id)), params=params, ), ) @classmethod async def create_refund_async( cls, id: str, **params: Unpack["ApplicationFee.CreateRefundParams"] ) -> "ApplicationFeeRefund": """ Refunds an application fee that has previously been collected but not yet refunded. Funds will be refunded to the Stripe account from which the fee was originally collected. You can optionally refund only part of an application fee. You can do so multiple times, until the entire fee has been refunded. Once entirely refunded, an application fee can't be refunded again. This method will raise an error when called on an already-refunded application fee, or when trying to refund more money than is left on an application fee. """ return cast( "ApplicationFeeRefund", await cls._static_request_async( "post", "/v1/application_fees/{id}/refunds".format(id=sanitize_id(id)), params=params, ), ) @classmethod def retrieve_refund( cls, fee: str, id: str, **params: Unpack["ApplicationFee.RetrieveRefundParams"], ) -> "ApplicationFeeRefund": """ By default, you can see the 10 most recent refunds stored directly on the application fee object, but you can also retrieve details about a specific refund stored on the application fee. """ return cast( "ApplicationFeeRefund", cls._static_request( "get", "/v1/application_fees/{fee}/refunds/{id}".format( fee=sanitize_id(fee), id=sanitize_id(id) ), params=params, ), ) @classmethod async def retrieve_refund_async( cls, fee: str, id: str, **params: Unpack["ApplicationFee.RetrieveRefundParams"], ) -> "ApplicationFeeRefund": """ By default, you can see the 10 most recent refunds stored directly on the application fee object, but you can also retrieve details about a specific refund stored on the application fee. """ return cast( "ApplicationFeeRefund", await cls._static_request_async( "get", "/v1/application_fees/{fee}/refunds/{id}".format( fee=sanitize_id(fee), id=sanitize_id(id) ), params=params, ), ) @classmethod def modify_refund( cls, fee: str, id: str, **params: Unpack["ApplicationFee.ModifyRefundParams"], ) -> "ApplicationFeeRefund": """ Updates the specified application fee refund by setting the values of the parameters passed. Any parameters not provided will be left unchanged. This request only accepts metadata as an argument. """ return cast( "ApplicationFeeRefund", cls._static_request( "post", "/v1/application_fees/{fee}/refunds/{id}".format( fee=sanitize_id(fee), id=sanitize_id(id) ), params=params, ), ) @classmethod async def modify_refund_async( cls, fee: str, id: str, **params: Unpack["ApplicationFee.ModifyRefundParams"], ) -> "ApplicationFeeRefund": """ Updates the specified application fee refund by setting the values of the parameters passed. Any parameters not provided will be left unchanged. This request only accepts metadata as an argument. """ return cast( "ApplicationFeeRefund", await cls._static_request_async( "post", "/v1/application_fees/{fee}/refunds/{id}".format( fee=sanitize_id(fee), id=sanitize_id(id) ), params=params, ), ) @classmethod def list_refunds( cls, id: str, **params: Unpack["ApplicationFee.ListRefundsParams"] ) -> ListObject["ApplicationFeeRefund"]: """ You can see a list of the refunds belonging to a specific application fee. Note that the 10 most recent refunds are always available by default on the application fee object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional refunds. """ return cast( ListObject["ApplicationFeeRefund"], cls._static_request( "get", "/v1/application_fees/{id}/refunds".format(id=sanitize_id(id)), params=params, ), ) @classmethod async def list_refunds_async( cls, id: str, **params: Unpack["ApplicationFee.ListRefundsParams"] ) -> ListObject["ApplicationFeeRefund"]: """ You can see a list of the refunds belonging to a specific application fee. Note that the 10 most recent refunds are always available by default on the application fee object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional refunds. """ return cast( ListObject["ApplicationFeeRefund"], await cls._static_request_async( "get", "/v1/application_fees/{id}/refunds".format(id=sanitize_id(id)), params=params, ), ) _inner_class_types = {"fee_source": FeeSource} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_application_fee_refund.py0000644000175100001770000000557314637354563021242 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._application_fee import ApplicationFee from stripe._expandable_field import ExpandableField from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import sanitize_id from typing import ClassVar, Dict, Optional, cast from typing_extensions import Literal, TYPE_CHECKING if TYPE_CHECKING: from stripe._balance_transaction import BalanceTransaction class ApplicationFeeRefund(UpdateableAPIResource["ApplicationFeeRefund"]): """ `Application Fee Refund` objects allow you to refund an application fee that has previously been created but not yet refunded. Funds will be refunded to the Stripe account from which the fee was originally collected. Related guide: [Refunding application fees](https://stripe.com/docs/connect/destination-charges#refunding-app-fee) """ OBJECT_NAME: ClassVar[Literal["fee_refund"]] = "fee_refund" amount: int """ Amount, in cents (or local equivalent). """ balance_transaction: Optional[ExpandableField["BalanceTransaction"]] """ Balance transaction that describes the impact on your account balance. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ 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). """ fee: ExpandableField["ApplicationFee"] """ ID of the application fee that was refunded. """ id: str """ Unique identifier for the object. """ metadata: Optional[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ object: Literal["fee_refund"] """ String representing the object's type. Objects of the same type share the same value. """ @classmethod def _build_instance_url(cls, fee, sid): base = ApplicationFee.class_url() cust_extn = sanitize_id(fee) extn = sanitize_id(sid) return "%s/%s/refunds/%s" % (base, cust_extn, extn) @classmethod def modify(cls, fee, sid, **params) -> "ApplicationFeeRefund": url = cls._build_instance_url(fee, sid) return cast( "ApplicationFeeRefund", cls._static_request("post", url, params=params), ) def instance_url(self): return self._build_instance_url(self.fee, self.id) @classmethod def retrieve(cls, id, **params) -> "ApplicationFeeRefund": raise NotImplementedError( "Can't retrieve a refund without an application fee ID. " "Use application_fee.refunds.retrieve('refund_id') instead." ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_application_fee_refund_service.py0000644000175100001770000002462214637354563022756 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._application_fee_refund import ApplicationFeeRefund from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class ApplicationFeeRefundService(StripeService): class CreateParams(TypedDict): amount: NotRequired[int] """ A positive integer, in _cents (or local equivalent)_, representing how much of this fee to refund. Can refund only up to the remaining unrefunded amount of the fee. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ class ListParams(TypedDict): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ def retrieve( self, fee: str, id: str, params: "ApplicationFeeRefundService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> ApplicationFeeRefund: """ By default, you can see the 10 most recent refunds stored directly on the application fee object, but you can also retrieve details about a specific refund stored on the application fee. """ return cast( ApplicationFeeRefund, self._request( "get", "/v1/application_fees/{fee}/refunds/{id}".format( fee=sanitize_id(fee), id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, fee: str, id: str, params: "ApplicationFeeRefundService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> ApplicationFeeRefund: """ By default, you can see the 10 most recent refunds stored directly on the application fee object, but you can also retrieve details about a specific refund stored on the application fee. """ return cast( ApplicationFeeRefund, await self._request_async( "get", "/v1/application_fees/{fee}/refunds/{id}".format( fee=sanitize_id(fee), id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, fee: str, id: str, params: "ApplicationFeeRefundService.UpdateParams" = {}, options: RequestOptions = {}, ) -> ApplicationFeeRefund: """ Updates the specified application fee refund by setting the values of the parameters passed. Any parameters not provided will be left unchanged. This request only accepts metadata as an argument. """ return cast( ApplicationFeeRefund, self._request( "post", "/v1/application_fees/{fee}/refunds/{id}".format( fee=sanitize_id(fee), id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, fee: str, id: str, params: "ApplicationFeeRefundService.UpdateParams" = {}, options: RequestOptions = {}, ) -> ApplicationFeeRefund: """ Updates the specified application fee refund by setting the values of the parameters passed. Any parameters not provided will be left unchanged. This request only accepts metadata as an argument. """ return cast( ApplicationFeeRefund, await self._request_async( "post", "/v1/application_fees/{fee}/refunds/{id}".format( fee=sanitize_id(fee), id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def list( self, id: str, params: "ApplicationFeeRefundService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[ApplicationFeeRefund]: """ You can see a list of the refunds belonging to a specific application fee. Note that the 10 most recent refunds are always available by default on the application fee object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional refunds. """ return cast( ListObject[ApplicationFeeRefund], self._request( "get", "/v1/application_fees/{id}/refunds".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, id: str, params: "ApplicationFeeRefundService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[ApplicationFeeRefund]: """ You can see a list of the refunds belonging to a specific application fee. Note that the 10 most recent refunds are always available by default on the application fee object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional refunds. """ return cast( ListObject[ApplicationFeeRefund], await self._request_async( "get", "/v1/application_fees/{id}/refunds".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, id: str, params: "ApplicationFeeRefundService.CreateParams" = {}, options: RequestOptions = {}, ) -> ApplicationFeeRefund: """ Refunds an application fee that has previously been collected but not yet refunded. Funds will be refunded to the Stripe account from which the fee was originally collected. You can optionally refund only part of an application fee. You can do so multiple times, until the entire fee has been refunded. Once entirely refunded, an application fee can't be refunded again. This method will raise an error when called on an already-refunded application fee, or when trying to refund more money than is left on an application fee. """ return cast( ApplicationFeeRefund, self._request( "post", "/v1/application_fees/{id}/refunds".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, id: str, params: "ApplicationFeeRefundService.CreateParams" = {}, options: RequestOptions = {}, ) -> ApplicationFeeRefund: """ Refunds an application fee that has previously been collected but not yet refunded. Funds will be refunded to the Stripe account from which the fee was originally collected. You can optionally refund only part of an application fee. You can do so multiple times, until the entire fee has been refunded. Once entirely refunded, an application fee can't be refunded again. This method will raise an error when called on an already-refunded application fee, or when trying to refund more money than is left on an application fee. """ return cast( ApplicationFeeRefund, await self._request_async( "post", "/v1/application_fees/{id}/refunds".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_application_fee_service.py0000644000175100001770000001237414637354563021414 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._application_fee import ApplicationFee from stripe._application_fee_refund_service import ApplicationFeeRefundService from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict class ApplicationFeeService(StripeService): def __init__(self, requestor): super().__init__(requestor) self.refunds = ApplicationFeeRefundService(self._requestor) class ListParams(TypedDict): charge: NotRequired[str] """ Only return application fees for the charge specified by this charge ID. """ created: NotRequired["ApplicationFeeService.ListParamsCreated|int"] """ Only return applications fees that were created during the given date interval. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def list( self, params: "ApplicationFeeService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[ApplicationFee]: """ Returns a list of application fees you've previously collected. The application fees are returned in sorted order, with the most recent fees appearing first. """ return cast( ListObject[ApplicationFee], self._request( "get", "/v1/application_fees", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "ApplicationFeeService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[ApplicationFee]: """ Returns a list of application fees you've previously collected. The application fees are returned in sorted order, with the most recent fees appearing first. """ return cast( ListObject[ApplicationFee], await self._request_async( "get", "/v1/application_fees", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, id: str, params: "ApplicationFeeService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> ApplicationFee: """ Retrieves the details of an application fee that your account has collected. The same information is returned when refunding the application fee. """ return cast( ApplicationFee, self._request( "get", "/v1/application_fees/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, id: str, params: "ApplicationFeeService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> ApplicationFee: """ Retrieves the details of an application fee that your account has collected. The same information is returned when refunding the application fee. """ return cast( ApplicationFee, await self._request_async( "get", "/v1/application_fees/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_apps_service.py0000644000175100001770000000050714637354563017230 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_service import StripeService from stripe.apps._secret_service import SecretService class AppsService(StripeService): def __init__(self, requestor): super().__init__(requestor) self.secrets = SecretService(self._requestor) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_balance.py0000644000175100001770000002147314637354563016137 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._singleton_api_resource import SingletonAPIResource from stripe._stripe_object import StripeObject from typing import ClassVar, List, Optional from typing_extensions import Literal, NotRequired, Unpack class Balance(SingletonAPIResource["Balance"]): """ This is an object representing your Stripe balance. You can retrieve it to see the balance currently on your Stripe account. You can also retrieve the balance history, which contains a list of [transactions](https://stripe.com/docs/reporting/balance-transaction-types) that contributed to the balance (charges, payouts, and so forth). The available and pending amounts for each currency are broken down further by payment source types. Related guide: [Understanding Connect account balances](https://stripe.com/docs/connect/account-balances) """ OBJECT_NAME: ClassVar[Literal["balance"]] = "balance" class Available(StripeObject): class SourceTypes(StripeObject): bank_account: Optional[int] """ Amount for bank account. """ card: Optional[int] """ Amount for card. """ fpx: Optional[int] """ Amount for FPX. """ amount: int """ Balance amount. """ 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). """ source_types: Optional[SourceTypes] _inner_class_types = {"source_types": SourceTypes} class ConnectReserved(StripeObject): class SourceTypes(StripeObject): bank_account: Optional[int] """ Amount for bank account. """ card: Optional[int] """ Amount for card. """ fpx: Optional[int] """ Amount for FPX. """ amount: int """ Balance amount. """ 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). """ source_types: Optional[SourceTypes] _inner_class_types = {"source_types": SourceTypes} class InstantAvailable(StripeObject): class NetAvailable(StripeObject): class SourceTypes(StripeObject): bank_account: Optional[int] """ Amount for bank account. """ card: Optional[int] """ Amount for card. """ fpx: Optional[int] """ Amount for FPX. """ amount: int """ Net balance amount, subtracting fees from platform-set pricing. """ destination: str """ ID of the external account for this net balance (not expandable). """ source_types: Optional[SourceTypes] _inner_class_types = {"source_types": SourceTypes} class SourceTypes(StripeObject): bank_account: Optional[int] """ Amount for bank account. """ card: Optional[int] """ Amount for card. """ fpx: Optional[int] """ Amount for FPX. """ amount: int """ Balance amount. """ 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). """ net_available: Optional[List[NetAvailable]] """ Breakdown of balance by destination. """ source_types: Optional[SourceTypes] _inner_class_types = { "net_available": NetAvailable, "source_types": SourceTypes, } class Issuing(StripeObject): class Available(StripeObject): class SourceTypes(StripeObject): bank_account: Optional[int] """ Amount for bank account. """ card: Optional[int] """ Amount for card. """ fpx: Optional[int] """ Amount for FPX. """ amount: int """ Balance amount. """ 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). """ source_types: Optional[SourceTypes] _inner_class_types = {"source_types": SourceTypes} available: List[Available] """ Funds that are available for use. """ _inner_class_types = {"available": Available} class Pending(StripeObject): class SourceTypes(StripeObject): bank_account: Optional[int] """ Amount for bank account. """ card: Optional[int] """ Amount for card. """ fpx: Optional[int] """ Amount for FPX. """ amount: int """ Balance amount. """ 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). """ source_types: Optional[SourceTypes] _inner_class_types = {"source_types": SourceTypes} class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ available: List[Available] """ Available funds that you can transfer or pay out automatically by Stripe or explicitly through the [Transfers API](https://stripe.com/docs/api#transfers) or [Payouts API](https://stripe.com/docs/api#payouts). You can find the available balance for each currency and payment type in the `source_types` property. """ connect_reserved: Optional[List[ConnectReserved]] """ Funds held due to negative balances on connected accounts where [account.controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. You can find the connect reserve balance for each currency and payment type in the `source_types` property. """ instant_available: Optional[List[InstantAvailable]] """ Funds that you can pay out using Instant Payouts. """ issuing: Optional[Issuing] 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["balance"] """ String representing the object's type. Objects of the same type share the same value. """ pending: List[Pending] """ Funds that aren't available in the balance yet. You can find the pending balance for each currency and each payment type in the `source_types` property. """ @classmethod def retrieve(cls, **params: Unpack["Balance.RetrieveParams"]) -> "Balance": """ Retrieves the current account balance, based on the authentication that was used to make the request. For a sample request, see [Accounting for negative balances](https://stripe.com/docs/connect/account-balances#accounting-for-negative-balances). """ instance = cls(None, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, **params: Unpack["Balance.RetrieveParams"] ) -> "Balance": """ Retrieves the current account balance, based on the authentication that was used to make the request. For a sample request, see [Accounting for negative balances](https://stripe.com/docs/connect/account-balances#accounting-for-negative-balances). """ instance = cls(None, **params) await instance.refresh_async() return instance @classmethod def class_url(cls): return "/v1/balance" _inner_class_types = { "available": Available, "connect_reserved": ConnectReserved, "instant_available": InstantAvailable, "issuing": Issuing, "pending": Pending, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_balance_service.py0000644000175100001770000000361414637354563017654 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._balance import Balance from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from typing import List, cast from typing_extensions import NotRequired, TypedDict class BalanceService(StripeService): class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def retrieve( self, params: "BalanceService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Balance: """ Retrieves the current account balance, based on the authentication that was used to make the request. For a sample request, see [Accounting for negative balances](https://stripe.com/docs/connect/account-balances#accounting-for-negative-balances). """ return cast( Balance, self._request( "get", "/v1/balance", api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, params: "BalanceService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Balance: """ Retrieves the current account balance, based on the authentication that was used to make the request. For a sample request, see [Accounting for negative balances](https://stripe.com/docs/connect/account-balances#accounting-for-negative-balances). """ return cast( Balance, await self._request_async( "get", "/v1/balance", api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_balance_transaction.py0000644000175100001770000003324414637354563020543 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from typing import ClassVar, List, Optional, Union from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._application_fee import ApplicationFee from stripe._application_fee_refund import ApplicationFeeRefund from stripe._charge import Charge from stripe._connect_collection_transfer import ConnectCollectionTransfer from stripe._customer_cash_balance_transaction import ( CustomerCashBalanceTransaction, ) from stripe._dispute import Dispute as DisputeResource from stripe._payout import Payout from stripe._refund import Refund from stripe._reserve_transaction import ReserveTransaction from stripe._reversal import Reversal from stripe._tax_deducted_at_source import TaxDeductedAtSource from stripe._topup import Topup from stripe._transfer import Transfer from stripe.issuing._authorization import Authorization from stripe.issuing._dispute import Dispute as IssuingDisputeResource from stripe.issuing._transaction import Transaction class BalanceTransaction(ListableAPIResource["BalanceTransaction"]): """ Balance transactions represent funds moving through your Stripe account. Stripe creates them for every type of transaction that enters or leaves your Stripe account balance. Related guide: [Balance transaction types](https://stripe.com/docs/reports/balance-transaction-types) """ OBJECT_NAME: ClassVar[Literal["balance_transaction"]] = ( "balance_transaction" ) class FeeDetail(StripeObject): amount: int """ Amount of the fee, in cents. """ application: Optional[str] """ ID of the Connect application that earned the fee. """ 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. """ type: str """ Type of the fee, one of: `application_fee`, `payment_method_passthrough_fee`, `stripe_fee` or `tax`. """ class ListParams(RequestOptions): created: NotRequired["BalanceTransaction.ListParamsCreated|int"] """ Only return transactions that were created during the given date interval. """ currency: NotRequired[str] """ Only return transactions in a certain currency. 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). """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ payout: NotRequired[str] """ For automatic Stripe payouts only, only returns transactions that were paid out on the specified payout ID. """ source: NotRequired[str] """ Only returns the original transaction. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ type: NotRequired[str] """ Only returns transactions of the given type. One of: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `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`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ amount: int """ Gross amount of this transaction (in cents (or local equivalent)). A positive value represents funds charged to another party, and a negative value represents funds sent to another party. """ available_on: int """ The date that the transaction's net funds become available in the Stripe balance. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ 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. """ exchange_rate: Optional[float] """ If applicable, this transaction uses an exchange rate. If money converts from currency A to currency B, then the `amount` in currency A, multipled by the `exchange_rate`, equals the `amount` in currency B. For example, if you charge a customer 10.00 EUR, the PaymentIntent's `amount` is `1000` and `currency` is `eur`. If this converts to 12.34 USD in your Stripe account, the BalanceTransaction's `amount` is `1234`, its `currency` is `usd`, and the `exchange_rate` is `1.234`. """ fee: int """ Fees (in cents (or local equivalent)) paid for this transaction. Represented as a positive integer when assessed. """ fee_details: List[FeeDetail] """ Detailed breakdown of fees (in cents (or local equivalent)) paid for this transaction. """ id: str """ Unique identifier for the object. """ net: int """ Net impact to a Stripe balance (in cents (or local equivalent)). A positive value represents incrementing a Stripe balance, and a negative value decrementing a Stripe balance. You can calculate the net impact of a transaction on a balance by `amount` - `fee` """ object: Literal["balance_transaction"] """ String representing the object's type. Objects of the same type share the same value. """ reporting_category: str """ Learn more about how [reporting categories](https://stripe.com/docs/reports/reporting-categories) can help you understand balance transactions from an accounting perspective. """ source: Optional[ ExpandableField[ Union[ "ApplicationFee", "Charge", "ConnectCollectionTransfer", "CustomerCashBalanceTransaction", "DisputeResource", "ApplicationFeeRefund", "Authorization", "IssuingDisputeResource", "Transaction", "Payout", "Refund", "ReserveTransaction", "TaxDeductedAtSource", "Topup", "Transfer", "Reversal", ] ] ] """ This transaction relates to the Stripe object. """ status: str """ The transaction's net funds status in the Stripe balance, which are either `available` or `pending`. """ type: Literal[ "adjustment", "advance", "advance_funding", "anticipation_repayment", "application_fee", "application_fee_refund", "charge", "climate_order_purchase", "climate_order_refund", "connect_collection_transfer", "contribution", "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", "refund", "refund_failure", "reserve_transaction", "reserved_funds", "stripe_fee", "stripe_fx_fee", "tax_fee", "topup", "topup_reversal", "transfer", "transfer_cancel", "transfer_failure", "transfer_refund", ] """ Transaction type: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `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`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. Learn more about [balance transaction types and what they represent](https://stripe.com/docs/reports/balance-transaction-types). To classify transactions for accounting purposes, consider `reporting_category` instead. """ @classmethod def list( cls, **params: Unpack["BalanceTransaction.ListParams"] ) -> ListObject["BalanceTransaction"]: """ Returns a list of transactions that have contributed to the Stripe account balance (e.g., charges, transfers, and so forth). The transactions are returned in sorted order, with the most recent transactions appearing first. Note that this endpoint was previously called “Balance history” and used the path /v1/balance/history. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["BalanceTransaction.ListParams"] ) -> ListObject["BalanceTransaction"]: """ Returns a list of transactions that have contributed to the Stripe account balance (e.g., charges, transfers, and so forth). The transactions are returned in sorted order, with the most recent transactions appearing first. Note that this endpoint was previously called “Balance history” and used the path /v1/balance/history. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def retrieve( cls, id: str, **params: Unpack["BalanceTransaction.RetrieveParams"] ) -> "BalanceTransaction": """ Retrieves the balance transaction with the given ID. Note that this endpoint previously used the path /v1/balance/history/:id. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["BalanceTransaction.RetrieveParams"] ) -> "BalanceTransaction": """ Retrieves the balance transaction with the given ID. Note that this endpoint previously used the path /v1/balance/history/:id. """ instance = cls(id, **params) await instance.refresh_async() return instance _inner_class_types = {"fee_details": FeeDetail} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_balance_transaction_service.py0000644000175100001770000001537514637354563022270 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._balance_transaction import BalanceTransaction from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict class BalanceTransactionService(StripeService): class ListParams(TypedDict): created: NotRequired["BalanceTransactionService.ListParamsCreated|int"] """ Only return transactions that were created during the given date interval. """ currency: NotRequired[str] """ Only return transactions in a certain currency. 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). """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ payout: NotRequired[str] """ For automatic Stripe payouts only, only returns transactions that were paid out on the specified payout ID. """ source: NotRequired[str] """ Only returns the original transaction. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ type: NotRequired[str] """ Only returns transactions of the given type. One of: `adjustment`, `advance`, `advance_funding`, `anticipation_repayment`, `application_fee`, `application_fee_refund`, `charge`, `climate_order_purchase`, `climate_order_refund`, `connect_collection_transfer`, `contribution`, `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`, `refund`, `refund_failure`, `reserve_transaction`, `reserved_funds`, `stripe_fee`, `stripe_fx_fee`, `tax_fee`, `topup`, `topup_reversal`, `transfer`, `transfer_cancel`, `transfer_failure`, or `transfer_refund`. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def list( self, params: "BalanceTransactionService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[BalanceTransaction]: """ Returns a list of transactions that have contributed to the Stripe account balance (e.g., charges, transfers, and so forth). The transactions are returned in sorted order, with the most recent transactions appearing first. Note that this endpoint was previously called “Balance history” and used the path /v1/balance/history. """ return cast( ListObject[BalanceTransaction], self._request( "get", "/v1/balance_transactions", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "BalanceTransactionService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[BalanceTransaction]: """ Returns a list of transactions that have contributed to the Stripe account balance (e.g., charges, transfers, and so forth). The transactions are returned in sorted order, with the most recent transactions appearing first. Note that this endpoint was previously called “Balance history” and used the path /v1/balance/history. """ return cast( ListObject[BalanceTransaction], await self._request_async( "get", "/v1/balance_transactions", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, id: str, params: "BalanceTransactionService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> BalanceTransaction: """ Retrieves the balance transaction with the given ID. Note that this endpoint previously used the path /v1/balance/history/:id. """ return cast( BalanceTransaction, self._request( "get", "/v1/balance_transactions/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, id: str, params: "BalanceTransactionService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> BalanceTransaction: """ Retrieves the balance transaction with the given ID. Note that this endpoint previously used the path /v1/balance/history/:id. """ return cast( BalanceTransaction, await self._request_async( "get", "/v1/balance_transactions/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_bank_account.py0000644000175100001770000005667314637354563017213 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._account import Account from stripe._customer import Customer from stripe._deletable_api_resource import DeletableAPIResource from stripe._error import InvalidRequestError from stripe._expandable_field import ExpandableField from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from stripe._verify_mixin import VerifyMixin from typing import ClassVar, Dict, List, Optional, Union, cast, overload from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: from stripe._card import Card class BankAccount( DeletableAPIResource["BankAccount"], UpdateableAPIResource["BankAccount"], VerifyMixin, ): """ These bank accounts are payment methods on `Customer` objects. On the other hand [External Accounts](https://stripe.com/api#external_accounts) are transfer destinations on `Account` objects for connected accounts. They can be bank accounts or debit cards as well, and are documented in the links above. Related guide: [Bank debits and transfers](https://stripe.com/payments/bank-debits-transfers) """ OBJECT_NAME: ClassVar[Literal["bank_account"]] = "bank_account" class FutureRequirements(StripeObject): class Error(StripeObject): code: Literal[ "invalid_address_city_state_postal_code", "invalid_address_highway_contract_box", "invalid_address_private_mailbox", "invalid_business_profile_name", "invalid_business_profile_name_denylisted", "invalid_company_name_denylisted", "invalid_dob_age_over_maximum", "invalid_dob_age_under_18", "invalid_dob_age_under_minimum", "invalid_product_description_length", "invalid_product_description_url_match", "invalid_representative_country", "invalid_statement_descriptor_business_mismatch", "invalid_statement_descriptor_denylisted", "invalid_statement_descriptor_length", "invalid_statement_descriptor_prefix_denylisted", "invalid_statement_descriptor_prefix_mismatch", "invalid_street_address", "invalid_tax_id", "invalid_tax_id_format", "invalid_tos_acceptance", "invalid_url_denylisted", "invalid_url_format", "invalid_url_length", "invalid_url_web_presence_detected", "invalid_url_website_business_information_mismatch", "invalid_url_website_empty", "invalid_url_website_inaccessible", "invalid_url_website_inaccessible_geoblocked", "invalid_url_website_inaccessible_password_protected", "invalid_url_website_incomplete", "invalid_url_website_incomplete_cancellation_policy", "invalid_url_website_incomplete_customer_service_details", "invalid_url_website_incomplete_legal_restrictions", "invalid_url_website_incomplete_refund_policy", "invalid_url_website_incomplete_return_policy", "invalid_url_website_incomplete_terms_and_conditions", "invalid_url_website_incomplete_under_construction", "invalid_url_website_other", "invalid_value_other", "verification_directors_mismatch", "verification_document_address_mismatch", "verification_document_address_missing", "verification_document_corrupt", "verification_document_country_not_supported", "verification_document_directors_mismatch", "verification_document_dob_mismatch", "verification_document_duplicate_type", "verification_document_expired", "verification_document_failed_copy", "verification_document_failed_greyscale", "verification_document_failed_other", "verification_document_failed_test_mode", "verification_document_fraudulent", "verification_document_id_number_mismatch", "verification_document_id_number_missing", "verification_document_incomplete", "verification_document_invalid", "verification_document_issue_or_expiry_date_missing", "verification_document_manipulated", "verification_document_missing_back", "verification_document_missing_front", "verification_document_name_mismatch", "verification_document_name_missing", "verification_document_nationality_mismatch", "verification_document_not_readable", "verification_document_not_signed", "verification_document_not_uploaded", "verification_document_photo_mismatch", "verification_document_too_large", "verification_document_type_not_supported", "verification_extraneous_directors", "verification_failed_address_match", "verification_failed_business_iec_number", "verification_failed_document_match", "verification_failed_id_number_match", "verification_failed_keyed_identity", "verification_failed_keyed_match", "verification_failed_name_match", "verification_failed_other", "verification_failed_representative_authority", "verification_failed_residential_address", "verification_failed_tax_id_match", "verification_failed_tax_id_not_issued", "verification_missing_directors", "verification_missing_executives", "verification_missing_owners", "verification_requires_additional_memorandum_of_associations", "verification_requires_additional_proof_of_registration", ] """ The code for the type of error. """ reason: str """ An informative message that indicates the error type and provides additional details about the error. """ requirement: str """ The specific user onboarding requirement field (in the requirements hash) that needs to be resolved. """ currently_due: Optional[List[str]] """ Fields that need to be collected to keep the external account enabled. If not collected by `current_deadline`, these fields appear in `past_due` as well, and the account is disabled. """ errors: Optional[List[Error]] """ Fields that are `currently_due` and need to be collected again because validation or verification failed. """ past_due: Optional[List[str]] """ Fields that weren't collected by `current_deadline`. These fields need to be collected to enable the external account. """ pending_verification: Optional[List[str]] """ Fields that might become required depending on the results of verification or review. It's an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. Fields might appear in `eventually_due`, `currently_due`, or `past_due` and in `pending_verification` if verification fails but another verification is still pending. """ _inner_class_types = {"errors": Error} class Requirements(StripeObject): class Error(StripeObject): code: Literal[ "invalid_address_city_state_postal_code", "invalid_address_highway_contract_box", "invalid_address_private_mailbox", "invalid_business_profile_name", "invalid_business_profile_name_denylisted", "invalid_company_name_denylisted", "invalid_dob_age_over_maximum", "invalid_dob_age_under_18", "invalid_dob_age_under_minimum", "invalid_product_description_length", "invalid_product_description_url_match", "invalid_representative_country", "invalid_statement_descriptor_business_mismatch", "invalid_statement_descriptor_denylisted", "invalid_statement_descriptor_length", "invalid_statement_descriptor_prefix_denylisted", "invalid_statement_descriptor_prefix_mismatch", "invalid_street_address", "invalid_tax_id", "invalid_tax_id_format", "invalid_tos_acceptance", "invalid_url_denylisted", "invalid_url_format", "invalid_url_length", "invalid_url_web_presence_detected", "invalid_url_website_business_information_mismatch", "invalid_url_website_empty", "invalid_url_website_inaccessible", "invalid_url_website_inaccessible_geoblocked", "invalid_url_website_inaccessible_password_protected", "invalid_url_website_incomplete", "invalid_url_website_incomplete_cancellation_policy", "invalid_url_website_incomplete_customer_service_details", "invalid_url_website_incomplete_legal_restrictions", "invalid_url_website_incomplete_refund_policy", "invalid_url_website_incomplete_return_policy", "invalid_url_website_incomplete_terms_and_conditions", "invalid_url_website_incomplete_under_construction", "invalid_url_website_other", "invalid_value_other", "verification_directors_mismatch", "verification_document_address_mismatch", "verification_document_address_missing", "verification_document_corrupt", "verification_document_country_not_supported", "verification_document_directors_mismatch", "verification_document_dob_mismatch", "verification_document_duplicate_type", "verification_document_expired", "verification_document_failed_copy", "verification_document_failed_greyscale", "verification_document_failed_other", "verification_document_failed_test_mode", "verification_document_fraudulent", "verification_document_id_number_mismatch", "verification_document_id_number_missing", "verification_document_incomplete", "verification_document_invalid", "verification_document_issue_or_expiry_date_missing", "verification_document_manipulated", "verification_document_missing_back", "verification_document_missing_front", "verification_document_name_mismatch", "verification_document_name_missing", "verification_document_nationality_mismatch", "verification_document_not_readable", "verification_document_not_signed", "verification_document_not_uploaded", "verification_document_photo_mismatch", "verification_document_too_large", "verification_document_type_not_supported", "verification_extraneous_directors", "verification_failed_address_match", "verification_failed_business_iec_number", "verification_failed_document_match", "verification_failed_id_number_match", "verification_failed_keyed_identity", "verification_failed_keyed_match", "verification_failed_name_match", "verification_failed_other", "verification_failed_representative_authority", "verification_failed_residential_address", "verification_failed_tax_id_match", "verification_failed_tax_id_not_issued", "verification_missing_directors", "verification_missing_executives", "verification_missing_owners", "verification_requires_additional_memorandum_of_associations", "verification_requires_additional_proof_of_registration", ] """ The code for the type of error. """ reason: str """ An informative message that indicates the error type and provides additional details about the error. """ requirement: str """ The specific user onboarding requirement field (in the requirements hash) that needs to be resolved. """ currently_due: Optional[List[str]] """ Fields that need to be collected to keep the external account enabled. If not collected by `current_deadline`, these fields appear in `past_due` as well, and the account is disabled. """ errors: Optional[List[Error]] """ Fields that are `currently_due` and need to be collected again because validation or verification failed. """ past_due: Optional[List[str]] """ Fields that weren't collected by `current_deadline`. These fields need to be collected to enable the external account. """ pending_verification: Optional[List[str]] """ Fields that might become required depending on the results of verification or review. It's an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. Fields might appear in `eventually_due`, `currently_due`, or `past_due` and in `pending_verification` if verification fails but another verification is still pending. """ _inner_class_types = {"errors": Error} class DeleteParams(RequestOptions): pass account: Optional[ExpandableField["Account"]] """ The ID of the account that the bank account is associated with. """ account_holder_name: Optional[str] """ The name of the person or business that owns the bank account. """ account_holder_type: Optional[str] """ The type of entity that holds the account. This can be either `individual` or `company`. """ account_type: Optional[str] """ The bank account type. This can only be `checking` or `savings` in most countries. In Japan, this can only be `futsu` or `toza`. """ available_payout_methods: Optional[List[Literal["instant", "standard"]]] """ A set of available payout methods for this bank account. Only values from this set should be passed as the `method` when creating a payout. """ bank_name: Optional[str] """ Name of the bank associated with the routing number (e.g., `WELLS FARGO`). """ country: str """ Two-letter ISO code representing the country the bank account is located in. """ currency: str """ Three-letter [ISO code for the currency](https://stripe.com/docs/payouts) paid out to the bank account. """ customer: Optional[ExpandableField["Customer"]] """ The ID of the customer that the bank account is associated with. """ default_for_currency: Optional[bool] """ Whether this bank account is the default external account for its currency. """ fingerprint: Optional[str] """ Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. """ future_requirements: Optional[FutureRequirements] """ Information about the [upcoming new requirements for the bank account](https://stripe.com/docs/connect/custom-accounts/future-requirements), including what information needs to be collected, and by when. """ id: str """ Unique identifier for the object. """ last4: str """ The last four digits of the bank account number. """ metadata: Optional[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ object: Literal["bank_account"] """ String representing the object's type. Objects of the same type share the same value. """ requirements: Optional[Requirements] """ Information about the requirements for the bank account, including what information needs to be collected. """ routing_number: Optional[str] """ The routing transit number for the bank account. """ status: str """ For bank accounts, possible values are `new`, `validated`, `verified`, `verification_failed`, or `errored`. A bank account that hasn't had any activity or validation performed is `new`. If Stripe can determine that the bank account exists, its status will be `validated`. Note that there often isn't enough information to know (e.g., for smaller credit unions), and the validation is not always run. If customer bank account verification has succeeded, the bank account status will be `verified`. If the verification failed for any reason, such as microdeposit failure, the status will be `verification_failed`. If a payout sent to this bank account fails, we'll set the status to `errored` and will not continue to send [scheduled payouts](https://stripe.com/docs/payouts#payout-schedule) until the bank details are updated. For external accounts, possible values are `new`, `errored` and `verification_failed`. If a payout fails, the status is set to `errored` and scheduled payouts are stopped until account details are updated. In the US and India, if we can't [verify the owner of the bank account](https://support.stripe.com/questions/bank-account-ownership-verification), we'll set the status to `verification_failed`. Other validations aren't run against external accounts because they're only used for payouts. This means the other statuses don't apply. """ deleted: Optional[Literal[True]] """ Always true for a deleted object """ @classmethod def _cls_delete( cls, sid: str, **params: Unpack["BankAccount.DeleteParams"] ) -> Union["BankAccount", "Card"]: """ Delete a specified external account for a given account. """ url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( Union["BankAccount", "Card"], cls._static_request( "delete", url, params=params, ), ) @overload @staticmethod def delete( sid: str, **params: Unpack["BankAccount.DeleteParams"] ) -> Union["BankAccount", "Card"]: """ Delete a specified external account for a given account. """ ... @overload def delete( self, **params: Unpack["BankAccount.DeleteParams"] ) -> Union["BankAccount", "Card"]: """ Delete a specified external account for a given account. """ ... @class_method_variant("_cls_delete") def delete( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["BankAccount.DeleteParams"] ) -> Union["BankAccount", "Card"]: """ Delete a specified external account for a given account. """ return self._request_and_refresh( "delete", self.instance_url(), params=params, ) @classmethod async def _cls_delete_async( cls, sid: str, **params: Unpack["BankAccount.DeleteParams"] ) -> Union["BankAccount", "Card"]: """ Delete a specified external account for a given account. """ url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( Union["BankAccount", "Card"], await cls._static_request_async( "delete", url, params=params, ), ) @overload @staticmethod async def delete_async( sid: str, **params: Unpack["BankAccount.DeleteParams"] ) -> Union["BankAccount", "Card"]: """ Delete a specified external account for a given account. """ ... @overload async def delete_async( self, **params: Unpack["BankAccount.DeleteParams"] ) -> Union["BankAccount", "Card"]: """ Delete a specified external account for a given account. """ ... @class_method_variant("_cls_delete_async") async def delete_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["BankAccount.DeleteParams"] ) -> Union["BankAccount", "Card"]: """ Delete a specified external account for a given account. """ return await self._request_and_refresh_async( "delete", self.instance_url(), params=params, ) def instance_url(self): token = self.id extn = sanitize_id(token) if hasattr(self, "customer"): customer = self.customer base = Customer.class_url() assert customer is not None if isinstance(customer, Customer): customer = customer.id owner_extn = sanitize_id(customer) class_base = "sources" elif hasattr(self, "account"): account = self.account base = Account.class_url() assert account is not None if isinstance(account, Account): account = account.id owner_extn = sanitize_id(account) class_base = "external_accounts" else: raise InvalidRequestError( "Could not determine whether bank_account_id %s is " "attached to a customer or an account." % token, "id", ) return "%s/%s/%s/%s" % (base, owner_extn, class_base, extn) @classmethod def modify(cls, sid, **params): raise NotImplementedError( "Can't modify a bank account without a customer or account ID. " "Use stripe.Customer.modify_source('customer_id', 'bank_account_id', ...) " "(see https://stripe.com/docs/api/customer_bank_accounts/update) or " "stripe.Account.modify_external_account('customer_id', 'bank_account_id', ...) " "(see https://stripe.com/docs/api/external_account_bank_accounts/update)." ) @classmethod def retrieve(cls, id, **params): raise NotImplementedError( "Can't retrieve a bank account without a customer or account ID. " "Use stripe.customer.retrieve_source('customer_id', 'bank_account_id') " "(see https://stripe.com/docs/api/customer_bank_accounts/retrieve) or " "stripe.Account.retrieve_external_account('account_id', 'bank_account_id') " "(see https://stripe.com/docs/api/external_account_bank_accounts/retrieve)." ) _inner_class_types = { "future_requirements": FutureRequirements, "requirements": Requirements, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_base_address.py0000644000175100001770000000044114637354563017161 0ustar00runnerdockerfrom typing import Optional from typing_extensions import NotRequired, TypedDict, Literal BaseAddress = Literal["api", "files", "connect"] class BaseAddresses(TypedDict): api: NotRequired[Optional[str]] connect: NotRequired[Optional[str]] files: NotRequired[Optional[str]] ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_billing_portal_service.py0000644000175100001770000000076014637354563021267 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_service import StripeService from stripe.billing_portal._configuration_service import ConfigurationService from stripe.billing_portal._session_service import SessionService class BillingPortalService(StripeService): def __init__(self, requestor): super().__init__(requestor) self.configurations = ConfigurationService(self._requestor) self.sessions = SessionService(self._requestor) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_billing_service.py0000644000175100001770000000122514637354563017703 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_service import StripeService from stripe.billing._meter_event_adjustment_service import ( MeterEventAdjustmentService, ) from stripe.billing._meter_event_service import MeterEventService from stripe.billing._meter_service import MeterService class BillingService(StripeService): def __init__(self, requestor): super().__init__(requestor) self.meters = MeterService(self._requestor) self.meter_events = MeterEventService(self._requestor) self.meter_event_adjustments = MeterEventAdjustmentService( self._requestor, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_capability.py0000644000175100001770000004600514637354563016671 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._account import Account from stripe._expandable_field import ExpandableField from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import sanitize_id from typing import ClassVar, List, Optional from typing_extensions import Literal class Capability(UpdateableAPIResource["Capability"]): """ This is an object representing a capability for a Stripe account. Related guide: [Account capabilities](https://stripe.com/docs/connect/account-capabilities) """ OBJECT_NAME: ClassVar[Literal["capability"]] = "capability" class FutureRequirements(StripeObject): class Alternative(StripeObject): alternative_fields_due: List[str] """ Fields that can be provided to satisfy all fields in `original_fields_due`. """ original_fields_due: List[str] """ Fields that are due and can be satisfied by providing all fields in `alternative_fields_due`. """ class Error(StripeObject): code: Literal[ "invalid_address_city_state_postal_code", "invalid_address_highway_contract_box", "invalid_address_private_mailbox", "invalid_business_profile_name", "invalid_business_profile_name_denylisted", "invalid_company_name_denylisted", "invalid_dob_age_over_maximum", "invalid_dob_age_under_18", "invalid_dob_age_under_minimum", "invalid_product_description_length", "invalid_product_description_url_match", "invalid_representative_country", "invalid_statement_descriptor_business_mismatch", "invalid_statement_descriptor_denylisted", "invalid_statement_descriptor_length", "invalid_statement_descriptor_prefix_denylisted", "invalid_statement_descriptor_prefix_mismatch", "invalid_street_address", "invalid_tax_id", "invalid_tax_id_format", "invalid_tos_acceptance", "invalid_url_denylisted", "invalid_url_format", "invalid_url_length", "invalid_url_web_presence_detected", "invalid_url_website_business_information_mismatch", "invalid_url_website_empty", "invalid_url_website_inaccessible", "invalid_url_website_inaccessible_geoblocked", "invalid_url_website_inaccessible_password_protected", "invalid_url_website_incomplete", "invalid_url_website_incomplete_cancellation_policy", "invalid_url_website_incomplete_customer_service_details", "invalid_url_website_incomplete_legal_restrictions", "invalid_url_website_incomplete_refund_policy", "invalid_url_website_incomplete_return_policy", "invalid_url_website_incomplete_terms_and_conditions", "invalid_url_website_incomplete_under_construction", "invalid_url_website_other", "invalid_value_other", "verification_directors_mismatch", "verification_document_address_mismatch", "verification_document_address_missing", "verification_document_corrupt", "verification_document_country_not_supported", "verification_document_directors_mismatch", "verification_document_dob_mismatch", "verification_document_duplicate_type", "verification_document_expired", "verification_document_failed_copy", "verification_document_failed_greyscale", "verification_document_failed_other", "verification_document_failed_test_mode", "verification_document_fraudulent", "verification_document_id_number_mismatch", "verification_document_id_number_missing", "verification_document_incomplete", "verification_document_invalid", "verification_document_issue_or_expiry_date_missing", "verification_document_manipulated", "verification_document_missing_back", "verification_document_missing_front", "verification_document_name_mismatch", "verification_document_name_missing", "verification_document_nationality_mismatch", "verification_document_not_readable", "verification_document_not_signed", "verification_document_not_uploaded", "verification_document_photo_mismatch", "verification_document_too_large", "verification_document_type_not_supported", "verification_extraneous_directors", "verification_failed_address_match", "verification_failed_business_iec_number", "verification_failed_document_match", "verification_failed_id_number_match", "verification_failed_keyed_identity", "verification_failed_keyed_match", "verification_failed_name_match", "verification_failed_other", "verification_failed_representative_authority", "verification_failed_residential_address", "verification_failed_tax_id_match", "verification_failed_tax_id_not_issued", "verification_missing_directors", "verification_missing_executives", "verification_missing_owners", "verification_requires_additional_memorandum_of_associations", "verification_requires_additional_proof_of_registration", ] """ The code for the type of error. """ reason: str """ An informative message that indicates the error type and provides additional details about the error. """ requirement: str """ The specific user onboarding requirement field (in the requirements hash) that needs to be resolved. """ alternatives: Optional[List[Alternative]] """ Fields that are due and can be satisfied by providing the corresponding alternative fields instead. """ current_deadline: Optional[int] """ Date on which `future_requirements` merges with the main `requirements` hash and `future_requirements` becomes empty. After the transition, `currently_due` requirements may immediately become `past_due`, but the account may also be given a grace period depending on the capability's enablement state prior to transitioning. """ currently_due: List[str] """ Fields that need to be collected to keep the capability enabled. If not collected by `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash. """ disabled_reason: Optional[ Literal[ "other", "paused.inactivity", "pending.onboarding", "pending.review", "platform_disabled", "platform_paused", "rejected.inactivity", "rejected.other", "rejected.unsupported_business", "requirements.fields_needed", ] ] """ This is typed as an enum for consistency with `requirements.disabled_reason`, but it safe to assume `future_requirements.disabled_reason` is null because fields in `future_requirements` will never disable the account. """ errors: List[Error] """ Fields that are `currently_due` and need to be collected again because validation or verification failed. """ eventually_due: List[str] """ Fields that need to be collected assuming all volume thresholds are reached. As they become required, they appear in `currently_due` as well. """ past_due: List[str] """ Fields that weren't collected by `requirements.current_deadline`. These fields need to be collected to enable the capability on the account. New fields will never appear here; `future_requirements.past_due` will always be a subset of `requirements.past_due`. """ pending_verification: List[str] """ Fields that might become required depending on the results of verification or review. It's an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due` or `currently_due`. Fields might appear in `eventually_due` or `currently_due` and in `pending_verification` if verification fails but another verification is still pending. """ _inner_class_types = {"alternatives": Alternative, "errors": Error} class Requirements(StripeObject): class Alternative(StripeObject): alternative_fields_due: List[str] """ Fields that can be provided to satisfy all fields in `original_fields_due`. """ original_fields_due: List[str] """ Fields that are due and can be satisfied by providing all fields in `alternative_fields_due`. """ class Error(StripeObject): code: Literal[ "invalid_address_city_state_postal_code", "invalid_address_highway_contract_box", "invalid_address_private_mailbox", "invalid_business_profile_name", "invalid_business_profile_name_denylisted", "invalid_company_name_denylisted", "invalid_dob_age_over_maximum", "invalid_dob_age_under_18", "invalid_dob_age_under_minimum", "invalid_product_description_length", "invalid_product_description_url_match", "invalid_representative_country", "invalid_statement_descriptor_business_mismatch", "invalid_statement_descriptor_denylisted", "invalid_statement_descriptor_length", "invalid_statement_descriptor_prefix_denylisted", "invalid_statement_descriptor_prefix_mismatch", "invalid_street_address", "invalid_tax_id", "invalid_tax_id_format", "invalid_tos_acceptance", "invalid_url_denylisted", "invalid_url_format", "invalid_url_length", "invalid_url_web_presence_detected", "invalid_url_website_business_information_mismatch", "invalid_url_website_empty", "invalid_url_website_inaccessible", "invalid_url_website_inaccessible_geoblocked", "invalid_url_website_inaccessible_password_protected", "invalid_url_website_incomplete", "invalid_url_website_incomplete_cancellation_policy", "invalid_url_website_incomplete_customer_service_details", "invalid_url_website_incomplete_legal_restrictions", "invalid_url_website_incomplete_refund_policy", "invalid_url_website_incomplete_return_policy", "invalid_url_website_incomplete_terms_and_conditions", "invalid_url_website_incomplete_under_construction", "invalid_url_website_other", "invalid_value_other", "verification_directors_mismatch", "verification_document_address_mismatch", "verification_document_address_missing", "verification_document_corrupt", "verification_document_country_not_supported", "verification_document_directors_mismatch", "verification_document_dob_mismatch", "verification_document_duplicate_type", "verification_document_expired", "verification_document_failed_copy", "verification_document_failed_greyscale", "verification_document_failed_other", "verification_document_failed_test_mode", "verification_document_fraudulent", "verification_document_id_number_mismatch", "verification_document_id_number_missing", "verification_document_incomplete", "verification_document_invalid", "verification_document_issue_or_expiry_date_missing", "verification_document_manipulated", "verification_document_missing_back", "verification_document_missing_front", "verification_document_name_mismatch", "verification_document_name_missing", "verification_document_nationality_mismatch", "verification_document_not_readable", "verification_document_not_signed", "verification_document_not_uploaded", "verification_document_photo_mismatch", "verification_document_too_large", "verification_document_type_not_supported", "verification_extraneous_directors", "verification_failed_address_match", "verification_failed_business_iec_number", "verification_failed_document_match", "verification_failed_id_number_match", "verification_failed_keyed_identity", "verification_failed_keyed_match", "verification_failed_name_match", "verification_failed_other", "verification_failed_representative_authority", "verification_failed_residential_address", "verification_failed_tax_id_match", "verification_failed_tax_id_not_issued", "verification_missing_directors", "verification_missing_executives", "verification_missing_owners", "verification_requires_additional_memorandum_of_associations", "verification_requires_additional_proof_of_registration", ] """ The code for the type of error. """ reason: str """ An informative message that indicates the error type and provides additional details about the error. """ requirement: str """ The specific user onboarding requirement field (in the requirements hash) that needs to be resolved. """ alternatives: Optional[List[Alternative]] """ Fields that are due and can be satisfied by providing the corresponding alternative fields instead. """ current_deadline: Optional[int] """ Date by which the fields in `currently_due` must be collected to keep the capability enabled for the account. These fields may disable the capability sooner if the next threshold is reached before they are collected. """ currently_due: List[str] """ Fields that need to be collected to keep the capability enabled. If not collected by `current_deadline`, these fields appear in `past_due` as well, and the capability is disabled. """ disabled_reason: Optional[ Literal[ "other", "paused.inactivity", "pending.onboarding", "pending.review", "platform_disabled", "platform_paused", "rejected.inactivity", "rejected.other", "rejected.unsupported_business", "requirements.fields_needed", ] ] """ Description of why the capability is disabled. [Learn more about handling verification issues](https://stripe.com/docs/connect/handling-api-verification). """ errors: List[Error] """ Fields that are `currently_due` and need to be collected again because validation or verification failed. """ eventually_due: List[str] """ Fields that need to be collected assuming all volume thresholds are reached. As they become required, they appear in `currently_due` as well, and `current_deadline` becomes set. """ past_due: List[str] """ Fields that weren't collected by `current_deadline`. These fields need to be collected to enable the capability on the account. """ pending_verification: List[str] """ Fields that might become required depending on the results of verification or review. It's an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. Fields might appear in `eventually_due`, `currently_due`, or `past_due` and in `pending_verification` if verification fails but another verification is still pending. """ _inner_class_types = {"alternatives": Alternative, "errors": Error} account: ExpandableField["Account"] """ The account for which the capability enables functionality. """ future_requirements: Optional[FutureRequirements] id: str """ The identifier for the capability. """ object: Literal["capability"] """ String representing the object's type. Objects of the same type share the same value. """ requested: bool """ Whether the capability has been requested. """ requested_at: Optional[int] """ Time at which the capability was requested. Measured in seconds since the Unix epoch. """ requirements: Optional[Requirements] status: Literal["active", "disabled", "inactive", "pending", "unrequested"] """ The status of the capability. Can be `active`, `inactive`, `pending`, or `unrequested`. """ def instance_url(self): token = self.id account = self.account base = Account.class_url() if isinstance(account, Account): account = account.id acct_extn = sanitize_id(account) extn = sanitize_id(token) return "%s/%s/capabilities/%s" % (base, acct_extn, extn) @classmethod def modify(cls, sid, **params): raise NotImplementedError( "Can't update a capability without an account ID. Update a capability using " "account.modify_capability('acct_123', 'acap_123', params)" ) @classmethod def retrieve(cls, id, **params): raise NotImplementedError( "Can't retrieve a capability without an account ID. Retrieve a capability using " "account.retrieve_capability('acct_123', 'acap_123')" ) _inner_class_types = { "future_requirements": FutureRequirements, "requirements": Requirements, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_card.py0000644000175100001770000003032614637354563015460 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._account import Account from stripe._customer import Customer from stripe._deletable_api_resource import DeletableAPIResource from stripe._error import InvalidRequestError from stripe._expandable_field import ExpandableField from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, Union, cast, overload from typing_extensions import Literal, Unpack, TYPE_CHECKING if TYPE_CHECKING: from stripe._bank_account import BankAccount class Card(DeletableAPIResource["Card"], UpdateableAPIResource["Card"]): """ You can store multiple cards on a customer in order to charge the customer later. You can also store multiple debit cards on a recipient in order to transfer to those cards later. Related guide: [Card payments with Sources](https://stripe.com/docs/sources/cards) """ OBJECT_NAME: ClassVar[Literal["card"]] = "card" class Networks(StripeObject): preferred: Optional[str] """ The preferred network for co-branded cards. Can be `cartes_bancaires`, `mastercard`, `visa` or `invalid_preference` if requested network is not valid for the card. """ class DeleteParams(RequestOptions): pass account: Optional[ExpandableField["Account"]] """ The account this card belongs to. This attribute will not be in the card object if the card belongs to a customer or recipient instead. This property is only available for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. """ address_city: Optional[str] """ City/District/Suburb/Town/Village. """ address_country: Optional[str] """ Billing address country, if provided when creating card. """ address_line1: Optional[str] """ Address line 1 (Street address/PO Box/Company name). """ address_line1_check: Optional[str] """ If `address_line1` was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`. """ address_line2: Optional[str] """ Address line 2 (Apartment/Suite/Unit/Building). """ address_state: Optional[str] """ State/County/Province/Region. """ address_zip: Optional[str] """ ZIP or postal code. """ address_zip_check: Optional[str] """ If `address_zip` was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`. """ available_payout_methods: Optional[List[Literal["instant", "standard"]]] """ A set of available payout methods for this card. Only values from this set should be passed as the `method` when creating a payout. """ brand: str """ Card brand. Can be `American Express`, `Diners Club`, `Discover`, `Eftpos Australia`, `JCB`, `MasterCard`, `UnionPay`, `Visa`, or `Unknown`. """ country: Optional[str] """ Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. """ currency: Optional[str] """ Three-letter [ISO code for currency](https://stripe.com/docs/payouts). Only applicable on accounts (not customers or recipients). The card can be used as a transfer destination for funds in this currency. This property is only available for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. """ customer: Optional[ExpandableField["Customer"]] """ The customer that this card belongs to. This attribute will not be in the card object if the card belongs to an account or recipient instead. """ cvc_check: Optional[str] """ If a CVC was provided, results of the check: `pass`, `fail`, `unavailable`, or `unchecked`. A result of unchecked indicates that CVC was provided but hasn't been checked yet. Checks are typically performed when attaching a card to a Customer object, or when creating a charge. For more details, see [Check if a card is valid without a charge](https://support.stripe.com/questions/check-if-a-card-is-valid-without-a-charge). """ default_for_currency: Optional[bool] """ Whether this card is the default external account for its currency. This property is only available for accounts where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `application`, which includes Custom accounts. """ description: Optional[str] """ A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) """ dynamic_last4: Optional[str] """ (For tokenized numbers only.) The last four digits of the device account number. """ exp_month: int """ Two-digit number representing the card's expiration month. """ exp_year: int """ Four-digit number representing the card's expiration year. """ fingerprint: Optional[str] """ Uniquely identifies this particular card number. You can use this attribute to check whether two customers who've signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* """ funding: str """ Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. """ id: str """ Unique identifier for the object. """ iin: Optional[str] """ Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) """ issuer: Optional[str] """ The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) """ last4: str """ The last four digits of the card. """ metadata: Optional[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ name: Optional[str] """ Cardholder name. """ networks: Optional[Networks] object: Literal["card"] """ String representing the object's type. Objects of the same type share the same value. """ status: Optional[str] """ For external accounts that are cards, possible values are `new` and `errored`. If a payout fails, the status is set to `errored` and [scheduled payouts](https://stripe.com/docs/payouts#payout-schedule) are stopped until account details are updated. """ tokenization_method: Optional[str] """ If the card number is tokenized, this is the method that was used. Can be `android_pay` (includes Google Pay), `apple_pay`, `masterpass`, `visa_checkout`, or null. """ deleted: Optional[Literal[True]] """ Always true for a deleted object """ @classmethod def _cls_delete( cls, sid: str, **params: Unpack["Card.DeleteParams"] ) -> Union["BankAccount", "Card"]: """ Delete a specified external account for a given account. """ url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( Union["BankAccount", "Card"], cls._static_request( "delete", url, params=params, ), ) @overload @staticmethod def delete( sid: str, **params: Unpack["Card.DeleteParams"] ) -> Union["BankAccount", "Card"]: """ Delete a specified external account for a given account. """ ... @overload def delete( self, **params: Unpack["Card.DeleteParams"] ) -> Union["BankAccount", "Card"]: """ Delete a specified external account for a given account. """ ... @class_method_variant("_cls_delete") def delete( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Card.DeleteParams"] ) -> Union["BankAccount", "Card"]: """ Delete a specified external account for a given account. """ return self._request_and_refresh( "delete", self.instance_url(), params=params, ) @classmethod async def _cls_delete_async( cls, sid: str, **params: Unpack["Card.DeleteParams"] ) -> Union["BankAccount", "Card"]: """ Delete a specified external account for a given account. """ url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( Union["BankAccount", "Card"], await cls._static_request_async( "delete", url, params=params, ), ) @overload @staticmethod async def delete_async( sid: str, **params: Unpack["Card.DeleteParams"] ) -> Union["BankAccount", "Card"]: """ Delete a specified external account for a given account. """ ... @overload async def delete_async( self, **params: Unpack["Card.DeleteParams"] ) -> Union["BankAccount", "Card"]: """ Delete a specified external account for a given account. """ ... @class_method_variant("_cls_delete_async") async def delete_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Card.DeleteParams"] ) -> Union["BankAccount", "Card"]: """ Delete a specified external account for a given account. """ return await self._request_and_refresh_async( "delete", self.instance_url(), params=params, ) def instance_url(self): token = self.id extn = sanitize_id(token) if hasattr(self, "customer"): customer = self.customer base = Customer.class_url() assert customer is not None if isinstance(customer, Customer): customer = customer.id owner_extn = sanitize_id(customer) class_base = "sources" elif hasattr(self, "account"): account = self.account base = Account.class_url() assert account is not None if isinstance(account, Account): account = account.id owner_extn = sanitize_id(account) class_base = "external_accounts" else: raise InvalidRequestError( "Could not determine whether card_id %s is " "attached to a customer, or " "account." % token, "id", ) return "%s/%s/%s/%s" % (base, owner_extn, class_base, extn) @classmethod def modify(cls, sid, **params): raise NotImplementedError( "Can't modify a card without a customer or account ID. " "Use stripe.Customer.modify_source('customer_id', 'card_id', ...) " "(see https://stripe.com/docs/api/cards/update) or " "stripe.Account.modify_external_account('account_id', 'card_id', ...) " "(see https://stripe.com/docs/api/external_account_cards/update)." ) @classmethod def retrieve(cls, id, **params): raise NotImplementedError( "Can't retrieve a card without a customer or account ID. " "Use stripe.Customer.retrieve_source('customer_id', 'card_id') " "(see https://stripe.com/docs/api/cards/retrieve) or " "stripe.Account.retrieve_external_account('account_id', 'card_id') " "(see https://stripe.com/docs/api/external_account_cards/retrieve)." ) _inner_class_types = {"networks": Networks} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_cash_balance.py0000644000175100001770000000424114637354563017127 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._customer import Customer from stripe._stripe_object import StripeObject from stripe._util import sanitize_id from typing import ClassVar, Dict, Optional from typing_extensions import Literal class CashBalance(StripeObject): """ A customer's `Cash balance` represents real funds. Customers can add funds to their cash balance by sending a bank transfer. These funds can be used for payment and can eventually be paid out to your bank account. """ OBJECT_NAME: ClassVar[Literal["cash_balance"]] = "cash_balance" class Settings(StripeObject): reconciliation_mode: Literal["automatic", "manual"] """ The configuration for how funds that land in the customer cash balance are reconciled. """ using_merchant_default: bool """ A flag to indicate if reconciliation mode returned is the user's default or is specific to this customer cash balance """ available: Optional[Dict[str, int]] """ A hash of all cash balances available to this customer. You cannot delete a customer with any cash balances, even if the balance is 0. Amounts are represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ customer: str """ The ID of the customer whose cash balance this object represents. """ 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["cash_balance"] """ String representing the object's type. Objects of the same type share the same value. """ settings: Settings def instance_url(self): customer = self.customer base = Customer.class_url() cust_extn = sanitize_id(customer) return "%s/%s/cash_balance" % (base, cust_extn) @classmethod def retrieve(cls, id, **params): raise NotImplementedError( "Can't retrieve a Customer Cash Balance without a Customer ID. " "Use Customer.retrieve_cash_balance('cus_123')" ) _inner_class_types = {"settings": Settings} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_charge.py0000644000175100001770000034746314637354563016015 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._nested_resource_class_methods import nested_resource_class_methods from stripe._request_options import RequestOptions from stripe._search_result_object import SearchResultObject from stripe._searchable_api_resource import SearchableAPIResource from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ( AsyncIterator, ClassVar, Dict, Iterator, List, Optional, Union, cast, overload, ) from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._account import Account from stripe._application import Application from stripe._application_fee import ApplicationFee from stripe._balance_transaction import BalanceTransaction from stripe._bank_account import BankAccount from stripe._card import Card as CardResource from stripe._customer import Customer from stripe._invoice import Invoice from stripe._mandate import Mandate from stripe._payment_intent import PaymentIntent from stripe._payment_method import PaymentMethod from stripe._refund import Refund from stripe._review import Review from stripe._source import Source from stripe._transfer import Transfer @nested_resource_class_methods("refund") class Charge( CreateableAPIResource["Charge"], ListableAPIResource["Charge"], SearchableAPIResource["Charge"], UpdateableAPIResource["Charge"], ): """ The `Charge` object represents a single attempt to move money into your Stripe account. PaymentIntent confirmation is the most common way to create Charges, but transferring money to a different Stripe account through Connect also creates Charges. Some legacy payment flows create Charges directly, which is not recommended for new integrations. """ OBJECT_NAME: ClassVar[Literal["charge"]] = "charge" 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 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State, county, province, or region. """ address: Optional[Address] """ Billing address. """ email: Optional[str] """ Email address. """ name: Optional[str] """ Full name. """ phone: Optional[str] """ Billing phone number (including extension). """ _inner_class_types = {"address": Address} class FraudDetails(StripeObject): stripe_report: Optional[str] """ Assessments from Stripe. If set, the value is `fraudulent`. """ user_report: Optional[str] """ Assessments reported by you. If set, possible values of are `safe` and `fraudulent`. """ class Level3(StripeObject): class LineItem(StripeObject): discount_amount: Optional[int] product_code: str product_description: str quantity: Optional[int] tax_amount: Optional[int] unit_cost: Optional[int] customer_reference: Optional[str] line_items: List[LineItem] merchant_reference: str shipping_address_zip: Optional[str] shipping_amount: Optional[int] shipping_from_zip: Optional[str] _inner_class_types = {"line_items": LineItem} class Outcome(StripeObject): class Rule(StripeObject): action: str """ The action taken on the payment. """ id: str """ Unique identifier for the object. """ predicate: str """ The predicate to evaluate the payment against. """ network_status: Optional[str] """ Possible values are `approved_by_network`, `declined_by_network`, `not_sent_to_network`, and `reversed_after_approval`. The value `reversed_after_approval` indicates the payment was [blocked by Stripe](https://stripe.com/docs/declines#blocked-payments) after bank authorization, and may temporarily appear as "pending" on a cardholder's statement. """ reason: Optional[str] """ An enumerated value providing a more detailed explanation of the outcome's `type`. Charges blocked by Radar's default block rule have the value `highest_risk_level`. Charges placed in review by Radar's default review rule have the value `elevated_risk_level`. Charges authorized, blocked, or placed in review by custom rules have the value `rule`. See [understanding declines](https://stripe.com/docs/declines) for more details. """ risk_level: Optional[str] """ Stripe Radar's evaluation of the riskiness of the payment. Possible values for evaluated payments are `normal`, `elevated`, `highest`. For non-card payments, and card-based payments predating the public assignment of risk levels, this field will have the value `not_assessed`. In the event of an error in the evaluation, this field will have the value `unknown`. This field is only available with Radar. """ risk_score: Optional[int] """ Stripe Radar's evaluation of the riskiness of the payment. Possible values for evaluated payments are between 0 and 100. For non-card payments, card-based payments predating the public assignment of risk scores, or in the event of an error during evaluation, this field will not be present. This field is only available with Radar for Fraud Teams. """ rule: Optional[ExpandableField[Rule]] """ The ID of the Radar rule that matched the payment, if applicable. """ seller_message: Optional[str] """ A human-readable description of the outcome type and reason, designed for you (the recipient of the payment), not your customer. """ type: str """ Possible values are `authorized`, `manual_review`, `issuer_declined`, `blocked`, and `invalid`. See [understanding declines](https://stripe.com/docs/declines) and [Radar reviews](https://stripe.com/docs/radar/reviews) for details. """ _inner_class_types = {"rule": Rule} class PaymentMethodDetails(StripeObject): class AchCreditTransfer(StripeObject): account_number: Optional[str] """ Account number to transfer funds to. """ bank_name: Optional[str] """ Name of the bank associated with the routing number. """ routing_number: Optional[str] """ Routing transit number for the bank account to transfer funds to. """ swift_code: Optional[str] """ SWIFT code of the bank associated with the routing number. """ class AchDebit(StripeObject): account_holder_type: Optional[Literal["company", "individual"]] """ Type of entity that holds the account. This can be either `individual` or `company`. """ bank_name: Optional[str] """ Name of the bank associated with the bank account. """ country: Optional[str] """ Two-letter ISO code representing the country the bank account is located in. """ fingerprint: Optional[str] """ Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. """ last4: Optional[str] """ Last four digits of the bank account number. """ routing_number: Optional[str] """ Routing transit number of the bank account. """ class AcssDebit(StripeObject): bank_name: Optional[str] """ Name of the bank associated with the bank account. """ fingerprint: Optional[str] """ Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. """ institution_number: Optional[str] """ Institution number of the bank account """ last4: Optional[str] """ Last four digits of the bank account number. """ mandate: Optional[str] """ ID of the mandate used to make this payment. """ transit_number: Optional[str] """ Transit number of the bank account. """ class Affirm(StripeObject): pass class AfterpayClearpay(StripeObject): order_id: Optional[str] """ The Afterpay order ID associated with this payment intent. """ reference: Optional[str] """ Order identifier shown to the merchant in Afterpay's online portal. """ class Alipay(StripeObject): buyer_id: Optional[str] """ Uniquely identifies this particular Alipay account. You can use this attribute to check whether two Alipay accounts are the same. """ fingerprint: Optional[str] """ Uniquely identifies this particular Alipay account. You can use this attribute to check whether two Alipay accounts are the same. """ transaction_id: Optional[str] """ Transaction ID of this particular Alipay transaction. """ class AmazonPay(StripeObject): pass class AuBecsDebit(StripeObject): bsb_number: Optional[str] """ Bank-State-Branch number of the bank account. """ fingerprint: Optional[str] """ Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. """ last4: Optional[str] """ Last four digits of the bank account number. """ mandate: Optional[str] """ ID of the mandate used to make this payment. """ class BacsDebit(StripeObject): fingerprint: Optional[str] """ Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. """ last4: Optional[str] """ Last four digits of the bank account number. """ mandate: Optional[str] """ ID of the mandate used to make this payment. """ sort_code: Optional[str] """ Sort code of the bank account. (e.g., `10-20-30`) """ class Bancontact(StripeObject): bank_code: Optional[str] """ Bank code of bank associated with the bank account. """ bank_name: Optional[str] """ Name of the bank associated with the bank account. """ bic: Optional[str] """ Bank Identifier Code of the bank associated with the bank account. """ generated_sepa_debit: Optional[ExpandableField["PaymentMethod"]] """ The ID of the SEPA Direct Debit PaymentMethod which was generated by this Charge. """ generated_sepa_debit_mandate: Optional[ExpandableField["Mandate"]] """ The mandate for the SEPA Direct Debit PaymentMethod which was generated by this Charge. """ iban_last4: Optional[str] """ Last four characters of the IBAN. """ preferred_language: Optional[Literal["de", "en", "fr", "nl"]] """ Preferred language of the Bancontact authorization page that the customer is redirected to. Can be one of `en`, `de`, `fr`, or `nl` """ verified_name: Optional[str] """ Owner's verified full name. Values are verified or provided by Bancontact directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ class Blik(StripeObject): pass class Boleto(StripeObject): tax_id: str """ The tax ID of the customer (CPF for individuals consumers or CNPJ for businesses consumers) """ class Card(StripeObject): class Checks(StripeObject): address_line1_check: Optional[str] """ If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. """ address_postal_code_check: Optional[str] """ If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. """ cvc_check: Optional[str] """ If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. """ class ExtendedAuthorization(StripeObject): status: Literal["disabled", "enabled"] """ Indicates whether or not the capture window is extended beyond the standard authorization. """ class IncrementalAuthorization(StripeObject): status: Literal["available", "unavailable"] """ Indicates whether or not the incremental authorization feature is supported. """ class Installments(StripeObject): class Plan(StripeObject): count: Optional[int] """ For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. """ interval: Optional[Literal["month"]] """ For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. One of `month`. """ type: Literal["fixed_count"] """ Type of installment plan, one of `fixed_count`. """ plan: Optional[Plan] """ Installment plan selected for the payment. """ _inner_class_types = {"plan": Plan} class Multicapture(StripeObject): status: Literal["available", "unavailable"] """ Indicates whether or not multiple captures are supported. """ class NetworkToken(StripeObject): used: bool """ Indicates if Stripe used a network token, either user provided or Stripe managed when processing the transaction. """ class Overcapture(StripeObject): maximum_amount_capturable: int """ The maximum amount that can be captured. """ status: Literal["available", "unavailable"] """ Indicates whether or not the authorized amount can be over-captured. """ class ThreeDSecure(StripeObject): authentication_flow: Optional[ Literal["challenge", "frictionless"] ] """ For authenticated transactions: how the customer was authenticated by the issuing bank. """ electronic_commerce_indicator: Optional[ Literal["01", "02", "05", "06", "07"] ] """ The Electronic Commerce Indicator (ECI). A protocol-level field indicating what degree of authentication was performed. """ exemption_indicator: Optional[Literal["low_risk", "none"]] """ The exemption requested via 3DS and accepted by the issuer at authentication time. """ exemption_indicator_applied: Optional[bool] """ Whether Stripe requested the value of `exemption_indicator` in the transaction. This will depend on the outcome of Stripe's internal risk assessment. """ result: Optional[ Literal[ "attempt_acknowledged", "authenticated", "exempted", "failed", "not_supported", "processing_error", ] ] """ Indicates the outcome of 3D Secure authentication. """ result_reason: Optional[ Literal[ "abandoned", "bypassed", "canceled", "card_not_enrolled", "network_not_supported", "protocol_error", "rejected", ] ] """ Additional information about why 3D Secure succeeded or failed based on the `result`. """ transaction_id: Optional[str] """ The 3D Secure 1 XID or 3D Secure 2 Directory Server Transaction ID (dsTransId) for this payment. """ version: Optional[Literal["1.0.2", "2.1.0", "2.2.0"]] """ The version of 3D Secure that was used. """ class Wallet(StripeObject): class AmexExpressCheckout(StripeObject): pass class ApplePay(StripeObject): pass class GooglePay(StripeObject): pass class Link(StripeObject): pass class Masterpass(StripeObject): class BillingAddress(StripeObject): city: Optional[str] """ City, district, suburb, town, or village. """ country: Optional[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: Optional[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State, county, province, or region. """ class ShippingAddress(StripeObject): city: Optional[str] """ City, district, suburb, town, or village. """ country: Optional[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: Optional[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State, county, province, or region. """ billing_address: Optional[BillingAddress] """ Owner's verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ email: Optional[str] """ Owner's verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ name: Optional[str] """ Owner's verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ shipping_address: Optional[ShippingAddress] """ Owner's verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ _inner_class_types = { "billing_address": BillingAddress, "shipping_address": ShippingAddress, } class SamsungPay(StripeObject): pass class VisaCheckout(StripeObject): class BillingAddress(StripeObject): city: Optional[str] """ City, district, suburb, town, or village. """ country: Optional[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: Optional[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State, county, province, or region. """ class ShippingAddress(StripeObject): city: Optional[str] """ City, district, suburb, town, or village. """ country: Optional[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: Optional[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State, county, province, or region. """ billing_address: Optional[BillingAddress] """ Owner's verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ email: Optional[str] """ Owner's verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ name: Optional[str] """ Owner's verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ shipping_address: Optional[ShippingAddress] """ Owner's verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ _inner_class_types = { "billing_address": BillingAddress, "shipping_address": ShippingAddress, } amex_express_checkout: Optional[AmexExpressCheckout] apple_pay: Optional[ApplePay] dynamic_last4: Optional[str] """ (For tokenized numbers only.) The last four digits of the device account number. """ google_pay: Optional[GooglePay] link: Optional[Link] masterpass: Optional[Masterpass] samsung_pay: Optional[SamsungPay] type: Literal[ "amex_express_checkout", "apple_pay", "google_pay", "link", "masterpass", "samsung_pay", "visa_checkout", ] """ The type of the card wallet, one of `amex_express_checkout`, `apple_pay`, `google_pay`, `masterpass`, `samsung_pay`, `visa_checkout`, or `link`. An additional hash is included on the Wallet subhash with a name matching this value. It contains additional information specific to the card wallet type. """ visa_checkout: Optional[VisaCheckout] _inner_class_types = { "amex_express_checkout": AmexExpressCheckout, "apple_pay": ApplePay, "google_pay": GooglePay, "link": Link, "masterpass": Masterpass, "samsung_pay": SamsungPay, "visa_checkout": VisaCheckout, } amount_authorized: Optional[int] """ The authorized amount. """ brand: Optional[str] """ Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ capture_before: Optional[int] """ When using manual capture, a future timestamp at which the charge will be automatically refunded if uncaptured. """ checks: Optional[Checks] """ Check results by Card networks on Card address and CVC at time of payment. """ country: Optional[str] """ Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. """ description: Optional[str] """ A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) """ exp_month: int """ Two-digit number representing the card's expiration month. """ exp_year: int """ Four-digit number representing the card's expiration year. """ extended_authorization: Optional[ExtendedAuthorization] fingerprint: Optional[str] """ Uniquely identifies this particular card number. You can use this attribute to check whether two customers who've signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* """ funding: Optional[str] """ Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. """ iin: Optional[str] """ Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) """ incremental_authorization: Optional[IncrementalAuthorization] installments: Optional[Installments] """ Installment details for this payment (Mexico only). For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). """ issuer: Optional[str] """ The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) """ last4: Optional[str] """ The last four digits of the card. """ mandate: Optional[str] """ ID of the mandate used to make this payment or created by it. """ moto: Optional[bool] """ True if this payment was marked as MOTO and out of scope for SCA. """ multicapture: Optional[Multicapture] network: Optional[str] """ Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ network_token: Optional[NetworkToken] """ If this card has network token credentials, this contains the details of the network token credentials. """ overcapture: Optional[Overcapture] three_d_secure: Optional[ThreeDSecure] """ Populated if this transaction used 3D Secure authentication. """ wallet: Optional[Wallet] """ If this Card is part of a card wallet, this contains the details of the card wallet. """ _inner_class_types = { "checks": Checks, "extended_authorization": ExtendedAuthorization, "incremental_authorization": IncrementalAuthorization, "installments": Installments, "multicapture": Multicapture, "network_token": NetworkToken, "overcapture": Overcapture, "three_d_secure": ThreeDSecure, "wallet": Wallet, } class CardPresent(StripeObject): class Offline(StripeObject): stored_at: Optional[int] """ Time at which the payment was collected while offline """ class Receipt(StripeObject): account_type: Optional[ Literal["checking", "credit", "prepaid", "unknown"] ] """ The type of account being debited or credited """ application_cryptogram: Optional[str] """ EMV tag 9F26, cryptogram generated by the integrated circuit chip. """ application_preferred_name: Optional[str] """ Mnenomic of the Application Identifier. """ authorization_code: Optional[str] """ Identifier for this transaction. """ authorization_response_code: Optional[str] """ EMV tag 8A. A code returned by the card issuer. """ cardholder_verification_method: Optional[str] """ Describes the method used by the cardholder to verify ownership of the card. One of the following: `approval`, `failure`, `none`, `offline_pin`, `offline_pin_and_signature`, `online_pin`, or `signature`. """ dedicated_file_name: Optional[str] """ EMV tag 84. Similar to the application identifier stored on the integrated circuit chip. """ terminal_verification_results: Optional[str] """ The outcome of a series of EMV functions performed by the card reader. """ transaction_status_information: Optional[str] """ An indication of various EMV functions performed during the transaction. """ amount_authorized: Optional[int] """ The authorized amount """ brand: Optional[str] """ Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ capture_before: Optional[int] """ When using manual capture, a future timestamp after which the charge will be automatically refunded if uncaptured. """ cardholder_name: Optional[str] """ The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. """ country: Optional[str] """ Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. """ description: Optional[str] """ A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) """ emv_auth_data: Optional[str] """ Authorization response cryptogram. """ exp_month: int """ Two-digit number representing the card's expiration month. """ exp_year: int """ Four-digit number representing the card's expiration year. """ fingerprint: Optional[str] """ Uniquely identifies this particular card number. You can use this attribute to check whether two customers who've signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* """ funding: Optional[str] """ Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. """ generated_card: Optional[str] """ ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. Only present if it was possible to generate a card PaymentMethod. """ iin: Optional[str] """ Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) """ incremental_authorization_supported: bool """ Whether this [PaymentIntent](https://stripe.com/docs/api/payment_intents) is eligible for incremental authorizations. Request support using [request_incremental_authorization_support](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method_options-card_present-request_incremental_authorization_support). """ issuer: Optional[str] """ The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) """ last4: Optional[str] """ The last four digits of the card. """ network: Optional[str] """ Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ offline: Optional[Offline] """ Details about payments collected offline. """ overcapture_supported: bool """ Defines whether the authorized amount can be over-captured or not """ preferred_locales: Optional[List[str]] """ EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. """ read_method: Optional[ Literal[ "contact_emv", "contactless_emv", "contactless_magstripe_mode", "magnetic_stripe_fallback", "magnetic_stripe_track2", ] ] """ How card details were read in this transaction. """ receipt: Optional[Receipt] """ A collection of fields required to be displayed on receipts. Only required for EMV transactions. """ _inner_class_types = {"offline": Offline, "receipt": Receipt} class Cashapp(StripeObject): buyer_id: Optional[str] """ A unique and immutable identifier assigned by Cash App to every buyer. """ cashtag: Optional[str] """ A public identifier for buyers using Cash App. """ class CustomerBalance(StripeObject): pass class Eps(StripeObject): bank: Optional[ Literal[ "arzte_und_apotheker_bank", "austrian_anadi_bank_ag", "bank_austria", "bankhaus_carl_spangler", "bankhaus_schelhammer_und_schattera_ag", "bawag_psk_ag", "bks_bank_ag", "brull_kallmus_bank_ag", "btv_vier_lander_bank", "capital_bank_grawe_gruppe_ag", "deutsche_bank_ag", "dolomitenbank", "easybank_ag", "erste_bank_und_sparkassen", "hypo_alpeadriabank_international_ag", "hypo_bank_burgenland_aktiengesellschaft", "hypo_noe_lb_fur_niederosterreich_u_wien", "hypo_oberosterreich_salzburg_steiermark", "hypo_tirol_bank_ag", "hypo_vorarlberg_bank_ag", "marchfelder_bank", "oberbank_ag", "raiffeisen_bankengruppe_osterreich", "schoellerbank_ag", "sparda_bank_wien", "volksbank_gruppe", "volkskreditbank_ag", "vr_bank_braunau", ] ] """ The customer's bank. Should be one of `arzte_und_apotheker_bank`, `austrian_anadi_bank_ag`, `bank_austria`, `bankhaus_carl_spangler`, `bankhaus_schelhammer_und_schattera_ag`, `bawag_psk_ag`, `bks_bank_ag`, `brull_kallmus_bank_ag`, `btv_vier_lander_bank`, `capital_bank_grawe_gruppe_ag`, `deutsche_bank_ag`, `dolomitenbank`, `easybank_ag`, `erste_bank_und_sparkassen`, `hypo_alpeadriabank_international_ag`, `hypo_noe_lb_fur_niederosterreich_u_wien`, `hypo_oberosterreich_salzburg_steiermark`, `hypo_tirol_bank_ag`, `hypo_vorarlberg_bank_ag`, `hypo_bank_burgenland_aktiengesellschaft`, `marchfelder_bank`, `oberbank_ag`, `raiffeisen_bankengruppe_osterreich`, `schoellerbank_ag`, `sparda_bank_wien`, `volksbank_gruppe`, `volkskreditbank_ag`, or `vr_bank_braunau`. """ verified_name: Optional[str] """ Owner's verified full name. Values are verified or provided by EPS directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. EPS rarely provides this information so the attribute is usually empty. """ class Fpx(StripeObject): account_holder_type: Optional[Literal["company", "individual"]] """ Account holder type, if provided. Can be one of `individual` or `company`. """ bank: Literal[ "affin_bank", "agrobank", "alliance_bank", "ambank", "bank_islam", "bank_muamalat", "bank_of_china", "bank_rakyat", "bsn", "cimb", "deutsche_bank", "hong_leong_bank", "hsbc", "kfh", "maybank2e", "maybank2u", "ocbc", "pb_enterprise", "public_bank", "rhb", "standard_chartered", "uob", ] """ The customer's bank. Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bank_rakyat`, `bsn`, `cimb`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `pb_enterprise`, or `bank_of_china`. """ transaction_id: Optional[str] """ Unique transaction id generated by FPX for every request from the merchant """ class Giropay(StripeObject): bank_code: Optional[str] """ Bank code of bank associated with the bank account. """ bank_name: Optional[str] """ Name of the bank associated with the bank account. """ bic: Optional[str] """ Bank Identifier Code of the bank associated with the bank account. """ verified_name: Optional[str] """ Owner's verified full name. Values are verified or provided by Giropay directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. Giropay rarely provides this information so the attribute is usually empty. """ class Grabpay(StripeObject): transaction_id: Optional[str] """ Unique transaction id generated by GrabPay """ class Ideal(StripeObject): bank: Optional[ Literal[ "abn_amro", "asn_bank", "bunq", "handelsbanken", "ing", "knab", "moneyou", "n26", "nn", "rabobank", "regiobank", "revolut", "sns_bank", "triodos_bank", "van_lanschot", "yoursafe", ] ] """ The customer's bank. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. """ bic: Optional[ Literal[ "ABNANL2A", "ASNBNL21", "BITSNL2A", "BUNQNL2A", "FVLBNL22", "HANDNL2A", "INGBNL2A", "KNABNL2H", "MOYONL21", "NNBANL2G", "NTSBDEB1", "RABONL2U", "RBRBNL21", "REVOIE23", "REVOLT21", "SNSBNL2A", "TRIONL2U", ] ] """ The Bank Identifier Code of the customer's bank. """ generated_sepa_debit: Optional[ExpandableField["PaymentMethod"]] """ The ID of the SEPA Direct Debit PaymentMethod which was generated by this Charge. """ generated_sepa_debit_mandate: Optional[ExpandableField["Mandate"]] """ The mandate for the SEPA Direct Debit PaymentMethod which was generated by this Charge. """ iban_last4: Optional[str] """ Last four characters of the IBAN. """ verified_name: Optional[str] """ Owner's verified full name. Values are verified or provided by iDEAL directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ class InteracPresent(StripeObject): class Receipt(StripeObject): account_type: Optional[ Literal["checking", "savings", "unknown"] ] """ The type of account being debited or credited """ application_cryptogram: Optional[str] """ EMV tag 9F26, cryptogram generated by the integrated circuit chip. """ application_preferred_name: Optional[str] """ Mnenomic of the Application Identifier. """ authorization_code: Optional[str] """ Identifier for this transaction. """ authorization_response_code: Optional[str] """ EMV tag 8A. A code returned by the card issuer. """ cardholder_verification_method: Optional[str] """ Describes the method used by the cardholder to verify ownership of the card. One of the following: `approval`, `failure`, `none`, `offline_pin`, `offline_pin_and_signature`, `online_pin`, or `signature`. """ dedicated_file_name: Optional[str] """ EMV tag 84. Similar to the application identifier stored on the integrated circuit chip. """ terminal_verification_results: Optional[str] """ The outcome of a series of EMV functions performed by the card reader. """ transaction_status_information: Optional[str] """ An indication of various EMV functions performed during the transaction. """ brand: Optional[str] """ Card brand. Can be `interac`, `mastercard` or `visa`. """ cardholder_name: Optional[str] """ The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. """ country: Optional[str] """ Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. """ description: Optional[str] """ A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) """ emv_auth_data: Optional[str] """ Authorization response cryptogram. """ exp_month: int """ Two-digit number representing the card's expiration month. """ exp_year: int """ Four-digit number representing the card's expiration year. """ fingerprint: Optional[str] """ Uniquely identifies this particular card number. You can use this attribute to check whether two customers who've signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* """ funding: Optional[str] """ Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. """ generated_card: Optional[str] """ ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. Only present if it was possible to generate a card PaymentMethod. """ iin: Optional[str] """ Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) """ issuer: Optional[str] """ The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) """ last4: Optional[str] """ The last four digits of the card. """ network: Optional[str] """ Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ preferred_locales: Optional[List[str]] """ EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. """ read_method: Optional[ Literal[ "contact_emv", "contactless_emv", "contactless_magstripe_mode", "magnetic_stripe_fallback", "magnetic_stripe_track2", ] ] """ How card details were read in this transaction. """ receipt: Optional[Receipt] """ A collection of fields required to be displayed on receipts. Only required for EMV transactions. """ _inner_class_types = {"receipt": Receipt} class Klarna(StripeObject): payment_method_category: Optional[str] """ The Klarna payment method used for this transaction. Can be one of `pay_later`, `pay_now`, `pay_with_financing`, or `pay_in_installments` """ preferred_locale: Optional[str] """ Preferred language of the Klarna authorization page that the customer is redirected to. Can be one of `de-AT`, `en-AT`, `nl-BE`, `fr-BE`, `en-BE`, `de-DE`, `en-DE`, `da-DK`, `en-DK`, `es-ES`, `en-ES`, `fi-FI`, `sv-FI`, `en-FI`, `en-GB`, `en-IE`, `it-IT`, `en-IT`, `nl-NL`, `en-NL`, `nb-NO`, `en-NO`, `sv-SE`, `en-SE`, `en-US`, `es-US`, `fr-FR`, `en-FR`, `cs-CZ`, `en-CZ`, `ro-RO`, `en-RO`, `el-GR`, `en-GR`, `en-AU`, `en-NZ`, `en-CA`, `fr-CA`, `pl-PL`, `en-PL`, `pt-PT`, `en-PT`, `de-CH`, `fr-CH`, `it-CH`, or `en-CH` """ class Konbini(StripeObject): class Store(StripeObject): chain: Optional[ Literal["familymart", "lawson", "ministop", "seicomart"] ] """ The name of the convenience store chain where the payment was completed. """ store: Optional[Store] """ If the payment succeeded, this contains the details of the convenience store where the payment was completed. """ _inner_class_types = {"store": Store} class Link(StripeObject): country: Optional[str] """ Two-letter ISO code representing the funding source country beneath the Link payment. You could use this attribute to get a sense of international fees. """ class Mobilepay(StripeObject): class Card(StripeObject): brand: Optional[str] """ Brand of the card used in the transaction """ country: Optional[str] """ Two-letter ISO code representing the country of the card """ exp_month: Optional[int] """ Two digit number representing the card's expiration month """ exp_year: Optional[int] """ Two digit number representing the card's expiration year """ last4: Optional[str] """ The last 4 digits of the card """ card: Optional[Card] """ Internal card details """ _inner_class_types = {"card": Card} class Multibanco(StripeObject): entity: Optional[str] """ Entity number associated with this Multibanco payment. """ reference: Optional[str] """ Reference number associated with this Multibanco payment. """ class Oxxo(StripeObject): number: Optional[str] """ OXXO reference number """ class P24(StripeObject): bank: Optional[ Literal[ "alior_bank", "bank_millennium", "bank_nowy_bfg_sa", "bank_pekao_sa", "banki_spbdzielcze", "blik", "bnp_paribas", "boz", "citi_handlowy", "credit_agricole", "envelobank", "etransfer_pocztowy24", "getin_bank", "ideabank", "ing", "inteligo", "mbank_mtransfer", "nest_przelew", "noble_pay", "pbac_z_ipko", "plus_bank", "santander_przelew24", "tmobile_usbugi_bankowe", "toyota_bank", "velobank", "volkswagen_bank", ] ] """ The customer's bank. Can be one of `ing`, `citi_handlowy`, `tmobile_usbugi_bankowe`, `plus_bank`, `etransfer_pocztowy24`, `banki_spbdzielcze`, `bank_nowy_bfg_sa`, `getin_bank`, `velobank`, `blik`, `noble_pay`, `ideabank`, `envelobank`, `santander_przelew24`, `nest_przelew`, `mbank_mtransfer`, `inteligo`, `pbac_z_ipko`, `bnp_paribas`, `credit_agricole`, `toyota_bank`, `bank_pekao_sa`, `volkswagen_bank`, `bank_millennium`, `alior_bank`, or `boz`. """ reference: Optional[str] """ Unique reference for this Przelewy24 payment. """ verified_name: Optional[str] """ Owner's verified full name. Values are verified or provided by Przelewy24 directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. Przelewy24 rarely provides this information so the attribute is usually empty. """ class Paynow(StripeObject): reference: Optional[str] """ Reference number associated with this PayNow payment """ class Paypal(StripeObject): class SellerProtection(StripeObject): dispute_categories: Optional[ List[Literal["fraudulent", "product_not_received"]] ] """ An array of conditions that are covered for the transaction, if applicable. """ status: Literal[ "eligible", "not_eligible", "partially_eligible" ] """ Indicates whether the transaction is eligible for PayPal's seller protection. """ payer_email: Optional[str] """ Owner's email. Values are provided by PayPal directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ payer_id: Optional[str] """ PayPal account PayerID. This identifier uniquely identifies the PayPal customer. """ payer_name: Optional[str] """ Owner's full name. Values provided by PayPal directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ seller_protection: Optional[SellerProtection] """ The level of protection offered as defined by PayPal Seller Protection for Merchants, for this transaction. """ transaction_id: Optional[str] """ A unique ID generated by PayPal for this transaction. """ _inner_class_types = {"seller_protection": SellerProtection} class Pix(StripeObject): bank_transaction_id: Optional[str] """ Unique transaction id generated by BCB """ class Promptpay(StripeObject): reference: Optional[str] """ Bill reference generated by PromptPay """ class RevolutPay(StripeObject): pass class SepaCreditTransfer(StripeObject): bank_name: Optional[str] """ Name of the bank associated with the bank account. """ bic: Optional[str] """ Bank Identifier Code of the bank associated with the bank account. """ iban: Optional[str] """ IBAN of the bank account to transfer funds to. """ class SepaDebit(StripeObject): bank_code: Optional[str] """ Bank code of bank associated with the bank account. """ branch_code: Optional[str] """ Branch code of bank associated with the bank account. """ country: Optional[str] """ Two-letter ISO code representing the country the bank account is located in. """ fingerprint: Optional[str] """ Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. """ last4: Optional[str] """ Last four characters of the IBAN. """ mandate: Optional[str] """ Find the ID of the mandate used for this payment under the [payment_method_details.sepa_debit.mandate](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-sepa_debit-mandate) property on the Charge. Use this mandate ID to [retrieve the Mandate](https://stripe.com/docs/api/mandates/retrieve). """ class Sofort(StripeObject): bank_code: Optional[str] """ Bank code of bank associated with the bank account. """ bank_name: Optional[str] """ Name of the bank associated with the bank account. """ bic: Optional[str] """ Bank Identifier Code of the bank associated with the bank account. """ country: Optional[str] """ Two-letter ISO code representing the country the bank account is located in. """ generated_sepa_debit: Optional[ExpandableField["PaymentMethod"]] """ The ID of the SEPA Direct Debit PaymentMethod which was generated by this Charge. """ generated_sepa_debit_mandate: Optional[ExpandableField["Mandate"]] """ The mandate for the SEPA Direct Debit PaymentMethod which was generated by this Charge. """ iban_last4: Optional[str] """ Last four characters of the IBAN. """ preferred_language: Optional[ Literal["de", "en", "es", "fr", "it", "nl", "pl"] ] """ Preferred language of the SOFORT authorization page that the customer is redirected to. Can be one of `de`, `en`, `es`, `fr`, `it`, `nl`, or `pl` """ verified_name: Optional[str] """ Owner's verified full name. Values are verified or provided by SOFORT directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ class StripeAccount(StripeObject): pass class Swish(StripeObject): fingerprint: Optional[str] """ Uniquely identifies the payer's Swish account. You can use this attribute to check whether two Swish transactions were paid for by the same payer """ payment_reference: Optional[str] """ Payer bank reference number for the payment """ verified_phone_last4: Optional[str] """ The last four digits of the Swish account phone number """ class Twint(StripeObject): pass class UsBankAccount(StripeObject): account_holder_type: Optional[Literal["company", "individual"]] """ Account holder type: individual or company. """ account_type: Optional[Literal["checking", "savings"]] """ Account type: checkings or savings. Defaults to checking if omitted. """ bank_name: Optional[str] """ Name of the bank associated with the bank account. """ fingerprint: Optional[str] """ Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. """ last4: Optional[str] """ Last four digits of the bank account number. """ mandate: Optional[ExpandableField["Mandate"]] """ ID of the mandate used to make this payment. """ payment_reference: Optional[str] """ Reference number to locate ACH payments with customer's bank. """ routing_number: Optional[str] """ Routing number of the bank account. """ class Wechat(StripeObject): pass class WechatPay(StripeObject): fingerprint: Optional[str] """ Uniquely identifies this particular WeChat Pay account. You can use this attribute to check whether two WeChat accounts are the same. """ transaction_id: Optional[str] """ Transaction ID of this particular WeChat Pay transaction. """ class Zip(StripeObject): pass ach_credit_transfer: Optional[AchCreditTransfer] ach_debit: Optional[AchDebit] acss_debit: Optional[AcssDebit] affirm: Optional[Affirm] afterpay_clearpay: Optional[AfterpayClearpay] alipay: Optional[Alipay] amazon_pay: Optional[AmazonPay] 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] cashapp: Optional[Cashapp] customer_balance: Optional[CustomerBalance] eps: Optional[Eps] fpx: Optional[Fpx] giropay: Optional[Giropay] grabpay: Optional[Grabpay] ideal: Optional[Ideal] interac_present: Optional[InteracPresent] klarna: Optional[Klarna] konbini: Optional[Konbini] link: Optional[Link] mobilepay: Optional[Mobilepay] multibanco: Optional[Multibanco] oxxo: Optional[Oxxo] p24: Optional[P24] paynow: Optional[Paynow] paypal: Optional[Paypal] pix: Optional[Pix] promptpay: Optional[Promptpay] revolut_pay: Optional[RevolutPay] sepa_credit_transfer: Optional[SepaCreditTransfer] sepa_debit: Optional[SepaDebit] sofort: Optional[Sofort] stripe_account: Optional[StripeAccount] swish: Optional[Swish] twint: Optional[Twint] type: str """ The type of transaction-specific details of the payment method used in the payment, one of `ach_credit_transfer`, `ach_debit`, `acss_debit`, `alipay`, `au_becs_debit`, `bancontact`, `card`, `card_present`, `eps`, `giropay`, `ideal`, `klarna`, `multibanco`, `p24`, `sepa_debit`, `sofort`, `stripe_account`, or `wechat`. An additional hash is included on `payment_method_details` with a name matching this value. It contains information specific to the payment method. """ us_bank_account: Optional[UsBankAccount] wechat: Optional[Wechat] wechat_pay: Optional[WechatPay] zip: Optional[Zip] _inner_class_types = { "ach_credit_transfer": AchCreditTransfer, "ach_debit": AchDebit, "acss_debit": AcssDebit, "affirm": Affirm, "afterpay_clearpay": AfterpayClearpay, "alipay": Alipay, "amazon_pay": AmazonPay, "au_becs_debit": AuBecsDebit, "bacs_debit": BacsDebit, "bancontact": Bancontact, "blik": Blik, "boleto": Boleto, "card": Card, "card_present": CardPresent, "cashapp": Cashapp, "customer_balance": CustomerBalance, "eps": Eps, "fpx": Fpx, "giropay": Giropay, "grabpay": Grabpay, "ideal": Ideal, "interac_present": InteracPresent, "klarna": Klarna, "konbini": Konbini, "link": Link, "mobilepay": Mobilepay, "multibanco": Multibanco, "oxxo": Oxxo, "p24": P24, "paynow": Paynow, "paypal": Paypal, "pix": Pix, "promptpay": Promptpay, "revolut_pay": RevolutPay, "sepa_credit_transfer": SepaCreditTransfer, "sepa_debit": SepaDebit, "sofort": Sofort, "stripe_account": StripeAccount, "swish": Swish, "twint": Twint, "us_bank_account": UsBankAccount, "wechat": Wechat, "wechat_pay": WechatPay, "zip": Zip, } class RadarOptions(StripeObject): session: Optional[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ class Shipping(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 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State, county, province, or region. """ address: Optional[Address] carrier: Optional[str] """ The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. """ name: Optional[str] """ Recipient name. """ phone: Optional[str] """ Recipient phone (including extension). """ tracking_number: Optional[str] """ The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ _inner_class_types = {"address": Address} class TransferData(StripeObject): amount: Optional[int] """ The amount transferred to the destination account, if specified. By default, the entire charge amount is transferred to the destination account. """ destination: ExpandableField["Account"] """ ID of an existing, connected Stripe account to transfer funds to if `transfer_data` was specified in the charge request. """ class CaptureParams(RequestOptions): amount: NotRequired[int] """ The amount to capture, which must be less than or equal to the original amount. Any additional amount will be automatically refunded. """ application_fee: NotRequired[int] """ An application fee to add on to this charge. """ application_fee_amount: NotRequired[int] """ An application fee amount to add on to this charge, which must be less than or equal to the original amount. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ receipt_email: NotRequired[str] """ The email address to send this charge's receipt to. This will override the previously-specified email address for this charge, if one was set. Receipts will not be sent in test mode. """ statement_descriptor: NotRequired[str] """ For card charges, use `statement_descriptor_suffix` instead. Otherwise, you can use this value as the complete description of a charge on your customers' statements. Must contain at least one letter, maximum 22 characters. """ statement_descriptor_suffix: NotRequired[str] """ Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. """ transfer_data: NotRequired["Charge.CaptureParamsTransferData"] """ An optional dictionary including the account to automatically transfer to as part of a destination charge. [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details. """ transfer_group: NotRequired[str] """ A string that identifies this transaction as part of a group. `transfer_group` may only be provided if it has not been set. See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details. """ class CaptureParamsTransferData(TypedDict): amount: NotRequired[int] """ The amount transferred to the destination account, if specified. By default, the entire charge amount is transferred to the destination account. """ class CreateParams(RequestOptions): amount: NotRequired[int] """ Amount intended to be collected by this payment. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/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://stripe.com/docs/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). """ application_fee: NotRequired[int] application_fee_amount: NotRequired[int] """ A fee in cents (or local equivalent) that will be applied to the charge and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the `Stripe-Account` header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/connect/direct-charges#collect-fees). """ 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://stripe.com/docs/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://stripe.com/docs/charges/placing-a-hold) documentation. """ currency: NotRequired[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). """ customer: NotRequired[str] """ The ID of an existing customer that will be charged in this request. """ description: NotRequired[str] """ An arbitrary string which you can attach to a `Charge` object. It is displayed when in the web interface alongside the charge. Note that if you use Stripe to send automatic email receipts to your customers, your receipt emails will include the `description` of the charge(s) that they are describing. """ destination: NotRequired["Charge.CreateParamsDestination"] expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ on_behalf_of: NotRequired[str] """ The Stripe account ID for which these funds are intended. Automatically set if you use the `destination` parameter. For details, see [Creating Separate Charges and Transfers](https://stripe.com/docs/connect/separate-charges-and-transfers#settlement-merchant). """ radar_options: NotRequired["Charge.CreateParamsRadarOptions"] """ Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. """ receipt_email: NotRequired[str] """ The email address to which this charge's [receipt](https://stripe.com/docs/dashboard/receipts) will be sent. The receipt will not be sent until the charge is paid, and no receipts will be sent for test mode charges. If this charge is for a [Customer](https://stripe.com/docs/api/customers/object), the email address specified here will override the customer's email address. If `receipt_email` is specified for a charge in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). """ shipping: NotRequired["Charge.CreateParamsShipping"] """ Shipping information for the charge. Helps prevent fraud on charges for physical goods. """ source: NotRequired[str] """ A payment source to be charged. This can be the ID of a [card](https://stripe.com/docs/api#cards) (i.e., credit or debit card), a [bank account](https://stripe.com/docs/api#bank_accounts), a [source](https://stripe.com/docs/api#sources), a [token](https://stripe.com/docs/api#tokens), or a [connected account](https://stripe.com/docs/connect/account-debits#charging-a-connected-account). For certain sources---namely, [cards](https://stripe.com/docs/api#cards), [bank accounts](https://stripe.com/docs/api#bank_accounts), and attached [sources](https://stripe.com/docs/api#sources)---you must also pass the ID of the associated customer. """ statement_descriptor: NotRequired[str] """ For card charges, use `statement_descriptor_suffix` instead. Otherwise, you can use this value as the complete description of a charge on your customers' statements. Must contain at least one letter, maximum 22 characters. """ statement_descriptor_suffix: NotRequired[str] """ Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. """ transfer_data: NotRequired["Charge.CreateParamsTransferData"] """ An optional dictionary including the account to automatically transfer to as part of a destination charge. [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details. """ transfer_group: NotRequired[str] """ A string that identifies this transaction as part of a group. For details, see [Grouping transactions](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options). """ class CreateParamsDestination(TypedDict): account: str """ ID of an existing, connected Stripe account. """ amount: NotRequired[int] """ The amount to transfer to the destination account without creating an `Application Fee` object. Cannot be combined with the `application_fee` parameter. Must be less than or equal to the charge amount. """ class CreateParamsRadarOptions(TypedDict): session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ class CreateParamsShipping(TypedDict): address: "Charge.CreateParamsShippingAddress" """ Shipping address. """ carrier: NotRequired[str] """ The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. """ name: str """ Recipient name. """ phone: NotRequired[str] """ Recipient phone (including extension). """ tracking_number: NotRequired[str] """ The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ class CreateParamsShippingAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsTransferData(TypedDict): amount: NotRequired[int] """ The amount transferred to the destination account, if specified. By default, the entire charge amount is transferred to the destination account. """ destination: str """ ID of an existing, connected Stripe account. """ class ListParams(RequestOptions): created: NotRequired["Charge.ListParamsCreated|int"] """ Only return charges that were created during the given date interval. """ customer: NotRequired[str] """ Only return charges for the customer specified by this customer ID. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ payment_intent: NotRequired[str] """ Only return charges that were created by the PaymentIntent specified by this PaymentIntent ID. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ transfer_group: NotRequired[str] """ Only return charges for this transfer group. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListRefundsParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ModifyParams(RequestOptions): customer: NotRequired[str] """ The ID of an existing customer that will be associated with this request. This field may only be updated if there is no existing associated customer with this charge. """ description: NotRequired[str] """ An arbitrary string which you can attach to a charge object. It is displayed when in the web interface alongside the charge. Note that if you use Stripe to send automatic email receipts to your customers, your receipt emails will include the `description` of the charge(s) that they are describing. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ fraud_details: NotRequired["Charge.ModifyParamsFraudDetails"] """ A set of key-value pairs you can attach to a charge giving information about its riskiness. If you believe a charge is fraudulent, include a `user_report` key with a value of `fraudulent`. If you believe a charge is safe, include a `user_report` key with a value of `safe`. Stripe will use the information you send to improve our fraud detection algorithms. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ receipt_email: NotRequired[str] """ This is the email address that the receipt for this charge will be sent to. If this field is updated, then a new email receipt will be sent to the updated address. """ shipping: NotRequired["Charge.ModifyParamsShipping"] """ Shipping information for the charge. Helps prevent fraud on charges for physical goods. """ transfer_group: NotRequired[str] """ A string that identifies this transaction as part of a group. `transfer_group` may only be provided if it has not been set. See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details. """ class ModifyParamsFraudDetails(TypedDict): user_report: Union[Literal[""], Literal["fraudulent", "safe"]] """ Either `safe` or `fraudulent`. """ class ModifyParamsShipping(TypedDict): address: "Charge.ModifyParamsShippingAddress" """ Shipping address. """ carrier: NotRequired[str] """ The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. """ name: str """ Recipient name. """ phone: NotRequired[str] """ Recipient phone (including extension). """ tracking_number: NotRequired[str] """ The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ class ModifyParamsShippingAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveRefundParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class SearchParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ page: NotRequired[str] """ A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. """ query: str """ The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for charges](https://stripe.com/docs/search#query-fields-for-charges). """ amount: int """ Amount intended to be collected by this payment. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/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://stripe.com/docs/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). """ amount_captured: int """ Amount in cents (or local equivalent) captured (can be less than the amount attribute on the charge if a partial capture was made). """ amount_refunded: int """ Amount in cents (or local equivalent) refunded (can be less than the amount attribute on the charge if a partial refund was issued). """ application: Optional[ExpandableField["Application"]] """ ID of the Connect application that created the charge. """ application_fee: Optional[ExpandableField["ApplicationFee"]] """ The application fee (if any) for the charge. [See the Connect documentation](https://stripe.com/docs/connect/direct-charges#collect-fees) for details. """ application_fee_amount: Optional[int] """ The amount of the application fee (if any) requested for the charge. [See the Connect documentation](https://stripe.com/docs/connect/direct-charges#collect-fees) for details. """ authorization_code: Optional[str] """ Authorization code on the charge. """ balance_transaction: Optional[ExpandableField["BalanceTransaction"]] """ ID of the balance transaction that describes the impact of this charge on your account balance (not including refunds or disputes). """ billing_details: BillingDetails calculated_statement_descriptor: Optional[str] """ The full statement descriptor that is passed to card networks, and that is displayed on your customers' credit card and bank statements. Allows you to see what the statement descriptor looks like after the static and dynamic portions are combined. """ captured: bool """ If the charge was created without capturing, this Boolean represents whether it is still uncaptured or has since been captured. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ 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). """ customer: Optional[ExpandableField["Customer"]] """ ID of the customer this charge is for if one exists. """ description: Optional[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ disputed: bool """ Whether the charge has been disputed. """ failure_balance_transaction: Optional[ ExpandableField["BalanceTransaction"] ] """ ID of the balance transaction that describes the reversal of the balance on your account due to payment failure. """ failure_code: Optional[str] """ Error code explaining reason for charge failure if available (see [the errors section](https://stripe.com/docs/error-codes) for a list of codes). """ failure_message: Optional[str] """ Message to user further explaining reason for charge failure if available. """ fraud_details: Optional[FraudDetails] """ Information on fraud assessments for the charge. """ id: str """ Unique identifier for the object. """ invoice: Optional[ExpandableField["Invoice"]] """ ID of the invoice this charge is for if one exists. """ level3: Optional[Level3] livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ metadata: Dict[str, str] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ object: Literal["charge"] """ String representing the object's type. Objects of the same type share the same value. """ on_behalf_of: Optional[ExpandableField["Account"]] """ The account (if any) the charge was made on behalf of without triggering an automatic transfer. See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. """ outcome: Optional[Outcome] """ Details about whether the payment was accepted, and why. See [understanding declines](https://stripe.com/docs/declines) for details. """ paid: bool """ `true` if the charge succeeded, or was successfully authorized for later capture. """ payment_intent: Optional[ExpandableField["PaymentIntent"]] """ ID of the PaymentIntent associated with this charge, if one exists. """ payment_method: Optional[str] """ ID of the payment method used in this charge. """ payment_method_details: Optional[PaymentMethodDetails] """ Details about the payment method at the time of the transaction. """ radar_options: Optional[RadarOptions] """ Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. """ receipt_email: Optional[str] """ This is the email address that the receipt for this charge was sent to. """ receipt_number: Optional[str] """ This is the transaction number that appears on email receipts sent for this charge. This attribute will be `null` until a receipt has been sent. """ receipt_url: Optional[str] """ This is the URL to view the receipt for this charge. The receipt is kept up-to-date to the latest state of the charge, including any refunds. If the charge is for an Invoice, the receipt will be stylized as an Invoice receipt. """ refunded: bool """ Whether the charge has been fully refunded. If the charge is only partially refunded, this attribute will still be false. """ refunds: Optional[ListObject["Refund"]] """ A list of refunds that have been applied to the charge. """ review: Optional[ExpandableField["Review"]] """ ID of the review associated with this charge if one exists. """ shipping: Optional[Shipping] """ Shipping information for the charge. """ source: Optional[Union["Account", "BankAccount", "CardResource", "Source"]] """ This is a legacy field that will be removed in the future. It contains the Source, Card, or BankAccount object used for the charge. For details about the payment method used for this charge, refer to `payment_method` or `payment_method_details` instead. """ source_transfer: Optional[ExpandableField["Transfer"]] """ The transfer ID which created this charge. Only present if the charge came from another Stripe account. [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details. """ statement_descriptor: Optional[str] """ For card charges, use `statement_descriptor_suffix` instead. Otherwise, you can use this value as the complete description of a charge on your customers' statements. Must contain at least one letter, maximum 22 characters. """ statement_descriptor_suffix: Optional[str] """ Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. """ status: Literal["failed", "pending", "succeeded"] """ The status of the payment is either `succeeded`, `pending`, or `failed`. """ transfer: Optional[ExpandableField["Transfer"]] """ ID of the transfer to the `destination` account (only applicable if the charge was created using the `destination` parameter). """ transfer_data: Optional[TransferData] """ An optional dictionary including the account to automatically transfer to as part of a destination charge. [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details. """ transfer_group: Optional[str] """ A string that identifies this transaction as part of a group. See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details. """ @classmethod def _cls_capture( cls, charge: str, **params: Unpack["Charge.CaptureParams"] ) -> "Charge": """ Capture the payment of an existing, uncaptured charge that was created with the capture option set to false. Uncaptured payments expire a set number of days after they are created ([7 by default](https://stripe.com/docs/charges/placing-a-hold)), after which they are marked as refunded and capture attempts will fail. Don't use this method to capture a PaymentIntent-initiated charge. Use [Capture a PaymentIntent](https://stripe.com/docs/api/payment_intents/capture). """ return cast( "Charge", cls._static_request( "post", "/v1/charges/{charge}/capture".format( charge=sanitize_id(charge) ), params=params, ), ) @overload @staticmethod def capture( charge: str, **params: Unpack["Charge.CaptureParams"] ) -> "Charge": """ Capture the payment of an existing, uncaptured charge that was created with the capture option set to false. Uncaptured payments expire a set number of days after they are created ([7 by default](https://stripe.com/docs/charges/placing-a-hold)), after which they are marked as refunded and capture attempts will fail. Don't use this method to capture a PaymentIntent-initiated charge. Use [Capture a PaymentIntent](https://stripe.com/docs/api/payment_intents/capture). """ ... @overload def capture(self, **params: Unpack["Charge.CaptureParams"]) -> "Charge": """ Capture the payment of an existing, uncaptured charge that was created with the capture option set to false. Uncaptured payments expire a set number of days after they are created ([7 by default](https://stripe.com/docs/charges/placing-a-hold)), after which they are marked as refunded and capture attempts will fail. Don't use this method to capture a PaymentIntent-initiated charge. Use [Capture a PaymentIntent](https://stripe.com/docs/api/payment_intents/capture). """ ... @class_method_variant("_cls_capture") def capture( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Charge.CaptureParams"] ) -> "Charge": """ Capture the payment of an existing, uncaptured charge that was created with the capture option set to false. Uncaptured payments expire a set number of days after they are created ([7 by default](https://stripe.com/docs/charges/placing-a-hold)), after which they are marked as refunded and capture attempts will fail. Don't use this method to capture a PaymentIntent-initiated charge. Use [Capture a PaymentIntent](https://stripe.com/docs/api/payment_intents/capture). """ return cast( "Charge", self._request( "post", "/v1/charges/{charge}/capture".format( charge=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_capture_async( cls, charge: str, **params: Unpack["Charge.CaptureParams"] ) -> "Charge": """ Capture the payment of an existing, uncaptured charge that was created with the capture option set to false. Uncaptured payments expire a set number of days after they are created ([7 by default](https://stripe.com/docs/charges/placing-a-hold)), after which they are marked as refunded and capture attempts will fail. Don't use this method to capture a PaymentIntent-initiated charge. Use [Capture a PaymentIntent](https://stripe.com/docs/api/payment_intents/capture). """ return cast( "Charge", await cls._static_request_async( "post", "/v1/charges/{charge}/capture".format( charge=sanitize_id(charge) ), params=params, ), ) @overload @staticmethod async def capture_async( charge: str, **params: Unpack["Charge.CaptureParams"] ) -> "Charge": """ Capture the payment of an existing, uncaptured charge that was created with the capture option set to false. Uncaptured payments expire a set number of days after they are created ([7 by default](https://stripe.com/docs/charges/placing-a-hold)), after which they are marked as refunded and capture attempts will fail. Don't use this method to capture a PaymentIntent-initiated charge. Use [Capture a PaymentIntent](https://stripe.com/docs/api/payment_intents/capture). """ ... @overload async def capture_async( self, **params: Unpack["Charge.CaptureParams"] ) -> "Charge": """ Capture the payment of an existing, uncaptured charge that was created with the capture option set to false. Uncaptured payments expire a set number of days after they are created ([7 by default](https://stripe.com/docs/charges/placing-a-hold)), after which they are marked as refunded and capture attempts will fail. Don't use this method to capture a PaymentIntent-initiated charge. Use [Capture a PaymentIntent](https://stripe.com/docs/api/payment_intents/capture). """ ... @class_method_variant("_cls_capture_async") async def capture_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Charge.CaptureParams"] ) -> "Charge": """ Capture the payment of an existing, uncaptured charge that was created with the capture option set to false. Uncaptured payments expire a set number of days after they are created ([7 by default](https://stripe.com/docs/charges/placing-a-hold)), after which they are marked as refunded and capture attempts will fail. Don't use this method to capture a PaymentIntent-initiated charge. Use [Capture a PaymentIntent](https://stripe.com/docs/api/payment_intents/capture). """ return cast( "Charge", await self._request_async( "post", "/v1/charges/{charge}/capture".format( charge=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def create(cls, **params: Unpack["Charge.CreateParams"]) -> "Charge": """ This method is no longer recommended—use the [Payment Intents API](https://stripe.com/docs/api/payment_intents) to initiate a new payment instead. Confirmation of the PaymentIntent creates the Charge object used to request payment. """ return cast( "Charge", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["Charge.CreateParams"] ) -> "Charge": """ This method is no longer recommended—use the [Payment Intents API](https://stripe.com/docs/api/payment_intents) to initiate a new payment instead. Confirmation of the PaymentIntent creates the Charge object used to request payment. """ return cast( "Charge", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def list( cls, **params: Unpack["Charge.ListParams"] ) -> ListObject["Charge"]: """ Returns a list of charges you've previously created. The charges are returned in sorted order, with the most recent charges appearing first. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["Charge.ListParams"] ) -> ListObject["Charge"]: """ Returns a list of charges you've previously created. The charges are returned in sorted order, with the most recent charges appearing first. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def modify( cls, id: str, **params: Unpack["Charge.ModifyParams"] ) -> "Charge": """ Updates the specified charge by setting the values of the parameters passed. Any parameters not provided will be left unchanged. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Charge", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["Charge.ModifyParams"] ) -> "Charge": """ Updates the specified charge by setting the values of the parameters passed. Any parameters not provided will be left unchanged. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Charge", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["Charge.RetrieveParams"] ) -> "Charge": """ Retrieves the details of a charge that has previously been created. Supply the unique charge ID that was returned from your previous request, and Stripe will return the corresponding charge information. The same information is returned when creating or refunding the charge. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["Charge.RetrieveParams"] ) -> "Charge": """ Retrieves the details of a charge that has previously been created. Supply the unique charge ID that was returned from your previous request, and Stripe will return the corresponding charge information. The same information is returned when creating or refunding the charge. """ instance = cls(id, **params) await instance.refresh_async() return instance @classmethod def search( cls, *args, **kwargs: Unpack["Charge.SearchParams"] ) -> SearchResultObject["Charge"]: """ Search for charges you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India. """ return cls._search(search_url="/v1/charges/search", *args, **kwargs) @classmethod async def search_async( cls, *args, **kwargs: Unpack["Charge.SearchParams"] ) -> SearchResultObject["Charge"]: """ Search for charges you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India. """ return await cls._search_async( search_url="/v1/charges/search", *args, **kwargs ) @classmethod def search_auto_paging_iter( cls, *args, **kwargs: Unpack["Charge.SearchParams"] ) -> Iterator["Charge"]: return cls.search(*args, **kwargs).auto_paging_iter() @classmethod async def search_auto_paging_iter_async( cls, *args, **kwargs: Unpack["Charge.SearchParams"] ) -> AsyncIterator["Charge"]: return (await cls.search_async(*args, **kwargs)).auto_paging_iter() def mark_as_fraudulent(self, idempotency_key=None) -> "Charge": params = { "fraud_details": {"user_report": "fraudulent"}, "idempotency_key": idempotency_key, } url = self.instance_url() self._request_and_refresh("post", url, params) return self def mark_as_safe(self, idempotency_key=None) -> "Charge": params = { "fraud_details": {"user_report": "safe"}, "idempotency_key": idempotency_key, } url = self.instance_url() self._request_and_refresh("post", url, params) return self @classmethod def retrieve_refund( cls, charge: str, refund: str, **params: Unpack["Charge.RetrieveRefundParams"], ) -> "Refund": """ Retrieves the details of an existing refund. """ return cast( "Refund", cls._static_request( "get", "/v1/charges/{charge}/refunds/{refund}".format( charge=sanitize_id(charge), refund=sanitize_id(refund) ), params=params, ), ) @classmethod async def retrieve_refund_async( cls, charge: str, refund: str, **params: Unpack["Charge.RetrieveRefundParams"], ) -> "Refund": """ Retrieves the details of an existing refund. """ return cast( "Refund", await cls._static_request_async( "get", "/v1/charges/{charge}/refunds/{refund}".format( charge=sanitize_id(charge), refund=sanitize_id(refund) ), params=params, ), ) @classmethod def list_refunds( cls, charge: str, **params: Unpack["Charge.ListRefundsParams"] ) -> ListObject["Refund"]: """ You can see a list of the refunds belonging to a specific charge. Note that the 10 most recent refunds are always available by default on the charge object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional refunds. """ return cast( ListObject["Refund"], cls._static_request( "get", "/v1/charges/{charge}/refunds".format( charge=sanitize_id(charge) ), params=params, ), ) @classmethod async def list_refunds_async( cls, charge: str, **params: Unpack["Charge.ListRefundsParams"] ) -> ListObject["Refund"]: """ You can see a list of the refunds belonging to a specific charge. Note that the 10 most recent refunds are always available by default on the charge object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional refunds. """ return cast( ListObject["Refund"], await cls._static_request_async( "get", "/v1/charges/{charge}/refunds".format( charge=sanitize_id(charge) ), params=params, ), ) _inner_class_types = { "billing_details": BillingDetails, "fraud_details": FraudDetails, "level3": Level3, "outcome": Outcome, "payment_method_details": PaymentMethodDetails, "radar_options": RadarOptions, "shipping": Shipping, "transfer_data": TransferData, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_charge_service.py0000644000175100001770000006767214637354563017536 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._charge import Charge from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._search_result_object import SearchResultObject from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import Dict, List, Union, cast from typing_extensions import Literal, NotRequired, TypedDict class ChargeService(StripeService): class CaptureParams(TypedDict): amount: NotRequired[int] """ The amount to capture, which must be less than or equal to the original amount. Any additional amount will be automatically refunded. """ application_fee: NotRequired[int] """ An application fee to add on to this charge. """ application_fee_amount: NotRequired[int] """ An application fee amount to add on to this charge, which must be less than or equal to the original amount. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ receipt_email: NotRequired[str] """ The email address to send this charge's receipt to. This will override the previously-specified email address for this charge, if one was set. Receipts will not be sent in test mode. """ statement_descriptor: NotRequired[str] """ For card charges, use `statement_descriptor_suffix` instead. Otherwise, you can use this value as the complete description of a charge on your customers' statements. Must contain at least one letter, maximum 22 characters. """ statement_descriptor_suffix: NotRequired[str] """ Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. """ transfer_data: NotRequired["ChargeService.CaptureParamsTransferData"] """ An optional dictionary including the account to automatically transfer to as part of a destination charge. [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details. """ transfer_group: NotRequired[str] """ A string that identifies this transaction as part of a group. `transfer_group` may only be provided if it has not been set. See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details. """ class CaptureParamsTransferData(TypedDict): amount: NotRequired[int] """ The amount transferred to the destination account, if specified. By default, the entire charge amount is transferred to the destination account. """ class CreateParams(TypedDict): amount: NotRequired[int] """ Amount intended to be collected by this payment. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/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://stripe.com/docs/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). """ application_fee: NotRequired[int] application_fee_amount: NotRequired[int] """ A fee in cents (or local equivalent) that will be applied to the charge and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the `Stripe-Account` header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/connect/direct-charges#collect-fees). """ 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://stripe.com/docs/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://stripe.com/docs/charges/placing-a-hold) documentation. """ currency: NotRequired[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). """ customer: NotRequired[str] """ The ID of an existing customer that will be charged in this request. """ description: NotRequired[str] """ An arbitrary string which you can attach to a `Charge` object. It is displayed when in the web interface alongside the charge. Note that if you use Stripe to send automatic email receipts to your customers, your receipt emails will include the `description` of the charge(s) that they are describing. """ destination: NotRequired["ChargeService.CreateParamsDestination"] expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ on_behalf_of: NotRequired[str] """ The Stripe account ID for which these funds are intended. Automatically set if you use the `destination` parameter. For details, see [Creating Separate Charges and Transfers](https://stripe.com/docs/connect/separate-charges-and-transfers#settlement-merchant). """ radar_options: NotRequired["ChargeService.CreateParamsRadarOptions"] """ Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. """ receipt_email: NotRequired[str] """ The email address to which this charge's [receipt](https://stripe.com/docs/dashboard/receipts) will be sent. The receipt will not be sent until the charge is paid, and no receipts will be sent for test mode charges. If this charge is for a [Customer](https://stripe.com/docs/api/customers/object), the email address specified here will override the customer's email address. If `receipt_email` is specified for a charge in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). """ shipping: NotRequired["ChargeService.CreateParamsShipping"] """ Shipping information for the charge. Helps prevent fraud on charges for physical goods. """ source: NotRequired[str] """ A payment source to be charged. This can be the ID of a [card](https://stripe.com/docs/api#cards) (i.e., credit or debit card), a [bank account](https://stripe.com/docs/api#bank_accounts), a [source](https://stripe.com/docs/api#sources), a [token](https://stripe.com/docs/api#tokens), or a [connected account](https://stripe.com/docs/connect/account-debits#charging-a-connected-account). For certain sources---namely, [cards](https://stripe.com/docs/api#cards), [bank accounts](https://stripe.com/docs/api#bank_accounts), and attached [sources](https://stripe.com/docs/api#sources)---you must also pass the ID of the associated customer. """ statement_descriptor: NotRequired[str] """ For card charges, use `statement_descriptor_suffix` instead. Otherwise, you can use this value as the complete description of a charge on your customers' statements. Must contain at least one letter, maximum 22 characters. """ statement_descriptor_suffix: NotRequired[str] """ Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. """ transfer_data: NotRequired["ChargeService.CreateParamsTransferData"] """ An optional dictionary including the account to automatically transfer to as part of a destination charge. [See the Connect documentation](https://stripe.com/docs/connect/destination-charges) for details. """ transfer_group: NotRequired[str] """ A string that identifies this transaction as part of a group. For details, see [Grouping transactions](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options). """ class CreateParamsDestination(TypedDict): account: str """ ID of an existing, connected Stripe account. """ amount: NotRequired[int] """ The amount to transfer to the destination account without creating an `Application Fee` object. Cannot be combined with the `application_fee` parameter. Must be less than or equal to the charge amount. """ class CreateParamsRadarOptions(TypedDict): session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ class CreateParamsShipping(TypedDict): address: "ChargeService.CreateParamsShippingAddress" """ Shipping address. """ carrier: NotRequired[str] """ The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. """ name: str """ Recipient name. """ phone: NotRequired[str] """ Recipient phone (including extension). """ tracking_number: NotRequired[str] """ The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ class CreateParamsShippingAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsTransferData(TypedDict): amount: NotRequired[int] """ The amount transferred to the destination account, if specified. By default, the entire charge amount is transferred to the destination account. """ destination: str """ ID of an existing, connected Stripe account. """ class ListParams(TypedDict): created: NotRequired["ChargeService.ListParamsCreated|int"] """ Only return charges that were created during the given date interval. """ customer: NotRequired[str] """ Only return charges for the customer specified by this customer ID. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ payment_intent: NotRequired[str] """ Only return charges that were created by the PaymentIntent specified by this PaymentIntent ID. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ transfer_group: NotRequired[str] """ Only return charges for this transfer group. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class SearchParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ page: NotRequired[str] """ A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. """ query: str """ The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for charges](https://stripe.com/docs/search#query-fields-for-charges). """ class UpdateParams(TypedDict): customer: NotRequired[str] """ The ID of an existing customer that will be associated with this request. This field may only be updated if there is no existing associated customer with this charge. """ description: NotRequired[str] """ An arbitrary string which you can attach to a charge object. It is displayed when in the web interface alongside the charge. Note that if you use Stripe to send automatic email receipts to your customers, your receipt emails will include the `description` of the charge(s) that they are describing. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ fraud_details: NotRequired["ChargeService.UpdateParamsFraudDetails"] """ A set of key-value pairs you can attach to a charge giving information about its riskiness. If you believe a charge is fraudulent, include a `user_report` key with a value of `fraudulent`. If you believe a charge is safe, include a `user_report` key with a value of `safe`. Stripe will use the information you send to improve our fraud detection algorithms. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ receipt_email: NotRequired[str] """ This is the email address that the receipt for this charge will be sent to. If this field is updated, then a new email receipt will be sent to the updated address. """ shipping: NotRequired["ChargeService.UpdateParamsShipping"] """ Shipping information for the charge. Helps prevent fraud on charges for physical goods. """ transfer_group: NotRequired[str] """ A string that identifies this transaction as part of a group. `transfer_group` may only be provided if it has not been set. See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details. """ class UpdateParamsFraudDetails(TypedDict): user_report: Union[Literal[""], Literal["fraudulent", "safe"]] """ Either `safe` or `fraudulent`. """ class UpdateParamsShipping(TypedDict): address: "ChargeService.UpdateParamsShippingAddress" """ Shipping address. """ carrier: NotRequired[str] """ The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. """ name: str """ Recipient name. """ phone: NotRequired[str] """ Recipient phone (including extension). """ tracking_number: NotRequired[str] """ The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ class UpdateParamsShippingAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ def list( self, params: "ChargeService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Charge]: """ Returns a list of charges you've previously created. The charges are returned in sorted order, with the most recent charges appearing first. """ return cast( ListObject[Charge], self._request( "get", "/v1/charges", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "ChargeService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Charge]: """ Returns a list of charges you've previously created. The charges are returned in sorted order, with the most recent charges appearing first. """ return cast( ListObject[Charge], await self._request_async( "get", "/v1/charges", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "ChargeService.CreateParams" = {}, options: RequestOptions = {}, ) -> Charge: """ This method is no longer recommended—use the [Payment Intents API](https://stripe.com/docs/api/payment_intents) to initiate a new payment instead. Confirmation of the PaymentIntent creates the Charge object used to request payment. """ return cast( Charge, self._request( "post", "/v1/charges", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "ChargeService.CreateParams" = {}, options: RequestOptions = {}, ) -> Charge: """ This method is no longer recommended—use the [Payment Intents API](https://stripe.com/docs/api/payment_intents) to initiate a new payment instead. Confirmation of the PaymentIntent creates the Charge object used to request payment. """ return cast( Charge, await self._request_async( "post", "/v1/charges", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, charge: str, params: "ChargeService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Charge: """ Retrieves the details of a charge that has previously been created. Supply the unique charge ID that was returned from your previous request, and Stripe will return the corresponding charge information. The same information is returned when creating or refunding the charge. """ return cast( Charge, self._request( "get", "/v1/charges/{charge}".format(charge=sanitize_id(charge)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, charge: str, params: "ChargeService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Charge: """ Retrieves the details of a charge that has previously been created. Supply the unique charge ID that was returned from your previous request, and Stripe will return the corresponding charge information. The same information is returned when creating or refunding the charge. """ return cast( Charge, await self._request_async( "get", "/v1/charges/{charge}".format(charge=sanitize_id(charge)), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, charge: str, params: "ChargeService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Charge: """ Updates the specified charge by setting the values of the parameters passed. Any parameters not provided will be left unchanged. """ return cast( Charge, self._request( "post", "/v1/charges/{charge}".format(charge=sanitize_id(charge)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, charge: str, params: "ChargeService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Charge: """ Updates the specified charge by setting the values of the parameters passed. Any parameters not provided will be left unchanged. """ return cast( Charge, await self._request_async( "post", "/v1/charges/{charge}".format(charge=sanitize_id(charge)), api_mode="V1", base_address="api", params=params, options=options, ), ) def search( self, params: "ChargeService.SearchParams", options: RequestOptions = {}, ) -> SearchResultObject[Charge]: """ Search for charges you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India. """ return cast( SearchResultObject[Charge], self._request( "get", "/v1/charges/search", api_mode="V1", base_address="api", params=params, options=options, ), ) async def search_async( self, params: "ChargeService.SearchParams", options: RequestOptions = {}, ) -> SearchResultObject[Charge]: """ Search for charges you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India. """ return cast( SearchResultObject[Charge], await self._request_async( "get", "/v1/charges/search", api_mode="V1", base_address="api", params=params, options=options, ), ) def capture( self, charge: str, params: "ChargeService.CaptureParams" = {}, options: RequestOptions = {}, ) -> Charge: """ Capture the payment of an existing, uncaptured charge that was created with the capture option set to false. Uncaptured payments expire a set number of days after they are created ([7 by default](https://stripe.com/docs/charges/placing-a-hold)), after which they are marked as refunded and capture attempts will fail. Don't use this method to capture a PaymentIntent-initiated charge. Use [Capture a PaymentIntent](https://stripe.com/docs/api/payment_intents/capture). """ return cast( Charge, self._request( "post", "/v1/charges/{charge}/capture".format( charge=sanitize_id(charge), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def capture_async( self, charge: str, params: "ChargeService.CaptureParams" = {}, options: RequestOptions = {}, ) -> Charge: """ Capture the payment of an existing, uncaptured charge that was created with the capture option set to false. Uncaptured payments expire a set number of days after they are created ([7 by default](https://stripe.com/docs/charges/placing-a-hold)), after which they are marked as refunded and capture attempts will fail. Don't use this method to capture a PaymentIntent-initiated charge. Use [Capture a PaymentIntent](https://stripe.com/docs/api/payment_intents/capture). """ return cast( Charge, await self._request_async( "post", "/v1/charges/{charge}/capture".format( charge=sanitize_id(charge), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_checkout_service.py0000644000175100001770000000052314637354563020070 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_service import StripeService from stripe.checkout._session_service import SessionService class CheckoutService(StripeService): def __init__(self, requestor): super().__init__(requestor) self.sessions = SessionService(self._requestor) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_client_options.py0000644000175100001770000000065514637354563017602 0ustar00runnerdockerfrom typing import Optional class _ClientOptions(object): client_id: Optional[str] proxy: Optional[str] verify_ssl_certs: Optional[bool] def __init__( self, client_id: Optional[str] = None, proxy: Optional[str] = None, verify_ssl_certs: Optional[bool] = None, ): self.client_id = client_id self.proxy = proxy self.verify_ssl_certs = verify_ssl_certs ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_climate_service.py0000644000175100001770000000106314637354563017701 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_service import StripeService from stripe.climate._order_service import OrderService from stripe.climate._product_service import ProductService from stripe.climate._supplier_service import SupplierService class ClimateService(StripeService): def __init__(self, requestor): super().__init__(requestor) self.orders = OrderService(self._requestor) self.products = ProductService(self._requestor) self.suppliers = SupplierService(self._requestor) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_confirmation_token.py0000644000175100001770000024733614637354563020452 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._api_resource import APIResource from stripe._expandable_field import ExpandableField from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._test_helpers import APIResourceTestHelpers from typing import ClassVar, Dict, List, Optional, cast from typing_extensions import ( Literal, NotRequired, Type, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._charge import Charge from stripe._setup_attempt import SetupAttempt class ConfirmationToken(APIResource["ConfirmationToken"]): """ ConfirmationTokens help transport client side data collected by Stripe JS over to your server for confirming a PaymentIntent or SetupIntent. If the confirmation is successful, values present on the ConfirmationToken are written onto the Intent. To learn more about how to use ConfirmationToken, visit the related guides: - [Finalize payments on the server](https://stripe.com/docs/payments/finalize-payments-on-the-server) - [Build two-step confirmation](https://stripe.com/docs/payments/build-a-two-step-confirmation). """ OBJECT_NAME: ClassVar[Literal["confirmation_token"]] = "confirmation_token" class MandateData(StripeObject): class CustomerAcceptance(StripeObject): class Online(StripeObject): ip_address: Optional[str] """ The IP address from which the Mandate was accepted by the customer. """ user_agent: Optional[str] """ The user agent of the browser from which the Mandate was accepted by the customer. """ online: Optional[Online] """ If this is a Mandate accepted online, this hash contains details about the online acceptance. """ type: str """ The type of customer acceptance information included with the Mandate. """ _inner_class_types = {"online": Online} customer_acceptance: CustomerAcceptance """ This hash contains details about the customer acceptance of the Mandate. """ _inner_class_types = {"customer_acceptance": CustomerAcceptance} class PaymentMethodPreview(StripeObject): class AcssDebit(StripeObject): bank_name: Optional[str] """ Name of the bank associated with the bank account. """ fingerprint: Optional[str] """ Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. """ institution_number: Optional[str] """ Institution number of the bank account. """ last4: Optional[str] """ Last four digits of the bank account number. """ transit_number: Optional[str] """ Transit number of the bank account. """ class Affirm(StripeObject): pass class AfterpayClearpay(StripeObject): pass class Alipay(StripeObject): pass class AmazonPay(StripeObject): pass class AuBecsDebit(StripeObject): bsb_number: Optional[str] """ Six-digit number identifying bank and branch associated with this bank account. """ fingerprint: Optional[str] """ Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. """ last4: Optional[str] """ Last four digits of the bank account number. """ class BacsDebit(StripeObject): fingerprint: Optional[str] """ Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. """ last4: Optional[str] """ Last four digits of the bank account number. """ sort_code: Optional[str] """ Sort code of the bank account. (e.g., `10-20-30`) """ class Bancontact(StripeObject): pass 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 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State, county, province, or region. """ address: Optional[Address] """ Billing address. """ email: Optional[str] """ Email address. """ name: Optional[str] """ Full name. """ phone: Optional[str] """ Billing phone number (including extension). """ _inner_class_types = {"address": Address} class Blik(StripeObject): pass class Boleto(StripeObject): tax_id: str """ Uniquely identifies the customer tax id (CNPJ or CPF) """ class Card(StripeObject): class Checks(StripeObject): address_line1_check: Optional[str] """ If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. """ address_postal_code_check: Optional[str] """ If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. """ cvc_check: Optional[str] """ If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. """ class GeneratedFrom(StripeObject): class PaymentMethodDetails(StripeObject): class CardPresent(StripeObject): class Offline(StripeObject): stored_at: Optional[int] """ Time at which the payment was collected while offline """ class Receipt(StripeObject): account_type: Optional[ Literal[ "checking", "credit", "prepaid", "unknown" ] ] """ The type of account being debited or credited """ application_cryptogram: Optional[str] """ EMV tag 9F26, cryptogram generated by the integrated circuit chip. """ application_preferred_name: Optional[str] """ Mnenomic of the Application Identifier. """ authorization_code: Optional[str] """ Identifier for this transaction. """ authorization_response_code: Optional[str] """ EMV tag 8A. A code returned by the card issuer. """ cardholder_verification_method: Optional[str] """ Describes the method used by the cardholder to verify ownership of the card. One of the following: `approval`, `failure`, `none`, `offline_pin`, `offline_pin_and_signature`, `online_pin`, or `signature`. """ dedicated_file_name: Optional[str] """ EMV tag 84. Similar to the application identifier stored on the integrated circuit chip. """ terminal_verification_results: Optional[str] """ The outcome of a series of EMV functions performed by the card reader. """ transaction_status_information: Optional[str] """ An indication of various EMV functions performed during the transaction. """ amount_authorized: Optional[int] """ The authorized amount """ brand: Optional[str] """ Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ capture_before: Optional[int] """ When using manual capture, a future timestamp after which the charge will be automatically refunded if uncaptured. """ cardholder_name: Optional[str] """ The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. """ country: Optional[str] """ Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. """ description: Optional[str] """ A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) """ emv_auth_data: Optional[str] """ Authorization response cryptogram. """ exp_month: int """ Two-digit number representing the card's expiration month. """ exp_year: int """ Four-digit number representing the card's expiration year. """ fingerprint: Optional[str] """ Uniquely identifies this particular card number. You can use this attribute to check whether two customers who've signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* """ funding: Optional[str] """ Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. """ generated_card: Optional[str] """ ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. Only present if it was possible to generate a card PaymentMethod. """ iin: Optional[str] """ Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) """ incremental_authorization_supported: bool """ Whether this [PaymentIntent](https://stripe.com/docs/api/payment_intents) is eligible for incremental authorizations. Request support using [request_incremental_authorization_support](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method_options-card_present-request_incremental_authorization_support). """ issuer: Optional[str] """ The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) """ last4: Optional[str] """ The last four digits of the card. """ network: Optional[str] """ Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ offline: Optional[Offline] """ Details about payments collected offline. """ overcapture_supported: bool """ Defines whether the authorized amount can be over-captured or not """ preferred_locales: Optional[List[str]] """ EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. """ read_method: Optional[ Literal[ "contact_emv", "contactless_emv", "contactless_magstripe_mode", "magnetic_stripe_fallback", "magnetic_stripe_track2", ] ] """ How card details were read in this transaction. """ receipt: Optional[Receipt] """ A collection of fields required to be displayed on receipts. Only required for EMV transactions. """ _inner_class_types = { "offline": Offline, "receipt": Receipt, } card_present: Optional[CardPresent] type: str """ The type of payment method transaction-specific details from the transaction that generated this `card` payment method. Always `card_present`. """ _inner_class_types = {"card_present": CardPresent} charge: Optional[str] """ The charge that created this object. """ payment_method_details: Optional[PaymentMethodDetails] """ Transaction-specific details of the payment method used in the payment. """ setup_attempt: Optional[ExpandableField["SetupAttempt"]] """ The ID of the SetupAttempt that generated this PaymentMethod, if any. """ _inner_class_types = { "payment_method_details": PaymentMethodDetails, } class Networks(StripeObject): available: List[str] """ All available networks for the card. """ preferred: Optional[str] """ The preferred network for co-branded cards. Can be `cartes_bancaires`, `mastercard`, `visa` or `invalid_preference` if requested network is not valid for the card. """ class ThreeDSecureUsage(StripeObject): supported: bool """ Whether 3D Secure is supported on this card. """ class Wallet(StripeObject): class AmexExpressCheckout(StripeObject): pass class ApplePay(StripeObject): pass class GooglePay(StripeObject): pass class Link(StripeObject): pass class Masterpass(StripeObject): class BillingAddress(StripeObject): city: Optional[str] """ City, district, suburb, town, or village. """ country: Optional[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: Optional[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State, county, province, or region. """ class ShippingAddress(StripeObject): city: Optional[str] """ City, district, suburb, town, or village. """ country: Optional[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: Optional[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State, county, province, or region. """ billing_address: Optional[BillingAddress] """ Owner's verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ email: Optional[str] """ Owner's verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ name: Optional[str] """ Owner's verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ shipping_address: Optional[ShippingAddress] """ Owner's verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ _inner_class_types = { "billing_address": BillingAddress, "shipping_address": ShippingAddress, } class SamsungPay(StripeObject): pass class VisaCheckout(StripeObject): class BillingAddress(StripeObject): city: Optional[str] """ City, district, suburb, town, or village. """ country: Optional[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: Optional[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State, county, province, or region. """ class ShippingAddress(StripeObject): city: Optional[str] """ City, district, suburb, town, or village. """ country: Optional[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: Optional[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State, county, province, or region. """ billing_address: Optional[BillingAddress] """ Owner's verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ email: Optional[str] """ Owner's verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ name: Optional[str] """ Owner's verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ shipping_address: Optional[ShippingAddress] """ Owner's verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ _inner_class_types = { "billing_address": BillingAddress, "shipping_address": ShippingAddress, } amex_express_checkout: Optional[AmexExpressCheckout] apple_pay: Optional[ApplePay] dynamic_last4: Optional[str] """ (For tokenized numbers only.) The last four digits of the device account number. """ google_pay: Optional[GooglePay] link: Optional[Link] masterpass: Optional[Masterpass] samsung_pay: Optional[SamsungPay] type: Literal[ "amex_express_checkout", "apple_pay", "google_pay", "link", "masterpass", "samsung_pay", "visa_checkout", ] """ The type of the card wallet, one of `amex_express_checkout`, `apple_pay`, `google_pay`, `masterpass`, `samsung_pay`, `visa_checkout`, or `link`. An additional hash is included on the Wallet subhash with a name matching this value. It contains additional information specific to the card wallet type. """ visa_checkout: Optional[VisaCheckout] _inner_class_types = { "amex_express_checkout": AmexExpressCheckout, "apple_pay": ApplePay, "google_pay": GooglePay, "link": Link, "masterpass": Masterpass, "samsung_pay": SamsungPay, "visa_checkout": VisaCheckout, } brand: str """ Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ checks: Optional[Checks] """ Checks on Card address and CVC if provided. """ country: Optional[str] """ Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. """ description: Optional[str] """ A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) """ display_brand: Optional[str] """ The brand to use when displaying the card, this accounts for customer's brand choice on dual-branded cards. Can be `american_express`, `cartes_bancaires`, `diners_club`, `discover`, `eftpos_australia`, `interac`, `jcb`, `mastercard`, `union_pay`, `visa`, or `other` and may contain more values in the future. """ exp_month: int """ Two-digit number representing the card's expiration month. """ exp_year: int """ Four-digit number representing the card's expiration year. """ fingerprint: Optional[str] """ Uniquely identifies this particular card number. You can use this attribute to check whether two customers who've signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* """ funding: str """ Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. """ generated_from: Optional[GeneratedFrom] """ Details of the original PaymentMethod that created this object. """ iin: Optional[str] """ Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) """ issuer: Optional[str] """ The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) """ last4: str """ The last four digits of the card. """ networks: Optional[Networks] """ Contains information about card networks that can be used to process the payment. """ three_d_secure_usage: Optional[ThreeDSecureUsage] """ Contains details on how this Card may be used for 3D Secure authentication. """ wallet: Optional[Wallet] """ If this Card is part of a card wallet, this contains the details of the card wallet. """ _inner_class_types = { "checks": Checks, "generated_from": GeneratedFrom, "networks": Networks, "three_d_secure_usage": ThreeDSecureUsage, "wallet": Wallet, } class CardPresent(StripeObject): class Networks(StripeObject): available: List[str] """ All available networks for the card. """ preferred: Optional[str] """ The preferred network for the card. """ brand: Optional[str] """ Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ cardholder_name: Optional[str] """ The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. """ country: Optional[str] """ Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. """ description: Optional[str] """ A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) """ exp_month: int """ Two-digit number representing the card's expiration month. """ exp_year: int """ Four-digit number representing the card's expiration year. """ fingerprint: Optional[str] """ Uniquely identifies this particular card number. You can use this attribute to check whether two customers who've signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* """ funding: Optional[str] """ Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. """ iin: Optional[str] """ Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) """ issuer: Optional[str] """ The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) """ last4: Optional[str] """ The last four digits of the card. """ networks: Optional[Networks] """ Contains information about card networks that can be used to process the payment. """ preferred_locales: Optional[List[str]] """ EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. """ read_method: Optional[ Literal[ "contact_emv", "contactless_emv", "contactless_magstripe_mode", "magnetic_stripe_fallback", "magnetic_stripe_track2", ] ] """ How card details were read in this transaction. """ _inner_class_types = {"networks": Networks} class Cashapp(StripeObject): buyer_id: Optional[str] """ A unique and immutable identifier assigned by Cash App to every buyer. """ cashtag: Optional[str] """ A public identifier for buyers using Cash App. """ class CustomerBalance(StripeObject): pass class Eps(StripeObject): bank: Optional[ Literal[ "arzte_und_apotheker_bank", "austrian_anadi_bank_ag", "bank_austria", "bankhaus_carl_spangler", "bankhaus_schelhammer_und_schattera_ag", "bawag_psk_ag", "bks_bank_ag", "brull_kallmus_bank_ag", "btv_vier_lander_bank", "capital_bank_grawe_gruppe_ag", "deutsche_bank_ag", "dolomitenbank", "easybank_ag", "erste_bank_und_sparkassen", "hypo_alpeadriabank_international_ag", "hypo_bank_burgenland_aktiengesellschaft", "hypo_noe_lb_fur_niederosterreich_u_wien", "hypo_oberosterreich_salzburg_steiermark", "hypo_tirol_bank_ag", "hypo_vorarlberg_bank_ag", "marchfelder_bank", "oberbank_ag", "raiffeisen_bankengruppe_osterreich", "schoellerbank_ag", "sparda_bank_wien", "volksbank_gruppe", "volkskreditbank_ag", "vr_bank_braunau", ] ] """ The customer's bank. Should be one of `arzte_und_apotheker_bank`, `austrian_anadi_bank_ag`, `bank_austria`, `bankhaus_carl_spangler`, `bankhaus_schelhammer_und_schattera_ag`, `bawag_psk_ag`, `bks_bank_ag`, `brull_kallmus_bank_ag`, `btv_vier_lander_bank`, `capital_bank_grawe_gruppe_ag`, `deutsche_bank_ag`, `dolomitenbank`, `easybank_ag`, `erste_bank_und_sparkassen`, `hypo_alpeadriabank_international_ag`, `hypo_noe_lb_fur_niederosterreich_u_wien`, `hypo_oberosterreich_salzburg_steiermark`, `hypo_tirol_bank_ag`, `hypo_vorarlberg_bank_ag`, `hypo_bank_burgenland_aktiengesellschaft`, `marchfelder_bank`, `oberbank_ag`, `raiffeisen_bankengruppe_osterreich`, `schoellerbank_ag`, `sparda_bank_wien`, `volksbank_gruppe`, `volkskreditbank_ag`, or `vr_bank_braunau`. """ class Fpx(StripeObject): account_holder_type: Optional[Literal["company", "individual"]] """ Account holder type, if provided. Can be one of `individual` or `company`. """ bank: Literal[ "affin_bank", "agrobank", "alliance_bank", "ambank", "bank_islam", "bank_muamalat", "bank_of_china", "bank_rakyat", "bsn", "cimb", "deutsche_bank", "hong_leong_bank", "hsbc", "kfh", "maybank2e", "maybank2u", "ocbc", "pb_enterprise", "public_bank", "rhb", "standard_chartered", "uob", ] """ The customer's bank, if provided. Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bank_rakyat`, `bsn`, `cimb`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `pb_enterprise`, or `bank_of_china`. """ class Giropay(StripeObject): pass class Grabpay(StripeObject): pass class Ideal(StripeObject): bank: Optional[ Literal[ "abn_amro", "asn_bank", "bunq", "handelsbanken", "ing", "knab", "moneyou", "n26", "nn", "rabobank", "regiobank", "revolut", "sns_bank", "triodos_bank", "van_lanschot", "yoursafe", ] ] """ The customer's bank, if provided. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. """ bic: Optional[ Literal[ "ABNANL2A", "ASNBNL21", "BITSNL2A", "BUNQNL2A", "FVLBNL22", "HANDNL2A", "INGBNL2A", "KNABNL2H", "MOYONL21", "NNBANL2G", "NTSBDEB1", "RABONL2U", "RBRBNL21", "REVOIE23", "REVOLT21", "SNSBNL2A", "TRIONL2U", ] ] """ The Bank Identifier Code of the customer's bank, if the bank was provided. """ class InteracPresent(StripeObject): class Networks(StripeObject): available: List[str] """ All available networks for the card. """ preferred: Optional[str] """ The preferred network for the card. """ brand: Optional[str] """ Card brand. Can be `interac`, `mastercard` or `visa`. """ cardholder_name: Optional[str] """ The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. """ country: Optional[str] """ Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. """ description: Optional[str] """ A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) """ exp_month: int """ Two-digit number representing the card's expiration month. """ exp_year: int """ Four-digit number representing the card's expiration year. """ fingerprint: Optional[str] """ Uniquely identifies this particular card number. You can use this attribute to check whether two customers who've signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* """ funding: Optional[str] """ Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. """ iin: Optional[str] """ Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) """ issuer: Optional[str] """ The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) """ last4: Optional[str] """ The last four digits of the card. """ networks: Optional[Networks] """ Contains information about card networks that can be used to process the payment. """ preferred_locales: Optional[List[str]] """ EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. """ read_method: Optional[ Literal[ "contact_emv", "contactless_emv", "contactless_magstripe_mode", "magnetic_stripe_fallback", "magnetic_stripe_track2", ] ] """ How card details were read in this transaction. """ _inner_class_types = {"networks": Networks} class Klarna(StripeObject): class Dob(StripeObject): day: Optional[int] """ The day of birth, between 1 and 31. """ month: Optional[int] """ The month of birth, between 1 and 12. """ year: Optional[int] """ The four-digit year of birth. """ dob: Optional[Dob] """ The customer's date of birth, if provided. """ _inner_class_types = {"dob": Dob} class Konbini(StripeObject): pass class Link(StripeObject): email: Optional[str] """ Account owner's email address. """ persistent_token: Optional[str] """ [Deprecated] This is a legacy parameter that no longer has any function. """ class Mobilepay(StripeObject): pass class Multibanco(StripeObject): pass class Oxxo(StripeObject): pass class P24(StripeObject): bank: Optional[ Literal[ "alior_bank", "bank_millennium", "bank_nowy_bfg_sa", "bank_pekao_sa", "banki_spbdzielcze", "blik", "bnp_paribas", "boz", "citi_handlowy", "credit_agricole", "envelobank", "etransfer_pocztowy24", "getin_bank", "ideabank", "ing", "inteligo", "mbank_mtransfer", "nest_przelew", "noble_pay", "pbac_z_ipko", "plus_bank", "santander_przelew24", "tmobile_usbugi_bankowe", "toyota_bank", "velobank", "volkswagen_bank", ] ] """ The customer's bank, if provided. """ class Paynow(StripeObject): pass class Paypal(StripeObject): payer_email: Optional[str] """ Owner's email. Values are provided by PayPal directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ payer_id: Optional[str] """ PayPal account PayerID. This identifier uniquely identifies the PayPal customer. """ class Pix(StripeObject): pass class Promptpay(StripeObject): pass class RevolutPay(StripeObject): pass class SepaDebit(StripeObject): class GeneratedFrom(StripeObject): charge: Optional[ExpandableField["Charge"]] """ The ID of the Charge that generated this PaymentMethod, if any. """ setup_attempt: Optional[ExpandableField["SetupAttempt"]] """ The ID of the SetupAttempt that generated this PaymentMethod, if any. """ bank_code: Optional[str] """ Bank code of bank associated with the bank account. """ branch_code: Optional[str] """ Branch code of bank associated with the bank account. """ country: Optional[str] """ Two-letter ISO code representing the country the bank account is located in. """ fingerprint: Optional[str] """ Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. """ generated_from: Optional[GeneratedFrom] """ Information about the object that generated this PaymentMethod. """ last4: Optional[str] """ Last four characters of the IBAN. """ _inner_class_types = {"generated_from": GeneratedFrom} class Sofort(StripeObject): country: Optional[str] """ Two-letter ISO code representing the country the bank account is located in. """ class Swish(StripeObject): pass class Twint(StripeObject): pass class UsBankAccount(StripeObject): class Networks(StripeObject): preferred: Optional[str] """ The preferred network. """ supported: List[Literal["ach", "us_domestic_wire"]] """ All supported networks. """ class StatusDetails(StripeObject): class Blocked(StripeObject): network_code: Optional[ Literal[ "R02", "R03", "R04", "R05", "R07", "R08", "R10", "R11", "R16", "R20", "R29", "R31", ] ] """ The ACH network code that resulted in this block. """ reason: Optional[ Literal[ "bank_account_closed", "bank_account_frozen", "bank_account_invalid_details", "bank_account_restricted", "bank_account_unusable", "debit_not_authorized", ] ] """ The reason why this PaymentMethod's fingerprint has been blocked """ blocked: Optional[Blocked] _inner_class_types = {"blocked": Blocked} account_holder_type: Optional[Literal["company", "individual"]] """ Account holder type: individual or company. """ account_type: Optional[Literal["checking", "savings"]] """ Account type: checkings or savings. Defaults to checking if omitted. """ bank_name: Optional[str] """ The name of the bank. """ financial_connections_account: Optional[str] """ The ID of the Financial Connections Account used to create the payment method. """ fingerprint: Optional[str] """ Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. """ last4: Optional[str] """ Last four digits of the bank account number. """ networks: Optional[Networks] """ Contains information about US bank account networks that can be used. """ routing_number: Optional[str] """ Routing number of the bank account. """ status_details: Optional[StatusDetails] """ Contains information about the future reusability of this PaymentMethod. """ _inner_class_types = { "networks": Networks, "status_details": StatusDetails, } class WechatPay(StripeObject): pass class Zip(StripeObject): pass acss_debit: Optional[AcssDebit] affirm: Optional[Affirm] afterpay_clearpay: Optional[AfterpayClearpay] alipay: Optional[Alipay] allow_redisplay: Optional[Literal["always", "limited", "unspecified"]] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to “unspecified”. """ amazon_pay: Optional[AmazonPay] au_becs_debit: Optional[AuBecsDebit] bacs_debit: Optional[BacsDebit] bancontact: Optional[Bancontact] billing_details: BillingDetails blik: Optional[Blik] boleto: Optional[Boleto] card: Optional[Card] card_present: Optional[CardPresent] cashapp: Optional[Cashapp] customer_balance: Optional[CustomerBalance] eps: Optional[Eps] fpx: Optional[Fpx] giropay: Optional[Giropay] grabpay: Optional[Grabpay] ideal: Optional[Ideal] interac_present: Optional[InteracPresent] klarna: Optional[Klarna] konbini: Optional[Konbini] link: Optional[Link] mobilepay: Optional[Mobilepay] multibanco: Optional[Multibanco] oxxo: Optional[Oxxo] p24: Optional[P24] paynow: Optional[Paynow] paypal: Optional[Paypal] pix: Optional[Pix] promptpay: Optional[Promptpay] revolut_pay: Optional[RevolutPay] sepa_debit: Optional[SepaDebit] sofort: Optional[Sofort] swish: Optional[Swish] twint: Optional[Twint] type: Literal[ "acss_debit", "affirm", "afterpay_clearpay", "alipay", "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", "blik", "boleto", "card", "card_present", "cashapp", "customer_balance", "eps", "fpx", "giropay", "grabpay", "ideal", "interac_present", "klarna", "konbini", "link", "mobilepay", "multibanco", "oxxo", "p24", "paynow", "paypal", "pix", "promptpay", "revolut_pay", "sepa_debit", "sofort", "swish", "twint", "us_bank_account", "wechat_pay", "zip", ] """ The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. """ us_bank_account: Optional[UsBankAccount] wechat_pay: Optional[WechatPay] zip: Optional[Zip] _inner_class_types = { "acss_debit": AcssDebit, "affirm": Affirm, "afterpay_clearpay": AfterpayClearpay, "alipay": Alipay, "amazon_pay": AmazonPay, "au_becs_debit": AuBecsDebit, "bacs_debit": BacsDebit, "bancontact": Bancontact, "billing_details": BillingDetails, "blik": Blik, "boleto": Boleto, "card": Card, "card_present": CardPresent, "cashapp": Cashapp, "customer_balance": CustomerBalance, "eps": Eps, "fpx": Fpx, "giropay": Giropay, "grabpay": Grabpay, "ideal": Ideal, "interac_present": InteracPresent, "klarna": Klarna, "konbini": Konbini, "link": Link, "mobilepay": Mobilepay, "multibanco": Multibanco, "oxxo": Oxxo, "p24": P24, "paynow": Paynow, "paypal": Paypal, "pix": Pix, "promptpay": Promptpay, "revolut_pay": RevolutPay, "sepa_debit": SepaDebit, "sofort": Sofort, "swish": Swish, "twint": Twint, "us_bank_account": UsBankAccount, "wechat_pay": WechatPay, "zip": Zip, } class Shipping(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 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State, county, province, or region. """ address: Address name: str """ Recipient name. """ phone: Optional[str] """ Recipient phone (including extension). """ _inner_class_types = {"address": Address} class CreateParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ payment_method: NotRequired[str] """ ID of an existing PaymentMethod. """ payment_method_data: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodData" ] """ If provided, this hash will be used to create a PaymentMethod. """ return_url: NotRequired[str] """ Return URL used to confirm the Intent. """ setup_future_usage: NotRequired[Literal["off_session", "on_session"]] """ Indicates that you intend to make future payments with this ConfirmationToken's payment method. The presence of this property will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. """ shipping: NotRequired["ConfirmationToken.CreateParamsShipping"] """ Shipping information for this ConfirmationToken. """ class CreateParamsPaymentMethodData(TypedDict): acss_debit: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataAcssDebit" ] """ If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. """ affirm: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataAffirm" ] """ If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. """ afterpay_clearpay: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataAfterpayClearpay" ] """ If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. """ alipay: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataAlipay" ] """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ allow_redisplay: NotRequired[ Literal["always", "limited", "unspecified"] ] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ amazon_pay: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataAmazonPay" ] """ If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. """ au_becs_debit: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataAuBecsDebit" ] """ If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. """ bacs_debit: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataBacsDebit" ] """ If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. """ bancontact: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataBancontact" ] """ If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. """ billing_details: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataBillingDetails" ] """ Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. """ blik: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataBlik" ] """ If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. """ boleto: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataBoleto" ] """ If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. """ cashapp: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataCashapp" ] """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ customer_balance: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataCustomerBalance" ] """ If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. """ eps: NotRequired["ConfirmationToken.CreateParamsPaymentMethodDataEps"] """ If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. """ fpx: NotRequired["ConfirmationToken.CreateParamsPaymentMethodDataFpx"] """ If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. """ giropay: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataGiropay" ] """ If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. """ grabpay: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataGrabpay" ] """ If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ ideal: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataIdeal" ] """ If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. """ interac_present: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataInteracPresent" ] """ If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. """ klarna: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataKlarna" ] """ If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. """ konbini: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataKonbini" ] """ If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. """ link: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataLink" ] """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ mobilepay: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataMobilepay" ] """ If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. """ multibanco: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataMultibanco" ] """ If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. """ oxxo: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataOxxo" ] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. """ p24: NotRequired["ConfirmationToken.CreateParamsPaymentMethodDataP24"] """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ paynow: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataPaynow" ] """ If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. """ paypal: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataPaypal" ] """ If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. """ pix: NotRequired["ConfirmationToken.CreateParamsPaymentMethodDataPix"] """ If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. """ promptpay: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataPromptpay" ] """ If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. """ radar_options: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataRadarOptions" ] """ Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. """ revolut_pay: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataRevolutPay" ] """ If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. """ sepa_debit: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataSepaDebit" ] """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ sofort: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataSofort" ] """ If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. """ swish: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataSwish" ] """ If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. """ twint: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataTwint" ] """ If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. """ type: Literal[ "acss_debit", "affirm", "afterpay_clearpay", "alipay", "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", "blik", "boleto", "cashapp", "customer_balance", "eps", "fpx", "giropay", "grabpay", "ideal", "klarna", "konbini", "link", "mobilepay", "multibanco", "oxxo", "p24", "paynow", "paypal", "pix", "promptpay", "revolut_pay", "sepa_debit", "sofort", "swish", "twint", "us_bank_account", "wechat_pay", "zip", ] """ The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. """ us_bank_account: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataUsBankAccount" ] """ If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. """ wechat_pay: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataWechatPay" ] """ If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. """ zip: NotRequired["ConfirmationToken.CreateParamsPaymentMethodDataZip"] """ If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. """ class CreateParamsPaymentMethodDataAcssDebit(TypedDict): account_number: str """ Customer's bank account number. """ institution_number: str """ Institution number of the customer's bank. """ transit_number: str """ Transit number of the customer's bank. """ class CreateParamsPaymentMethodDataAffirm(TypedDict): pass class CreateParamsPaymentMethodDataAfterpayClearpay(TypedDict): pass class CreateParamsPaymentMethodDataAlipay(TypedDict): pass class CreateParamsPaymentMethodDataAmazonPay(TypedDict): pass class CreateParamsPaymentMethodDataAuBecsDebit(TypedDict): account_number: str """ The account number for the bank account. """ bsb_number: str """ Bank-State-Branch number of the bank account. """ class CreateParamsPaymentMethodDataBacsDebit(TypedDict): account_number: NotRequired[str] """ Account number of the bank account that the funds will be debited from. """ sort_code: NotRequired[str] """ Sort code of the bank account. (e.g., `10-20-30`) """ class CreateParamsPaymentMethodDataBancontact(TypedDict): pass class CreateParamsPaymentMethodDataBillingDetails(TypedDict): address: NotRequired[ "Literal['']|ConfirmationToken.CreateParamsPaymentMethodDataBillingDetailsAddress" ] """ Billing address. """ email: NotRequired["Literal['']|str"] """ Email address. """ name: NotRequired["Literal['']|str"] """ Full name. """ phone: NotRequired["Literal['']|str"] """ Billing phone number (including extension). """ class CreateParamsPaymentMethodDataBillingDetailsAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsPaymentMethodDataBlik(TypedDict): pass class CreateParamsPaymentMethodDataBoleto(TypedDict): tax_id: str """ The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) """ class CreateParamsPaymentMethodDataCashapp(TypedDict): pass class CreateParamsPaymentMethodDataCustomerBalance(TypedDict): pass class CreateParamsPaymentMethodDataEps(TypedDict): bank: NotRequired[ Literal[ "arzte_und_apotheker_bank", "austrian_anadi_bank_ag", "bank_austria", "bankhaus_carl_spangler", "bankhaus_schelhammer_und_schattera_ag", "bawag_psk_ag", "bks_bank_ag", "brull_kallmus_bank_ag", "btv_vier_lander_bank", "capital_bank_grawe_gruppe_ag", "deutsche_bank_ag", "dolomitenbank", "easybank_ag", "erste_bank_und_sparkassen", "hypo_alpeadriabank_international_ag", "hypo_bank_burgenland_aktiengesellschaft", "hypo_noe_lb_fur_niederosterreich_u_wien", "hypo_oberosterreich_salzburg_steiermark", "hypo_tirol_bank_ag", "hypo_vorarlberg_bank_ag", "marchfelder_bank", "oberbank_ag", "raiffeisen_bankengruppe_osterreich", "schoellerbank_ag", "sparda_bank_wien", "volksbank_gruppe", "volkskreditbank_ag", "vr_bank_braunau", ] ] """ The customer's bank. """ class CreateParamsPaymentMethodDataFpx(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type for FPX transaction """ bank: Literal[ "affin_bank", "agrobank", "alliance_bank", "ambank", "bank_islam", "bank_muamalat", "bank_of_china", "bank_rakyat", "bsn", "cimb", "deutsche_bank", "hong_leong_bank", "hsbc", "kfh", "maybank2e", "maybank2u", "ocbc", "pb_enterprise", "public_bank", "rhb", "standard_chartered", "uob", ] """ The customer's bank. """ class CreateParamsPaymentMethodDataGiropay(TypedDict): pass class CreateParamsPaymentMethodDataGrabpay(TypedDict): pass class CreateParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ Literal[ "abn_amro", "asn_bank", "bunq", "handelsbanken", "ing", "knab", "moneyou", "n26", "nn", "rabobank", "regiobank", "revolut", "sns_bank", "triodos_bank", "van_lanschot", "yoursafe", ] ] """ The customer's bank. """ class CreateParamsPaymentMethodDataInteracPresent(TypedDict): pass class CreateParamsPaymentMethodDataKlarna(TypedDict): dob: NotRequired[ "ConfirmationToken.CreateParamsPaymentMethodDataKlarnaDob" ] """ Customer's date of birth """ class CreateParamsPaymentMethodDataKlarnaDob(TypedDict): day: int """ The day of birth, between 1 and 31. """ month: int """ The month of birth, between 1 and 12. """ year: int """ The four-digit year of birth. """ class CreateParamsPaymentMethodDataKonbini(TypedDict): pass class CreateParamsPaymentMethodDataLink(TypedDict): pass class CreateParamsPaymentMethodDataMobilepay(TypedDict): pass class CreateParamsPaymentMethodDataMultibanco(TypedDict): pass class CreateParamsPaymentMethodDataOxxo(TypedDict): pass class CreateParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ Literal[ "alior_bank", "bank_millennium", "bank_nowy_bfg_sa", "bank_pekao_sa", "banki_spbdzielcze", "blik", "bnp_paribas", "boz", "citi_handlowy", "credit_agricole", "envelobank", "etransfer_pocztowy24", "getin_bank", "ideabank", "ing", "inteligo", "mbank_mtransfer", "nest_przelew", "noble_pay", "pbac_z_ipko", "plus_bank", "santander_przelew24", "tmobile_usbugi_bankowe", "toyota_bank", "velobank", "volkswagen_bank", ] ] """ The customer's bank. """ class CreateParamsPaymentMethodDataPaynow(TypedDict): pass class CreateParamsPaymentMethodDataPaypal(TypedDict): pass class CreateParamsPaymentMethodDataPix(TypedDict): pass class CreateParamsPaymentMethodDataPromptpay(TypedDict): pass class CreateParamsPaymentMethodDataRadarOptions(TypedDict): session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ class CreateParamsPaymentMethodDataRevolutPay(TypedDict): pass class CreateParamsPaymentMethodDataSepaDebit(TypedDict): iban: str """ IBAN of the bank account. """ class CreateParamsPaymentMethodDataSofort(TypedDict): country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] """ Two-letter ISO code representing the country the bank account is located in. """ class CreateParamsPaymentMethodDataSwish(TypedDict): pass class CreateParamsPaymentMethodDataTwint(TypedDict): pass class CreateParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type: individual or company. """ account_number: NotRequired[str] """ Account number of the bank account. """ account_type: NotRequired[Literal["checking", "savings"]] """ Account type: checkings or savings. Defaults to checking if omitted. """ financial_connections_account: NotRequired[str] """ The ID of a Financial Connections Account to use as a payment method. """ routing_number: NotRequired[str] """ Routing number of the bank account. """ class CreateParamsPaymentMethodDataWechatPay(TypedDict): pass class CreateParamsPaymentMethodDataZip(TypedDict): pass class CreateParamsShipping(TypedDict): address: "ConfirmationToken.CreateParamsShippingAddress" """ Shipping address """ name: str """ Recipient name. """ phone: NotRequired["Literal['']|str"] """ Recipient phone (including extension) """ class CreateParamsShippingAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ expires_at: Optional[int] """ Time at which this ConfirmationToken expires and can no longer be used to confirm a PaymentIntent or SetupIntent. """ id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ mandate_data: Optional[MandateData] """ Data used for generating a Mandate. """ object: Literal["confirmation_token"] """ String representing the object's type. Objects of the same type share the same value. """ payment_intent: Optional[str] """ ID of the PaymentIntent that this ConfirmationToken was used to confirm, or null if this ConfirmationToken has not yet been used. """ payment_method_preview: Optional[PaymentMethodPreview] """ Payment details collected by the Payment Element, used to create a PaymentMethod when a PaymentIntent or SetupIntent is confirmed with this ConfirmationToken. """ return_url: Optional[str] """ Return URL used to confirm the Intent. """ setup_future_usage: Optional[Literal["off_session", "on_session"]] """ Indicates that you intend to make future payments with this ConfirmationToken's payment method. The presence of this property will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. """ setup_intent: Optional[str] """ ID of the SetupIntent that this ConfirmationToken was used to confirm, or null if this ConfirmationToken has not yet been used. """ shipping: Optional[Shipping] """ Shipping information collected on this ConfirmationToken. """ use_stripe_sdk: bool """ Indicates whether the Stripe SDK is used to handle confirmation flow. Defaults to `true` on ConfirmationToken. """ @classmethod def retrieve( cls, id: str, **params: Unpack["ConfirmationToken.RetrieveParams"] ) -> "ConfirmationToken": """ Retrieves an existing ConfirmationToken object """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["ConfirmationToken.RetrieveParams"] ) -> "ConfirmationToken": """ Retrieves an existing ConfirmationToken object """ instance = cls(id, **params) await instance.refresh_async() return instance class TestHelpers(APIResourceTestHelpers["ConfirmationToken"]): _resource_cls: Type["ConfirmationToken"] @classmethod def create( cls, **params: Unpack["ConfirmationToken.CreateParams"] ) -> "ConfirmationToken": """ Creates a test mode Confirmation Token server side for your integration tests. """ return cast( "ConfirmationToken", cls._static_request( "post", "/v1/test_helpers/confirmation_tokens", params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["ConfirmationToken.CreateParams"] ) -> "ConfirmationToken": """ Creates a test mode Confirmation Token server side for your integration tests. """ return cast( "ConfirmationToken", await cls._static_request_async( "post", "/v1/test_helpers/confirmation_tokens", params=params, ), ) @property def test_helpers(self): return self.TestHelpers(self) _inner_class_types = { "mandate_data": MandateData, "payment_method_preview": PaymentMethodPreview, "shipping": Shipping, } ConfirmationToken.TestHelpers._resource_cls = ConfirmationToken ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_confirmation_token_service.py0000644000175100001770000000366214637354563022162 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._confirmation_token import ConfirmationToken from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict class ConfirmationTokenService(StripeService): class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def retrieve( self, confirmation_token: str, params: "ConfirmationTokenService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> ConfirmationToken: """ Retrieves an existing ConfirmationToken object """ return cast( ConfirmationToken, self._request( "get", "/v1/confirmation_tokens/{confirmation_token}".format( confirmation_token=sanitize_id(confirmation_token), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, confirmation_token: str, params: "ConfirmationTokenService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> ConfirmationToken: """ Retrieves an existing ConfirmationToken object """ return cast( ConfirmationToken, await self._request_async( "get", "/v1/confirmation_tokens/{confirmation_token}".format( confirmation_token=sanitize_id(confirmation_token), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_connect_collection_transfer.py0000644000175100001770000000234114637354563022313 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._expandable_field import ExpandableField from stripe._stripe_object import StripeObject from typing import ClassVar from typing_extensions import Literal, TYPE_CHECKING if TYPE_CHECKING: from stripe._account import Account class ConnectCollectionTransfer(StripeObject): OBJECT_NAME: ClassVar[Literal["connect_collection_transfer"]] = ( "connect_collection_transfer" ) amount: int """ Amount transferred, in cents (or local equivalent). """ 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). """ destination: ExpandableField["Account"] """ ID of the account that funds are being collected for. """ id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ object: Literal["connect_collection_transfer"] """ String representing the object's type. Objects of the same type share the same value. """ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_country_spec.py0000644000175100001770000001351114637354563017261 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from typing import ClassVar, Dict, List from typing_extensions import Literal, NotRequired, Unpack class CountrySpec(ListableAPIResource["CountrySpec"]): """ Stripe needs to collect certain pieces of information about each account created. These requirements can differ depending on the account's country. The Country Specs API makes these rules available to your integration. You can also view the information from this API call as [an online guide](https://stripe.com/docs/connect/required-verification-information). """ OBJECT_NAME: ClassVar[Literal["country_spec"]] = "country_spec" class VerificationFields(StripeObject): class Company(StripeObject): additional: List[str] """ Additional fields which are only required for some users. """ minimum: List[str] """ Fields which every account must eventually provide. """ class Individual(StripeObject): additional: List[str] """ Additional fields which are only required for some users. """ minimum: List[str] """ Fields which every account must eventually provide. """ company: Company individual: Individual _inner_class_types = {"company": Company, "individual": Individual} class ListParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ default_currency: str """ The default currency for this country. This applies to both payment methods and bank accounts. """ id: str """ Unique identifier for the object. Represented as the ISO country code for this country. """ object: Literal["country_spec"] """ String representing the object's type. Objects of the same type share the same value. """ supported_bank_account_currencies: Dict[str, List[str]] """ Currencies that can be accepted in the specific country (for transfers). """ supported_payment_currencies: List[str] """ Currencies that can be accepted in the specified country (for payments). """ supported_payment_methods: List[str] """ Payment methods available in the specified country. You may need to enable some payment methods (e.g., [ACH](https://stripe.com/docs/ach)) on your account before they appear in this list. The `stripe` payment method refers to [charging through your platform](https://stripe.com/docs/connect/destination-charges). """ supported_transfer_countries: List[str] """ Countries that can accept transfers from the specified country. """ verification_fields: VerificationFields @classmethod def list( cls, **params: Unpack["CountrySpec.ListParams"] ) -> ListObject["CountrySpec"]: """ Lists all Country Spec objects available in the API. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["CountrySpec.ListParams"] ) -> ListObject["CountrySpec"]: """ Lists all Country Spec objects available in the API. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def retrieve( cls, id: str, **params: Unpack["CountrySpec.RetrieveParams"] ) -> "CountrySpec": """ Returns a Country Spec for a given Country code. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["CountrySpec.RetrieveParams"] ) -> "CountrySpec": """ Returns a Country Spec for a given Country code. """ instance = cls(id, **params) await instance.refresh_async() return instance _inner_class_types = {"verification_fields": VerificationFields} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_country_spec_service.py0000644000175100001770000000771114637354563021006 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._country_spec import CountrySpec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict class CountrySpecService(StripeService): class ListParams(TypedDict): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def list( self, params: "CountrySpecService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[CountrySpec]: """ Lists all Country Spec objects available in the API. """ return cast( ListObject[CountrySpec], self._request( "get", "/v1/country_specs", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "CountrySpecService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[CountrySpec]: """ Lists all Country Spec objects available in the API. """ return cast( ListObject[CountrySpec], await self._request_async( "get", "/v1/country_specs", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, country: str, params: "CountrySpecService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> CountrySpec: """ Returns a Country Spec for a given Country code. """ return cast( CountrySpec, self._request( "get", "/v1/country_specs/{country}".format( country=sanitize_id(country), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, country: str, params: "CountrySpecService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> CountrySpec: """ Returns a Country Spec for a given Country code. """ return cast( CountrySpec, await self._request_async( "get", "/v1/country_specs/{country}".format( country=sanitize_id(country), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_coupon.py0000644000175100001770000005052214637354563016052 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._deletable_api_resource import DeletableAPIResource from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import Literal, NotRequired, TypedDict, Unpack class Coupon( CreateableAPIResource["Coupon"], DeletableAPIResource["Coupon"], ListableAPIResource["Coupon"], UpdateableAPIResource["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://stripe.com/docs/api#subscriptions), [invoices](https://stripe.com/docs/api#invoices), [checkout sessions](https://stripe.com/docs/api/checkout/sessions), [quotes](https://stripe.com/docs/api#quotes), and more. Coupons do not work with conventional one-off [charges](https://stripe.com/docs/api#create_charge) or [payment intents](https://stripe.com/docs/api/payment_intents). """ OBJECT_NAME: ClassVar[Literal["coupon"]] = "coupon" class AppliesTo(StripeObject): products: List[str] """ A list of product IDs this coupon applies to """ class CurrencyOptions(StripeObject): amount_off: int """ Amount (in the `currency` specified) that will be taken off the subtotal of any invoices for this customer. """ class CreateParams(RequestOptions): amount_off: NotRequired[int] """ A positive integer representing the amount to subtract from an invoice total (required if `percent_off` is not passed). """ applies_to: NotRequired["Coupon.CreateParamsAppliesTo"] """ A hash containing directions for what this Coupon will apply discounts to. """ currency: NotRequired[str] """ Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) of the `amount_off` parameter (required if `amount_off` is passed). """ currency_options: NotRequired[ Dict[str, "Coupon.CreateParamsCurrencyOptions"] ] """ Coupons defined in each available currency option (only supported if `amount_off` is passed). Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ duration: NotRequired[Literal["forever", "once", "repeating"]] """ Specifies how long the discount will be in effect if used on a subscription. Defaults to `once`. """ duration_in_months: NotRequired[int] """ Required only if `duration` is `repeating`, in which case it must be a positive integer that specifies the number of months the discount will be in effect. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ id: NotRequired[str] """ Unique string of your choice that will be used to identify this coupon when applying it to a customer. If you don't want to specify a particular code, you can leave the ID blank and we'll generate a random code for you. """ max_redemptions: NotRequired[int] """ A positive integer specifying the number of times the coupon can be redeemed before it's no longer valid. For example, you might have a 50% off coupon that the first 20 readers of your blog can use. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ name: NotRequired[str] """ Name of the coupon displayed to customers on, for instance invoices, or receipts. By default the `id` is shown if `name` is not set. """ percent_off: NotRequired[float] """ A positive float larger than 0, and smaller or equal to 100, that represents the discount the coupon will apply (required if `amount_off` is not passed). """ redeem_by: NotRequired[int] """ Unix timestamp specifying the last time at which the coupon can be redeemed. After the redeem_by date, the coupon can no longer be applied to new customers. """ class CreateParamsAppliesTo(TypedDict): products: NotRequired[List[str]] """ An array of Product IDs that this Coupon will apply to. """ class CreateParamsCurrencyOptions(TypedDict): amount_off: int """ A positive integer representing the amount to subtract from an invoice total. """ class DeleteParams(RequestOptions): pass class ListParams(RequestOptions): created: NotRequired["Coupon.ListParamsCreated|int"] """ A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): currency_options: NotRequired[ Dict[str, "Coupon.ModifyParamsCurrencyOptions"] ] """ Coupons defined in each available currency option (only supported if the coupon is amount-based). Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ name: NotRequired[str] """ Name of the coupon displayed to customers on, for instance invoices, or receipts. By default the `id` is shown if `name` is not set. """ class ModifyParamsCurrencyOptions(TypedDict): amount_off: int """ A positive integer representing the amount to subtract from an invoice total. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ amount_off: Optional[int] """ Amount (in the `currency` specified) that will be taken off the subtotal of any invoices for this customer. """ applies_to: Optional[AppliesTo] created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ currency: Optional[str] """ If `amount_off` has been set, the three-letter [ISO code for the currency](https://stripe.com/docs/currencies) of the amount to take off. """ currency_options: Optional[Dict[str, CurrencyOptions]] """ Coupons defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ duration: Literal["forever", "once", "repeating"] """ One of `forever`, `once`, and `repeating`. Describes how long a customer who applies this coupon will get the discount. """ duration_in_months: Optional[int] """ If `duration` is `repeating`, the number of months the coupon applies. Null if coupon `duration` is `forever` or `once`. """ id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ max_redemptions: Optional[int] """ Maximum number of times this coupon can be redeemed, in total, across all customers, before it is no longer valid. """ metadata: Optional[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ name: Optional[str] """ Name of the coupon displayed to customers on for instance invoices or receipts. """ object: Literal["coupon"] """ String representing the object's type. Objects of the same type share the same value. """ percent_off: Optional[float] """ Percent that will be taken off the subtotal of any invoices for this customer for the duration of the coupon. For example, a coupon with percent_off of 50 will make a $ (or local equivalent)100 invoice $ (or local equivalent)50 instead. """ redeem_by: Optional[int] """ Date after which the coupon can no longer be redeemed. """ times_redeemed: int """ Number of times this coupon has been applied to a customer. """ valid: bool """ Taking account of the above properties, whether this coupon can still be applied to a customer. """ deleted: Optional[Literal[True]] """ Always true for a deleted object """ @classmethod def create(cls, **params: Unpack["Coupon.CreateParams"]) -> "Coupon": """ You can create coupons easily via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. Coupon creation is also accessible via the API if you need to create coupons on the fly. A coupon has either a percent_off or an amount_off and currency. If you set an amount_off, that amount will be subtracted from any invoice's subtotal. For example, an invoice with a subtotal of 100 will have a final total of 0 if a coupon with an amount_off of 200 is applied to it and an invoice with a subtotal of 300 will have a final total of 100 if a coupon with an amount_off of 200 is applied to it. """ return cast( "Coupon", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["Coupon.CreateParams"] ) -> "Coupon": """ You can create coupons easily via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. Coupon creation is also accessible via the API if you need to create coupons on the fly. A coupon has either a percent_off or an amount_off and currency. If you set an amount_off, that amount will be subtracted from any invoice's subtotal. For example, an invoice with a subtotal of 100 will have a final total of 0 if a coupon with an amount_off of 200 is applied to it and an invoice with a subtotal of 300 will have a final total of 100 if a coupon with an amount_off of 200 is applied to it. """ return cast( "Coupon", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def _cls_delete( cls, sid: str, **params: Unpack["Coupon.DeleteParams"] ) -> "Coupon": """ You can delete coupons via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. However, deleting a coupon does not affect any customers who have already applied the coupon; it means that new customers can't redeem the coupon. You can also delete coupons via the API. """ url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "Coupon", cls._static_request( "delete", url, params=params, ), ) @overload @staticmethod def delete(sid: str, **params: Unpack["Coupon.DeleteParams"]) -> "Coupon": """ You can delete coupons via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. However, deleting a coupon does not affect any customers who have already applied the coupon; it means that new customers can't redeem the coupon. You can also delete coupons via the API. """ ... @overload def delete(self, **params: Unpack["Coupon.DeleteParams"]) -> "Coupon": """ You can delete coupons via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. However, deleting a coupon does not affect any customers who have already applied the coupon; it means that new customers can't redeem the coupon. You can also delete coupons via the API. """ ... @class_method_variant("_cls_delete") def delete( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Coupon.DeleteParams"] ) -> "Coupon": """ You can delete coupons via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. However, deleting a coupon does not affect any customers who have already applied the coupon; it means that new customers can't redeem the coupon. You can also delete coupons via the API. """ return self._request_and_refresh( "delete", self.instance_url(), params=params, ) @classmethod async def _cls_delete_async( cls, sid: str, **params: Unpack["Coupon.DeleteParams"] ) -> "Coupon": """ You can delete coupons via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. However, deleting a coupon does not affect any customers who have already applied the coupon; it means that new customers can't redeem the coupon. You can also delete coupons via the API. """ url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "Coupon", await cls._static_request_async( "delete", url, params=params, ), ) @overload @staticmethod async def delete_async( sid: str, **params: Unpack["Coupon.DeleteParams"] ) -> "Coupon": """ You can delete coupons via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. However, deleting a coupon does not affect any customers who have already applied the coupon; it means that new customers can't redeem the coupon. You can also delete coupons via the API. """ ... @overload async def delete_async( self, **params: Unpack["Coupon.DeleteParams"] ) -> "Coupon": """ You can delete coupons via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. However, deleting a coupon does not affect any customers who have already applied the coupon; it means that new customers can't redeem the coupon. You can also delete coupons via the API. """ ... @class_method_variant("_cls_delete_async") async def delete_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Coupon.DeleteParams"] ) -> "Coupon": """ You can delete coupons via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. However, deleting a coupon does not affect any customers who have already applied the coupon; it means that new customers can't redeem the coupon. You can also delete coupons via the API. """ return await self._request_and_refresh_async( "delete", self.instance_url(), params=params, ) @classmethod def list( cls, **params: Unpack["Coupon.ListParams"] ) -> ListObject["Coupon"]: """ Returns a list of your coupons. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["Coupon.ListParams"] ) -> ListObject["Coupon"]: """ Returns a list of your coupons. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def modify( cls, id: str, **params: Unpack["Coupon.ModifyParams"] ) -> "Coupon": """ Updates the metadata of a coupon. Other coupon details (currency, duration, amount_off) are, by design, not editable. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Coupon", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["Coupon.ModifyParams"] ) -> "Coupon": """ Updates the metadata of a coupon. Other coupon details (currency, duration, amount_off) are, by design, not editable. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Coupon", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["Coupon.RetrieveParams"] ) -> "Coupon": """ Retrieves the coupon with the given ID. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["Coupon.RetrieveParams"] ) -> "Coupon": """ Retrieves the coupon with the given ID. """ instance = cls(id, **params) await instance.refresh_async() return instance _inner_class_types = { "applies_to": AppliesTo, "currency_options": CurrencyOptions, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_coupon_service.py0000644000175100001770000003447214637354563017600 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._coupon import Coupon from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class CouponService(StripeService): class CreateParams(TypedDict): amount_off: NotRequired[int] """ A positive integer representing the amount to subtract from an invoice total (required if `percent_off` is not passed). """ applies_to: NotRequired["CouponService.CreateParamsAppliesTo"] """ A hash containing directions for what this Coupon will apply discounts to. """ currency: NotRequired[str] """ Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) of the `amount_off` parameter (required if `amount_off` is passed). """ currency_options: NotRequired[ Dict[str, "CouponService.CreateParamsCurrencyOptions"] ] """ Coupons defined in each available currency option (only supported if `amount_off` is passed). Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ duration: NotRequired[Literal["forever", "once", "repeating"]] """ Specifies how long the discount will be in effect if used on a subscription. Defaults to `once`. """ duration_in_months: NotRequired[int] """ Required only if `duration` is `repeating`, in which case it must be a positive integer that specifies the number of months the discount will be in effect. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ id: NotRequired[str] """ Unique string of your choice that will be used to identify this coupon when applying it to a customer. If you don't want to specify a particular code, you can leave the ID blank and we'll generate a random code for you. """ max_redemptions: NotRequired[int] """ A positive integer specifying the number of times the coupon can be redeemed before it's no longer valid. For example, you might have a 50% off coupon that the first 20 readers of your blog can use. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ name: NotRequired[str] """ Name of the coupon displayed to customers on, for instance invoices, or receipts. By default the `id` is shown if `name` is not set. """ percent_off: NotRequired[float] """ A positive float larger than 0, and smaller or equal to 100, that represents the discount the coupon will apply (required if `amount_off` is not passed). """ redeem_by: NotRequired[int] """ Unix timestamp specifying the last time at which the coupon can be redeemed. After the redeem_by date, the coupon can no longer be applied to new customers. """ class CreateParamsAppliesTo(TypedDict): products: NotRequired[List[str]] """ An array of Product IDs that this Coupon will apply to. """ class CreateParamsCurrencyOptions(TypedDict): amount_off: int """ A positive integer representing the amount to subtract from an invoice total. """ class DeleteParams(TypedDict): pass class ListParams(TypedDict): created: NotRequired["CouponService.ListParamsCreated|int"] """ A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): currency_options: NotRequired[ Dict[str, "CouponService.UpdateParamsCurrencyOptions"] ] """ Coupons defined in each available currency option (only supported if the coupon is amount-based). Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ name: NotRequired[str] """ Name of the coupon displayed to customers on, for instance invoices, or receipts. By default the `id` is shown if `name` is not set. """ class UpdateParamsCurrencyOptions(TypedDict): amount_off: int """ A positive integer representing the amount to subtract from an invoice total. """ def delete( self, coupon: str, params: "CouponService.DeleteParams" = {}, options: RequestOptions = {}, ) -> Coupon: """ You can delete coupons via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. However, deleting a coupon does not affect any customers who have already applied the coupon; it means that new customers can't redeem the coupon. You can also delete coupons via the API. """ return cast( Coupon, self._request( "delete", "/v1/coupons/{coupon}".format(coupon=sanitize_id(coupon)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def delete_async( self, coupon: str, params: "CouponService.DeleteParams" = {}, options: RequestOptions = {}, ) -> Coupon: """ You can delete coupons via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. However, deleting a coupon does not affect any customers who have already applied the coupon; it means that new customers can't redeem the coupon. You can also delete coupons via the API. """ return cast( Coupon, await self._request_async( "delete", "/v1/coupons/{coupon}".format(coupon=sanitize_id(coupon)), api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, coupon: str, params: "CouponService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Coupon: """ Retrieves the coupon with the given ID. """ return cast( Coupon, self._request( "get", "/v1/coupons/{coupon}".format(coupon=sanitize_id(coupon)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, coupon: str, params: "CouponService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Coupon: """ Retrieves the coupon with the given ID. """ return cast( Coupon, await self._request_async( "get", "/v1/coupons/{coupon}".format(coupon=sanitize_id(coupon)), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, coupon: str, params: "CouponService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Coupon: """ Updates the metadata of a coupon. Other coupon details (currency, duration, amount_off) are, by design, not editable. """ return cast( Coupon, self._request( "post", "/v1/coupons/{coupon}".format(coupon=sanitize_id(coupon)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, coupon: str, params: "CouponService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Coupon: """ Updates the metadata of a coupon. Other coupon details (currency, duration, amount_off) are, by design, not editable. """ return cast( Coupon, await self._request_async( "post", "/v1/coupons/{coupon}".format(coupon=sanitize_id(coupon)), api_mode="V1", base_address="api", params=params, options=options, ), ) def list( self, params: "CouponService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Coupon]: """ Returns a list of your coupons. """ return cast( ListObject[Coupon], self._request( "get", "/v1/coupons", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "CouponService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Coupon]: """ Returns a list of your coupons. """ return cast( ListObject[Coupon], await self._request_async( "get", "/v1/coupons", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "CouponService.CreateParams" = {}, options: RequestOptions = {}, ) -> Coupon: """ You can create coupons easily via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. Coupon creation is also accessible via the API if you need to create coupons on the fly. A coupon has either a percent_off or an amount_off and currency. If you set an amount_off, that amount will be subtracted from any invoice's subtotal. For example, an invoice with a subtotal of 100 will have a final total of 0 if a coupon with an amount_off of 200 is applied to it and an invoice with a subtotal of 300 will have a final total of 100 if a coupon with an amount_off of 200 is applied to it. """ return cast( Coupon, self._request( "post", "/v1/coupons", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "CouponService.CreateParams" = {}, options: RequestOptions = {}, ) -> Coupon: """ You can create coupons easily via the [coupon management](https://dashboard.stripe.com/coupons) page of the Stripe dashboard. Coupon creation is also accessible via the API if you need to create coupons on the fly. A coupon has either a percent_off or an amount_off and currency. If you set an amount_off, that amount will be subtracted from any invoice's subtotal. For example, an invoice with a subtotal of 100 will have a final total of 0 if a coupon with an amount_off of 200 is applied to it and an invoice with a subtotal of 300 will have a final total of 100 if a coupon with an amount_off of 200 is applied to it. """ return cast( Coupon, await self._request_async( "post", "/v1/coupons", api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_createable_api_resource.py0000644000175100001770000000057614637354563021402 0ustar00runnerdockerfrom stripe._api_resource import APIResource from typing import TypeVar, cast from stripe._stripe_object import StripeObject T = TypeVar("T", bound=StripeObject) class CreateableAPIResource(APIResource[T]): @classmethod def create(cls, **params) -> T: return cast( T, cls._static_request("post", cls.class_url(), params=params), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_credit_note.py0000644000175100001770000012552514637354563017054 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._nested_resource_class_methods import nested_resource_class_methods from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._credit_note_line_item import CreditNoteLineItem from stripe._customer import Customer from stripe._customer_balance_transaction import CustomerBalanceTransaction from stripe._discount import Discount from stripe._invoice import Invoice from stripe._refund import Refund from stripe._shipping_rate import ShippingRate from stripe._tax_rate import TaxRate @nested_resource_class_methods("line") class CreditNote( CreateableAPIResource["CreditNote"], ListableAPIResource["CreditNote"], UpdateableAPIResource["CreditNote"], ): """ Issue a credit note to adjust an invoice's amount after the invoice is finalized. Related guide: [Credit notes](https://stripe.com/docs/billing/invoices/credit-notes) """ OBJECT_NAME: ClassVar[Literal["credit_note"]] = "credit_note" class DiscountAmount(StripeObject): amount: int """ The amount, in cents (or local equivalent), of the discount. """ discount: ExpandableField["Discount"] """ The discount that was applied to get this discount amount. """ class ShippingCost(StripeObject): class Tax(StripeObject): amount: int """ Amount of tax applied for this rate. """ rate: "TaxRate" """ Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates) """ taxability_reason: Optional[ Literal[ "customer_exempt", "not_collecting", "not_subject_to_tax", "not_supported", "portion_product_exempt", "portion_reduced_rated", "portion_standard_rated", "product_exempt", "product_exempt_holiday", "proportionally_rated", "reduced_rated", "reverse_charge", "standard_rated", "taxable_basis_reduced", "zero_rated", ] ] """ The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. """ taxable_amount: Optional[int] """ The amount on which tax is calculated, in cents (or local equivalent). """ amount_subtotal: int """ Total shipping cost before any taxes are applied. """ amount_tax: int """ Total tax amount applied due to shipping costs. If no tax was applied, defaults to 0. """ amount_total: int """ Total shipping cost after taxes are applied. """ shipping_rate: Optional[ExpandableField["ShippingRate"]] """ The ID of the ShippingRate for this invoice. """ taxes: Optional[List[Tax]] """ The taxes applied to the shipping rate. """ _inner_class_types = {"taxes": Tax} class TaxAmount(StripeObject): amount: int """ The amount, in cents (or local equivalent), of the tax. """ inclusive: bool """ Whether this tax amount is inclusive or exclusive. """ tax_rate: ExpandableField["TaxRate"] """ The tax rate that was applied to get this tax amount. """ taxability_reason: Optional[ Literal[ "customer_exempt", "not_collecting", "not_subject_to_tax", "not_supported", "portion_product_exempt", "portion_reduced_rated", "portion_standard_rated", "product_exempt", "product_exempt_holiday", "proportionally_rated", "reduced_rated", "reverse_charge", "standard_rated", "taxable_basis_reduced", "zero_rated", ] ] """ The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. """ taxable_amount: Optional[int] """ The amount on which tax is calculated, in cents (or local equivalent). """ class CreateParams(RequestOptions): amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the total amount of the credit note. """ credit_amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. """ effective_at: NotRequired[int] """ The date when this credit note is in effect. Same as `created` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. """ email_type: NotRequired[Literal["credit_note", "none"]] """ Type of email to send to the customer, one of `credit_note` or `none` and the default is `credit_note`. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ invoice: str """ ID of the invoice. """ lines: NotRequired[List["CreditNote.CreateParamsLine"]] """ Line items that make up the credit note. """ memo: NotRequired[str] """ The credit note's memo appears on the credit note PDF. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ out_of_band_amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. """ reason: NotRequired[ Literal[ "duplicate", "fraudulent", "order_change", "product_unsatisfactory", ] ] """ Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory` """ refund: NotRequired[str] """ ID of an existing refund to link this credit note to. """ refund_amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. """ shipping_cost: NotRequired["CreditNote.CreateParamsShippingCost"] """ When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. """ class CreateParamsLine(TypedDict): amount: NotRequired[int] """ The line item amount to credit. Only valid when `type` is `invoice_line_item`. """ description: NotRequired[str] """ The description of the credit note line item. Only valid when the `type` is `custom_line_item`. """ invoice_line_item: NotRequired[str] """ The invoice line item to credit. Only valid when the `type` is `invoice_line_item`. """ quantity: NotRequired[int] """ The line item quantity to credit. """ tax_amounts: NotRequired[ "Literal['']|List[CreditNote.CreateParamsLineTaxAmount]" ] """ A list of up to 10 tax amounts for the credit note line item. Cannot be mixed with `tax_rates`. """ tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates which apply to the credit note line item. Only valid when the `type` is `custom_line_item` and cannot be mixed with `tax_amounts`. """ type: Literal["custom_line_item", "invoice_line_item"] """ Type of the credit note line item, one of `invoice_line_item` or `custom_line_item` """ unit_amount: NotRequired[int] """ The integer unit amount in cents (or local equivalent) of the credit note line item. This `unit_amount` will be multiplied by the quantity to get the full amount to credit for this line item. Only valid when `type` is `custom_line_item`. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class CreateParamsLineTaxAmount(TypedDict): amount: int """ The amount, in cents (or local equivalent), of the tax. """ tax_rate: str """ The id of the tax rate for this tax amount. The tax rate must have been automatically created by Stripe. """ taxable_amount: int """ The amount on which tax is calculated, in cents (or local equivalent). """ class CreateParamsShippingCost(TypedDict): shipping_rate: NotRequired[str] """ The ID of the shipping rate to use for this order. """ class ListLinesParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParams(RequestOptions): created: NotRequired["CreditNote.ListParamsCreated|int"] """ Only return credit notes that were created during the given date interval. """ customer: NotRequired[str] """ Only return credit notes for the customer specified by this customer ID. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ invoice: NotRequired[str] """ Only return credit notes for the invoice specified by this invoice ID. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ memo: NotRequired[str] """ Credit note memo. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ class PreviewLinesParams(RequestOptions): amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the total amount of the credit note. """ credit_amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. """ effective_at: NotRequired[int] """ The date when this credit note is in effect. Same as `created` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. """ email_type: NotRequired[Literal["credit_note", "none"]] """ Type of email to send to the customer, one of `credit_note` or `none` and the default is `credit_note`. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ invoice: str """ ID of the invoice. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ lines: NotRequired[List["CreditNote.PreviewLinesParamsLine"]] """ Line items that make up the credit note. """ memo: NotRequired[str] """ The credit note's memo appears on the credit note PDF. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ out_of_band_amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. """ reason: NotRequired[ Literal[ "duplicate", "fraudulent", "order_change", "product_unsatisfactory", ] ] """ Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory` """ refund: NotRequired[str] """ ID of an existing refund to link this credit note to. """ refund_amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. """ shipping_cost: NotRequired["CreditNote.PreviewLinesParamsShippingCost"] """ When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class PreviewLinesParamsLine(TypedDict): amount: NotRequired[int] """ The line item amount to credit. Only valid when `type` is `invoice_line_item`. """ description: NotRequired[str] """ The description of the credit note line item. Only valid when the `type` is `custom_line_item`. """ invoice_line_item: NotRequired[str] """ The invoice line item to credit. Only valid when the `type` is `invoice_line_item`. """ quantity: NotRequired[int] """ The line item quantity to credit. """ tax_amounts: NotRequired[ "Literal['']|List[CreditNote.PreviewLinesParamsLineTaxAmount]" ] """ A list of up to 10 tax amounts for the credit note line item. Cannot be mixed with `tax_rates`. """ tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates which apply to the credit note line item. Only valid when the `type` is `custom_line_item` and cannot be mixed with `tax_amounts`. """ type: Literal["custom_line_item", "invoice_line_item"] """ Type of the credit note line item, one of `invoice_line_item` or `custom_line_item` """ unit_amount: NotRequired[int] """ The integer unit amount in cents (or local equivalent) of the credit note line item. This `unit_amount` will be multiplied by the quantity to get the full amount to credit for this line item. Only valid when `type` is `custom_line_item`. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class PreviewLinesParamsLineTaxAmount(TypedDict): amount: int """ The amount, in cents (or local equivalent), of the tax. """ tax_rate: str """ The id of the tax rate for this tax amount. The tax rate must have been automatically created by Stripe. """ taxable_amount: int """ The amount on which tax is calculated, in cents (or local equivalent). """ class PreviewLinesParamsShippingCost(TypedDict): shipping_rate: NotRequired[str] """ The ID of the shipping rate to use for this order. """ class PreviewParams(RequestOptions): amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the total amount of the credit note. """ credit_amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. """ effective_at: NotRequired[int] """ The date when this credit note is in effect. Same as `created` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. """ email_type: NotRequired[Literal["credit_note", "none"]] """ Type of email to send to the customer, one of `credit_note` or `none` and the default is `credit_note`. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ invoice: str """ ID of the invoice. """ lines: NotRequired[List["CreditNote.PreviewParamsLine"]] """ Line items that make up the credit note. """ memo: NotRequired[str] """ The credit note's memo appears on the credit note PDF. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ out_of_band_amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. """ reason: NotRequired[ Literal[ "duplicate", "fraudulent", "order_change", "product_unsatisfactory", ] ] """ Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory` """ refund: NotRequired[str] """ ID of an existing refund to link this credit note to. """ refund_amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. """ shipping_cost: NotRequired["CreditNote.PreviewParamsShippingCost"] """ When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. """ class PreviewParamsLine(TypedDict): amount: NotRequired[int] """ The line item amount to credit. Only valid when `type` is `invoice_line_item`. """ description: NotRequired[str] """ The description of the credit note line item. Only valid when the `type` is `custom_line_item`. """ invoice_line_item: NotRequired[str] """ The invoice line item to credit. Only valid when the `type` is `invoice_line_item`. """ quantity: NotRequired[int] """ The line item quantity to credit. """ tax_amounts: NotRequired[ "Literal['']|List[CreditNote.PreviewParamsLineTaxAmount]" ] """ A list of up to 10 tax amounts for the credit note line item. Cannot be mixed with `tax_rates`. """ tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates which apply to the credit note line item. Only valid when the `type` is `custom_line_item` and cannot be mixed with `tax_amounts`. """ type: Literal["custom_line_item", "invoice_line_item"] """ Type of the credit note line item, one of `invoice_line_item` or `custom_line_item` """ unit_amount: NotRequired[int] """ The integer unit amount in cents (or local equivalent) of the credit note line item. This `unit_amount` will be multiplied by the quantity to get the full amount to credit for this line item. Only valid when `type` is `custom_line_item`. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class PreviewParamsLineTaxAmount(TypedDict): amount: int """ The amount, in cents (or local equivalent), of the tax. """ tax_rate: str """ The id of the tax rate for this tax amount. The tax rate must have been automatically created by Stripe. """ taxable_amount: int """ The amount on which tax is calculated, in cents (or local equivalent). """ class PreviewParamsShippingCost(TypedDict): shipping_rate: NotRequired[str] """ The ID of the shipping rate to use for this order. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class VoidCreditNoteParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ amount: int """ The integer amount in cents (or local equivalent) representing the total amount of the credit note, including tax. """ amount_shipping: int """ This is the sum of all the shipping amounts. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ 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). """ customer: ExpandableField["Customer"] """ ID of the customer. """ customer_balance_transaction: Optional[ ExpandableField["CustomerBalanceTransaction"] ] """ Customer balance transaction related to this credit note. """ discount_amount: int """ The integer amount in cents (or local equivalent) representing the total amount of discount that was credited. """ discount_amounts: List[DiscountAmount] """ The aggregate amounts calculated per discount for all line items. """ effective_at: Optional[int] """ The date when this credit note is in effect. Same as `created` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. """ id: str """ Unique identifier for the object. """ invoice: ExpandableField["Invoice"] """ ID of the invoice. """ lines: ListObject["CreditNoteLineItem"] """ Line items that make up the credit note """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ memo: Optional[str] """ Customer-facing text that appears on the credit note PDF. """ metadata: Optional[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ number: str """ A unique number that identifies this particular credit note and appears on the PDF of the credit note and its associated invoice. """ object: Literal["credit_note"] """ String representing the object's type. Objects of the same type share the same value. """ out_of_band_amount: Optional[int] """ Amount that was credited outside of Stripe. """ pdf: str """ The link to download the PDF of the credit note. """ reason: Optional[ Literal[ "duplicate", "fraudulent", "order_change", "product_unsatisfactory" ] ] """ Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory` """ refund: Optional[ExpandableField["Refund"]] """ Refund related to this credit note. """ shipping_cost: Optional[ShippingCost] """ The details of the cost of shipping, including the ShippingRate applied to the invoice. """ status: Literal["issued", "void"] """ Status of this credit note, one of `issued` or `void`. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding). """ subtotal: int """ The integer amount in cents (or local equivalent) representing the amount of the credit note, excluding exclusive tax and invoice level discounts. """ subtotal_excluding_tax: Optional[int] """ The integer amount in cents (or local equivalent) representing the amount of the credit note, excluding all tax and invoice level discounts. """ tax_amounts: List[TaxAmount] """ The aggregate amounts calculated per tax rate for all line items. """ total: int """ The integer amount in cents (or local equivalent) representing the total amount of the credit note, including tax and all discount. """ total_excluding_tax: Optional[int] """ The integer amount in cents (or local equivalent) representing the total amount of the credit note, excluding tax, but including discounts. """ type: Literal["post_payment", "pre_payment"] """ Type of this credit note, one of `pre_payment` or `post_payment`. A `pre_payment` credit note means it was issued when the invoice was open. A `post_payment` credit note means it was issued when the invoice was paid. """ voided_at: Optional[int] """ The time that the credit note was voided. """ @classmethod def create( cls, **params: Unpack["CreditNote.CreateParams"] ) -> "CreditNote": """ Issue a credit note to adjust the amount of a finalized invoice. For a status=open invoice, a credit note reduces its amount_due. For a status=paid invoice, a credit note does not affect its amount_due. Instead, it can result in any combination of the following: Refund: create a new refund (using refund_amount) or link an existing refund (using refund). Customer balance credit: credit the customer's balance (using credit_amount) which will be automatically applied to their next invoice when it's finalized. Outside of Stripe credit: record the amount that is or will be credited outside of Stripe (using out_of_band_amount). For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts must equal the credit note total. You may issue multiple credit notes for an invoice. Each credit note will increment the invoice's pre_payment_credit_notes_amount or post_payment_credit_notes_amount depending on its status at the time of credit note creation. """ return cast( "CreditNote", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["CreditNote.CreateParams"] ) -> "CreditNote": """ Issue a credit note to adjust the amount of a finalized invoice. For a status=open invoice, a credit note reduces its amount_due. For a status=paid invoice, a credit note does not affect its amount_due. Instead, it can result in any combination of the following: Refund: create a new refund (using refund_amount) or link an existing refund (using refund). Customer balance credit: credit the customer's balance (using credit_amount) which will be automatically applied to their next invoice when it's finalized. Outside of Stripe credit: record the amount that is or will be credited outside of Stripe (using out_of_band_amount). For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts must equal the credit note total. You may issue multiple credit notes for an invoice. Each credit note will increment the invoice's pre_payment_credit_notes_amount or post_payment_credit_notes_amount depending on its status at the time of credit note creation. """ return cast( "CreditNote", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def list( cls, **params: Unpack["CreditNote.ListParams"] ) -> ListObject["CreditNote"]: """ Returns a list of credit notes. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["CreditNote.ListParams"] ) -> ListObject["CreditNote"]: """ Returns a list of credit notes. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def modify( cls, id: str, **params: Unpack["CreditNote.ModifyParams"] ) -> "CreditNote": """ Updates an existing credit note. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "CreditNote", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["CreditNote.ModifyParams"] ) -> "CreditNote": """ Updates an existing credit note. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "CreditNote", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def preview( cls, **params: Unpack["CreditNote.PreviewParams"] ) -> "CreditNote": """ Get a preview of a credit note without creating it. """ return cast( "CreditNote", cls._static_request( "get", "/v1/credit_notes/preview", params=params, ), ) @classmethod async def preview_async( cls, **params: Unpack["CreditNote.PreviewParams"] ) -> "CreditNote": """ Get a preview of a credit note without creating it. """ return cast( "CreditNote", await cls._static_request_async( "get", "/v1/credit_notes/preview", params=params, ), ) @classmethod def preview_lines( cls, **params: Unpack["CreditNote.PreviewLinesParams"] ) -> ListObject["CreditNoteLineItem"]: """ When retrieving a credit note preview, you'll get a lines property containing the first handful of those items. This URL you can retrieve the full (paginated) list of line items. """ return cast( ListObject["CreditNoteLineItem"], cls._static_request( "get", "/v1/credit_notes/preview/lines", params=params, ), ) @classmethod async def preview_lines_async( cls, **params: Unpack["CreditNote.PreviewLinesParams"] ) -> ListObject["CreditNoteLineItem"]: """ When retrieving a credit note preview, you'll get a lines property containing the first handful of those items. This URL you can retrieve the full (paginated) list of line items. """ return cast( ListObject["CreditNoteLineItem"], await cls._static_request_async( "get", "/v1/credit_notes/preview/lines", params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["CreditNote.RetrieveParams"] ) -> "CreditNote": """ Retrieves the credit note object with the given identifier. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["CreditNote.RetrieveParams"] ) -> "CreditNote": """ Retrieves the credit note object with the given identifier. """ instance = cls(id, **params) await instance.refresh_async() return instance @classmethod def _cls_void_credit_note( cls, id: str, **params: Unpack["CreditNote.VoidCreditNoteParams"] ) -> "CreditNote": """ Marks a credit note as void. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding). """ return cast( "CreditNote", cls._static_request( "post", "/v1/credit_notes/{id}/void".format(id=sanitize_id(id)), params=params, ), ) @overload @staticmethod def void_credit_note( id: str, **params: Unpack["CreditNote.VoidCreditNoteParams"] ) -> "CreditNote": """ Marks a credit note as void. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding). """ ... @overload def void_credit_note( self, **params: Unpack["CreditNote.VoidCreditNoteParams"] ) -> "CreditNote": """ Marks a credit note as void. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding). """ ... @class_method_variant("_cls_void_credit_note") def void_credit_note( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["CreditNote.VoidCreditNoteParams"] ) -> "CreditNote": """ Marks a credit note as void. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding). """ return cast( "CreditNote", self._request( "post", "/v1/credit_notes/{id}/void".format( id=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_void_credit_note_async( cls, id: str, **params: Unpack["CreditNote.VoidCreditNoteParams"] ) -> "CreditNote": """ Marks a credit note as void. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding). """ return cast( "CreditNote", await cls._static_request_async( "post", "/v1/credit_notes/{id}/void".format(id=sanitize_id(id)), params=params, ), ) @overload @staticmethod async def void_credit_note_async( id: str, **params: Unpack["CreditNote.VoidCreditNoteParams"] ) -> "CreditNote": """ Marks a credit note as void. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding). """ ... @overload async def void_credit_note_async( self, **params: Unpack["CreditNote.VoidCreditNoteParams"] ) -> "CreditNote": """ Marks a credit note as void. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding). """ ... @class_method_variant("_cls_void_credit_note_async") async def void_credit_note_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["CreditNote.VoidCreditNoteParams"] ) -> "CreditNote": """ Marks a credit note as void. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding). """ return cast( "CreditNote", await self._request_async( "post", "/v1/credit_notes/{id}/void".format( id=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def list_lines( cls, credit_note: str, **params: Unpack["CreditNote.ListLinesParams"] ) -> ListObject["CreditNoteLineItem"]: """ When retrieving a credit note, you'll get a lines property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ return cast( ListObject["CreditNoteLineItem"], cls._static_request( "get", "/v1/credit_notes/{credit_note}/lines".format( credit_note=sanitize_id(credit_note) ), params=params, ), ) @classmethod async def list_lines_async( cls, credit_note: str, **params: Unpack["CreditNote.ListLinesParams"] ) -> ListObject["CreditNoteLineItem"]: """ When retrieving a credit note, you'll get a lines property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ return cast( ListObject["CreditNoteLineItem"], await cls._static_request_async( "get", "/v1/credit_notes/{credit_note}/lines".format( credit_note=sanitize_id(credit_note) ), params=params, ), ) _inner_class_types = { "discount_amounts": DiscountAmount, "shipping_cost": ShippingCost, "tax_amounts": TaxAmount, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_credit_note_line_item.py0000644000175100001770000001104214637354563021065 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._expandable_field import ExpandableField from stripe._stripe_object import StripeObject from typing import ClassVar, List, Optional from typing_extensions import Literal, TYPE_CHECKING if TYPE_CHECKING: from stripe._discount import Discount from stripe._tax_rate import TaxRate class CreditNoteLineItem(StripeObject): """ The credit note line item object """ OBJECT_NAME: ClassVar[Literal["credit_note_line_item"]] = ( "credit_note_line_item" ) class DiscountAmount(StripeObject): amount: int """ The amount, in cents (or local equivalent), of the discount. """ discount: ExpandableField["Discount"] """ The discount that was applied to get this discount amount. """ class TaxAmount(StripeObject): amount: int """ The amount, in cents (or local equivalent), of the tax. """ inclusive: bool """ Whether this tax amount is inclusive or exclusive. """ tax_rate: ExpandableField["TaxRate"] """ The tax rate that was applied to get this tax amount. """ taxability_reason: Optional[ Literal[ "customer_exempt", "not_collecting", "not_subject_to_tax", "not_supported", "portion_product_exempt", "portion_reduced_rated", "portion_standard_rated", "product_exempt", "product_exempt_holiday", "proportionally_rated", "reduced_rated", "reverse_charge", "standard_rated", "taxable_basis_reduced", "zero_rated", ] ] """ The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. """ taxable_amount: Optional[int] """ The amount on which tax is calculated, in cents (or local equivalent). """ amount: int """ The integer amount in cents (or local equivalent) representing the gross amount being credited for this line item, excluding (exclusive) tax and discounts. """ amount_excluding_tax: Optional[int] """ The integer amount in cents (or local equivalent) representing the amount being credited for this line item, excluding all tax and discounts. """ description: Optional[str] """ Description of the item being credited. """ discount_amount: int """ The integer amount in cents (or local equivalent) representing the discount being credited for this line item. """ discount_amounts: List[DiscountAmount] """ The amount of discount calculated per discount for this line item """ id: str """ Unique identifier for the object. """ invoice_line_item: Optional[str] """ ID of the invoice line item being credited """ 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["credit_note_line_item"] """ String representing the object's type. Objects of the same type share the same value. """ quantity: Optional[int] """ The number of units of product being credited. """ tax_amounts: List[TaxAmount] """ The amount of tax calculated per tax rate for this line item """ tax_rates: List["TaxRate"] """ The tax rates which apply to the line item. """ type: Literal["custom_line_item", "invoice_line_item"] """ The type of the credit note line item, one of `invoice_line_item` or `custom_line_item`. When the type is `invoice_line_item` there is an additional `invoice_line_item` property on the resource the value of which is the id of the credited line item on the invoice. """ unit_amount: Optional[int] """ The cost of each unit of product being credited. """ unit_amount_decimal: Optional[str] """ Same as `unit_amount`, but contains a decimal value with at most 12 decimal places. """ unit_amount_excluding_tax: Optional[str] """ The amount in cents (or local equivalent) representing the unit amount being credited for this line item, excluding all tax and discounts. """ _inner_class_types = { "discount_amounts": DiscountAmount, "tax_amounts": TaxAmount, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_credit_note_line_item_service.py0000644000175100001770000000616014637354563022612 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._credit_note_line_item import CreditNoteLineItem from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict class CreditNoteLineItemService(StripeService): class ListParams(TypedDict): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ def list( self, credit_note: str, params: "CreditNoteLineItemService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[CreditNoteLineItem]: """ When retrieving a credit note, you'll get a lines property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ return cast( ListObject[CreditNoteLineItem], self._request( "get", "/v1/credit_notes/{credit_note}/lines".format( credit_note=sanitize_id(credit_note), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, credit_note: str, params: "CreditNoteLineItemService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[CreditNoteLineItem]: """ When retrieving a credit note, you'll get a lines property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ return cast( ListObject[CreditNoteLineItem], await self._request_async( "get", "/v1/credit_notes/{credit_note}/lines".format( credit_note=sanitize_id(credit_note), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_credit_note_preview_lines_service.py0000644000175100001770000001772414637354563023530 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._credit_note_line_item import CreditNoteLineItem from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class CreditNotePreviewLinesService(StripeService): class ListParams(TypedDict): amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the total amount of the credit note. """ credit_amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. """ effective_at: NotRequired[int] """ The date when this credit note is in effect. Same as `created` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. """ email_type: NotRequired[Literal["credit_note", "none"]] """ Type of email to send to the customer, one of `credit_note` or `none` and the default is `credit_note`. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ invoice: str """ ID of the invoice. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ lines: NotRequired[ List["CreditNotePreviewLinesService.ListParamsLine"] ] """ Line items that make up the credit note. """ memo: NotRequired[str] """ The credit note's memo appears on the credit note PDF. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ out_of_band_amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. """ reason: NotRequired[ Literal[ "duplicate", "fraudulent", "order_change", "product_unsatisfactory", ] ] """ Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory` """ refund: NotRequired[str] """ ID of an existing refund to link this credit note to. """ refund_amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. """ shipping_cost: NotRequired[ "CreditNotePreviewLinesService.ListParamsShippingCost" ] """ When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsLine(TypedDict): amount: NotRequired[int] """ The line item amount to credit. Only valid when `type` is `invoice_line_item`. """ description: NotRequired[str] """ The description of the credit note line item. Only valid when the `type` is `custom_line_item`. """ invoice_line_item: NotRequired[str] """ The invoice line item to credit. Only valid when the `type` is `invoice_line_item`. """ quantity: NotRequired[int] """ The line item quantity to credit. """ tax_amounts: NotRequired[ "Literal['']|List[CreditNotePreviewLinesService.ListParamsLineTaxAmount]" ] """ A list of up to 10 tax amounts for the credit note line item. Cannot be mixed with `tax_rates`. """ tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates which apply to the credit note line item. Only valid when the `type` is `custom_line_item` and cannot be mixed with `tax_amounts`. """ type: Literal["custom_line_item", "invoice_line_item"] """ Type of the credit note line item, one of `invoice_line_item` or `custom_line_item` """ unit_amount: NotRequired[int] """ The integer unit amount in cents (or local equivalent) of the credit note line item. This `unit_amount` will be multiplied by the quantity to get the full amount to credit for this line item. Only valid when `type` is `custom_line_item`. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class ListParamsLineTaxAmount(TypedDict): amount: int """ The amount, in cents (or local equivalent), of the tax. """ tax_rate: str """ The id of the tax rate for this tax amount. The tax rate must have been automatically created by Stripe. """ taxable_amount: int """ The amount on which tax is calculated, in cents (or local equivalent). """ class ListParamsShippingCost(TypedDict): shipping_rate: NotRequired[str] """ The ID of the shipping rate to use for this order. """ def list( self, params: "CreditNotePreviewLinesService.ListParams", options: RequestOptions = {}, ) -> ListObject[CreditNoteLineItem]: """ When retrieving a credit note preview, you'll get a lines property containing the first handful of those items. This URL you can retrieve the full (paginated) list of line items. """ return cast( ListObject[CreditNoteLineItem], self._request( "get", "/v1/credit_notes/preview/lines", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "CreditNotePreviewLinesService.ListParams", options: RequestOptions = {}, ) -> ListObject[CreditNoteLineItem]: """ When retrieving a credit note preview, you'll get a lines property containing the first handful of those items. This URL you can retrieve the full (paginated) list of line items. """ return cast( ListObject[CreditNoteLineItem], await self._request_async( "get", "/v1/credit_notes/preview/lines", api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_credit_note_service.py0000644000175100001770000005541514637354563020574 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._credit_note import CreditNote from stripe._credit_note_line_item_service import CreditNoteLineItemService from stripe._credit_note_preview_lines_service import ( CreditNotePreviewLinesService, ) from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class CreditNoteService(StripeService): def __init__(self, requestor): super().__init__(requestor) self.line_items = CreditNoteLineItemService(self._requestor) self.preview_lines = CreditNotePreviewLinesService(self._requestor) class CreateParams(TypedDict): amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the total amount of the credit note. """ credit_amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. """ effective_at: NotRequired[int] """ The date when this credit note is in effect. Same as `created` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. """ email_type: NotRequired[Literal["credit_note", "none"]] """ Type of email to send to the customer, one of `credit_note` or `none` and the default is `credit_note`. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ invoice: str """ ID of the invoice. """ lines: NotRequired[List["CreditNoteService.CreateParamsLine"]] """ Line items that make up the credit note. """ memo: NotRequired[str] """ The credit note's memo appears on the credit note PDF. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ out_of_band_amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. """ reason: NotRequired[ Literal[ "duplicate", "fraudulent", "order_change", "product_unsatisfactory", ] ] """ Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory` """ refund: NotRequired[str] """ ID of an existing refund to link this credit note to. """ refund_amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. """ shipping_cost: NotRequired[ "CreditNoteService.CreateParamsShippingCost" ] """ When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. """ class CreateParamsLine(TypedDict): amount: NotRequired[int] """ The line item amount to credit. Only valid when `type` is `invoice_line_item`. """ description: NotRequired[str] """ The description of the credit note line item. Only valid when the `type` is `custom_line_item`. """ invoice_line_item: NotRequired[str] """ The invoice line item to credit. Only valid when the `type` is `invoice_line_item`. """ quantity: NotRequired[int] """ The line item quantity to credit. """ tax_amounts: NotRequired[ "Literal['']|List[CreditNoteService.CreateParamsLineTaxAmount]" ] """ A list of up to 10 tax amounts for the credit note line item. Cannot be mixed with `tax_rates`. """ tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates which apply to the credit note line item. Only valid when the `type` is `custom_line_item` and cannot be mixed with `tax_amounts`. """ type: Literal["custom_line_item", "invoice_line_item"] """ Type of the credit note line item, one of `invoice_line_item` or `custom_line_item` """ unit_amount: NotRequired[int] """ The integer unit amount in cents (or local equivalent) of the credit note line item. This `unit_amount` will be multiplied by the quantity to get the full amount to credit for this line item. Only valid when `type` is `custom_line_item`. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class CreateParamsLineTaxAmount(TypedDict): amount: int """ The amount, in cents (or local equivalent), of the tax. """ tax_rate: str """ The id of the tax rate for this tax amount. The tax rate must have been automatically created by Stripe. """ taxable_amount: int """ The amount on which tax is calculated, in cents (or local equivalent). """ class CreateParamsShippingCost(TypedDict): shipping_rate: NotRequired[str] """ The ID of the shipping rate to use for this order. """ class ListParams(TypedDict): created: NotRequired["CreditNoteService.ListParamsCreated|int"] """ Only return credit notes that were created during the given date interval. """ customer: NotRequired[str] """ Only return credit notes for the customer specified by this customer ID. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ invoice: NotRequired[str] """ Only return credit notes for the invoice specified by this invoice ID. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class PreviewParams(TypedDict): amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the total amount of the credit note. """ credit_amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the amount to credit the customer's balance, which will be automatically applied to their next invoice. """ effective_at: NotRequired[int] """ The date when this credit note is in effect. Same as `created` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the credit note PDF. """ email_type: NotRequired[Literal["credit_note", "none"]] """ Type of email to send to the customer, one of `credit_note` or `none` and the default is `credit_note`. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ invoice: str """ ID of the invoice. """ lines: NotRequired[List["CreditNoteService.PreviewParamsLine"]] """ Line items that make up the credit note. """ memo: NotRequired[str] """ The credit note's memo appears on the credit note PDF. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ out_of_band_amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the amount that is credited outside of Stripe. """ reason: NotRequired[ Literal[ "duplicate", "fraudulent", "order_change", "product_unsatisfactory", ] ] """ Reason for issuing this credit note, one of `duplicate`, `fraudulent`, `order_change`, or `product_unsatisfactory` """ refund: NotRequired[str] """ ID of an existing refund to link this credit note to. """ refund_amount: NotRequired[int] """ The integer amount in cents (or local equivalent) representing the amount to refund. If set, a refund will be created for the charge associated with the invoice. """ shipping_cost: NotRequired[ "CreditNoteService.PreviewParamsShippingCost" ] """ When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included in the credit note. """ class PreviewParamsLine(TypedDict): amount: NotRequired[int] """ The line item amount to credit. Only valid when `type` is `invoice_line_item`. """ description: NotRequired[str] """ The description of the credit note line item. Only valid when the `type` is `custom_line_item`. """ invoice_line_item: NotRequired[str] """ The invoice line item to credit. Only valid when the `type` is `invoice_line_item`. """ quantity: NotRequired[int] """ The line item quantity to credit. """ tax_amounts: NotRequired[ "Literal['']|List[CreditNoteService.PreviewParamsLineTaxAmount]" ] """ A list of up to 10 tax amounts for the credit note line item. Cannot be mixed with `tax_rates`. """ tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates which apply to the credit note line item. Only valid when the `type` is `custom_line_item` and cannot be mixed with `tax_amounts`. """ type: Literal["custom_line_item", "invoice_line_item"] """ Type of the credit note line item, one of `invoice_line_item` or `custom_line_item` """ unit_amount: NotRequired[int] """ The integer unit amount in cents (or local equivalent) of the credit note line item. This `unit_amount` will be multiplied by the quantity to get the full amount to credit for this line item. Only valid when `type` is `custom_line_item`. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class PreviewParamsLineTaxAmount(TypedDict): amount: int """ The amount, in cents (or local equivalent), of the tax. """ tax_rate: str """ The id of the tax rate for this tax amount. The tax rate must have been automatically created by Stripe. """ taxable_amount: int """ The amount on which tax is calculated, in cents (or local equivalent). """ class PreviewParamsShippingCost(TypedDict): shipping_rate: NotRequired[str] """ The ID of the shipping rate to use for this order. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ memo: NotRequired[str] """ Credit note memo. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ class VoidCreditNoteParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def list( self, params: "CreditNoteService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[CreditNote]: """ Returns a list of credit notes. """ return cast( ListObject[CreditNote], self._request( "get", "/v1/credit_notes", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "CreditNoteService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[CreditNote]: """ Returns a list of credit notes. """ return cast( ListObject[CreditNote], await self._request_async( "get", "/v1/credit_notes", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "CreditNoteService.CreateParams", options: RequestOptions = {}, ) -> CreditNote: """ Issue a credit note to adjust the amount of a finalized invoice. For a status=open invoice, a credit note reduces its amount_due. For a status=paid invoice, a credit note does not affect its amount_due. Instead, it can result in any combination of the following: Refund: create a new refund (using refund_amount) or link an existing refund (using refund). Customer balance credit: credit the customer's balance (using credit_amount) which will be automatically applied to their next invoice when it's finalized. Outside of Stripe credit: record the amount that is or will be credited outside of Stripe (using out_of_band_amount). For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts must equal the credit note total. You may issue multiple credit notes for an invoice. Each credit note will increment the invoice's pre_payment_credit_notes_amount or post_payment_credit_notes_amount depending on its status at the time of credit note creation. """ return cast( CreditNote, self._request( "post", "/v1/credit_notes", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "CreditNoteService.CreateParams", options: RequestOptions = {}, ) -> CreditNote: """ Issue a credit note to adjust the amount of a finalized invoice. For a status=open invoice, a credit note reduces its amount_due. For a status=paid invoice, a credit note does not affect its amount_due. Instead, it can result in any combination of the following: Refund: create a new refund (using refund_amount) or link an existing refund (using refund). Customer balance credit: credit the customer's balance (using credit_amount) which will be automatically applied to their next invoice when it's finalized. Outside of Stripe credit: record the amount that is or will be credited outside of Stripe (using out_of_band_amount). For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts must equal the credit note total. You may issue multiple credit notes for an invoice. Each credit note will increment the invoice's pre_payment_credit_notes_amount or post_payment_credit_notes_amount depending on its status at the time of credit note creation. """ return cast( CreditNote, await self._request_async( "post", "/v1/credit_notes", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, id: str, params: "CreditNoteService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> CreditNote: """ Retrieves the credit note object with the given identifier. """ return cast( CreditNote, self._request( "get", "/v1/credit_notes/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, id: str, params: "CreditNoteService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> CreditNote: """ Retrieves the credit note object with the given identifier. """ return cast( CreditNote, await self._request_async( "get", "/v1/credit_notes/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, id: str, params: "CreditNoteService.UpdateParams" = {}, options: RequestOptions = {}, ) -> CreditNote: """ Updates an existing credit note. """ return cast( CreditNote, self._request( "post", "/v1/credit_notes/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, id: str, params: "CreditNoteService.UpdateParams" = {}, options: RequestOptions = {}, ) -> CreditNote: """ Updates an existing credit note. """ return cast( CreditNote, await self._request_async( "post", "/v1/credit_notes/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) def preview( self, params: "CreditNoteService.PreviewParams", options: RequestOptions = {}, ) -> CreditNote: """ Get a preview of a credit note without creating it. """ return cast( CreditNote, self._request( "get", "/v1/credit_notes/preview", api_mode="V1", base_address="api", params=params, options=options, ), ) async def preview_async( self, params: "CreditNoteService.PreviewParams", options: RequestOptions = {}, ) -> CreditNote: """ Get a preview of a credit note without creating it. """ return cast( CreditNote, await self._request_async( "get", "/v1/credit_notes/preview", api_mode="V1", base_address="api", params=params, options=options, ), ) def void_credit_note( self, id: str, params: "CreditNoteService.VoidCreditNoteParams" = {}, options: RequestOptions = {}, ) -> CreditNote: """ Marks a credit note as void. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding). """ return cast( CreditNote, self._request( "post", "/v1/credit_notes/{id}/void".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def void_credit_note_async( self, id: str, params: "CreditNoteService.VoidCreditNoteParams" = {}, options: RequestOptions = {}, ) -> CreditNote: """ Marks a credit note as void. Learn more about [voiding credit notes](https://stripe.com/docs/billing/invoices/credit-notes#voiding). """ return cast( CreditNote, await self._request_async( "post", "/v1/credit_notes/{id}/void".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_custom_method.py0000644000175100001770000000475114637354563017424 0ustar00runnerdockerfrom typing import Optional from stripe import _util from urllib.parse import quote_plus # TODO(major): 1704. @_util.deprecated( "the custom_method class decorator will be removed in a future version of stripe-python. Define custom methods directly and use StripeObject._static_request within." ) def custom_method( name: str, http_verb: str, http_path: Optional[str] = None, is_streaming=False, ): if http_verb not in ["get", "post", "delete"]: raise ValueError( "Invalid http_verb: %s. Must be one of 'get', 'post' or 'delete'" % http_verb ) if http_path is None: http_path = name def wrapper(cls): def custom_method_request(cls, sid, **params): url = "%s/%s/%s" % ( cls.class_url(), quote_plus(sid), http_path, ) obj = cls._static_request(http_verb, url, params=params) # For list objects, we have to attach the parameters so that they # can be referenced in auto-pagination and ensure consistency. if "object" in obj and obj.object == "list": obj._retrieve_params = params return obj def custom_method_request_stream(cls, sid, **params): url = "%s/%s/%s" % ( cls.class_url(), quote_plus(sid), http_path, ) return cls._static_request_stream(http_verb, url, params=params) if is_streaming: class_method_impl = classmethod(custom_method_request_stream) else: class_method_impl = classmethod(custom_method_request) existing_method = getattr(cls, name, None) if existing_method is None: setattr(cls, name, class_method_impl) else: # If a method with the same name we want to use already exists on # the class, we assume it's an instance method. In this case, the # new class method is prefixed with `_cls_`, and the original # instance method is decorated with `util.class_method_variant` so # that the new class method is called when the original method is # called as a class method. setattr(cls, "_cls_" + name, class_method_impl) instance_method = _util.class_method_variant("_cls_" + name)( existing_method ) setattr(cls, name, instance_method) return cls return wrapper ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_customer.py0000644000175100001770000033247614637354563016423 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._deletable_api_resource import DeletableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._nested_resource_class_methods import nested_resource_class_methods from stripe._request_options import RequestOptions from stripe._search_result_object import SearchResultObject from stripe._searchable_api_resource import SearchableAPIResource from stripe._stripe_object import StripeObject from stripe._test_helpers import APIResourceTestHelpers from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ( AsyncIterator, ClassVar, Dict, Iterator, List, Optional, Union, cast, overload, ) from typing_extensions import ( Literal, NotRequired, Type, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._account import Account from stripe._bank_account import BankAccount from stripe._card import Card from stripe._cash_balance import CashBalance from stripe._customer_balance_transaction import CustomerBalanceTransaction from stripe._customer_cash_balance_transaction import ( CustomerCashBalanceTransaction, ) from stripe._discount import Discount from stripe._funding_instructions import FundingInstructions from stripe._payment_method import PaymentMethod from stripe._source import Source from stripe._subscription import Subscription from stripe._tax_id import TaxId from stripe.test_helpers._test_clock import TestClock @nested_resource_class_methods("balance_transaction") @nested_resource_class_methods("cash_balance_transaction") @nested_resource_class_methods("source") @nested_resource_class_methods("tax_id") class Customer( CreateableAPIResource["Customer"], DeletableAPIResource["Customer"], ListableAPIResource["Customer"], SearchableAPIResource["Customer"], UpdateableAPIResource["Customer"], ): """ This object represents a customer of your business. Use it to create recurring charges and track payments that belong to the same customer. Related guide: [Save a card during payment](https://stripe.com/docs/payments/save-during-payment) """ OBJECT_NAME: ClassVar[Literal["customer"]] = "customer" 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 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State, county, province, or region. """ class InvoiceSettings(StripeObject): class CustomField(StripeObject): name: str """ The name of the custom field. """ value: str """ The value of the custom field. """ class RenderingOptions(StripeObject): amount_tax_display: Optional[str] """ How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. """ custom_fields: Optional[List[CustomField]] """ Default custom fields to be displayed on invoices for this customer. """ default_payment_method: Optional[ExpandableField["PaymentMethod"]] """ ID of a payment method that's attached to the customer, to be used as the customer's default payment method for subscriptions and invoices. """ footer: Optional[str] """ Default footer to be displayed on invoices for this customer. """ rendering_options: Optional[RenderingOptions] """ Default options for invoice PDF rendering for this customer. """ _inner_class_types = { "custom_fields": CustomField, "rendering_options": RenderingOptions, } class Shipping(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 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State, county, province, or region. """ address: Optional[Address] carrier: Optional[str] """ The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. """ name: Optional[str] """ Recipient name. """ phone: Optional[str] """ Recipient phone (including extension). """ tracking_number: Optional[str] """ The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ _inner_class_types = {"address": Address} class Tax(StripeObject): class Location(StripeObject): country: str """ The customer's country as identified by Stripe Tax. """ source: Literal[ "billing_address", "ip_address", "payment_method", "shipping_destination", ] """ The data source used to infer the customer's location. """ state: Optional[str] """ The customer's state, county, province, or region as identified by Stripe Tax. """ automatic_tax: Literal[ "failed", "not_collecting", "supported", "unrecognized_location" ] """ Surfaces if automatic tax computation is possible given the current customer location information. """ ip_address: Optional[str] """ A recent IP address of the customer used for tax reporting and tax location inference. """ location: Optional[Location] """ The customer's location as identified by Stripe Tax. """ _inner_class_types = {"location": Location} class CreateBalanceTransactionParams(RequestOptions): amount: int """ The integer amount in **cents (or local equivalent)** to apply to the customer's credit balance. """ 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). Specifies the [`invoice_credit_balance`](https://stripe.com/docs/api/customers/object#customer_object-invoice_credit_balance) that this transaction will apply to. If the customer's `currency` is not set, it will be updated to this value. """ description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ class CreateFundingInstructionsParams(RequestOptions): bank_transfer: "Customer.CreateFundingInstructionsParamsBankTransfer" """ Additional parameters for `bank_transfer` funding types """ 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). """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ funding_type: Literal["bank_transfer"] """ The `funding_type` to get the instructions for. """ class CreateFundingInstructionsParamsBankTransfer(TypedDict): eu_bank_transfer: NotRequired[ "Customer.CreateFundingInstructionsParamsBankTransferEuBankTransfer" ] """ Configuration for eu_bank_transfer funding type. """ requested_address_types: NotRequired[ List[Literal["iban", "sort_code", "spei", "zengin"]] ] """ List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. """ type: Literal[ "eu_bank_transfer", "gb_bank_transfer", "jp_bank_transfer", "mx_bank_transfer", "us_bank_transfer", ] """ The type of the `bank_transfer` """ class CreateFundingInstructionsParamsBankTransferEuBankTransfer(TypedDict): country: str """ The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. """ class CreateParams(RequestOptions): address: NotRequired["Literal['']|Customer.CreateParamsAddress"] """ The customer's address. """ balance: NotRequired[int] """ An integer amount in cents (or local equivalent) that represents the customer's current balance, which affect the customer's future invoices. A negative amount represents a credit that decreases the amount due on an invoice; a positive amount increases the amount due on an invoice. """ cash_balance: NotRequired["Customer.CreateParamsCashBalance"] """ Balance information and default balance settings for this customer. """ coupon: NotRequired[str] description: NotRequired[str] """ An arbitrary string that you can attach to a customer object. It is displayed alongside the customer in the dashboard. """ email: NotRequired[str] """ Customer's email address. It's displayed alongside the customer in your dashboard and can be useful for searching and tracking. This may be up to *512 characters*. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ invoice_prefix: NotRequired[str] """ The prefix for the customer used to generate unique invoice numbers. Must be 3–12 uppercase letters or numbers. """ invoice_settings: NotRequired["Customer.CreateParamsInvoiceSettings"] """ Default invoice settings for this customer. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ name: NotRequired[str] """ The customer's full name or business name. """ next_invoice_sequence: NotRequired[int] """ The sequence to be used on the customer's next invoice. Defaults to 1. """ payment_method: NotRequired[str] phone: NotRequired[str] """ The customer's phone number. """ preferred_locales: NotRequired[List[str]] """ Customer's preferred languages, ordered by preference. """ promotion_code: NotRequired[str] """ The ID of a promotion code to apply to the customer. The customer will have a discount applied on all recurring payments. Charges you create through the API will not have the discount. """ shipping: NotRequired["Literal['']|Customer.CreateParamsShipping"] """ The customer's shipping information. Appears on invoices emailed to this customer. """ source: NotRequired[str] tax: NotRequired["Customer.CreateParamsTax"] """ Tax details about the customer. """ tax_exempt: NotRequired[ "Literal['']|Literal['exempt', 'none', 'reverse']" ] """ The customer's tax exemption. One of `none`, `exempt`, or `reverse`. """ tax_id_data: NotRequired[List["Customer.CreateParamsTaxIdDatum"]] """ The customer's tax IDs. """ test_clock: NotRequired[str] """ ID of the test clock to attach to the customer. """ validate: NotRequired[bool] class CreateParamsAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsCashBalance(TypedDict): settings: NotRequired["Customer.CreateParamsCashBalanceSettings"] """ Settings controlling the behavior of the customer's cash balance, such as reconciliation of funds received. """ class CreateParamsCashBalanceSettings(TypedDict): reconciliation_mode: NotRequired[ Literal["automatic", "manual", "merchant_default"] ] """ Controls how funds transferred by the customer are applied to payment intents and invoices. Valid options are `automatic`, `manual`, or `merchant_default`. For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation). """ class CreateParamsInvoiceSettings(TypedDict): custom_fields: NotRequired[ "Literal['']|List[Customer.CreateParamsInvoiceSettingsCustomField]" ] """ The list of up to 4 default custom fields to be displayed on invoices for this customer. When updating, pass an empty string to remove previously-defined fields. """ default_payment_method: NotRequired[str] """ ID of a payment method that's attached to the customer, to be used as the customer's default payment method for subscriptions and invoices. """ footer: NotRequired[str] """ Default footer to be displayed on invoices for this customer. """ rendering_options: NotRequired[ "Literal['']|Customer.CreateParamsInvoiceSettingsRenderingOptions" ] """ Default options for invoice PDF rendering for this customer. """ class CreateParamsInvoiceSettingsCustomField(TypedDict): name: str """ The name of the custom field. This may be up to 40 characters. """ value: str """ The value of the custom field. This may be up to 140 characters. """ class CreateParamsInvoiceSettingsRenderingOptions(TypedDict): amount_tax_display: NotRequired[ "Literal['']|Literal['exclude_tax', 'include_inclusive_tax']" ] """ How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. """ class CreateParamsShipping(TypedDict): address: "Customer.CreateParamsShippingAddress" """ Customer shipping address. """ name: str """ Customer name. """ phone: NotRequired[str] """ Customer phone (including extension). """ class CreateParamsShippingAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsTax(TypedDict): ip_address: NotRequired["Literal['']|str"] """ A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. """ validate_location: NotRequired[Literal["deferred", "immediately"]] """ A flag that indicates when Stripe should validate the customer tax location. Defaults to `deferred`. """ class CreateParamsTaxIdDatum(TypedDict): type: Literal[ "ad_nrt", "ae_trn", "ar_cuit", "au_abn", "au_arn", "bg_uic", "bh_vat", "bo_tin", "br_cnpj", "br_cpf", "ca_bn", "ca_gst_hst", "ca_pst_bc", "ca_pst_mb", "ca_pst_sk", "ca_qst", "ch_uid", "ch_vat", "cl_tin", "cn_tin", "co_nit", "cr_tin", "de_stn", "do_rcn", "ec_ruc", "eg_tin", "es_cif", "eu_oss_vat", "eu_vat", "gb_vat", "ge_vat", "hk_br", "hu_tin", "id_npwp", "il_vat", "in_gst", "is_vat", "jp_cn", "jp_rn", "jp_trn", "ke_pin", "kr_brn", "kz_bin", "li_uid", "mx_rfc", "my_frp", "my_itn", "my_sst", "ng_tin", "no_vat", "no_voec", "nz_gst", "om_vat", "pe_ruc", "ph_tin", "ro_tin", "rs_pib", "ru_inn", "ru_kpp", "sa_vat", "sg_gst", "sg_uen", "si_tin", "sv_nit", "th_vat", "tr_tin", "tw_vat", "ua_vat", "us_ein", "uy_ruc", "ve_rif", "vn_tin", "za_vat", ] """ Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ Value of the tax ID. """ class CreateSourceParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ source: str """ Please refer to full [documentation](https://stripe.com/docs/api) instead. """ validate: NotRequired[bool] class CreateTaxIdParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ type: Literal[ "ad_nrt", "ae_trn", "ar_cuit", "au_abn", "au_arn", "bg_uic", "bh_vat", "bo_tin", "br_cnpj", "br_cpf", "ca_bn", "ca_gst_hst", "ca_pst_bc", "ca_pst_mb", "ca_pst_sk", "ca_qst", "ch_uid", "ch_vat", "cl_tin", "cn_tin", "co_nit", "cr_tin", "de_stn", "do_rcn", "ec_ruc", "eg_tin", "es_cif", "eu_oss_vat", "eu_vat", "gb_vat", "ge_vat", "hk_br", "hu_tin", "id_npwp", "il_vat", "in_gst", "is_vat", "jp_cn", "jp_rn", "jp_trn", "ke_pin", "kr_brn", "kz_bin", "li_uid", "mx_rfc", "my_frp", "my_itn", "my_sst", "ng_tin", "no_vat", "no_voec", "nz_gst", "om_vat", "pe_ruc", "ph_tin", "ro_tin", "rs_pib", "ru_inn", "ru_kpp", "sa_vat", "sg_gst", "sg_uen", "si_tin", "sv_nit", "th_vat", "tr_tin", "tw_vat", "ua_vat", "us_ein", "uy_ruc", "ve_rif", "vn_tin", "za_vat", ] """ Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ Value of the tax ID. """ class DeleteDiscountParams(RequestOptions): pass class DeleteParams(RequestOptions): pass class DeleteSourceParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class DeleteTaxIdParams(RequestOptions): pass class FundCashBalanceParams(RequestOptions): amount: int """ Amount to be used for this test cash balance transaction. A positive integer representing how much to fund in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to fund $1.00 or 100 to fund ¥100, 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). """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ reference: NotRequired[str] """ A description of the test funding. This simulates free-text references supplied by customers when making bank transfers to their cash balance. You can use this to test how Stripe's [reconciliation algorithm](https://stripe.com/docs/payments/customer-balance/reconciliation) applies to different user inputs. """ class ListBalanceTransactionsParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListCashBalanceTransactionsParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParams(RequestOptions): created: NotRequired["Customer.ListParamsCreated|int"] """ Only return customers that were created during the given date interval. """ email: NotRequired[str] """ A case-sensitive filter on the list based on the customer's `email` field. The value must be a string. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ test_clock: NotRequired[str] """ Provides a list of customers that are associated with the specified test clock. The response will not include customers with test clocks if this parameter is not set. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListPaymentMethodsParams(RequestOptions): allow_redisplay: NotRequired[ Literal["always", "limited", "unspecified"] ] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ type: NotRequired[ Literal[ "acss_debit", "affirm", "afterpay_clearpay", "alipay", "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", "blik", "boleto", "card", "cashapp", "customer_balance", "eps", "fpx", "giropay", "grabpay", "ideal", "klarna", "konbini", "link", "mobilepay", "multibanco", "oxxo", "p24", "paynow", "paypal", "pix", "promptpay", "revolut_pay", "sepa_debit", "sofort", "swish", "twint", "us_bank_account", "wechat_pay", "zip", ] ] """ An optional filter on the list, based on the object `type` field. Without the filter, the list includes all current and future payment method types. If your integration expects only one type of payment method in the response, make sure to provide a type value in the request. """ class ListSourcesParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ object: NotRequired[str] """ Filter sources according to a particular object type. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListTaxIdsParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ModifyBalanceTransactionParams(RequestOptions): description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ class ModifyCashBalanceParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ settings: NotRequired["Customer.ModifyCashBalanceParamsSettings"] """ A hash of settings for this cash balance. """ class ModifyCashBalanceParamsSettings(TypedDict): reconciliation_mode: NotRequired[ Literal["automatic", "manual", "merchant_default"] ] """ Controls how funds transferred by the customer are applied to payment intents and invoices. Valid options are `automatic`, `manual`, or `merchant_default`. For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation). """ class ModifyParams(RequestOptions): address: NotRequired["Literal['']|Customer.ModifyParamsAddress"] """ The customer's address. """ balance: NotRequired[int] """ An integer amount in cents (or local equivalent) that represents the customer's current balance, which affect the customer's future invoices. A negative amount represents a credit that decreases the amount due on an invoice; a positive amount increases the amount due on an invoice. """ cash_balance: NotRequired["Customer.ModifyParamsCashBalance"] """ Balance information and default balance settings for this customer. """ coupon: NotRequired[str] default_source: NotRequired[str] """ If you are using payment methods created via the PaymentMethods API, see the [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method) parameter. Provide the ID of a payment source already attached to this customer to make it this customer's default payment source. If you want to add a new payment source and make it the default, see the [source](https://stripe.com/docs/api/customers/update#update_customer-source) property. """ description: NotRequired[str] """ An arbitrary string that you can attach to a customer object. It is displayed alongside the customer in the dashboard. """ email: NotRequired[str] """ Customer's email address. It's displayed alongside the customer in your dashboard and can be useful for searching and tracking. This may be up to *512 characters*. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ invoice_prefix: NotRequired[str] """ The prefix for the customer used to generate unique invoice numbers. Must be 3–12 uppercase letters or numbers. """ invoice_settings: NotRequired["Customer.ModifyParamsInvoiceSettings"] """ Default invoice settings for this customer. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ name: NotRequired[str] """ The customer's full name or business name. """ next_invoice_sequence: NotRequired[int] """ The sequence to be used on the customer's next invoice. Defaults to 1. """ phone: NotRequired[str] """ The customer's phone number. """ preferred_locales: NotRequired[List[str]] """ Customer's preferred languages, ordered by preference. """ promotion_code: NotRequired[str] """ The ID of a promotion code to apply to the customer. The customer will have a discount applied on all recurring payments. Charges you create through the API will not have the discount. """ shipping: NotRequired["Literal['']|Customer.ModifyParamsShipping"] """ The customer's shipping information. Appears on invoices emailed to this customer. """ source: NotRequired[str] tax: NotRequired["Customer.ModifyParamsTax"] """ Tax details about the customer. """ tax_exempt: NotRequired[ "Literal['']|Literal['exempt', 'none', 'reverse']" ] """ The customer's tax exemption. One of `none`, `exempt`, or `reverse`. """ validate: NotRequired[bool] class ModifyParamsAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class ModifyParamsCashBalance(TypedDict): settings: NotRequired["Customer.ModifyParamsCashBalanceSettings"] """ Settings controlling the behavior of the customer's cash balance, such as reconciliation of funds received. """ class ModifyParamsCashBalanceSettings(TypedDict): reconciliation_mode: NotRequired[ Literal["automatic", "manual", "merchant_default"] ] """ Controls how funds transferred by the customer are applied to payment intents and invoices. Valid options are `automatic`, `manual`, or `merchant_default`. For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation). """ class ModifyParamsInvoiceSettings(TypedDict): custom_fields: NotRequired[ "Literal['']|List[Customer.ModifyParamsInvoiceSettingsCustomField]" ] """ The list of up to 4 default custom fields to be displayed on invoices for this customer. When updating, pass an empty string to remove previously-defined fields. """ default_payment_method: NotRequired[str] """ ID of a payment method that's attached to the customer, to be used as the customer's default payment method for subscriptions and invoices. """ footer: NotRequired[str] """ Default footer to be displayed on invoices for this customer. """ rendering_options: NotRequired[ "Literal['']|Customer.ModifyParamsInvoiceSettingsRenderingOptions" ] """ Default options for invoice PDF rendering for this customer. """ class ModifyParamsInvoiceSettingsCustomField(TypedDict): name: str """ The name of the custom field. This may be up to 40 characters. """ value: str """ The value of the custom field. This may be up to 140 characters. """ class ModifyParamsInvoiceSettingsRenderingOptions(TypedDict): amount_tax_display: NotRequired[ "Literal['']|Literal['exclude_tax', 'include_inclusive_tax']" ] """ How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. """ class ModifyParamsShipping(TypedDict): address: "Customer.ModifyParamsShippingAddress" """ Customer shipping address. """ name: str """ Customer name. """ phone: NotRequired[str] """ Customer phone (including extension). """ class ModifyParamsShippingAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class ModifyParamsTax(TypedDict): ip_address: NotRequired["Literal['']|str"] """ A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. """ validate_location: NotRequired[Literal["deferred", "immediately"]] """ A flag that indicates when Stripe should validate the customer tax location. Defaults to `deferred`. """ class ModifySourceParams(RequestOptions): account_holder_name: NotRequired[str] """ The name of the person or business that owns the bank account. """ account_holder_type: NotRequired[Literal["company", "individual"]] """ The type of entity that holds the account. This can be either `individual` or `company`. """ address_city: NotRequired[str] """ City/District/Suburb/Town/Village. """ address_country: NotRequired[str] """ Billing address country, if provided when creating card. """ address_line1: NotRequired[str] """ Address line 1 (Street address/PO Box/Company name). """ address_line2: NotRequired[str] """ Address line 2 (Apartment/Suite/Unit/Building). """ address_state: NotRequired[str] """ State/County/Province/Region. """ address_zip: NotRequired[str] """ ZIP or postal code. """ exp_month: NotRequired[str] """ Two digit number representing the card's expiration month. """ exp_year: NotRequired[str] """ Four digit number representing the card's expiration year. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ name: NotRequired[str] """ Cardholder name. """ owner: NotRequired["Customer.ModifySourceParamsOwner"] class ModifySourceParamsOwner(TypedDict): address: NotRequired["Customer.ModifySourceParamsOwnerAddress"] """ Owner's address. """ email: NotRequired[str] """ Owner's email address. """ name: NotRequired[str] """ Owner's full name. """ phone: NotRequired[str] """ Owner's phone number. """ class ModifySourceParamsOwnerAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class RetrieveBalanceTransactionParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveCashBalanceParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveCashBalanceTransactionParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrievePaymentMethodParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveSourceParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveTaxIdParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class SearchParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ page: NotRequired[str] """ A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. """ query: str """ The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for customers](https://stripe.com/docs/search#query-fields-for-customers). """ address: Optional[Address] """ The customer's address. """ balance: Optional[int] """ The current balance, if any, that's stored on the customer. If negative, the customer has credit to apply to their next invoice. If positive, the customer has an amount owed that's added to their next invoice. The balance only considers amounts that Stripe hasn't successfully applied to any invoice. It doesn't reflect unpaid invoices. This balance is only taken into account after invoices finalize. """ cash_balance: Optional["CashBalance"] """ The current funds being held by Stripe on behalf of the customer. You can apply these funds towards payment intents when the source is "cash_balance". The `settings[reconciliation_mode]` field describes if these funds apply to these payment intents manually or automatically. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ currency: Optional[str] """ Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) the customer can be charged in for recurring billing purposes. """ default_source: Optional[ ExpandableField[Union["Account", "BankAccount", "Card", "Source"]] ] """ ID of the default payment source for the customer. If you use payment methods created through the PaymentMethods API, see the [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) field instead. """ delinquent: Optional[bool] """ Tracks the most recent state change on any invoice belonging to the customer. Paying an invoice or marking it uncollectible via the API will set this field to false. An automatic payment failure or passing the `invoice.due_date` will set this field to `true`. If an invoice becomes uncollectible by [dunning](https://stripe.com/docs/billing/automatic-collection), `delinquent` doesn't reset to `false`. If you care whether the customer has paid their most recent subscription invoice, use `subscription.status` instead. Paying or marking uncollectible any customer invoice regardless of whether it is the latest invoice for a subscription will always set this field to `false`. """ description: Optional[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ discount: Optional["Discount"] """ Describes the current discount active on the customer, if there is one. """ email: Optional[str] """ The customer's email address. """ id: str """ Unique identifier for the object. """ invoice_credit_balance: Optional[Dict[str, int]] """ The current multi-currency balances, if any, that's stored on the customer. If positive in a currency, the customer has a credit to apply to their next invoice denominated in that currency. If negative, the customer has an amount owed that's added to their next invoice denominated in that currency. These balances don't apply to unpaid invoices. They solely track amounts that Stripe hasn't successfully applied to any invoice. Stripe only applies a balance in a specific currency to an invoice after that invoice (which is in the same currency) finalizes. """ invoice_prefix: Optional[str] """ The prefix for the customer used to generate unique invoice numbers. """ invoice_settings: Optional[InvoiceSettings] livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ metadata: Optional[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ name: Optional[str] """ The customer's full name or business name. """ next_invoice_sequence: Optional[int] """ The suffix of the customer's next invoice number (for example, 0001). """ object: Literal["customer"] """ String representing the object's type. Objects of the same type share the same value. """ phone: Optional[str] """ The customer's phone number. """ preferred_locales: Optional[List[str]] """ The customer's preferred locales (languages), ordered by preference. """ shipping: Optional[Shipping] """ Mailing and shipping address for the customer. Appears on invoices emailed to this customer. """ sources: Optional[ ListObject[Union["Account", "BankAccount", "Card", "Source"]] ] """ The customer's payment sources, if any. """ subscriptions: Optional[ListObject["Subscription"]] """ The customer's current subscriptions, if any. """ tax: Optional[Tax] tax_exempt: Optional[Literal["exempt", "none", "reverse"]] """ Describes the customer's tax exemption status, which is `none`, `exempt`, or `reverse`. When set to `reverse`, invoice and receipt PDFs include the following text: **"Reverse charge"**. """ tax_ids: Optional[ListObject["TaxId"]] """ The customer's tax IDs. """ test_clock: Optional[ExpandableField["TestClock"]] """ ID of the test clock that this customer belongs to. """ deleted: Optional[Literal[True]] """ Always true for a deleted object """ @classmethod def create(cls, **params: Unpack["Customer.CreateParams"]) -> "Customer": """ Creates a new customer object. """ return cast( "Customer", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["Customer.CreateParams"] ) -> "Customer": """ Creates a new customer object. """ return cast( "Customer", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def _cls_create_funding_instructions( cls, customer: str, **params: Unpack["Customer.CreateFundingInstructionsParams"], ) -> "FundingInstructions": """ Retrieve funding instructions for a customer cash balance. If funding instructions do not yet exist for the customer, new funding instructions will be created. If funding instructions have already been created for a given customer, the same funding instructions will be retrieved. In other words, we will return the same funding instructions each time. """ return cast( "FundingInstructions", cls._static_request( "post", "/v1/customers/{customer}/funding_instructions".format( customer=sanitize_id(customer) ), params=params, ), ) @overload @staticmethod def create_funding_instructions( customer: str, **params: Unpack["Customer.CreateFundingInstructionsParams"], ) -> "FundingInstructions": """ Retrieve funding instructions for a customer cash balance. If funding instructions do not yet exist for the customer, new funding instructions will be created. If funding instructions have already been created for a given customer, the same funding instructions will be retrieved. In other words, we will return the same funding instructions each time. """ ... @overload def create_funding_instructions( self, **params: Unpack["Customer.CreateFundingInstructionsParams"] ) -> "FundingInstructions": """ Retrieve funding instructions for a customer cash balance. If funding instructions do not yet exist for the customer, new funding instructions will be created. If funding instructions have already been created for a given customer, the same funding instructions will be retrieved. In other words, we will return the same funding instructions each time. """ ... @class_method_variant("_cls_create_funding_instructions") def create_funding_instructions( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Customer.CreateFundingInstructionsParams"] ) -> "FundingInstructions": """ Retrieve funding instructions for a customer cash balance. If funding instructions do not yet exist for the customer, new funding instructions will be created. If funding instructions have already been created for a given customer, the same funding instructions will be retrieved. In other words, we will return the same funding instructions each time. """ return cast( "FundingInstructions", self._request( "post", "/v1/customers/{customer}/funding_instructions".format( customer=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_create_funding_instructions_async( cls, customer: str, **params: Unpack["Customer.CreateFundingInstructionsParams"], ) -> "FundingInstructions": """ Retrieve funding instructions for a customer cash balance. If funding instructions do not yet exist for the customer, new funding instructions will be created. If funding instructions have already been created for a given customer, the same funding instructions will be retrieved. In other words, we will return the same funding instructions each time. """ return cast( "FundingInstructions", await cls._static_request_async( "post", "/v1/customers/{customer}/funding_instructions".format( customer=sanitize_id(customer) ), params=params, ), ) @overload @staticmethod async def create_funding_instructions_async( customer: str, **params: Unpack["Customer.CreateFundingInstructionsParams"], ) -> "FundingInstructions": """ Retrieve funding instructions for a customer cash balance. If funding instructions do not yet exist for the customer, new funding instructions will be created. If funding instructions have already been created for a given customer, the same funding instructions will be retrieved. In other words, we will return the same funding instructions each time. """ ... @overload async def create_funding_instructions_async( self, **params: Unpack["Customer.CreateFundingInstructionsParams"] ) -> "FundingInstructions": """ Retrieve funding instructions for a customer cash balance. If funding instructions do not yet exist for the customer, new funding instructions will be created. If funding instructions have already been created for a given customer, the same funding instructions will be retrieved. In other words, we will return the same funding instructions each time. """ ... @class_method_variant("_cls_create_funding_instructions_async") async def create_funding_instructions_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Customer.CreateFundingInstructionsParams"] ) -> "FundingInstructions": """ Retrieve funding instructions for a customer cash balance. If funding instructions do not yet exist for the customer, new funding instructions will be created. If funding instructions have already been created for a given customer, the same funding instructions will be retrieved. In other words, we will return the same funding instructions each time. """ return cast( "FundingInstructions", await self._request_async( "post", "/v1/customers/{customer}/funding_instructions".format( customer=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def _cls_delete( cls, sid: str, **params: Unpack["Customer.DeleteParams"] ) -> "Customer": """ Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer. """ url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "Customer", cls._static_request( "delete", url, params=params, ), ) @overload @staticmethod def delete( sid: str, **params: Unpack["Customer.DeleteParams"] ) -> "Customer": """ Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer. """ ... @overload def delete(self, **params: Unpack["Customer.DeleteParams"]) -> "Customer": """ Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer. """ ... @class_method_variant("_cls_delete") def delete( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Customer.DeleteParams"] ) -> "Customer": """ Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer. """ return self._request_and_refresh( "delete", self.instance_url(), params=params, ) @classmethod async def _cls_delete_async( cls, sid: str, **params: Unpack["Customer.DeleteParams"] ) -> "Customer": """ Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer. """ url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "Customer", await cls._static_request_async( "delete", url, params=params, ), ) @overload @staticmethod async def delete_async( sid: str, **params: Unpack["Customer.DeleteParams"] ) -> "Customer": """ Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer. """ ... @overload async def delete_async( self, **params: Unpack["Customer.DeleteParams"] ) -> "Customer": """ Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer. """ ... @class_method_variant("_cls_delete_async") async def delete_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Customer.DeleteParams"] ) -> "Customer": """ Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer. """ return await self._request_and_refresh_async( "delete", self.instance_url(), params=params, ) @classmethod def _cls_delete_discount( cls, customer: str, **params: Unpack["Customer.DeleteDiscountParams"] ) -> "Discount": """ Removes the currently applied discount on a customer. """ return cast( "Discount", cls._static_request( "delete", "/v1/customers/{customer}/discount".format( customer=sanitize_id(customer) ), params=params, ), ) @overload @staticmethod def delete_discount( customer: str, **params: Unpack["Customer.DeleteDiscountParams"] ) -> "Discount": """ Removes the currently applied discount on a customer. """ ... @overload def delete_discount( self, **params: Unpack["Customer.DeleteDiscountParams"] ) -> "Discount": """ Removes the currently applied discount on a customer. """ ... @class_method_variant("_cls_delete_discount") def delete_discount( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Customer.DeleteDiscountParams"] ) -> "Discount": """ Removes the currently applied discount on a customer. """ return cast( "Discount", self._request( "delete", "/v1/customers/{customer}/discount".format( customer=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_delete_discount_async( cls, customer: str, **params: Unpack["Customer.DeleteDiscountParams"] ) -> "Discount": """ Removes the currently applied discount on a customer. """ return cast( "Discount", await cls._static_request_async( "delete", "/v1/customers/{customer}/discount".format( customer=sanitize_id(customer) ), params=params, ), ) @overload @staticmethod async def delete_discount_async( customer: str, **params: Unpack["Customer.DeleteDiscountParams"] ) -> "Discount": """ Removes the currently applied discount on a customer. """ ... @overload async def delete_discount_async( self, **params: Unpack["Customer.DeleteDiscountParams"] ) -> "Discount": """ Removes the currently applied discount on a customer. """ ... @class_method_variant("_cls_delete_discount_async") async def delete_discount_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Customer.DeleteDiscountParams"] ) -> "Discount": """ Removes the currently applied discount on a customer. """ return cast( "Discount", await self._request_async( "delete", "/v1/customers/{customer}/discount".format( customer=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def list( cls, **params: Unpack["Customer.ListParams"] ) -> ListObject["Customer"]: """ Returns a list of your customers. The customers are returned sorted by creation date, with the most recent customers appearing first. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["Customer.ListParams"] ) -> ListObject["Customer"]: """ Returns a list of your customers. The customers are returned sorted by creation date, with the most recent customers appearing first. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def _cls_list_payment_methods( cls, customer: str, **params: Unpack["Customer.ListPaymentMethodsParams"], ) -> ListObject["PaymentMethod"]: """ Returns a list of PaymentMethods for a given Customer """ return cast( ListObject["PaymentMethod"], cls._static_request( "get", "/v1/customers/{customer}/payment_methods".format( customer=sanitize_id(customer) ), params=params, ), ) @overload @staticmethod def list_payment_methods( customer: str, **params: Unpack["Customer.ListPaymentMethodsParams"] ) -> ListObject["PaymentMethod"]: """ Returns a list of PaymentMethods for a given Customer """ ... @overload def list_payment_methods( self, **params: Unpack["Customer.ListPaymentMethodsParams"] ) -> ListObject["PaymentMethod"]: """ Returns a list of PaymentMethods for a given Customer """ ... @class_method_variant("_cls_list_payment_methods") def list_payment_methods( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Customer.ListPaymentMethodsParams"] ) -> ListObject["PaymentMethod"]: """ Returns a list of PaymentMethods for a given Customer """ return cast( ListObject["PaymentMethod"], self._request( "get", "/v1/customers/{customer}/payment_methods".format( customer=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_list_payment_methods_async( cls, customer: str, **params: Unpack["Customer.ListPaymentMethodsParams"], ) -> ListObject["PaymentMethod"]: """ Returns a list of PaymentMethods for a given Customer """ return cast( ListObject["PaymentMethod"], await cls._static_request_async( "get", "/v1/customers/{customer}/payment_methods".format( customer=sanitize_id(customer) ), params=params, ), ) @overload @staticmethod async def list_payment_methods_async( customer: str, **params: Unpack["Customer.ListPaymentMethodsParams"] ) -> ListObject["PaymentMethod"]: """ Returns a list of PaymentMethods for a given Customer """ ... @overload async def list_payment_methods_async( self, **params: Unpack["Customer.ListPaymentMethodsParams"] ) -> ListObject["PaymentMethod"]: """ Returns a list of PaymentMethods for a given Customer """ ... @class_method_variant("_cls_list_payment_methods_async") async def list_payment_methods_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Customer.ListPaymentMethodsParams"] ) -> ListObject["PaymentMethod"]: """ Returns a list of PaymentMethods for a given Customer """ return cast( ListObject["PaymentMethod"], await self._request_async( "get", "/v1/customers/{customer}/payment_methods".format( customer=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def modify( cls, id: str, **params: Unpack["Customer.ModifyParams"] ) -> "Customer": """ Updates the specified customer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. For example, if you pass the source parameter, that becomes the customer's active source (e.g., a card) to be used for all charges in the future. When you update a customer to a new valid card source by passing the source parameter: for each of the customer's current subscriptions, if the subscription bills automatically and is in the past_due state, then the latest open invoice for the subscription with automatic collection enabled will be retried. This retry will not count as an automatic retry, and will not affect the next regularly scheduled payment for the invoice. Changing the default_source for a customer will not trigger this behavior. This request accepts mostly the same arguments as the customer creation call. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Customer", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["Customer.ModifyParams"] ) -> "Customer": """ Updates the specified customer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. For example, if you pass the source parameter, that becomes the customer's active source (e.g., a card) to be used for all charges in the future. When you update a customer to a new valid card source by passing the source parameter: for each of the customer's current subscriptions, if the subscription bills automatically and is in the past_due state, then the latest open invoice for the subscription with automatic collection enabled will be retried. This retry will not count as an automatic retry, and will not affect the next regularly scheduled payment for the invoice. Changing the default_source for a customer will not trigger this behavior. This request accepts mostly the same arguments as the customer creation call. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Customer", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["Customer.RetrieveParams"] ) -> "Customer": """ Retrieves a Customer object. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["Customer.RetrieveParams"] ) -> "Customer": """ Retrieves a Customer object. """ instance = cls(id, **params) await instance.refresh_async() return instance @classmethod def _cls_retrieve_payment_method( cls, customer: str, payment_method: str, **params: Unpack["Customer.RetrievePaymentMethodParams"], ) -> "PaymentMethod": """ Retrieves a PaymentMethod object for a given Customer. """ return cast( "PaymentMethod", cls._static_request( "get", "/v1/customers/{customer}/payment_methods/{payment_method}".format( customer=sanitize_id(customer), payment_method=sanitize_id(payment_method), ), params=params, ), ) @overload @staticmethod def retrieve_payment_method( customer: str, payment_method: str, **params: Unpack["Customer.RetrievePaymentMethodParams"], ) -> "PaymentMethod": """ Retrieves a PaymentMethod object for a given Customer. """ ... @overload def retrieve_payment_method( self, payment_method: str, **params: Unpack["Customer.RetrievePaymentMethodParams"], ) -> "PaymentMethod": """ Retrieves a PaymentMethod object for a given Customer. """ ... @class_method_variant("_cls_retrieve_payment_method") def retrieve_payment_method( # pyright: ignore[reportGeneralTypeIssues] self, payment_method: str, **params: Unpack["Customer.RetrievePaymentMethodParams"], ) -> "PaymentMethod": """ Retrieves a PaymentMethod object for a given Customer. """ return cast( "PaymentMethod", self._request( "get", "/v1/customers/{customer}/payment_methods/{payment_method}".format( customer=sanitize_id(self.get("id")), payment_method=sanitize_id(payment_method), ), params=params, ), ) @classmethod async def _cls_retrieve_payment_method_async( cls, customer: str, payment_method: str, **params: Unpack["Customer.RetrievePaymentMethodParams"], ) -> "PaymentMethod": """ Retrieves a PaymentMethod object for a given Customer. """ return cast( "PaymentMethod", await cls._static_request_async( "get", "/v1/customers/{customer}/payment_methods/{payment_method}".format( customer=sanitize_id(customer), payment_method=sanitize_id(payment_method), ), params=params, ), ) @overload @staticmethod async def retrieve_payment_method_async( customer: str, payment_method: str, **params: Unpack["Customer.RetrievePaymentMethodParams"], ) -> "PaymentMethod": """ Retrieves a PaymentMethod object for a given Customer. """ ... @overload async def retrieve_payment_method_async( self, payment_method: str, **params: Unpack["Customer.RetrievePaymentMethodParams"], ) -> "PaymentMethod": """ Retrieves a PaymentMethod object for a given Customer. """ ... @class_method_variant("_cls_retrieve_payment_method_async") async def retrieve_payment_method_async( # pyright: ignore[reportGeneralTypeIssues] self, payment_method: str, **params: Unpack["Customer.RetrievePaymentMethodParams"], ) -> "PaymentMethod": """ Retrieves a PaymentMethod object for a given Customer. """ return cast( "PaymentMethod", await self._request_async( "get", "/v1/customers/{customer}/payment_methods/{payment_method}".format( customer=sanitize_id(self.get("id")), payment_method=sanitize_id(payment_method), ), params=params, ), ) @classmethod def search( cls, *args, **kwargs: Unpack["Customer.SearchParams"] ) -> SearchResultObject["Customer"]: """ Search for customers you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India. """ return cls._search(search_url="/v1/customers/search", *args, **kwargs) @classmethod async def search_async( cls, *args, **kwargs: Unpack["Customer.SearchParams"] ) -> SearchResultObject["Customer"]: """ Search for customers you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India. """ return await cls._search_async( search_url="/v1/customers/search", *args, **kwargs ) @classmethod def search_auto_paging_iter( cls, *args, **kwargs: Unpack["Customer.SearchParams"] ) -> Iterator["Customer"]: return cls.search(*args, **kwargs).auto_paging_iter() @classmethod async def search_auto_paging_iter_async( cls, *args, **kwargs: Unpack["Customer.SearchParams"] ) -> AsyncIterator["Customer"]: return (await cls.search_async(*args, **kwargs)).auto_paging_iter() @classmethod def create_balance_transaction( cls, customer: str, **params: Unpack["Customer.CreateBalanceTransactionParams"], ) -> "CustomerBalanceTransaction": """ Creates an immutable transaction that updates the customer's credit [balance](https://stripe.com/docs/billing/customer/balance). """ return cast( "CustomerBalanceTransaction", cls._static_request( "post", "/v1/customers/{customer}/balance_transactions".format( customer=sanitize_id(customer) ), params=params, ), ) @classmethod async def create_balance_transaction_async( cls, customer: str, **params: Unpack["Customer.CreateBalanceTransactionParams"], ) -> "CustomerBalanceTransaction": """ Creates an immutable transaction that updates the customer's credit [balance](https://stripe.com/docs/billing/customer/balance). """ return cast( "CustomerBalanceTransaction", await cls._static_request_async( "post", "/v1/customers/{customer}/balance_transactions".format( customer=sanitize_id(customer) ), params=params, ), ) @classmethod def retrieve_balance_transaction( cls, customer: str, transaction: str, **params: Unpack["Customer.RetrieveBalanceTransactionParams"], ) -> "CustomerBalanceTransaction": """ Retrieves a specific customer balance transaction that updated the customer's [balances](https://stripe.com/docs/billing/customer/balance). """ return cast( "CustomerBalanceTransaction", cls._static_request( "get", "/v1/customers/{customer}/balance_transactions/{transaction}".format( customer=sanitize_id(customer), transaction=sanitize_id(transaction), ), params=params, ), ) @classmethod async def retrieve_balance_transaction_async( cls, customer: str, transaction: str, **params: Unpack["Customer.RetrieveBalanceTransactionParams"], ) -> "CustomerBalanceTransaction": """ Retrieves a specific customer balance transaction that updated the customer's [balances](https://stripe.com/docs/billing/customer/balance). """ return cast( "CustomerBalanceTransaction", await cls._static_request_async( "get", "/v1/customers/{customer}/balance_transactions/{transaction}".format( customer=sanitize_id(customer), transaction=sanitize_id(transaction), ), params=params, ), ) @classmethod def modify_balance_transaction( cls, customer: str, transaction: str, **params: Unpack["Customer.ModifyBalanceTransactionParams"], ) -> "CustomerBalanceTransaction": """ Most credit balance transaction fields are immutable, but you may update its description and metadata. """ return cast( "CustomerBalanceTransaction", cls._static_request( "post", "/v1/customers/{customer}/balance_transactions/{transaction}".format( customer=sanitize_id(customer), transaction=sanitize_id(transaction), ), params=params, ), ) @classmethod async def modify_balance_transaction_async( cls, customer: str, transaction: str, **params: Unpack["Customer.ModifyBalanceTransactionParams"], ) -> "CustomerBalanceTransaction": """ Most credit balance transaction fields are immutable, but you may update its description and metadata. """ return cast( "CustomerBalanceTransaction", await cls._static_request_async( "post", "/v1/customers/{customer}/balance_transactions/{transaction}".format( customer=sanitize_id(customer), transaction=sanitize_id(transaction), ), params=params, ), ) @classmethod def list_balance_transactions( cls, customer: str, **params: Unpack["Customer.ListBalanceTransactionsParams"], ) -> ListObject["CustomerBalanceTransaction"]: """ Returns a list of transactions that updated the customer's [balances](https://stripe.com/docs/billing/customer/balance). """ return cast( ListObject["CustomerBalanceTransaction"], cls._static_request( "get", "/v1/customers/{customer}/balance_transactions".format( customer=sanitize_id(customer) ), params=params, ), ) @classmethod async def list_balance_transactions_async( cls, customer: str, **params: Unpack["Customer.ListBalanceTransactionsParams"], ) -> ListObject["CustomerBalanceTransaction"]: """ Returns a list of transactions that updated the customer's [balances](https://stripe.com/docs/billing/customer/balance). """ return cast( ListObject["CustomerBalanceTransaction"], await cls._static_request_async( "get", "/v1/customers/{customer}/balance_transactions".format( customer=sanitize_id(customer) ), params=params, ), ) @classmethod def retrieve_cash_balance_transaction( cls, customer: str, transaction: str, **params: Unpack["Customer.RetrieveCashBalanceTransactionParams"], ) -> "CustomerCashBalanceTransaction": """ Retrieves a specific cash balance transaction, which updated the customer's [cash balance](https://stripe.com/docs/payments/customer-balance). """ return cast( "CustomerCashBalanceTransaction", cls._static_request( "get", "/v1/customers/{customer}/cash_balance_transactions/{transaction}".format( customer=sanitize_id(customer), transaction=sanitize_id(transaction), ), params=params, ), ) @classmethod async def retrieve_cash_balance_transaction_async( cls, customer: str, transaction: str, **params: Unpack["Customer.RetrieveCashBalanceTransactionParams"], ) -> "CustomerCashBalanceTransaction": """ Retrieves a specific cash balance transaction, which updated the customer's [cash balance](https://stripe.com/docs/payments/customer-balance). """ return cast( "CustomerCashBalanceTransaction", await cls._static_request_async( "get", "/v1/customers/{customer}/cash_balance_transactions/{transaction}".format( customer=sanitize_id(customer), transaction=sanitize_id(transaction), ), params=params, ), ) @classmethod def list_cash_balance_transactions( cls, customer: str, **params: Unpack["Customer.ListCashBalanceTransactionsParams"], ) -> ListObject["CustomerCashBalanceTransaction"]: """ Returns a list of transactions that modified the customer's [cash balance](https://stripe.com/docs/payments/customer-balance). """ return cast( ListObject["CustomerCashBalanceTransaction"], cls._static_request( "get", "/v1/customers/{customer}/cash_balance_transactions".format( customer=sanitize_id(customer) ), params=params, ), ) @classmethod async def list_cash_balance_transactions_async( cls, customer: str, **params: Unpack["Customer.ListCashBalanceTransactionsParams"], ) -> ListObject["CustomerCashBalanceTransaction"]: """ Returns a list of transactions that modified the customer's [cash balance](https://stripe.com/docs/payments/customer-balance). """ return cast( ListObject["CustomerCashBalanceTransaction"], await cls._static_request_async( "get", "/v1/customers/{customer}/cash_balance_transactions".format( customer=sanitize_id(customer) ), params=params, ), ) @classmethod def create_source( cls, customer: str, **params: Unpack["Customer.CreateSourceParams"] ) -> Union["Account", "BankAccount", "Card", "Source"]: """ When you create a new credit card, you must specify a customer or recipient on which to create it. If the card's owner has no default card, then the new card will become the default. However, if the owner already has a default, then it will not change. To change the default, you should [update the customer](https://stripe.com/docs/api#update_customer) to have a new default_source. """ return cast( Union["Account", "BankAccount", "Card", "Source"], cls._static_request( "post", "/v1/customers/{customer}/sources".format( customer=sanitize_id(customer) ), params=params, ), ) @classmethod async def create_source_async( cls, customer: str, **params: Unpack["Customer.CreateSourceParams"] ) -> Union["Account", "BankAccount", "Card", "Source"]: """ When you create a new credit card, you must specify a customer or recipient on which to create it. If the card's owner has no default card, then the new card will become the default. However, if the owner already has a default, then it will not change. To change the default, you should [update the customer](https://stripe.com/docs/api#update_customer) to have a new default_source. """ return cast( Union["Account", "BankAccount", "Card", "Source"], await cls._static_request_async( "post", "/v1/customers/{customer}/sources".format( customer=sanitize_id(customer) ), params=params, ), ) @classmethod def retrieve_source( cls, customer: str, id: str, **params: Unpack["Customer.RetrieveSourceParams"], ) -> Union["Account", "BankAccount", "Card", "Source"]: """ Retrieve a specified source for a given customer. """ return cast( Union["Account", "BankAccount", "Card", "Source"], cls._static_request( "get", "/v1/customers/{customer}/sources/{id}".format( customer=sanitize_id(customer), id=sanitize_id(id) ), params=params, ), ) @classmethod async def retrieve_source_async( cls, customer: str, id: str, **params: Unpack["Customer.RetrieveSourceParams"], ) -> Union["Account", "BankAccount", "Card", "Source"]: """ Retrieve a specified source for a given customer. """ return cast( Union["Account", "BankAccount", "Card", "Source"], await cls._static_request_async( "get", "/v1/customers/{customer}/sources/{id}".format( customer=sanitize_id(customer), id=sanitize_id(id) ), params=params, ), ) @classmethod def modify_source( cls, customer: str, id: str, **params: Unpack["Customer.ModifySourceParams"], ) -> Union["Account", "BankAccount", "Card", "Source"]: """ Update a specified source for a given customer. """ return cast( Union["Account", "BankAccount", "Card", "Source"], cls._static_request( "post", "/v1/customers/{customer}/sources/{id}".format( customer=sanitize_id(customer), id=sanitize_id(id) ), params=params, ), ) @classmethod async def modify_source_async( cls, customer: str, id: str, **params: Unpack["Customer.ModifySourceParams"], ) -> Union["Account", "BankAccount", "Card", "Source"]: """ Update a specified source for a given customer. """ return cast( Union["Account", "BankAccount", "Card", "Source"], await cls._static_request_async( "post", "/v1/customers/{customer}/sources/{id}".format( customer=sanitize_id(customer), id=sanitize_id(id) ), params=params, ), ) @classmethod def delete_source( cls, customer: str, id: str, **params: Unpack["Customer.DeleteSourceParams"], ) -> Union["Account", "BankAccount", "Card", "Source"]: """ Delete a specified source for a given customer. """ return cast( Union["Account", "BankAccount", "Card", "Source"], cls._static_request( "delete", "/v1/customers/{customer}/sources/{id}".format( customer=sanitize_id(customer), id=sanitize_id(id) ), params=params, ), ) @classmethod async def delete_source_async( cls, customer: str, id: str, **params: Unpack["Customer.DeleteSourceParams"], ) -> Union["Account", "BankAccount", "Card", "Source"]: """ Delete a specified source for a given customer. """ return cast( Union["Account", "BankAccount", "Card", "Source"], await cls._static_request_async( "delete", "/v1/customers/{customer}/sources/{id}".format( customer=sanitize_id(customer), id=sanitize_id(id) ), params=params, ), ) @classmethod def list_sources( cls, customer: str, **params: Unpack["Customer.ListSourcesParams"] ) -> ListObject[Union["Account", "BankAccount", "Card", "Source"]]: """ List sources for a specified customer. """ return cast( ListObject[Union["Account", "BankAccount", "Card", "Source"]], cls._static_request( "get", "/v1/customers/{customer}/sources".format( customer=sanitize_id(customer) ), params=params, ), ) @classmethod async def list_sources_async( cls, customer: str, **params: Unpack["Customer.ListSourcesParams"] ) -> ListObject[Union["Account", "BankAccount", "Card", "Source"]]: """ List sources for a specified customer. """ return cast( ListObject[Union["Account", "BankAccount", "Card", "Source"]], await cls._static_request_async( "get", "/v1/customers/{customer}/sources".format( customer=sanitize_id(customer) ), params=params, ), ) @classmethod def create_tax_id( cls, customer: str, **params: Unpack["Customer.CreateTaxIdParams"] ) -> "TaxId": """ Creates a new tax_id object for a customer. """ return cast( "TaxId", cls._static_request( "post", "/v1/customers/{customer}/tax_ids".format( customer=sanitize_id(customer) ), params=params, ), ) @classmethod async def create_tax_id_async( cls, customer: str, **params: Unpack["Customer.CreateTaxIdParams"] ) -> "TaxId": """ Creates a new tax_id object for a customer. """ return cast( "TaxId", await cls._static_request_async( "post", "/v1/customers/{customer}/tax_ids".format( customer=sanitize_id(customer) ), params=params, ), ) @classmethod def retrieve_tax_id( cls, customer: str, id: str, **params: Unpack["Customer.RetrieveTaxIdParams"], ) -> "TaxId": """ Retrieves the tax_id object with the given identifier. """ return cast( "TaxId", cls._static_request( "get", "/v1/customers/{customer}/tax_ids/{id}".format( customer=sanitize_id(customer), id=sanitize_id(id) ), params=params, ), ) @classmethod async def retrieve_tax_id_async( cls, customer: str, id: str, **params: Unpack["Customer.RetrieveTaxIdParams"], ) -> "TaxId": """ Retrieves the tax_id object with the given identifier. """ return cast( "TaxId", await cls._static_request_async( "get", "/v1/customers/{customer}/tax_ids/{id}".format( customer=sanitize_id(customer), id=sanitize_id(id) ), params=params, ), ) @classmethod def delete_tax_id( cls, customer: str, id: str, **params: Unpack["Customer.DeleteTaxIdParams"], ) -> "TaxId": """ Deletes an existing tax_id object. """ return cast( "TaxId", cls._static_request( "delete", "/v1/customers/{customer}/tax_ids/{id}".format( customer=sanitize_id(customer), id=sanitize_id(id) ), params=params, ), ) @classmethod async def delete_tax_id_async( cls, customer: str, id: str, **params: Unpack["Customer.DeleteTaxIdParams"], ) -> "TaxId": """ Deletes an existing tax_id object. """ return cast( "TaxId", await cls._static_request_async( "delete", "/v1/customers/{customer}/tax_ids/{id}".format( customer=sanitize_id(customer), id=sanitize_id(id) ), params=params, ), ) @classmethod def list_tax_ids( cls, customer: str, **params: Unpack["Customer.ListTaxIdsParams"] ) -> ListObject["TaxId"]: """ Returns a list of tax IDs for a customer. """ return cast( ListObject["TaxId"], cls._static_request( "get", "/v1/customers/{customer}/tax_ids".format( customer=sanitize_id(customer) ), params=params, ), ) @classmethod async def list_tax_ids_async( cls, customer: str, **params: Unpack["Customer.ListTaxIdsParams"] ) -> ListObject["TaxId"]: """ Returns a list of tax IDs for a customer. """ return cast( ListObject["TaxId"], await cls._static_request_async( "get", "/v1/customers/{customer}/tax_ids".format( customer=sanitize_id(customer) ), params=params, ), ) @classmethod def retrieve_cash_balance( cls, customer: str, **params: Unpack["Customer.RetrieveCashBalanceParams"], ) -> "CashBalance": """ Retrieves a customer's cash balance. """ return cast( "CashBalance", cls._static_request( "get", "/v1/customers/{customer}/cash_balance".format( customer=sanitize_id(customer) ), params=params, ), ) @classmethod async def retrieve_cash_balance_async( cls, customer: str, **params: Unpack["Customer.RetrieveCashBalanceParams"], ) -> "CashBalance": """ Retrieves a customer's cash balance. """ return cast( "CashBalance", await cls._static_request_async( "get", "/v1/customers/{customer}/cash_balance".format( customer=sanitize_id(customer) ), params=params, ), ) @classmethod def modify_cash_balance( cls, customer: str, **params: Unpack["Customer.ModifyCashBalanceParams"], ) -> "CashBalance": """ Changes the settings on a customer's cash balance. """ return cast( "CashBalance", cls._static_request( "post", "/v1/customers/{customer}/cash_balance".format( customer=sanitize_id(customer) ), params=params, ), ) @classmethod async def modify_cash_balance_async( cls, customer: str, **params: Unpack["Customer.ModifyCashBalanceParams"], ) -> "CashBalance": """ Changes the settings on a customer's cash balance. """ return cast( "CashBalance", await cls._static_request_async( "post", "/v1/customers/{customer}/cash_balance".format( customer=sanitize_id(customer) ), params=params, ), ) class TestHelpers(APIResourceTestHelpers["Customer"]): _resource_cls: Type["Customer"] @classmethod def _cls_fund_cash_balance( cls, customer: str, **params: Unpack["Customer.FundCashBalanceParams"], ) -> "CustomerCashBalanceTransaction": """ Create an incoming testmode bank transfer """ return cast( "CustomerCashBalanceTransaction", cls._static_request( "post", "/v1/test_helpers/customers/{customer}/fund_cash_balance".format( customer=sanitize_id(customer) ), params=params, ), ) @overload @staticmethod def fund_cash_balance( customer: str, **params: Unpack["Customer.FundCashBalanceParams"] ) -> "CustomerCashBalanceTransaction": """ Create an incoming testmode bank transfer """ ... @overload def fund_cash_balance( self, **params: Unpack["Customer.FundCashBalanceParams"] ) -> "CustomerCashBalanceTransaction": """ Create an incoming testmode bank transfer """ ... @class_method_variant("_cls_fund_cash_balance") def fund_cash_balance( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Customer.FundCashBalanceParams"] ) -> "CustomerCashBalanceTransaction": """ Create an incoming testmode bank transfer """ return cast( "CustomerCashBalanceTransaction", self.resource._request( "post", "/v1/test_helpers/customers/{customer}/fund_cash_balance".format( customer=sanitize_id(self.resource.get("id")) ), params=params, ), ) @classmethod async def _cls_fund_cash_balance_async( cls, customer: str, **params: Unpack["Customer.FundCashBalanceParams"], ) -> "CustomerCashBalanceTransaction": """ Create an incoming testmode bank transfer """ return cast( "CustomerCashBalanceTransaction", await cls._static_request_async( "post", "/v1/test_helpers/customers/{customer}/fund_cash_balance".format( customer=sanitize_id(customer) ), params=params, ), ) @overload @staticmethod async def fund_cash_balance_async( customer: str, **params: Unpack["Customer.FundCashBalanceParams"] ) -> "CustomerCashBalanceTransaction": """ Create an incoming testmode bank transfer """ ... @overload async def fund_cash_balance_async( self, **params: Unpack["Customer.FundCashBalanceParams"] ) -> "CustomerCashBalanceTransaction": """ Create an incoming testmode bank transfer """ ... @class_method_variant("_cls_fund_cash_balance_async") async def fund_cash_balance_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Customer.FundCashBalanceParams"] ) -> "CustomerCashBalanceTransaction": """ Create an incoming testmode bank transfer """ return cast( "CustomerCashBalanceTransaction", await self.resource._request_async( "post", "/v1/test_helpers/customers/{customer}/fund_cash_balance".format( customer=sanitize_id(self.resource.get("id")) ), params=params, ), ) @property def test_helpers(self): return self.TestHelpers(self) _inner_class_types = { "address": Address, "invoice_settings": InvoiceSettings, "shipping": Shipping, "tax": Tax, } Customer.TestHelpers._resource_cls = Customer ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_customer_balance_transaction.py0000644000175100001770000001046314637354563022462 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._api_resource import APIResource from stripe._customer import Customer from stripe._expandable_field import ExpandableField from stripe._util import sanitize_id from typing import ClassVar, Dict, Optional from typing_extensions import Literal, TYPE_CHECKING if TYPE_CHECKING: from stripe._credit_note import CreditNote from stripe._invoice import Invoice class CustomerBalanceTransaction(APIResource["CustomerBalanceTransaction"]): """ Each customer has a [Balance](https://stripe.com/docs/api/customers/object#customer_object-balance) value, which denotes a debit or credit that's automatically applied to their next invoice upon finalization. You may modify the value directly by using the [update customer API](https://stripe.com/docs/api/customers/update), or by creating a Customer Balance Transaction, which increments or decrements the customer's `balance` by the specified `amount`. Related guide: [Customer balance](https://stripe.com/docs/billing/customer/balance) """ OBJECT_NAME: ClassVar[Literal["customer_balance_transaction"]] = ( "customer_balance_transaction" ) amount: int """ The amount of the transaction. A negative value is a credit for the customer's balance, and a positive value is a debit to the customer's `balance`. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ credit_note: Optional[ExpandableField["CreditNote"]] """ The ID of the credit note (if any) related to the transaction. """ 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). """ customer: ExpandableField["Customer"] """ The ID of the customer the transaction belongs to. """ description: Optional[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ ending_balance: int """ The customer's `balance` after the transaction was applied. A negative value decreases the amount due on the customer's next invoice. A positive value increases the amount due on the customer's next invoice. """ id: str """ Unique identifier for the object. """ invoice: Optional[ExpandableField["Invoice"]] """ The ID of the invoice (if any) related to the transaction. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ metadata: Optional[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ object: Literal["customer_balance_transaction"] """ String representing the object's type. Objects of the same type share the same value. """ type: Literal[ "adjustment", "applied_to_invoice", "credit_note", "initial", "invoice_overpaid", "invoice_too_large", "invoice_too_small", "migration", "unapplied_from_invoice", "unspent_receiver_credit", ] """ Transaction type: `adjustment`, `applied_to_invoice`, `credit_note`, `initial`, `invoice_overpaid`, `invoice_too_large`, `invoice_too_small`, `unspent_receiver_credit`, or `unapplied_from_invoice`. See the [Customer Balance page](https://stripe.com/docs/billing/customer/balance#types) to learn more about transaction types. """ def instance_url(self): token = self.id customer = self.customer if isinstance(customer, Customer): customer = customer.id base = Customer.class_url() cust_extn = sanitize_id(customer) extn = sanitize_id(token) return "%s/%s/balance_transactions/%s" % (base, cust_extn, extn) @classmethod def retrieve(cls, id, **params) -> "CustomerBalanceTransaction": raise NotImplementedError( "Can't retrieve a Customer Balance Transaction without a Customer ID. " "Use Customer.retrieve_customer_balance_transaction('cus_123', 'cbtxn_123')" ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_customer_balance_transaction_service.py0000644000175100001770000002427714637354563024212 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._customer_balance_transaction import CustomerBalanceTransaction from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class CustomerBalanceTransactionService(StripeService): class CreateParams(TypedDict): amount: int """ The integer amount in **cents (or local equivalent)** to apply to the customer's credit balance. """ 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). Specifies the [`invoice_credit_balance`](https://stripe.com/docs/api/customers/object#customer_object-invoice_credit_balance) that this transaction will apply to. If the customer's `currency` is not set, it will be updated to this value. """ description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ class ListParams(TypedDict): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ def list( self, customer: str, params: "CustomerBalanceTransactionService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[CustomerBalanceTransaction]: """ Returns a list of transactions that updated the customer's [balances](https://stripe.com/docs/billing/customer/balance). """ return cast( ListObject[CustomerBalanceTransaction], self._request( "get", "/v1/customers/{customer}/balance_transactions".format( customer=sanitize_id(customer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, customer: str, params: "CustomerBalanceTransactionService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[CustomerBalanceTransaction]: """ Returns a list of transactions that updated the customer's [balances](https://stripe.com/docs/billing/customer/balance). """ return cast( ListObject[CustomerBalanceTransaction], await self._request_async( "get", "/v1/customers/{customer}/balance_transactions".format( customer=sanitize_id(customer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, customer: str, params: "CustomerBalanceTransactionService.CreateParams", options: RequestOptions = {}, ) -> CustomerBalanceTransaction: """ Creates an immutable transaction that updates the customer's credit [balance](https://stripe.com/docs/billing/customer/balance). """ return cast( CustomerBalanceTransaction, self._request( "post", "/v1/customers/{customer}/balance_transactions".format( customer=sanitize_id(customer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, customer: str, params: "CustomerBalanceTransactionService.CreateParams", options: RequestOptions = {}, ) -> CustomerBalanceTransaction: """ Creates an immutable transaction that updates the customer's credit [balance](https://stripe.com/docs/billing/customer/balance). """ return cast( CustomerBalanceTransaction, await self._request_async( "post", "/v1/customers/{customer}/balance_transactions".format( customer=sanitize_id(customer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, customer: str, transaction: str, params: "CustomerBalanceTransactionService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> CustomerBalanceTransaction: """ Retrieves a specific customer balance transaction that updated the customer's [balances](https://stripe.com/docs/billing/customer/balance). """ return cast( CustomerBalanceTransaction, self._request( "get", "/v1/customers/{customer}/balance_transactions/{transaction}".format( customer=sanitize_id(customer), transaction=sanitize_id(transaction), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, customer: str, transaction: str, params: "CustomerBalanceTransactionService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> CustomerBalanceTransaction: """ Retrieves a specific customer balance transaction that updated the customer's [balances](https://stripe.com/docs/billing/customer/balance). """ return cast( CustomerBalanceTransaction, await self._request_async( "get", "/v1/customers/{customer}/balance_transactions/{transaction}".format( customer=sanitize_id(customer), transaction=sanitize_id(transaction), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, customer: str, transaction: str, params: "CustomerBalanceTransactionService.UpdateParams" = {}, options: RequestOptions = {}, ) -> CustomerBalanceTransaction: """ Most credit balance transaction fields are immutable, but you may update its description and metadata. """ return cast( CustomerBalanceTransaction, self._request( "post", "/v1/customers/{customer}/balance_transactions/{transaction}".format( customer=sanitize_id(customer), transaction=sanitize_id(transaction), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, customer: str, transaction: str, params: "CustomerBalanceTransactionService.UpdateParams" = {}, options: RequestOptions = {}, ) -> CustomerBalanceTransaction: """ Most credit balance transaction fields are immutable, but you may update its description and metadata. """ return cast( CustomerBalanceTransaction, await self._request_async( "post", "/v1/customers/{customer}/balance_transactions/{transaction}".format( customer=sanitize_id(customer), transaction=sanitize_id(transaction), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_customer_cash_balance_service.py0000644000175100001770000000765214637354563022601 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._cash_balance import CashBalance from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict class CustomerCashBalanceService(StripeService): class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ settings: NotRequired[ "CustomerCashBalanceService.UpdateParamsSettings" ] """ A hash of settings for this cash balance. """ class UpdateParamsSettings(TypedDict): reconciliation_mode: NotRequired[ Literal["automatic", "manual", "merchant_default"] ] """ Controls how funds transferred by the customer are applied to payment intents and invoices. Valid options are `automatic`, `manual`, or `merchant_default`. For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation). """ def retrieve( self, customer: str, params: "CustomerCashBalanceService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> CashBalance: """ Retrieves a customer's cash balance. """ return cast( CashBalance, self._request( "get", "/v1/customers/{customer}/cash_balance".format( customer=sanitize_id(customer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, customer: str, params: "CustomerCashBalanceService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> CashBalance: """ Retrieves a customer's cash balance. """ return cast( CashBalance, await self._request_async( "get", "/v1/customers/{customer}/cash_balance".format( customer=sanitize_id(customer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, customer: str, params: "CustomerCashBalanceService.UpdateParams" = {}, options: RequestOptions = {}, ) -> CashBalance: """ Changes the settings on a customer's cash balance. """ return cast( CashBalance, self._request( "post", "/v1/customers/{customer}/cash_balance".format( customer=sanitize_id(customer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, customer: str, params: "CustomerCashBalanceService.UpdateParams" = {}, options: RequestOptions = {}, ) -> CashBalance: """ Changes the settings on a customer's cash balance. """ return cast( CashBalance, await self._request_async( "post", "/v1/customers/{customer}/cash_balance".format( customer=sanitize_id(customer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_customer_cash_balance_transaction.py0000644000175100001770000002022214637354563023452 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._expandable_field import ExpandableField from stripe._stripe_object import StripeObject from typing import ClassVar, Optional from typing_extensions import Literal, TYPE_CHECKING if TYPE_CHECKING: from stripe._balance_transaction import BalanceTransaction from stripe._customer import Customer from stripe._payment_intent import PaymentIntent from stripe._refund import Refund class CustomerCashBalanceTransaction(StripeObject): """ Customers with certain payments enabled have a cash balance, representing funds that were paid by the customer to a merchant, but have not yet been allocated to a payment. Cash Balance Transactions represent when funds are moved into or out of this balance. This includes funding by the customer, allocation to payments, and refunds to the customer. """ OBJECT_NAME: ClassVar[Literal["customer_cash_balance_transaction"]] = ( "customer_cash_balance_transaction" ) class AdjustedForOverdraft(StripeObject): balance_transaction: ExpandableField["BalanceTransaction"] """ The [Balance Transaction](https://stripe.com/docs/api/balance_transactions/object) that corresponds to funds taken out of your Stripe balance. """ linked_transaction: ExpandableField["CustomerCashBalanceTransaction"] """ The [Cash Balance Transaction](https://stripe.com/docs/api/cash_balance_transactions/object) that brought the customer balance negative, triggering the clawback of funds. """ class AppliedToPayment(StripeObject): payment_intent: ExpandableField["PaymentIntent"] """ The [Payment Intent](https://stripe.com/docs/api/payment_intents/object) that funds were applied to. """ class Funded(StripeObject): class BankTransfer(StripeObject): class EuBankTransfer(StripeObject): 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. """ sender_name: Optional[str] """ The full name of the sender, as supplied by the sending bank. """ class GbBankTransfer(StripeObject): account_number_last4: Optional[str] """ The last 4 digits of the account number of the sender of the funding. """ sender_name: Optional[str] """ The full name of the sender, as supplied by the sending bank. """ sort_code: Optional[str] """ The sort code of the bank of the sender of the funding """ class JpBankTransfer(StripeObject): sender_bank: Optional[str] """ The name of the bank of the sender of the funding. """ sender_branch: Optional[str] """ The name of the bank branch of the sender of the funding. """ sender_name: Optional[str] """ The full name of the sender, as supplied by the sending bank. """ class UsBankTransfer(StripeObject): network: Optional[Literal["ach", "domestic_wire_us", "swift"]] """ The banking network used for this funding. """ sender_name: Optional[str] """ The full name of the sender, as supplied by the sending bank. """ eu_bank_transfer: Optional[EuBankTransfer] gb_bank_transfer: Optional[GbBankTransfer] jp_bank_transfer: Optional[JpBankTransfer] reference: Optional[str] """ The user-supplied reference field on the bank transfer. """ type: Literal[ "eu_bank_transfer", "gb_bank_transfer", "jp_bank_transfer", "mx_bank_transfer", "us_bank_transfer", ] """ The funding method type used to fund the customer balance. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. """ us_bank_transfer: Optional[UsBankTransfer] _inner_class_types = { "eu_bank_transfer": EuBankTransfer, "gb_bank_transfer": GbBankTransfer, "jp_bank_transfer": JpBankTransfer, "us_bank_transfer": UsBankTransfer, } bank_transfer: BankTransfer _inner_class_types = {"bank_transfer": BankTransfer} class RefundedFromPayment(StripeObject): refund: ExpandableField["Refund"] """ The [Refund](https://stripe.com/docs/api/refunds/object) that moved these funds into the customer's cash balance. """ class TransferredToBalance(StripeObject): balance_transaction: ExpandableField["BalanceTransaction"] """ The [Balance Transaction](https://stripe.com/docs/api/balance_transactions/object) that corresponds to funds transferred to your Stripe balance. """ class UnappliedFromPayment(StripeObject): payment_intent: ExpandableField["PaymentIntent"] """ The [Payment Intent](https://stripe.com/docs/api/payment_intents/object) that funds were unapplied from. """ adjusted_for_overdraft: Optional[AdjustedForOverdraft] applied_to_payment: Optional[AppliedToPayment] created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ 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). """ customer: ExpandableField["Customer"] """ The customer whose available cash balance changed as a result of this transaction. """ ending_balance: int """ The total available cash balance for the specified currency after this transaction was applied. Represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ funded: Optional[Funded] id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ net_amount: int """ The amount by which the cash balance changed, represented in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). A positive value represents funds being added to the cash balance, a negative value represents funds being removed from the cash balance. """ object: Literal["customer_cash_balance_transaction"] """ String representing the object's type. Objects of the same type share the same value. """ refunded_from_payment: Optional[RefundedFromPayment] transferred_to_balance: Optional[TransferredToBalance] type: Literal[ "adjusted_for_overdraft", "applied_to_payment", "funded", "funding_reversed", "refunded_from_payment", "return_canceled", "return_initiated", "transferred_to_balance", "unapplied_from_payment", ] """ The type of the cash balance transaction. New types may be added in future. See [Customer Balance](https://stripe.com/docs/payments/customer-balance#types) to learn more about these types. """ unapplied_from_payment: Optional[UnappliedFromPayment] _inner_class_types = { "adjusted_for_overdraft": AdjustedForOverdraft, "applied_to_payment": AppliedToPayment, "funded": Funded, "refunded_from_payment": RefundedFromPayment, "transferred_to_balance": TransferredToBalance, "unapplied_from_payment": UnappliedFromPayment, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_customer_cash_balance_transaction_service.py0000644000175100001770000001210514637354563025173 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._customer_cash_balance_transaction import ( CustomerCashBalanceTransaction, ) from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict class CustomerCashBalanceTransactionService(StripeService): class ListParams(TypedDict): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def list( self, customer: str, params: "CustomerCashBalanceTransactionService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[CustomerCashBalanceTransaction]: """ Returns a list of transactions that modified the customer's [cash balance](https://stripe.com/docs/payments/customer-balance). """ return cast( ListObject[CustomerCashBalanceTransaction], self._request( "get", "/v1/customers/{customer}/cash_balance_transactions".format( customer=sanitize_id(customer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, customer: str, params: "CustomerCashBalanceTransactionService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[CustomerCashBalanceTransaction]: """ Returns a list of transactions that modified the customer's [cash balance](https://stripe.com/docs/payments/customer-balance). """ return cast( ListObject[CustomerCashBalanceTransaction], await self._request_async( "get", "/v1/customers/{customer}/cash_balance_transactions".format( customer=sanitize_id(customer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, customer: str, transaction: str, params: "CustomerCashBalanceTransactionService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> CustomerCashBalanceTransaction: """ Retrieves a specific cash balance transaction, which updated the customer's [cash balance](https://stripe.com/docs/payments/customer-balance). """ return cast( CustomerCashBalanceTransaction, self._request( "get", "/v1/customers/{customer}/cash_balance_transactions/{transaction}".format( customer=sanitize_id(customer), transaction=sanitize_id(transaction), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, customer: str, transaction: str, params: "CustomerCashBalanceTransactionService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> CustomerCashBalanceTransaction: """ Retrieves a specific cash balance transaction, which updated the customer's [cash balance](https://stripe.com/docs/payments/customer-balance). """ return cast( CustomerCashBalanceTransaction, await self._request_async( "get", "/v1/customers/{customer}/cash_balance_transactions/{transaction}".format( customer=sanitize_id(customer), transaction=sanitize_id(transaction), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_customer_funding_instructions_service.py0000644000175100001770000001024314637354563024462 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._funding_instructions import FundingInstructions from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict class CustomerFundingInstructionsService(StripeService): class CreateParams(TypedDict): bank_transfer: ( "CustomerFundingInstructionsService.CreateParamsBankTransfer" ) """ Additional parameters for `bank_transfer` funding types """ 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). """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ funding_type: Literal["bank_transfer"] """ The `funding_type` to get the instructions for. """ class CreateParamsBankTransfer(TypedDict): eu_bank_transfer: NotRequired[ "CustomerFundingInstructionsService.CreateParamsBankTransferEuBankTransfer" ] """ Configuration for eu_bank_transfer funding type. """ requested_address_types: NotRequired[ List[Literal["iban", "sort_code", "spei", "zengin"]] ] """ List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. """ type: Literal[ "eu_bank_transfer", "gb_bank_transfer", "jp_bank_transfer", "mx_bank_transfer", "us_bank_transfer", ] """ The type of the `bank_transfer` """ class CreateParamsBankTransferEuBankTransfer(TypedDict): country: str """ The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. """ def create( self, customer: str, params: "CustomerFundingInstructionsService.CreateParams", options: RequestOptions = {}, ) -> FundingInstructions: """ Retrieve funding instructions for a customer cash balance. If funding instructions do not yet exist for the customer, new funding instructions will be created. If funding instructions have already been created for a given customer, the same funding instructions will be retrieved. In other words, we will return the same funding instructions each time. """ return cast( FundingInstructions, self._request( "post", "/v1/customers/{customer}/funding_instructions".format( customer=sanitize_id(customer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, customer: str, params: "CustomerFundingInstructionsService.CreateParams", options: RequestOptions = {}, ) -> FundingInstructions: """ Retrieve funding instructions for a customer cash balance. If funding instructions do not yet exist for the customer, new funding instructions will be created. If funding instructions have already been created for a given customer, the same funding instructions will be retrieved. In other words, we will return the same funding instructions each time. """ return cast( FundingInstructions, await self._request_async( "post", "/v1/customers/{customer}/funding_instructions".format( customer=sanitize_id(customer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_customer_payment_method_service.py0000644000175100001770000001450114637354563023222 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._payment_method import PaymentMethod from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict class CustomerPaymentMethodService(StripeService): class ListParams(TypedDict): allow_redisplay: NotRequired[ Literal["always", "limited", "unspecified"] ] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ type: NotRequired[ Literal[ "acss_debit", "affirm", "afterpay_clearpay", "alipay", "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", "blik", "boleto", "card", "cashapp", "customer_balance", "eps", "fpx", "giropay", "grabpay", "ideal", "klarna", "konbini", "link", "mobilepay", "multibanco", "oxxo", "p24", "paynow", "paypal", "pix", "promptpay", "revolut_pay", "sepa_debit", "sofort", "swish", "twint", "us_bank_account", "wechat_pay", "zip", ] ] """ An optional filter on the list, based on the object `type` field. Without the filter, the list includes all current and future payment method types. If your integration expects only one type of payment method in the response, make sure to provide a type value in the request. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def list( self, customer: str, params: "CustomerPaymentMethodService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[PaymentMethod]: """ Returns a list of PaymentMethods for a given Customer """ return cast( ListObject[PaymentMethod], self._request( "get", "/v1/customers/{customer}/payment_methods".format( customer=sanitize_id(customer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, customer: str, params: "CustomerPaymentMethodService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[PaymentMethod]: """ Returns a list of PaymentMethods for a given Customer """ return cast( ListObject[PaymentMethod], await self._request_async( "get", "/v1/customers/{customer}/payment_methods".format( customer=sanitize_id(customer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, customer: str, payment_method: str, params: "CustomerPaymentMethodService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> PaymentMethod: """ Retrieves a PaymentMethod object for a given Customer. """ return cast( PaymentMethod, self._request( "get", "/v1/customers/{customer}/payment_methods/{payment_method}".format( customer=sanitize_id(customer), payment_method=sanitize_id(payment_method), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, customer: str, payment_method: str, params: "CustomerPaymentMethodService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> PaymentMethod: """ Retrieves a PaymentMethod object for a given Customer. """ return cast( PaymentMethod, await self._request_async( "get", "/v1/customers/{customer}/payment_methods/{payment_method}".format( customer=sanitize_id(customer), payment_method=sanitize_id(payment_method), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_customer_payment_source_service.py0000644000175100001770000003730214637354563023246 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._account import Account from stripe._bank_account import BankAccount from stripe._card import Card from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._source import Source from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import Dict, List, Union, cast from typing_extensions import Literal, NotRequired, TypedDict class CustomerPaymentSourceService(StripeService): class CreateParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ source: str """ Please refer to full [documentation](https://stripe.com/docs/api) instead. """ validate: NotRequired[bool] class DeleteParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ListParams(TypedDict): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ object: NotRequired[str] """ Filter sources according to a particular object type. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): account_holder_name: NotRequired[str] """ The name of the person or business that owns the bank account. """ account_holder_type: NotRequired[Literal["company", "individual"]] """ The type of entity that holds the account. This can be either `individual` or `company`. """ address_city: NotRequired[str] """ City/District/Suburb/Town/Village. """ address_country: NotRequired[str] """ Billing address country, if provided when creating card. """ address_line1: NotRequired[str] """ Address line 1 (Street address/PO Box/Company name). """ address_line2: NotRequired[str] """ Address line 2 (Apartment/Suite/Unit/Building). """ address_state: NotRequired[str] """ State/County/Province/Region. """ address_zip: NotRequired[str] """ ZIP or postal code. """ exp_month: NotRequired[str] """ Two digit number representing the card's expiration month. """ exp_year: NotRequired[str] """ Four digit number representing the card's expiration year. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ name: NotRequired[str] """ Cardholder name. """ owner: NotRequired["CustomerPaymentSourceService.UpdateParamsOwner"] class UpdateParamsOwner(TypedDict): address: NotRequired[ "CustomerPaymentSourceService.UpdateParamsOwnerAddress" ] """ Owner's address. """ email: NotRequired[str] """ Owner's email address. """ name: NotRequired[str] """ Owner's full name. """ phone: NotRequired[str] """ Owner's phone number. """ class UpdateParamsOwnerAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class VerifyParams(TypedDict): amounts: NotRequired[List[int]] """ Two positive integers, in *cents*, equal to the values of the microdeposits sent to the bank account. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def list( self, customer: str, params: "CustomerPaymentSourceService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Union[Account, BankAccount, Card, Source]]: """ List sources for a specified customer. """ return cast( ListObject[Union[Account, BankAccount, Card, Source]], self._request( "get", "/v1/customers/{customer}/sources".format( customer=sanitize_id(customer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, customer: str, params: "CustomerPaymentSourceService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Union[Account, BankAccount, Card, Source]]: """ List sources for a specified customer. """ return cast( ListObject[Union[Account, BankAccount, Card, Source]], await self._request_async( "get", "/v1/customers/{customer}/sources".format( customer=sanitize_id(customer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, customer: str, params: "CustomerPaymentSourceService.CreateParams", options: RequestOptions = {}, ) -> Union[Account, BankAccount, Card, Source]: """ When you create a new credit card, you must specify a customer or recipient on which to create it. If the card's owner has no default card, then the new card will become the default. However, if the owner already has a default, then it will not change. To change the default, you should [update the customer](https://stripe.com/docs/api#update_customer) to have a new default_source. """ return cast( Union[Account, BankAccount, Card, Source], self._request( "post", "/v1/customers/{customer}/sources".format( customer=sanitize_id(customer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, customer: str, params: "CustomerPaymentSourceService.CreateParams", options: RequestOptions = {}, ) -> Union[Account, BankAccount, Card, Source]: """ When you create a new credit card, you must specify a customer or recipient on which to create it. If the card's owner has no default card, then the new card will become the default. However, if the owner already has a default, then it will not change. To change the default, you should [update the customer](https://stripe.com/docs/api#update_customer) to have a new default_source. """ return cast( Union[Account, BankAccount, Card, Source], await self._request_async( "post", "/v1/customers/{customer}/sources".format( customer=sanitize_id(customer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, customer: str, id: str, params: "CustomerPaymentSourceService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Union[Account, BankAccount, Card, Source]: """ Retrieve a specified source for a given customer. """ return cast( Union[Account, BankAccount, Card, Source], self._request( "get", "/v1/customers/{customer}/sources/{id}".format( customer=sanitize_id(customer), id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, customer: str, id: str, params: "CustomerPaymentSourceService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Union[Account, BankAccount, Card, Source]: """ Retrieve a specified source for a given customer. """ return cast( Union[Account, BankAccount, Card, Source], await self._request_async( "get", "/v1/customers/{customer}/sources/{id}".format( customer=sanitize_id(customer), id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, customer: str, id: str, params: "CustomerPaymentSourceService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Union[Account, BankAccount, Card, Source]: """ Update a specified source for a given customer. """ return cast( Union[Account, BankAccount, Card, Source], self._request( "post", "/v1/customers/{customer}/sources/{id}".format( customer=sanitize_id(customer), id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, customer: str, id: str, params: "CustomerPaymentSourceService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Union[Account, BankAccount, Card, Source]: """ Update a specified source for a given customer. """ return cast( Union[Account, BankAccount, Card, Source], await self._request_async( "post", "/v1/customers/{customer}/sources/{id}".format( customer=sanitize_id(customer), id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def delete( self, customer: str, id: str, params: "CustomerPaymentSourceService.DeleteParams" = {}, options: RequestOptions = {}, ) -> Union[Account, BankAccount, Card, Source]: """ Delete a specified source for a given customer. """ return cast( Union[Account, BankAccount, Card, Source], self._request( "delete", "/v1/customers/{customer}/sources/{id}".format( customer=sanitize_id(customer), id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def delete_async( self, customer: str, id: str, params: "CustomerPaymentSourceService.DeleteParams" = {}, options: RequestOptions = {}, ) -> Union[Account, BankAccount, Card, Source]: """ Delete a specified source for a given customer. """ return cast( Union[Account, BankAccount, Card, Source], await self._request_async( "delete", "/v1/customers/{customer}/sources/{id}".format( customer=sanitize_id(customer), id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def verify( self, customer: str, id: str, params: "CustomerPaymentSourceService.VerifyParams" = {}, options: RequestOptions = {}, ) -> BankAccount: """ Verify a specified bank account for a given customer. """ return cast( BankAccount, self._request( "post", "/v1/customers/{customer}/sources/{id}/verify".format( customer=sanitize_id(customer), id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def verify_async( self, customer: str, id: str, params: "CustomerPaymentSourceService.VerifyParams" = {}, options: RequestOptions = {}, ) -> BankAccount: """ Verify a specified bank account for a given customer. """ return cast( BankAccount, await self._request_async( "post", "/v1/customers/{customer}/sources/{id}/verify".format( customer=sanitize_id(customer), id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_customer_service.py0000644000175100001770000010754314637354563020136 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._customer import Customer from stripe._customer_balance_transaction_service import ( CustomerBalanceTransactionService, ) from stripe._customer_cash_balance_service import CustomerCashBalanceService from stripe._customer_cash_balance_transaction_service import ( CustomerCashBalanceTransactionService, ) from stripe._customer_funding_instructions_service import ( CustomerFundingInstructionsService, ) from stripe._customer_payment_method_service import ( CustomerPaymentMethodService, ) from stripe._customer_payment_source_service import ( CustomerPaymentSourceService, ) from stripe._customer_tax_id_service import CustomerTaxIdService from stripe._discount import Discount from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._search_result_object import SearchResultObject from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class CustomerService(StripeService): def __init__(self, requestor): super().__init__(requestor) self.cash_balance = CustomerCashBalanceService(self._requestor) self.balance_transactions = CustomerBalanceTransactionService( self._requestor, ) self.cash_balance_transactions = CustomerCashBalanceTransactionService( self._requestor, ) self.payment_sources = CustomerPaymentSourceService(self._requestor) self.tax_ids = CustomerTaxIdService(self._requestor) self.payment_methods = CustomerPaymentMethodService(self._requestor) self.funding_instructions = CustomerFundingInstructionsService( self._requestor, ) class CreateParams(TypedDict): address: NotRequired["Literal['']|CustomerService.CreateParamsAddress"] """ The customer's address. """ balance: NotRequired[int] """ An integer amount in cents (or local equivalent) that represents the customer's current balance, which affect the customer's future invoices. A negative amount represents a credit that decreases the amount due on an invoice; a positive amount increases the amount due on an invoice. """ cash_balance: NotRequired["CustomerService.CreateParamsCashBalance"] """ Balance information and default balance settings for this customer. """ coupon: NotRequired[str] description: NotRequired[str] """ An arbitrary string that you can attach to a customer object. It is displayed alongside the customer in the dashboard. """ email: NotRequired[str] """ Customer's email address. It's displayed alongside the customer in your dashboard and can be useful for searching and tracking. This may be up to *512 characters*. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ invoice_prefix: NotRequired[str] """ The prefix for the customer used to generate unique invoice numbers. Must be 3–12 uppercase letters or numbers. """ invoice_settings: NotRequired[ "CustomerService.CreateParamsInvoiceSettings" ] """ Default invoice settings for this customer. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ name: NotRequired[str] """ The customer's full name or business name. """ next_invoice_sequence: NotRequired[int] """ The sequence to be used on the customer's next invoice. Defaults to 1. """ payment_method: NotRequired[str] phone: NotRequired[str] """ The customer's phone number. """ preferred_locales: NotRequired[List[str]] """ Customer's preferred languages, ordered by preference. """ promotion_code: NotRequired[str] """ The ID of a promotion code to apply to the customer. The customer will have a discount applied on all recurring payments. Charges you create through the API will not have the discount. """ shipping: NotRequired[ "Literal['']|CustomerService.CreateParamsShipping" ] """ The customer's shipping information. Appears on invoices emailed to this customer. """ source: NotRequired[str] tax: NotRequired["CustomerService.CreateParamsTax"] """ Tax details about the customer. """ tax_exempt: NotRequired[ "Literal['']|Literal['exempt', 'none', 'reverse']" ] """ The customer's tax exemption. One of `none`, `exempt`, or `reverse`. """ tax_id_data: NotRequired[ List["CustomerService.CreateParamsTaxIdDatum"] ] """ The customer's tax IDs. """ test_clock: NotRequired[str] """ ID of the test clock to attach to the customer. """ validate: NotRequired[bool] class CreateParamsAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsCashBalance(TypedDict): settings: NotRequired[ "CustomerService.CreateParamsCashBalanceSettings" ] """ Settings controlling the behavior of the customer's cash balance, such as reconciliation of funds received. """ class CreateParamsCashBalanceSettings(TypedDict): reconciliation_mode: NotRequired[ Literal["automatic", "manual", "merchant_default"] ] """ Controls how funds transferred by the customer are applied to payment intents and invoices. Valid options are `automatic`, `manual`, or `merchant_default`. For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation). """ class CreateParamsInvoiceSettings(TypedDict): custom_fields: NotRequired[ "Literal['']|List[CustomerService.CreateParamsInvoiceSettingsCustomField]" ] """ The list of up to 4 default custom fields to be displayed on invoices for this customer. When updating, pass an empty string to remove previously-defined fields. """ default_payment_method: NotRequired[str] """ ID of a payment method that's attached to the customer, to be used as the customer's default payment method for subscriptions and invoices. """ footer: NotRequired[str] """ Default footer to be displayed on invoices for this customer. """ rendering_options: NotRequired[ "Literal['']|CustomerService.CreateParamsInvoiceSettingsRenderingOptions" ] """ Default options for invoice PDF rendering for this customer. """ class CreateParamsInvoiceSettingsCustomField(TypedDict): name: str """ The name of the custom field. This may be up to 40 characters. """ value: str """ The value of the custom field. This may be up to 140 characters. """ class CreateParamsInvoiceSettingsRenderingOptions(TypedDict): amount_tax_display: NotRequired[ "Literal['']|Literal['exclude_tax', 'include_inclusive_tax']" ] """ How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. """ class CreateParamsShipping(TypedDict): address: "CustomerService.CreateParamsShippingAddress" """ Customer shipping address. """ name: str """ Customer name. """ phone: NotRequired[str] """ Customer phone (including extension). """ class CreateParamsShippingAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsTax(TypedDict): ip_address: NotRequired["Literal['']|str"] """ A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. """ validate_location: NotRequired[Literal["deferred", "immediately"]] """ A flag that indicates when Stripe should validate the customer tax location. Defaults to `deferred`. """ class CreateParamsTaxIdDatum(TypedDict): type: Literal[ "ad_nrt", "ae_trn", "ar_cuit", "au_abn", "au_arn", "bg_uic", "bh_vat", "bo_tin", "br_cnpj", "br_cpf", "ca_bn", "ca_gst_hst", "ca_pst_bc", "ca_pst_mb", "ca_pst_sk", "ca_qst", "ch_uid", "ch_vat", "cl_tin", "cn_tin", "co_nit", "cr_tin", "de_stn", "do_rcn", "ec_ruc", "eg_tin", "es_cif", "eu_oss_vat", "eu_vat", "gb_vat", "ge_vat", "hk_br", "hu_tin", "id_npwp", "il_vat", "in_gst", "is_vat", "jp_cn", "jp_rn", "jp_trn", "ke_pin", "kr_brn", "kz_bin", "li_uid", "mx_rfc", "my_frp", "my_itn", "my_sst", "ng_tin", "no_vat", "no_voec", "nz_gst", "om_vat", "pe_ruc", "ph_tin", "ro_tin", "rs_pib", "ru_inn", "ru_kpp", "sa_vat", "sg_gst", "sg_uen", "si_tin", "sv_nit", "th_vat", "tr_tin", "tw_vat", "ua_vat", "us_ein", "uy_ruc", "ve_rif", "vn_tin", "za_vat", ] """ Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ Value of the tax ID. """ class DeleteDiscountParams(TypedDict): pass class DeleteParams(TypedDict): pass class ListParams(TypedDict): created: NotRequired["CustomerService.ListParamsCreated|int"] """ Only return customers that were created during the given date interval. """ email: NotRequired[str] """ A case-sensitive filter on the list based on the customer's `email` field. The value must be a string. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ test_clock: NotRequired[str] """ Provides a list of customers that are associated with the specified test clock. The response will not include customers with test clocks if this parameter is not set. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class SearchParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ page: NotRequired[str] """ A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. """ query: str """ The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for customers](https://stripe.com/docs/search#query-fields-for-customers). """ class UpdateParams(TypedDict): address: NotRequired["Literal['']|CustomerService.UpdateParamsAddress"] """ The customer's address. """ balance: NotRequired[int] """ An integer amount in cents (or local equivalent) that represents the customer's current balance, which affect the customer's future invoices. A negative amount represents a credit that decreases the amount due on an invoice; a positive amount increases the amount due on an invoice. """ cash_balance: NotRequired["CustomerService.UpdateParamsCashBalance"] """ Balance information and default balance settings for this customer. """ coupon: NotRequired[str] default_source: NotRequired[str] """ If you are using payment methods created via the PaymentMethods API, see the [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method) parameter. Provide the ID of a payment source already attached to this customer to make it this customer's default payment source. If you want to add a new payment source and make it the default, see the [source](https://stripe.com/docs/api/customers/update#update_customer-source) property. """ description: NotRequired[str] """ An arbitrary string that you can attach to a customer object. It is displayed alongside the customer in the dashboard. """ email: NotRequired[str] """ Customer's email address. It's displayed alongside the customer in your dashboard and can be useful for searching and tracking. This may be up to *512 characters*. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ invoice_prefix: NotRequired[str] """ The prefix for the customer used to generate unique invoice numbers. Must be 3–12 uppercase letters or numbers. """ invoice_settings: NotRequired[ "CustomerService.UpdateParamsInvoiceSettings" ] """ Default invoice settings for this customer. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ name: NotRequired[str] """ The customer's full name or business name. """ next_invoice_sequence: NotRequired[int] """ The sequence to be used on the customer's next invoice. Defaults to 1. """ phone: NotRequired[str] """ The customer's phone number. """ preferred_locales: NotRequired[List[str]] """ Customer's preferred languages, ordered by preference. """ promotion_code: NotRequired[str] """ The ID of a promotion code to apply to the customer. The customer will have a discount applied on all recurring payments. Charges you create through the API will not have the discount. """ shipping: NotRequired[ "Literal['']|CustomerService.UpdateParamsShipping" ] """ The customer's shipping information. Appears on invoices emailed to this customer. """ source: NotRequired[str] tax: NotRequired["CustomerService.UpdateParamsTax"] """ Tax details about the customer. """ tax_exempt: NotRequired[ "Literal['']|Literal['exempt', 'none', 'reverse']" ] """ The customer's tax exemption. One of `none`, `exempt`, or `reverse`. """ validate: NotRequired[bool] class UpdateParamsAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class UpdateParamsCashBalance(TypedDict): settings: NotRequired[ "CustomerService.UpdateParamsCashBalanceSettings" ] """ Settings controlling the behavior of the customer's cash balance, such as reconciliation of funds received. """ class UpdateParamsCashBalanceSettings(TypedDict): reconciliation_mode: NotRequired[ Literal["automatic", "manual", "merchant_default"] ] """ Controls how funds transferred by the customer are applied to payment intents and invoices. Valid options are `automatic`, `manual`, or `merchant_default`. For more information about these reconciliation modes, see [Reconciliation](https://stripe.com/docs/payments/customer-balance/reconciliation). """ class UpdateParamsInvoiceSettings(TypedDict): custom_fields: NotRequired[ "Literal['']|List[CustomerService.UpdateParamsInvoiceSettingsCustomField]" ] """ The list of up to 4 default custom fields to be displayed on invoices for this customer. When updating, pass an empty string to remove previously-defined fields. """ default_payment_method: NotRequired[str] """ ID of a payment method that's attached to the customer, to be used as the customer's default payment method for subscriptions and invoices. """ footer: NotRequired[str] """ Default footer to be displayed on invoices for this customer. """ rendering_options: NotRequired[ "Literal['']|CustomerService.UpdateParamsInvoiceSettingsRenderingOptions" ] """ Default options for invoice PDF rendering for this customer. """ class UpdateParamsInvoiceSettingsCustomField(TypedDict): name: str """ The name of the custom field. This may be up to 40 characters. """ value: str """ The value of the custom field. This may be up to 140 characters. """ class UpdateParamsInvoiceSettingsRenderingOptions(TypedDict): amount_tax_display: NotRequired[ "Literal['']|Literal['exclude_tax', 'include_inclusive_tax']" ] """ How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. """ class UpdateParamsShipping(TypedDict): address: "CustomerService.UpdateParamsShippingAddress" """ Customer shipping address. """ name: str """ Customer name. """ phone: NotRequired[str] """ Customer phone (including extension). """ class UpdateParamsShippingAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class UpdateParamsTax(TypedDict): ip_address: NotRequired["Literal['']|str"] """ A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. """ validate_location: NotRequired[Literal["deferred", "immediately"]] """ A flag that indicates when Stripe should validate the customer tax location. Defaults to `deferred`. """ def delete( self, customer: str, params: "CustomerService.DeleteParams" = {}, options: RequestOptions = {}, ) -> Customer: """ Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer. """ return cast( Customer, self._request( "delete", "/v1/customers/{customer}".format( customer=sanitize_id(customer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def delete_async( self, customer: str, params: "CustomerService.DeleteParams" = {}, options: RequestOptions = {}, ) -> Customer: """ Permanently deletes a customer. It cannot be undone. Also immediately cancels any active subscriptions on the customer. """ return cast( Customer, await self._request_async( "delete", "/v1/customers/{customer}".format( customer=sanitize_id(customer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, customer: str, params: "CustomerService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Customer: """ Retrieves a Customer object. """ return cast( Customer, self._request( "get", "/v1/customers/{customer}".format( customer=sanitize_id(customer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, customer: str, params: "CustomerService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Customer: """ Retrieves a Customer object. """ return cast( Customer, await self._request_async( "get", "/v1/customers/{customer}".format( customer=sanitize_id(customer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, customer: str, params: "CustomerService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Customer: """ Updates the specified customer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. For example, if you pass the source parameter, that becomes the customer's active source (e.g., a card) to be used for all charges in the future. When you update a customer to a new valid card source by passing the source parameter: for each of the customer's current subscriptions, if the subscription bills automatically and is in the past_due state, then the latest open invoice for the subscription with automatic collection enabled will be retried. This retry will not count as an automatic retry, and will not affect the next regularly scheduled payment for the invoice. Changing the default_source for a customer will not trigger this behavior. This request accepts mostly the same arguments as the customer creation call. """ return cast( Customer, self._request( "post", "/v1/customers/{customer}".format( customer=sanitize_id(customer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, customer: str, params: "CustomerService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Customer: """ Updates the specified customer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. For example, if you pass the source parameter, that becomes the customer's active source (e.g., a card) to be used for all charges in the future. When you update a customer to a new valid card source by passing the source parameter: for each of the customer's current subscriptions, if the subscription bills automatically and is in the past_due state, then the latest open invoice for the subscription with automatic collection enabled will be retried. This retry will not count as an automatic retry, and will not affect the next regularly scheduled payment for the invoice. Changing the default_source for a customer will not trigger this behavior. This request accepts mostly the same arguments as the customer creation call. """ return cast( Customer, await self._request_async( "post", "/v1/customers/{customer}".format( customer=sanitize_id(customer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def delete_discount( self, customer: str, params: "CustomerService.DeleteDiscountParams" = {}, options: RequestOptions = {}, ) -> Discount: """ Removes the currently applied discount on a customer. """ return cast( Discount, self._request( "delete", "/v1/customers/{customer}/discount".format( customer=sanitize_id(customer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def delete_discount_async( self, customer: str, params: "CustomerService.DeleteDiscountParams" = {}, options: RequestOptions = {}, ) -> Discount: """ Removes the currently applied discount on a customer. """ return cast( Discount, await self._request_async( "delete", "/v1/customers/{customer}/discount".format( customer=sanitize_id(customer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def list( self, params: "CustomerService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Customer]: """ Returns a list of your customers. The customers are returned sorted by creation date, with the most recent customers appearing first. """ return cast( ListObject[Customer], self._request( "get", "/v1/customers", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "CustomerService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Customer]: """ Returns a list of your customers. The customers are returned sorted by creation date, with the most recent customers appearing first. """ return cast( ListObject[Customer], await self._request_async( "get", "/v1/customers", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "CustomerService.CreateParams" = {}, options: RequestOptions = {}, ) -> Customer: """ Creates a new customer object. """ return cast( Customer, self._request( "post", "/v1/customers", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "CustomerService.CreateParams" = {}, options: RequestOptions = {}, ) -> Customer: """ Creates a new customer object. """ return cast( Customer, await self._request_async( "post", "/v1/customers", api_mode="V1", base_address="api", params=params, options=options, ), ) def search( self, params: "CustomerService.SearchParams", options: RequestOptions = {}, ) -> SearchResultObject[Customer]: """ Search for customers you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India. """ return cast( SearchResultObject[Customer], self._request( "get", "/v1/customers/search", api_mode="V1", base_address="api", params=params, options=options, ), ) async def search_async( self, params: "CustomerService.SearchParams", options: RequestOptions = {}, ) -> SearchResultObject[Customer]: """ Search for customers you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India. """ return cast( SearchResultObject[Customer], await self._request_async( "get", "/v1/customers/search", api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_customer_session.py0000644000175100001770000001150014637354563020144 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from typing import ClassVar, List, Optional, cast from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._customer import Customer class CustomerSession(CreateableAPIResource["CustomerSession"]): """ A customer session allows you to grant client access to Stripe's frontend SDKs (like StripeJs) control over a customer. """ OBJECT_NAME: ClassVar[Literal["customer_session"]] = "customer_session" class Components(StripeObject): class BuyButton(StripeObject): enabled: bool """ Whether the buy button is enabled. """ class PricingTable(StripeObject): enabled: bool """ Whether the pricing table is enabled. """ buy_button: BuyButton """ This hash contains whether the buy button is enabled. """ pricing_table: PricingTable """ This hash contains whether the pricing table is enabled. """ _inner_class_types = { "buy_button": BuyButton, "pricing_table": PricingTable, } class CreateParams(RequestOptions): components: "CustomerSession.CreateParamsComponents" """ Configuration for each component. Exactly 1 component must be enabled. """ customer: str """ The ID of an existing customer for which to create the customer session. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CreateParamsComponents(TypedDict): buy_button: NotRequired[ "CustomerSession.CreateParamsComponentsBuyButton" ] """ Configuration for buy button. """ pricing_table: NotRequired[ "CustomerSession.CreateParamsComponentsPricingTable" ] """ Configuration for the pricing table. """ class CreateParamsComponentsBuyButton(TypedDict): enabled: bool """ Whether the buy button is enabled. """ class CreateParamsComponentsPricingTable(TypedDict): enabled: bool """ Whether the pricing table is enabled. """ client_secret: str """ The client secret of this customer session. Used on the client to set up secure access to the given `customer`. The client secret can be used to provide access to `customer` from your frontend. It should not be stored, logged, or exposed to anyone other than the relevant customer. Make sure that you have TLS enabled on any page that includes the client secret. """ components: Optional[Components] """ Configuration for the components supported by this customer session. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ customer: ExpandableField["Customer"] """ The customer the customer session was created for. """ expires_at: int """ The timestamp at which this customer session will expire. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ object: Literal["customer_session"] """ String representing the object's type. Objects of the same type share the same value. """ @classmethod def create( cls, **params: Unpack["CustomerSession.CreateParams"] ) -> "CustomerSession": """ Creates a customer session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources. """ return cast( "CustomerSession", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["CustomerSession.CreateParams"] ) -> "CustomerSession": """ Creates a customer session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources. """ return cast( "CustomerSession", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) _inner_class_types = {"components": Components} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_customer_session_service.py0000644000175100001770000000543214637354563021673 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._customer_session import CustomerSession from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from typing import List, cast from typing_extensions import NotRequired, TypedDict class CustomerSessionService(StripeService): class CreateParams(TypedDict): components: "CustomerSessionService.CreateParamsComponents" """ Configuration for each component. Exactly 1 component must be enabled. """ customer: str """ The ID of an existing customer for which to create the customer session. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CreateParamsComponents(TypedDict): buy_button: NotRequired[ "CustomerSessionService.CreateParamsComponentsBuyButton" ] """ Configuration for buy button. """ pricing_table: NotRequired[ "CustomerSessionService.CreateParamsComponentsPricingTable" ] """ Configuration for the pricing table. """ class CreateParamsComponentsBuyButton(TypedDict): enabled: bool """ Whether the buy button is enabled. """ class CreateParamsComponentsPricingTable(TypedDict): enabled: bool """ Whether the pricing table is enabled. """ def create( self, params: "CustomerSessionService.CreateParams", options: RequestOptions = {}, ) -> CustomerSession: """ Creates a customer session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources. """ return cast( CustomerSession, self._request( "post", "/v1/customer_sessions", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "CustomerSessionService.CreateParams", options: RequestOptions = {}, ) -> CustomerSession: """ Creates a customer session object that includes a single-use client secret that you can use on your front-end to grant client-side API access for certain customer resources. """ return cast( CustomerSession, await self._request_async( "post", "/v1/customer_sessions", api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_customer_tax_id_service.py0000644000175100001770000002301114637354563021451 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._tax_id import TaxId from stripe._util import sanitize_id from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict class CustomerTaxIdService(StripeService): class CreateParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ type: Literal[ "ad_nrt", "ae_trn", "ar_cuit", "au_abn", "au_arn", "bg_uic", "bh_vat", "bo_tin", "br_cnpj", "br_cpf", "ca_bn", "ca_gst_hst", "ca_pst_bc", "ca_pst_mb", "ca_pst_sk", "ca_qst", "ch_uid", "ch_vat", "cl_tin", "cn_tin", "co_nit", "cr_tin", "de_stn", "do_rcn", "ec_ruc", "eg_tin", "es_cif", "eu_oss_vat", "eu_vat", "gb_vat", "ge_vat", "hk_br", "hu_tin", "id_npwp", "il_vat", "in_gst", "is_vat", "jp_cn", "jp_rn", "jp_trn", "ke_pin", "kr_brn", "kz_bin", "li_uid", "mx_rfc", "my_frp", "my_itn", "my_sst", "ng_tin", "no_vat", "no_voec", "nz_gst", "om_vat", "pe_ruc", "ph_tin", "ro_tin", "rs_pib", "ru_inn", "ru_kpp", "sa_vat", "sg_gst", "sg_uen", "si_tin", "sv_nit", "th_vat", "tr_tin", "tw_vat", "ua_vat", "us_ein", "uy_ruc", "ve_rif", "vn_tin", "za_vat", ] """ Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ Value of the tax ID. """ class DeleteParams(TypedDict): pass class ListParams(TypedDict): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def delete( self, customer: str, id: str, params: "CustomerTaxIdService.DeleteParams" = {}, options: RequestOptions = {}, ) -> TaxId: """ Deletes an existing tax_id object. """ return cast( TaxId, self._request( "delete", "/v1/customers/{customer}/tax_ids/{id}".format( customer=sanitize_id(customer), id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def delete_async( self, customer: str, id: str, params: "CustomerTaxIdService.DeleteParams" = {}, options: RequestOptions = {}, ) -> TaxId: """ Deletes an existing tax_id object. """ return cast( TaxId, await self._request_async( "delete", "/v1/customers/{customer}/tax_ids/{id}".format( customer=sanitize_id(customer), id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, customer: str, id: str, params: "CustomerTaxIdService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> TaxId: """ Retrieves the tax_id object with the given identifier. """ return cast( TaxId, self._request( "get", "/v1/customers/{customer}/tax_ids/{id}".format( customer=sanitize_id(customer), id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, customer: str, id: str, params: "CustomerTaxIdService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> TaxId: """ Retrieves the tax_id object with the given identifier. """ return cast( TaxId, await self._request_async( "get", "/v1/customers/{customer}/tax_ids/{id}".format( customer=sanitize_id(customer), id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def list( self, customer: str, params: "CustomerTaxIdService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[TaxId]: """ Returns a list of tax IDs for a customer. """ return cast( ListObject[TaxId], self._request( "get", "/v1/customers/{customer}/tax_ids".format( customer=sanitize_id(customer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, customer: str, params: "CustomerTaxIdService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[TaxId]: """ Returns a list of tax IDs for a customer. """ return cast( ListObject[TaxId], await self._request_async( "get", "/v1/customers/{customer}/tax_ids".format( customer=sanitize_id(customer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, customer: str, params: "CustomerTaxIdService.CreateParams", options: RequestOptions = {}, ) -> TaxId: """ Creates a new tax_id object for a customer. """ return cast( TaxId, self._request( "post", "/v1/customers/{customer}/tax_ids".format( customer=sanitize_id(customer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, customer: str, params: "CustomerTaxIdService.CreateParams", options: RequestOptions = {}, ) -> TaxId: """ Creates a new tax_id object for a customer. """ return cast( TaxId, await self._request_async( "post", "/v1/customers/{customer}/tax_ids".format( customer=sanitize_id(customer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_deletable_api_resource.py0000644000175100001770000000131014637354563021217 0ustar00runnerdockerfrom stripe import _util from stripe._api_resource import APIResource from urllib.parse import quote_plus from typing import TypeVar, cast from stripe._stripe_object import StripeObject T = TypeVar("T", bound=StripeObject) class DeletableAPIResource(APIResource[T]): @classmethod def _cls_delete(cls, sid, **params) -> T: url = "%s/%s" % (cls.class_url(), quote_plus(sid)) return cast(T, cls._static_request("delete", url, params=params)) @_util.class_method_variant("_cls_delete") def delete(self, **params) -> T: return cast( T, self._request_and_refresh( "delete", self.instance_url(), params=params ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_discount.py0000644000175100001770000000645114637354563016401 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._expandable_field import ExpandableField from stripe._stripe_object import StripeObject from typing import ClassVar, Optional from typing_extensions import Literal, TYPE_CHECKING if TYPE_CHECKING: from stripe._coupon import Coupon from stripe._customer import Customer from stripe._promotion_code import PromotionCode class Discount(StripeObject): """ A discount represents the actual application of a [coupon](https://stripe.com/docs/api#coupons) or [promotion code](https://stripe.com/docs/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://stripe.com/docs/billing/subscriptions/discounts) """ OBJECT_NAME: ClassVar[Literal["discount"]] = "discount" checkout_session: Optional[str] """ The Checkout session that this coupon is applied to, if it is applied to a particular session in payment mode. Will not be present for subscription mode. """ coupon: "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://stripe.com/docs/api#subscriptions), [invoices](https://stripe.com/docs/api#invoices), [checkout sessions](https://stripe.com/docs/api/checkout/sessions), [quotes](https://stripe.com/docs/api#quotes), and more. Coupons do not work with conventional one-off [charges](https://stripe.com/docs/api#create_charge) or [payment intents](https://stripe.com/docs/api/payment_intents). """ customer: Optional[ExpandableField["Customer"]] """ The ID of the customer associated with this discount. """ end: Optional[int] """ If the coupon has a duration of `repeating`, the date that this discount will end. If the coupon has a duration of `once` or `forever`, this attribute will be null. """ id: str """ The ID of the discount object. Discounts cannot be fetched by ID. Use `expand[]=discounts` in API calls to expand discount IDs in an array. """ invoice: Optional[str] """ The invoice that the discount's coupon was applied to, if it was applied directly to a particular invoice. """ invoice_item: Optional[str] """ The invoice item `id` (or invoice line item `id` for invoice line items of type='subscription') that the discount's coupon was applied to, if it was applied directly to a particular invoice item or invoice line item. """ object: Literal["discount"] """ String representing the object's type. Objects of the same type share the same value. """ promotion_code: Optional[ExpandableField["PromotionCode"]] """ The promotion code applied to create this discount. """ start: int """ Date that the coupon was applied. """ subscription: Optional[str] """ The subscription that this coupon is applied to, if it is applied to a particular subscription. """ subscription_item: Optional[str] """ The subscription item that this coupon is applied to, if it is applied to a particular subscription item. """ deleted: Optional[Literal[True]] """ Always true for a deleted object """ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_dispute.py0000644000175100001770000007244714637354563016236 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._balance_transaction import BalanceTransaction from stripe._charge import Charge from stripe._file import File from stripe._payment_intent import PaymentIntent class Dispute( ListableAPIResource["Dispute"], UpdateableAPIResource["Dispute"] ): """ A dispute occurs when a customer questions your charge with their card issuer. When this happens, you have the opportunity to respond to the dispute with evidence that shows that the charge is legitimate. Related guide: [Disputes and fraud](https://stripe.com/docs/disputes) """ OBJECT_NAME: ClassVar[Literal["dispute"]] = "dispute" class Evidence(StripeObject): access_activity_log: Optional[str] """ Any server or activity logs showing proof that the customer accessed or downloaded the purchased digital product. This information should include IP addresses, corresponding timestamps, and any detailed recorded activity. """ billing_address: Optional[str] """ The billing address provided by the customer. """ cancellation_policy: Optional[ExpandableField["File"]] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Your subscription cancellation policy, as shown to the customer. """ cancellation_policy_disclosure: Optional[str] """ An explanation of how and when the customer was shown your refund policy prior to purchase. """ cancellation_rebuttal: Optional[str] """ A justification for why the customer's subscription was not canceled. """ customer_communication: Optional[ExpandableField["File"]] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any communication with the customer that you feel is relevant to your case. Examples include emails proving that the customer received the product or service, or demonstrating their use of or satisfaction with the product or service. """ customer_email_address: Optional[str] """ The email address of the customer. """ customer_name: Optional[str] """ The name of the customer. """ customer_purchase_ip: Optional[str] """ The IP address that the customer used when making the purchase. """ customer_signature: Optional[ExpandableField["File"]] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A relevant document or contract showing the customer's signature. """ duplicate_charge_documentation: Optional[ExpandableField["File"]] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation for the prior charge that can uniquely identify the charge, such as a receipt, shipping label, work order, etc. This document should be paired with a similar document from the disputed payment that proves the two payments are separate. """ duplicate_charge_explanation: Optional[str] """ An explanation of the difference between the disputed charge versus the prior charge that appears to be a duplicate. """ duplicate_charge_id: Optional[str] """ The Stripe ID for the prior charge which appears to be a duplicate of the disputed charge. """ product_description: Optional[str] """ A description of the product or service that was sold. """ receipt: Optional[ExpandableField["File"]] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any receipt or message sent to the customer notifying them of the charge. """ refund_policy: Optional[ExpandableField["File"]] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Your refund policy, as shown to the customer. """ refund_policy_disclosure: Optional[str] """ Documentation demonstrating that the customer was shown your refund policy prior to purchase. """ refund_refusal_explanation: Optional[str] """ A justification for why the customer is not entitled to a refund. """ service_date: Optional[str] """ The date on which the customer received or began receiving the purchased service, in a clear human-readable format. """ service_documentation: Optional[ExpandableField["File"]] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation showing proof that a service was provided to the customer. This could include a copy of a signed contract, work order, or other form of written agreement. """ shipping_address: Optional[str] """ The address to which a physical product was shipped. You should try to include as complete address information as possible. """ shipping_carrier: Optional[str] """ The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. If multiple carriers were used for this purchase, please separate them with commas. """ shipping_date: Optional[str] """ The date on which a physical product began its route to the shipping address, in a clear human-readable format. """ shipping_documentation: Optional[ExpandableField["File"]] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation showing proof that a product was shipped to the customer at the same address the customer provided to you. This could include a copy of the shipment receipt, shipping label, etc. It should show the customer's full shipping address, if possible. """ shipping_tracking_number: Optional[str] """ The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ uncategorized_file: Optional[ExpandableField["File"]] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any additional evidence or statements. """ uncategorized_text: Optional[str] """ Any additional evidence or statements. """ class EvidenceDetails(StripeObject): due_by: Optional[int] """ Date by which evidence must be submitted in order to successfully challenge dispute. Will be 0 if the customer's bank or credit card company doesn't allow a response for this particular dispute. """ has_evidence: bool """ Whether evidence has been staged for this dispute. """ past_due: bool """ Whether the last evidence submission was submitted past the due date. Defaults to `false` if no evidence submissions have occurred. If `true`, then delivery of the latest evidence is *not* guaranteed. """ submission_count: int """ The number of times evidence has been submitted. Typically, you may only submit evidence once. """ class PaymentMethodDetails(StripeObject): class Card(StripeObject): brand: str """ Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ network_reason_code: Optional[str] """ The card network's specific dispute reason code, which maps to one of Stripe's primary dispute categories to simplify response guidance. The [Network code map](https://stripe.com/docs/disputes/categories#network-code-map) lists all available dispute reason codes by network. """ class Klarna(StripeObject): reason_code: Optional[str] """ The reason for the dispute as defined by Klarna """ class Paypal(StripeObject): case_id: Optional[str] """ The ID of the dispute in PayPal. """ reason_code: Optional[str] """ The reason for the dispute as defined by PayPal """ card: Optional[Card] klarna: Optional[Klarna] paypal: Optional[Paypal] type: Literal["card", "klarna", "paypal"] """ Payment method type. """ _inner_class_types = {"card": Card, "klarna": Klarna, "paypal": Paypal} class CloseParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ListParams(RequestOptions): charge: NotRequired[str] """ Only return disputes associated to the charge specified by this charge ID. """ created: NotRequired["Dispute.ListParamsCreated|int"] ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ payment_intent: NotRequired[str] """ Only return disputes associated to the PaymentIntent specified by this PaymentIntent ID. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): evidence: NotRequired["Dispute.ModifyParamsEvidence"] """ Evidence to upload, to respond to a dispute. Updating any field in the hash will submit all fields in the hash for review. The combined character count of all fields is limited to 150,000. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ submit: NotRequired[bool] """ Whether to immediately submit evidence to the bank. If `false`, evidence is staged on the dispute. Staged evidence is visible in the API and Dashboard, and can be submitted to the bank by making another request with this attribute set to `true` (the default). """ class ModifyParamsEvidence(TypedDict): access_activity_log: NotRequired[str] """ Any server or activity logs showing proof that the customer accessed or downloaded the purchased digital product. This information should include IP addresses, corresponding timestamps, and any detailed recorded activity. Has a maximum character count of 20,000. """ billing_address: NotRequired[str] """ The billing address provided by the customer. """ cancellation_policy: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Your subscription cancellation policy, as shown to the customer. """ cancellation_policy_disclosure: NotRequired[str] """ An explanation of how and when the customer was shown your refund policy prior to purchase. Has a maximum character count of 20,000. """ cancellation_rebuttal: NotRequired[str] """ A justification for why the customer's subscription was not canceled. Has a maximum character count of 20,000. """ customer_communication: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any communication with the customer that you feel is relevant to your case. Examples include emails proving that the customer received the product or service, or demonstrating their use of or satisfaction with the product or service. """ customer_email_address: NotRequired[str] """ The email address of the customer. """ customer_name: NotRequired[str] """ The name of the customer. """ customer_purchase_ip: NotRequired[str] """ The IP address that the customer used when making the purchase. """ customer_signature: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A relevant document or contract showing the customer's signature. """ duplicate_charge_documentation: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation for the prior charge that can uniquely identify the charge, such as a receipt, shipping label, work order, etc. This document should be paired with a similar document from the disputed payment that proves the two payments are separate. """ duplicate_charge_explanation: NotRequired[str] """ An explanation of the difference between the disputed charge versus the prior charge that appears to be a duplicate. Has a maximum character count of 20,000. """ duplicate_charge_id: NotRequired[str] """ The Stripe ID for the prior charge which appears to be a duplicate of the disputed charge. """ product_description: NotRequired[str] """ A description of the product or service that was sold. Has a maximum character count of 20,000. """ receipt: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any receipt or message sent to the customer notifying them of the charge. """ refund_policy: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Your refund policy, as shown to the customer. """ refund_policy_disclosure: NotRequired[str] """ Documentation demonstrating that the customer was shown your refund policy prior to purchase. Has a maximum character count of 20,000. """ refund_refusal_explanation: NotRequired[str] """ A justification for why the customer is not entitled to a refund. Has a maximum character count of 20,000. """ service_date: NotRequired[str] """ The date on which the customer received or began receiving the purchased service, in a clear human-readable format. """ service_documentation: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation showing proof that a service was provided to the customer. This could include a copy of a signed contract, work order, or other form of written agreement. """ shipping_address: NotRequired[str] """ The address to which a physical product was shipped. You should try to include as complete address information as possible. """ shipping_carrier: NotRequired[str] """ The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. If multiple carriers were used for this purchase, please separate them with commas. """ shipping_date: NotRequired[str] """ The date on which a physical product began its route to the shipping address, in a clear human-readable format. """ shipping_documentation: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation showing proof that a product was shipped to the customer at the same address the customer provided to you. This could include a copy of the shipment receipt, shipping label, etc. It should show the customer's full shipping address, if possible. """ shipping_tracking_number: NotRequired[str] """ The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ uncategorized_file: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any additional evidence or statements. """ uncategorized_text: NotRequired[str] """ Any additional evidence or statements. Has a maximum character count of 20,000. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ amount: int """ Disputed amount. Usually the amount of the charge, but it can differ (usually because of currency fluctuation or because only part of the order is disputed). """ balance_transactions: List["BalanceTransaction"] """ List of zero, one, or two balance transactions that show funds withdrawn and reinstated to your Stripe account as a result of this dispute. """ charge: ExpandableField["Charge"] """ ID of the charge that's disputed. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ 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). """ evidence: Evidence evidence_details: EvidenceDetails id: str """ Unique identifier for the object. """ is_charge_refundable: bool """ If true, it's still possible to refund the disputed payment. After the payment has been fully refunded, no further funds are withdrawn from your Stripe account as a result of this dispute. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ metadata: Dict[str, str] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ network_reason_code: Optional[str] """ Network-dependent reason code for the dispute. """ object: Literal["dispute"] """ String representing the object's type. Objects of the same type share the same value. """ payment_intent: Optional[ExpandableField["PaymentIntent"]] """ ID of the PaymentIntent that's disputed. """ payment_method_details: Optional[PaymentMethodDetails] reason: str """ Reason given by cardholder for dispute. Possible values are `bank_cannot_process`, `check_returned`, `credit_not_processed`, `customer_initiated`, `debit_not_authorized`, `duplicate`, `fraudulent`, `general`, `incorrect_account_details`, `insufficient_funds`, `product_not_received`, `product_unacceptable`, `subscription_canceled`, or `unrecognized`. Learn more about [dispute reasons](https://stripe.com/docs/disputes/categories). """ status: Literal[ "lost", "needs_response", "under_review", "warning_closed", "warning_needs_response", "warning_under_review", "won", ] """ Current status of dispute. Possible values are `warning_needs_response`, `warning_under_review`, `warning_closed`, `needs_response`, `under_review`, `won`, or `lost`. """ @classmethod def _cls_close( cls, dispute: str, **params: Unpack["Dispute.CloseParams"] ) -> "Dispute": """ Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost. The status of the dispute will change from needs_response to lost. Closing a dispute is irreversible. """ return cast( "Dispute", cls._static_request( "post", "/v1/disputes/{dispute}/close".format( dispute=sanitize_id(dispute) ), params=params, ), ) @overload @staticmethod def close( dispute: str, **params: Unpack["Dispute.CloseParams"] ) -> "Dispute": """ Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost. The status of the dispute will change from needs_response to lost. Closing a dispute is irreversible. """ ... @overload def close(self, **params: Unpack["Dispute.CloseParams"]) -> "Dispute": """ Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost. The status of the dispute will change from needs_response to lost. Closing a dispute is irreversible. """ ... @class_method_variant("_cls_close") def close( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Dispute.CloseParams"] ) -> "Dispute": """ Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost. The status of the dispute will change from needs_response to lost. Closing a dispute is irreversible. """ return cast( "Dispute", self._request( "post", "/v1/disputes/{dispute}/close".format( dispute=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_close_async( cls, dispute: str, **params: Unpack["Dispute.CloseParams"] ) -> "Dispute": """ Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost. The status of the dispute will change from needs_response to lost. Closing a dispute is irreversible. """ return cast( "Dispute", await cls._static_request_async( "post", "/v1/disputes/{dispute}/close".format( dispute=sanitize_id(dispute) ), params=params, ), ) @overload @staticmethod async def close_async( dispute: str, **params: Unpack["Dispute.CloseParams"] ) -> "Dispute": """ Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost. The status of the dispute will change from needs_response to lost. Closing a dispute is irreversible. """ ... @overload async def close_async( self, **params: Unpack["Dispute.CloseParams"] ) -> "Dispute": """ Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost. The status of the dispute will change from needs_response to lost. Closing a dispute is irreversible. """ ... @class_method_variant("_cls_close_async") async def close_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Dispute.CloseParams"] ) -> "Dispute": """ Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost. The status of the dispute will change from needs_response to lost. Closing a dispute is irreversible. """ return cast( "Dispute", await self._request_async( "post", "/v1/disputes/{dispute}/close".format( dispute=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def list( cls, **params: Unpack["Dispute.ListParams"] ) -> ListObject["Dispute"]: """ Returns a list of your disputes. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["Dispute.ListParams"] ) -> ListObject["Dispute"]: """ Returns a list of your disputes. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def modify( cls, id: str, **params: Unpack["Dispute.ModifyParams"] ) -> "Dispute": """ When you get a dispute, contacting your customer is always the best first step. If that doesn't work, you can submit evidence to help us resolve the dispute in your favor. You can do this in your [dashboard](https://dashboard.stripe.com/disputes), but if you prefer, you can use the API to submit evidence programmatically. Depending on your dispute type, different evidence fields will give you a better chance of winning your dispute. To figure out which evidence fields to provide, see our [guide to dispute types](https://stripe.com/docs/disputes/categories). """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Dispute", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["Dispute.ModifyParams"] ) -> "Dispute": """ When you get a dispute, contacting your customer is always the best first step. If that doesn't work, you can submit evidence to help us resolve the dispute in your favor. You can do this in your [dashboard](https://dashboard.stripe.com/disputes), but if you prefer, you can use the API to submit evidence programmatically. Depending on your dispute type, different evidence fields will give you a better chance of winning your dispute. To figure out which evidence fields to provide, see our [guide to dispute types](https://stripe.com/docs/disputes/categories). """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Dispute", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["Dispute.RetrieveParams"] ) -> "Dispute": """ Retrieves the dispute with the given ID. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["Dispute.RetrieveParams"] ) -> "Dispute": """ Retrieves the dispute with the given ID. """ instance = cls(id, **params) await instance.refresh_async() return instance _inner_class_types = { "evidence": Evidence, "evidence_details": EvidenceDetails, "payment_method_details": PaymentMethodDetails, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_dispute_service.py0000644000175100001770000003707414637354563017753 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._dispute import Dispute from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class DisputeService(StripeService): class CloseParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ListParams(TypedDict): charge: NotRequired[str] """ Only return disputes associated to the charge specified by this charge ID. """ created: NotRequired["DisputeService.ListParamsCreated|int"] ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ payment_intent: NotRequired[str] """ Only return disputes associated to the PaymentIntent specified by this PaymentIntent ID. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): evidence: NotRequired["DisputeService.UpdateParamsEvidence"] """ Evidence to upload, to respond to a dispute. Updating any field in the hash will submit all fields in the hash for review. The combined character count of all fields is limited to 150,000. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ submit: NotRequired[bool] """ Whether to immediately submit evidence to the bank. If `false`, evidence is staged on the dispute. Staged evidence is visible in the API and Dashboard, and can be submitted to the bank by making another request with this attribute set to `true` (the default). """ class UpdateParamsEvidence(TypedDict): access_activity_log: NotRequired[str] """ Any server or activity logs showing proof that the customer accessed or downloaded the purchased digital product. This information should include IP addresses, corresponding timestamps, and any detailed recorded activity. Has a maximum character count of 20,000. """ billing_address: NotRequired[str] """ The billing address provided by the customer. """ cancellation_policy: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Your subscription cancellation policy, as shown to the customer. """ cancellation_policy_disclosure: NotRequired[str] """ An explanation of how and when the customer was shown your refund policy prior to purchase. Has a maximum character count of 20,000. """ cancellation_rebuttal: NotRequired[str] """ A justification for why the customer's subscription was not canceled. Has a maximum character count of 20,000. """ customer_communication: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any communication with the customer that you feel is relevant to your case. Examples include emails proving that the customer received the product or service, or demonstrating their use of or satisfaction with the product or service. """ customer_email_address: NotRequired[str] """ The email address of the customer. """ customer_name: NotRequired[str] """ The name of the customer. """ customer_purchase_ip: NotRequired[str] """ The IP address that the customer used when making the purchase. """ customer_signature: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) A relevant document or contract showing the customer's signature. """ duplicate_charge_documentation: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation for the prior charge that can uniquely identify the charge, such as a receipt, shipping label, work order, etc. This document should be paired with a similar document from the disputed payment that proves the two payments are separate. """ duplicate_charge_explanation: NotRequired[str] """ An explanation of the difference between the disputed charge versus the prior charge that appears to be a duplicate. Has a maximum character count of 20,000. """ duplicate_charge_id: NotRequired[str] """ The Stripe ID for the prior charge which appears to be a duplicate of the disputed charge. """ product_description: NotRequired[str] """ A description of the product or service that was sold. Has a maximum character count of 20,000. """ receipt: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any receipt or message sent to the customer notifying them of the charge. """ refund_policy: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Your refund policy, as shown to the customer. """ refund_policy_disclosure: NotRequired[str] """ Documentation demonstrating that the customer was shown your refund policy prior to purchase. Has a maximum character count of 20,000. """ refund_refusal_explanation: NotRequired[str] """ A justification for why the customer is not entitled to a refund. Has a maximum character count of 20,000. """ service_date: NotRequired[str] """ The date on which the customer received or began receiving the purchased service, in a clear human-readable format. """ service_documentation: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation showing proof that a service was provided to the customer. This could include a copy of a signed contract, work order, or other form of written agreement. """ shipping_address: NotRequired[str] """ The address to which a physical product was shipped. You should try to include as complete address information as possible. """ shipping_carrier: NotRequired[str] """ The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. If multiple carriers were used for this purchase, please separate them with commas. """ shipping_date: NotRequired[str] """ The date on which a physical product began its route to the shipping address, in a clear human-readable format. """ shipping_documentation: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Documentation showing proof that a product was shipped to the customer at the same address the customer provided to you. This could include a copy of the shipment receipt, shipping label, etc. It should show the customer's full shipping address, if possible. """ shipping_tracking_number: NotRequired[str] """ The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ uncategorized_file: NotRequired[str] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Any additional evidence or statements. """ uncategorized_text: NotRequired[str] """ Any additional evidence or statements. Has a maximum character count of 20,000. """ def list( self, params: "DisputeService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Dispute]: """ Returns a list of your disputes. """ return cast( ListObject[Dispute], self._request( "get", "/v1/disputes", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "DisputeService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Dispute]: """ Returns a list of your disputes. """ return cast( ListObject[Dispute], await self._request_async( "get", "/v1/disputes", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, dispute: str, params: "DisputeService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Dispute: """ Retrieves the dispute with the given ID. """ return cast( Dispute, self._request( "get", "/v1/disputes/{dispute}".format(dispute=sanitize_id(dispute)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, dispute: str, params: "DisputeService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Dispute: """ Retrieves the dispute with the given ID. """ return cast( Dispute, await self._request_async( "get", "/v1/disputes/{dispute}".format(dispute=sanitize_id(dispute)), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, dispute: str, params: "DisputeService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Dispute: """ When you get a dispute, contacting your customer is always the best first step. If that doesn't work, you can submit evidence to help us resolve the dispute in your favor. You can do this in your [dashboard](https://dashboard.stripe.com/disputes), but if you prefer, you can use the API to submit evidence programmatically. Depending on your dispute type, different evidence fields will give you a better chance of winning your dispute. To figure out which evidence fields to provide, see our [guide to dispute types](https://stripe.com/docs/disputes/categories). """ return cast( Dispute, self._request( "post", "/v1/disputes/{dispute}".format(dispute=sanitize_id(dispute)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, dispute: str, params: "DisputeService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Dispute: """ When you get a dispute, contacting your customer is always the best first step. If that doesn't work, you can submit evidence to help us resolve the dispute in your favor. You can do this in your [dashboard](https://dashboard.stripe.com/disputes), but if you prefer, you can use the API to submit evidence programmatically. Depending on your dispute type, different evidence fields will give you a better chance of winning your dispute. To figure out which evidence fields to provide, see our [guide to dispute types](https://stripe.com/docs/disputes/categories). """ return cast( Dispute, await self._request_async( "post", "/v1/disputes/{dispute}".format(dispute=sanitize_id(dispute)), api_mode="V1", base_address="api", params=params, options=options, ), ) def close( self, dispute: str, params: "DisputeService.CloseParams" = {}, options: RequestOptions = {}, ) -> Dispute: """ Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost. The status of the dispute will change from needs_response to lost. Closing a dispute is irreversible. """ return cast( Dispute, self._request( "post", "/v1/disputes/{dispute}/close".format( dispute=sanitize_id(dispute), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def close_async( self, dispute: str, params: "DisputeService.CloseParams" = {}, options: RequestOptions = {}, ) -> Dispute: """ Closing the dispute for a charge indicates that you do not have any evidence to submit and are essentially dismissing the dispute, acknowledging it as lost. The status of the dispute will change from needs_response to lost. Closing a dispute is irreversible. """ return cast( Dispute, await self._request_async( "post", "/v1/disputes/{dispute}/close".format( dispute=sanitize_id(dispute), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_encode.py0000644000175100001770000000277414637354563016012 0ustar00runnerdockerimport calendar import datetime import time from collections import OrderedDict from typing import Generator, Tuple, Any def _encode_datetime(dttime: datetime.datetime): if dttime.tzinfo and dttime.tzinfo.utcoffset(dttime) is not None: utc_timestamp = calendar.timegm(dttime.utctimetuple()) else: utc_timestamp = time.mktime(dttime.timetuple()) return int(utc_timestamp) def _encode_nested_dict(key, data, fmt="%s[%s]"): d = OrderedDict() for subkey, subvalue in data.items(): d[fmt % (key, subkey)] = subvalue return d def _api_encode(data) -> Generator[Tuple[str, Any], None, None]: for key, value in data.items(): if value is None: continue elif hasattr(value, "stripe_id"): yield (key, value.stripe_id) elif isinstance(value, list) or isinstance(value, tuple): for i, sv in enumerate(value): if isinstance(sv, dict): subdict = _encode_nested_dict("%s[%d]" % (key, i), sv) for k, v in _api_encode(subdict): yield (k, v) else: yield ("%s[%d]" % (key, i), sv) elif isinstance(value, dict): subdict = _encode_nested_dict(key, value) for subkey, subvalue in _api_encode(subdict): yield (subkey, subvalue) elif isinstance(value, datetime.datetime): yield (key, _encode_datetime(value)) else: yield (key, value) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_entitlements_service.py0000644000175100001770000000100614637354563020773 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_service import StripeService from stripe.entitlements._active_entitlement_service import ( ActiveEntitlementService, ) from stripe.entitlements._feature_service import FeatureService class EntitlementsService(StripeService): def __init__(self, requestor): super().__init__(requestor) self.active_entitlements = ActiveEntitlementService(self._requestor) self.features = FeatureService(self._requestor) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_ephemeral_key.py0000644000175100001770000001110114637354563017347 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._deletable_api_resource import DeletableAPIResource from stripe._request_options import RequestOptions from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, List, Optional, cast, overload from typing_extensions import Literal, NotRequired, Unpack class EphemeralKey( CreateableAPIResource["EphemeralKey"], DeletableAPIResource["EphemeralKey"], ): OBJECT_NAME: ClassVar[Literal["ephemeral_key"]] = "ephemeral_key" class DeleteParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ expires: int """ Time at which the key will expire. Measured in seconds since the Unix epoch. """ id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ object: Literal["ephemeral_key"] """ String representing the object's type. Objects of the same type share the same value. """ secret: Optional[str] """ The key's secret. You can use this value to make authorized requests to the Stripe API. """ @classmethod def _cls_delete( cls, sid: str, **params: Unpack["EphemeralKey.DeleteParams"] ) -> "EphemeralKey": """ Invalidates a short-lived API key for a given resource. """ url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "EphemeralKey", cls._static_request( "delete", url, params=params, ), ) @overload @staticmethod def delete( sid: str, **params: Unpack["EphemeralKey.DeleteParams"] ) -> "EphemeralKey": """ Invalidates a short-lived API key for a given resource. """ ... @overload def delete( self, **params: Unpack["EphemeralKey.DeleteParams"] ) -> "EphemeralKey": """ Invalidates a short-lived API key for a given resource. """ ... @class_method_variant("_cls_delete") def delete( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["EphemeralKey.DeleteParams"] ) -> "EphemeralKey": """ Invalidates a short-lived API key for a given resource. """ return self._request_and_refresh( "delete", self.instance_url(), params=params, ) @classmethod async def _cls_delete_async( cls, sid: str, **params: Unpack["EphemeralKey.DeleteParams"] ) -> "EphemeralKey": """ Invalidates a short-lived API key for a given resource. """ url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "EphemeralKey", await cls._static_request_async( "delete", url, params=params, ), ) @overload @staticmethod async def delete_async( sid: str, **params: Unpack["EphemeralKey.DeleteParams"] ) -> "EphemeralKey": """ Invalidates a short-lived API key for a given resource. """ ... @overload async def delete_async( self, **params: Unpack["EphemeralKey.DeleteParams"] ) -> "EphemeralKey": """ Invalidates a short-lived API key for a given resource. """ ... @class_method_variant("_cls_delete_async") async def delete_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["EphemeralKey.DeleteParams"] ) -> "EphemeralKey": """ Invalidates a short-lived API key for a given resource. """ return await self._request_and_refresh_async( "delete", self.instance_url(), params=params, ) @classmethod def create(cls, **params): if params.get("stripe_version") is None: raise ValueError( "stripe_version must be specified to create an ephemeral " "key" ) url = cls.class_url() return cls._static_request( "post", url, params=params, base_address="api", api_mode="V1", ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_ephemeral_key_service.py0000644000175100001770000000707714637354563021110 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._ephemeral_key import EphemeralKey from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict class EphemeralKeyService(StripeService): class CreateParams(TypedDict): customer: NotRequired[str] """ The ID of the Customer you'd like to modify using the resulting ephemeral key. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ issuing_card: NotRequired[str] """ The ID of the Issuing Card you'd like to access using the resulting ephemeral key. """ nonce: NotRequired[str] """ A single-use token, created by Stripe.js, used for creating ephemeral keys for Issuing Cards without exchanging sensitive information. """ verification_session: NotRequired[str] """ The ID of the Identity VerificationSession you'd like to access using the resulting ephemeral key """ class DeleteParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def delete( self, key: str, params: "EphemeralKeyService.DeleteParams" = {}, options: RequestOptions = {}, ) -> EphemeralKey: """ Invalidates a short-lived API key for a given resource. """ return cast( EphemeralKey, self._request( "delete", "/v1/ephemeral_keys/{key}".format(key=sanitize_id(key)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def delete_async( self, key: str, params: "EphemeralKeyService.DeleteParams" = {}, options: RequestOptions = {}, ) -> EphemeralKey: """ Invalidates a short-lived API key for a given resource. """ return cast( EphemeralKey, await self._request_async( "delete", "/v1/ephemeral_keys/{key}".format(key=sanitize_id(key)), api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "EphemeralKeyService.CreateParams" = {}, options: RequestOptions = {}, ) -> EphemeralKey: """ Creates a short-lived API key for a given resource. """ return cast( EphemeralKey, self._request( "post", "/v1/ephemeral_keys", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "EphemeralKeyService.CreateParams" = {}, options: RequestOptions = {}, ) -> EphemeralKey: """ Creates a short-lived API key for a given resource. """ return cast( EphemeralKey, await self._request_async( "post", "/v1/ephemeral_keys", api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_error.py0000644000175100001770000001136514637354563015702 0ustar00runnerdockerfrom typing import Dict, Optional, Union, cast # Used for global variable import stripe # noqa: IMP101 from stripe._error_object import ErrorObject class StripeError(Exception): _message: Optional[str] http_body: Optional[str] http_status: Optional[int] json_body: Optional[object] headers: Optional[Dict[str, str]] code: Optional[str] request_id: Optional[str] error: Optional[ErrorObject] def __init__( self, message: Optional[str] = None, http_body: Optional[Union[bytes, str]] = None, http_status: Optional[int] = None, json_body: Optional[object] = None, headers: Optional[Dict[str, str]] = None, code: Optional[str] = None, ): super(StripeError, self).__init__(message) body: Optional[str] = None if http_body and hasattr(http_body, "decode"): try: body = cast(bytes, http_body).decode("utf-8") except BaseException: body = ( "" ) self._message = message self.http_body = body self.http_status = http_status self.json_body = json_body self.headers = headers or {} self.code = code self.request_id = self.headers.get("request-id", None) self.error = self._construct_error_object() def __str__(self): msg = self._message or "" if self.request_id is not None: return "Request {0}: {1}".format(self.request_id, msg) else: return msg # Returns the underlying `Exception` (base class) message, which is usually # the raw message returned by Stripe's API. This was previously available # in python2 via `error.message`. Unlike `str(error)`, it omits "Request # req_..." from the beginning of the string. @property def user_message(self): return self._message def __repr__(self): return "%s(message=%r, http_status=%r, request_id=%r)" % ( self.__class__.__name__, self._message, self.http_status, self.request_id, ) def _construct_error_object(self) -> Optional[ErrorObject]: if ( self.json_body is None or not isinstance(self.json_body, dict) or "error" not in self.json_body or not isinstance(self.json_body["error"], dict) ): return None return ErrorObject._construct_from( values=self.json_body["error"], requestor=stripe._APIRequestor._global_instance(), api_mode="V1", ) class APIError(StripeError): pass class APIConnectionError(StripeError): should_retry: bool def __init__( self, message, http_body=None, http_status=None, json_body=None, headers=None, code=None, should_retry=False, ): super(APIConnectionError, self).__init__( message, http_body, http_status, json_body, headers, code ) self.should_retry = should_retry class StripeErrorWithParamCode(StripeError): def __repr__(self): return ( "%s(message=%r, param=%r, code=%r, http_status=%r, " "request_id=%r)" % ( self.__class__.__name__, self._message, self.param, # pyright: ignore self.code, self.http_status, self.request_id, ) ) class CardError(StripeErrorWithParamCode): def __init__( self, message, param, code, http_body=None, http_status=None, json_body=None, headers=None, ): super(CardError, self).__init__( message, http_body, http_status, json_body, headers, code ) self.param = param class IdempotencyError(StripeError): pass class InvalidRequestError(StripeErrorWithParamCode): def __init__( self, message, param, code=None, http_body=None, http_status=None, json_body=None, headers=None, ): super(InvalidRequestError, self).__init__( message, http_body, http_status, json_body, headers, code ) self.param = param class AuthenticationError(StripeError): pass class PermissionError(StripeError): pass class RateLimitError(StripeError): pass class SignatureVerificationError(StripeError): def __init__(self, message, sig_header, http_body=None): super(SignatureVerificationError, self).__init__(message, http_body) self.sig_header = sig_header ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_error_object.py0000644000175100001770000000755714637354563017240 0ustar00runnerdockerfrom typing import Optional from typing_extensions import TYPE_CHECKING from stripe._util import merge_dicts from stripe._stripe_object import StripeObject from stripe._api_mode import ApiMode if TYPE_CHECKING: from stripe._payment_intent import PaymentIntent from stripe._setup_intent import SetupIntent from stripe._source import Source from stripe._payment_method import PaymentMethod class ErrorObject(StripeObject): charge: Optional[str] code: Optional[str] decline_code: Optional[str] doc_url: Optional[str] message: Optional[str] param: Optional[str] payment_intent: Optional["PaymentIntent"] payment_method: Optional["PaymentMethod"] setup_intent: Optional["SetupIntent"] source: Optional["Source"] type: str def refresh_from( self, values, api_key=None, partial=False, stripe_version=None, stripe_account=None, last_response=None, *, api_mode: ApiMode = "V1", ): return self._refresh_from( values=values, partial=partial, last_response=last_response, requestor=self._requestor._replace_options( { "api_key": api_key, "stripe_version": stripe_version, "stripe_account": stripe_account, } ), api_mode=api_mode, ) def _refresh_from( self, *, values, partial=False, last_response=None, requestor, api_mode: ApiMode, ) -> None: # Unlike most other API resources, the API will omit attributes in # error objects when they have a null value. We manually set default # values here to facilitate generic error handling. values = merge_dicts( { "charge": None, "code": None, "decline_code": None, "doc_url": None, "message": None, "param": None, "payment_intent": None, "payment_method": None, "setup_intent": None, "source": None, "type": None, }, values, ) return super(ErrorObject, self)._refresh_from( values=values, partial=partial, last_response=last_response, requestor=requestor, api_mode=api_mode, ) class OAuthErrorObject(StripeObject): def refresh_from( self, values, api_key=None, partial=False, stripe_version=None, stripe_account=None, last_response=None, *, api_mode: ApiMode = "V1", ): return self._refresh_from( values=values, partial=partial, last_response=last_response, requestor=self._requestor._replace_options( { "api_key": api_key, "stripe_version": stripe_version, "stripe_account": stripe_account, } ), api_mode=api_mode, ) def _refresh_from( self, *, values, partial=False, last_response=None, requestor, api_mode: ApiMode, ) -> None: # Unlike most other API resources, the API will omit attributes in # error objects when they have a null value. We manually set default # values here to facilitate generic error handling. values = merge_dicts( {"error": None, "error_description": None}, values ) return super(OAuthErrorObject, self)._refresh_from( values=values, partial=partial, last_response=last_response, requestor=requestor, api_mode=api_mode, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_event.py0000644000175100001770000004422414637354563015672 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from typing import Any, ClassVar, Dict, List, Optional from typing_extensions import Literal, NotRequired, TypedDict, Unpack class Event(ListableAPIResource["Event"]): """ Events are our way of letting you know when something interesting happens in your account. When an interesting event occurs, we create a new `Event` object. For example, when a charge succeeds, we create a `charge.succeeded` event, and when an invoice payment attempt fails, we create an `invoice.payment_failed` event. Certain API requests might create multiple events. For example, if you create a new subscription for a customer, you receive both a `customer.subscription.created` event and a `charge.succeeded` event. Events occur when the state of another API resource changes. The event's data field embeds the resource's state at the time of the change. For example, a `charge.succeeded` event contains a charge, and an `invoice.payment_failed` event contains an invoice. As with other API resources, you can use endpoints to retrieve an [individual event](https://stripe.com/docs/api#retrieve_event) or a [list of events](https://stripe.com/docs/api#list_events) from the API. We also have a separate [webhooks](http://en.wikipedia.org/wiki/Webhook) system for sending the `Event` objects directly to an endpoint on your server. You can manage webhooks in your [account settings](https://dashboard.stripe.com/account/webhooks). Learn how to [listen for events](https://docs.stripe.com/webhooks) so that your integration can automatically trigger reactions. When using [Connect](https://docs.stripe.com/connect), you can also receive event notifications that occur in connected accounts. For these events, there's an additional `account` attribute in the received `Event` object. We only guarantee access to events through the [Retrieve Event API](https://stripe.com/docs/api#retrieve_event) for 30 days. """ OBJECT_NAME: ClassVar[Literal["event"]] = "event" class Data(StripeObject): object: Dict[str, Any] """ Object containing the API resource relevant to the event. For example, an `invoice.created` event will have a full [invoice object](https://stripe.com/docs/api#invoice_object) as the value of the object key. """ previous_attributes: Optional[Dict[str, Any]] """ Object containing the names of the updated attributes and their values prior to the event (only included in events of type `*.updated`). If an array attribute has any updated elements, this object contains the entire array. In Stripe API versions 2017-04-06 or earlier, an updated array attribute in this object includes only the updated array elements. """ class Request(StripeObject): id: Optional[str] """ ID of the API request that caused the event. If null, the event was automatic (e.g., Stripe's automatic subscription handling). Request logs are available in the [dashboard](https://dashboard.stripe.com/logs), but currently not in the API. """ idempotency_key: Optional[str] """ The idempotency key transmitted during the request, if any. *Note: This property is populated only for events on or after May 23, 2017*. """ class ListParams(RequestOptions): created: NotRequired["Event.ListParamsCreated|int"] """ Only return events that were created during the given date interval. """ delivery_success: NotRequired[bool] """ Filter events by whether all webhooks were successfully delivered. If false, events which are still pending or have failed all delivery attempts to a webhook endpoint will be returned. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ type: NotRequired[str] """ A string containing a specific event name, or group of events using * as a wildcard. The list will be filtered to include only events with a matching event property. """ types: NotRequired[List[str]] """ An array of up to 20 strings containing specific event names. The list will be filtered to include only events with a matching event property. You may pass either `type` or `types`, but not both. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ account: Optional[str] """ The connected account that originates the event. """ api_version: Optional[str] """ The Stripe API version used to render `data`. This property is populated only for events on or after October 31, 2014. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ data: Data id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ object: Literal["event"] """ String representing the object's type. Objects of the same type share the same value. """ pending_webhooks: int """ Number of webhooks that haven't been successfully delivered (for example, to return a 20x response) to the URLs you specify. """ request: Optional[Request] """ Information on the API request that triggers the event. """ type: Literal[ "account.application.authorized", "account.application.deauthorized", "account.external_account.created", "account.external_account.deleted", "account.external_account.updated", "account.updated", "application_fee.created", "application_fee.refund.updated", "application_fee.refunded", "balance.available", "billing_portal.configuration.created", "billing_portal.configuration.updated", "billing_portal.session.created", "capability.updated", "cash_balance.funds_available", "charge.captured", "charge.dispute.closed", "charge.dispute.created", "charge.dispute.funds_reinstated", "charge.dispute.funds_withdrawn", "charge.dispute.updated", "charge.expired", "charge.failed", "charge.pending", "charge.refund.updated", "charge.refunded", "charge.succeeded", "charge.updated", "checkout.session.async_payment_failed", "checkout.session.async_payment_succeeded", "checkout.session.completed", "checkout.session.expired", "climate.order.canceled", "climate.order.created", "climate.order.delayed", "climate.order.delivered", "climate.order.product_substituted", "climate.product.created", "climate.product.pricing_updated", "coupon.created", "coupon.deleted", "coupon.updated", "credit_note.created", "credit_note.updated", "credit_note.voided", "customer.created", "customer.deleted", "customer.discount.created", "customer.discount.deleted", "customer.discount.updated", "customer.source.created", "customer.source.deleted", "customer.source.expiring", "customer.source.updated", "customer.subscription.created", "customer.subscription.deleted", "customer.subscription.paused", "customer.subscription.pending_update_applied", "customer.subscription.pending_update_expired", "customer.subscription.resumed", "customer.subscription.trial_will_end", "customer.subscription.updated", "customer.tax_id.created", "customer.tax_id.deleted", "customer.tax_id.updated", "customer.updated", "customer_cash_balance_transaction.created", "entitlements.active_entitlement_summary.updated", "file.created", "financial_connections.account.created", "financial_connections.account.deactivated", "financial_connections.account.disconnected", "financial_connections.account.reactivated", "financial_connections.account.refreshed_balance", "financial_connections.account.refreshed_ownership", "financial_connections.account.refreshed_transactions", "identity.verification_session.canceled", "identity.verification_session.created", "identity.verification_session.processing", "identity.verification_session.redacted", "identity.verification_session.requires_input", "identity.verification_session.verified", "invoice.created", "invoice.deleted", "invoice.finalization_failed", "invoice.finalized", "invoice.marked_uncollectible", "invoice.paid", "invoice.payment_action_required", "invoice.payment_failed", "invoice.payment_succeeded", "invoice.sent", "invoice.upcoming", "invoice.updated", "invoice.voided", "invoiceitem.created", "invoiceitem.deleted", "issuing_authorization.created", "issuing_authorization.request", "issuing_authorization.updated", "issuing_card.created", "issuing_card.updated", "issuing_cardholder.created", "issuing_cardholder.updated", "issuing_dispute.closed", "issuing_dispute.created", "issuing_dispute.funds_reinstated", "issuing_dispute.submitted", "issuing_dispute.updated", "issuing_personalization_design.activated", "issuing_personalization_design.deactivated", "issuing_personalization_design.rejected", "issuing_personalization_design.updated", "issuing_token.created", "issuing_token.updated", "issuing_transaction.created", "issuing_transaction.updated", "mandate.updated", "payment_intent.amount_capturable_updated", "payment_intent.canceled", "payment_intent.created", "payment_intent.partially_funded", "payment_intent.payment_failed", "payment_intent.processing", "payment_intent.requires_action", "payment_intent.succeeded", "payment_link.created", "payment_link.updated", "payment_method.attached", "payment_method.automatically_updated", "payment_method.detached", "payment_method.updated", "payout.canceled", "payout.created", "payout.failed", "payout.paid", "payout.reconciliation_completed", "payout.updated", "person.created", "person.deleted", "person.updated", "plan.created", "plan.deleted", "plan.updated", "price.created", "price.deleted", "price.updated", "product.created", "product.deleted", "product.updated", "promotion_code.created", "promotion_code.updated", "quote.accepted", "quote.canceled", "quote.created", "quote.finalized", "radar.early_fraud_warning.created", "radar.early_fraud_warning.updated", "refund.created", "refund.updated", "reporting.report_run.failed", "reporting.report_run.succeeded", "reporting.report_type.updated", "review.closed", "review.opened", "setup_intent.canceled", "setup_intent.created", "setup_intent.requires_action", "setup_intent.setup_failed", "setup_intent.succeeded", "sigma.scheduled_query_run.created", "source.canceled", "source.chargeable", "source.failed", "source.mandate_notification", "source.refund_attributes_required", "source.transaction.created", "source.transaction.updated", "subscription_schedule.aborted", "subscription_schedule.canceled", "subscription_schedule.completed", "subscription_schedule.created", "subscription_schedule.expiring", "subscription_schedule.released", "subscription_schedule.updated", "tax.settings.updated", "tax_rate.created", "tax_rate.updated", "terminal.reader.action_failed", "terminal.reader.action_succeeded", "test_helpers.test_clock.advancing", "test_helpers.test_clock.created", "test_helpers.test_clock.deleted", "test_helpers.test_clock.internal_failure", "test_helpers.test_clock.ready", "topup.canceled", "topup.created", "topup.failed", "topup.reversed", "topup.succeeded", "transfer.created", "transfer.reversed", "transfer.updated", "treasury.credit_reversal.created", "treasury.credit_reversal.posted", "treasury.debit_reversal.completed", "treasury.debit_reversal.created", "treasury.debit_reversal.initial_credit_granted", "treasury.financial_account.closed", "treasury.financial_account.created", "treasury.financial_account.features_status_updated", "treasury.inbound_transfer.canceled", "treasury.inbound_transfer.created", "treasury.inbound_transfer.failed", "treasury.inbound_transfer.succeeded", "treasury.outbound_payment.canceled", "treasury.outbound_payment.created", "treasury.outbound_payment.expected_arrival_date_updated", "treasury.outbound_payment.failed", "treasury.outbound_payment.posted", "treasury.outbound_payment.returned", "treasury.outbound_payment.tracking_details_updated", "treasury.outbound_transfer.canceled", "treasury.outbound_transfer.created", "treasury.outbound_transfer.expected_arrival_date_updated", "treasury.outbound_transfer.failed", "treasury.outbound_transfer.posted", "treasury.outbound_transfer.returned", "treasury.outbound_transfer.tracking_details_updated", "treasury.received_credit.created", "treasury.received_credit.failed", "treasury.received_credit.succeeded", "treasury.received_debit.created", ] """ Description of the event (for example, `invoice.created` or `charge.refunded`). """ @classmethod def list(cls, **params: Unpack["Event.ListParams"]) -> ListObject["Event"]: """ List events, going back up to 30 days. Each event data is rendered according to Stripe API version at its creation time, specified in [event object](https://docs.stripe.com/api/events/object) api_version attribute (not according to your current Stripe API version or Stripe-Version header). """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["Event.ListParams"] ) -> ListObject["Event"]: """ List events, going back up to 30 days. Each event data is rendered according to Stripe API version at its creation time, specified in [event object](https://docs.stripe.com/api/events/object) api_version attribute (not according to your current Stripe API version or Stripe-Version header). """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def retrieve( cls, id: str, **params: Unpack["Event.RetrieveParams"] ) -> "Event": """ Retrieves the details of an event. Supply the unique identifier of the event, which you might have received in a webhook. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["Event.RetrieveParams"] ) -> "Event": """ Retrieves the details of an event. Supply the unique identifier of the event, which you might have received in a webhook. """ instance = cls(id, **params) await instance.refresh_async() return instance _inner_class_types = {"data": Data, "request": Request} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_event_service.py0000644000175100001770000001324114637354563017405 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._event import Event from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict class EventService(StripeService): class ListParams(TypedDict): created: NotRequired["EventService.ListParamsCreated|int"] """ Only return events that were created during the given date interval. """ delivery_success: NotRequired[bool] """ Filter events by whether all webhooks were successfully delivered. If false, events which are still pending or have failed all delivery attempts to a webhook endpoint will be returned. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ type: NotRequired[str] """ A string containing a specific event name, or group of events using * as a wildcard. The list will be filtered to include only events with a matching event property. """ types: NotRequired[List[str]] """ An array of up to 20 strings containing specific event names. The list will be filtered to include only events with a matching event property. You may pass either `type` or `types`, but not both. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def list( self, params: "EventService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Event]: """ List events, going back up to 30 days. Each event data is rendered according to Stripe API version at its creation time, specified in [event object](https://docs.stripe.com/api/events/object) api_version attribute (not according to your current Stripe API version or Stripe-Version header). """ return cast( ListObject[Event], self._request( "get", "/v1/events", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "EventService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Event]: """ List events, going back up to 30 days. Each event data is rendered according to Stripe API version at its creation time, specified in [event object](https://docs.stripe.com/api/events/object) api_version attribute (not according to your current Stripe API version or Stripe-Version header). """ return cast( ListObject[Event], await self._request_async( "get", "/v1/events", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, id: str, params: "EventService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Event: """ Retrieves the details of an event. Supply the unique identifier of the event, which you might have received in a webhook. """ return cast( Event, self._request( "get", "/v1/events/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, id: str, params: "EventService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Event: """ Retrieves the details of an event. Supply the unique identifier of the event, which you might have received in a webhook. """ return cast( Event, await self._request_async( "get", "/v1/events/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_exchange_rate.py0000644000175100001770000001335114637354563017343 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from typing import ClassVar, Dict, List from typing_extensions import Literal, NotRequired, Unpack class ExchangeRate(ListableAPIResource["ExchangeRate"]): """ `ExchangeRate` objects allow you to determine the rates that Stripe is currently using to convert from one currency to another. Since this number is variable throughout the day, there are various reasons why you might want to know the current rate (for example, to dynamically price an item for a user with a default payment in a foreign currency). Please refer to our [Exchange Rates API](https://stripe.com/docs/fx-rates) guide for more details. *[Note: this integration path is supported but no longer recommended]* Additionally, you can guarantee that a charge is made with an exchange rate that you expect is current. To do so, you must pass in the exchange_rate to charges endpoints. If the value is no longer up to date, the charge won't go through. Please refer to our [Using with charges](https://stripe.com/docs/exchange-rates) guide for more details. -----   *This Exchange Rates API is a Beta Service and is subject to Stripe's terms of service. You may use the API solely for the purpose of transacting on Stripe. For example, the API may be queried in order to:* - *localize prices for processing payments on Stripe* - *reconcile Stripe transactions* - *determine how much money to send to a connected account* - *determine app fees to charge a connected account* *Using this Exchange Rates API beta for any purpose other than to transact on Stripe is strictly prohibited and constitutes a violation of Stripe's terms of service.* """ OBJECT_NAME: ClassVar[Literal["exchange_rate"]] = "exchange_rate" class ListParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is the currency that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with the exchange rate for currency X your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and total number of supported payout currencies, and the default is the max. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is the currency that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with the exchange rate for currency X, your subsequent call can include `starting_after=X` in order to fetch the next page of the list. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ id: str """ Unique identifier for the object. Represented as the three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) in lowercase. """ object: Literal["exchange_rate"] """ String representing the object's type. Objects of the same type share the same value. """ rates: Dict[str, float] """ Hash where the keys are supported currencies and the values are the exchange rate at which the base id currency converts to the key currency. """ @classmethod def list( cls, **params: Unpack["ExchangeRate.ListParams"] ) -> ListObject["ExchangeRate"]: """ Returns a list of objects that contain the rates at which foreign currencies are converted to one another. Only shows the currencies for which Stripe supports. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["ExchangeRate.ListParams"] ) -> ListObject["ExchangeRate"]: """ Returns a list of objects that contain the rates at which foreign currencies are converted to one another. Only shows the currencies for which Stripe supports. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def retrieve( cls, id: str, **params: Unpack["ExchangeRate.RetrieveParams"] ) -> "ExchangeRate": """ Retrieves the exchange rates from the given currency to every supported currency. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["ExchangeRate.RetrieveParams"] ) -> "ExchangeRate": """ Retrieves the exchange rates from the given currency to every supported currency. """ instance = cls(id, **params) await instance.refresh_async() return instance ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_exchange_rate_service.py0000644000175100001770000001051014637354563021055 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._exchange_rate import ExchangeRate from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict class ExchangeRateService(StripeService): class ListParams(TypedDict): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is the currency that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with the exchange rate for currency X your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and total number of supported payout currencies, and the default is the max. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is the currency that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with the exchange rate for currency X, your subsequent call can include `starting_after=X` in order to fetch the next page of the list. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def list( self, params: "ExchangeRateService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[ExchangeRate]: """ Returns a list of objects that contain the rates at which foreign currencies are converted to one another. Only shows the currencies for which Stripe supports. """ return cast( ListObject[ExchangeRate], self._request( "get", "/v1/exchange_rates", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "ExchangeRateService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[ExchangeRate]: """ Returns a list of objects that contain the rates at which foreign currencies are converted to one another. Only shows the currencies for which Stripe supports. """ return cast( ListObject[ExchangeRate], await self._request_async( "get", "/v1/exchange_rates", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, rate_id: str, params: "ExchangeRateService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> ExchangeRate: """ Retrieves the exchange rates from the given currency to every supported currency. """ return cast( ExchangeRate, self._request( "get", "/v1/exchange_rates/{rate_id}".format( rate_id=sanitize_id(rate_id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, rate_id: str, params: "ExchangeRateService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> ExchangeRate: """ Retrieves the exchange rates from the given currency to every supported currency. """ return cast( ExchangeRate, await self._request_async( "get", "/v1/exchange_rates/{rate_id}".format( rate_id=sanitize_id(rate_id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_expandable_field.py0000644000175100001770000000012414637354563020006 0ustar00runnerdockerfrom typing import Union, TypeVar T = TypeVar("T") ExpandableField = Union[str, T] ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_file.py0000644000175100001770000002642314637354563015471 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from typing import Any, ClassVar, Dict, List, Optional, cast from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._file_link import FileLink class File(CreateableAPIResource["File"], ListableAPIResource["File"]): """ This object represents files hosted on Stripe's servers. You can upload files with the [create file](https://stripe.com/docs/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://stripe.com/docs/api#scheduled_queries)). Related guide: [File upload guide](https://stripe.com/docs/file-upload) """ OBJECT_NAME: ClassVar[Literal["file"]] = "file" class CreateParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ file: Any """ A file to upload. Make sure that the specifications follow RFC 2388, which defines file transfers for the `multipart/form-data` protocol. """ file_link_data: NotRequired["File.CreateParamsFileLinkData"] """ Optional parameters that automatically create a [file link](https://stripe.com/docs/api#file_links) for the newly created file. """ purpose: Literal[ "account_requirement", "additional_verification", "business_icon", "business_logo", "customer_signature", "dispute_evidence", "identity_document", "pci_document", "tax_document_user_upload", "terminal_reader_splashscreen", ] """ The [purpose](https://stripe.com/docs/file-upload#uploading-a-file) of the uploaded file. """ class CreateParamsFileLinkData(TypedDict): create: bool """ Set this to `true` to create a file link for the newly created file. Creating a link is only possible when the file's `purpose` is one of the following: `business_icon`, `business_logo`, `customer_signature`, `dispute_evidence`, `pci_document`, `tax_document_user_upload`, or `terminal_reader_splashscreen`. """ expires_at: NotRequired[int] """ The link isn't available after this future timestamp. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ class ListParams(RequestOptions): created: NotRequired["File.ListParamsCreated|int"] """ Only return files that were created during the given date interval. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ purpose: NotRequired[ Literal[ "account_requirement", "additional_verification", "business_icon", "business_logo", "customer_signature", "dispute_evidence", "document_provider_identity_document", "finance_report_run", "identity_document", "identity_document_downloadable", "pci_document", "selfie", "sigma_scheduled_query", "tax_document_user_upload", "terminal_reader_splashscreen", ] ] """ Filter queries by the file purpose. If you don't provide a purpose, the queries return unfiltered files. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ expires_at: Optional[int] """ The file expires and isn't available at this time in epoch seconds. """ filename: Optional[str] """ The suitable name for saving the file to a filesystem. """ id: str """ Unique identifier for the object. """ links: Optional[ListObject["FileLink"]] """ A list of [file links](https://stripe.com/docs/api#file_links) that point at this file. """ object: Literal["file"] """ String representing the object's type. Objects of the same type share the same value. """ purpose: Literal[ "account_requirement", "additional_verification", "business_icon", "business_logo", "customer_signature", "dispute_evidence", "document_provider_identity_document", "finance_report_run", "identity_document", "identity_document_downloadable", "pci_document", "selfie", "sigma_scheduled_query", "tax_document_user_upload", "terminal_reader_splashscreen", ] """ The [purpose](https://stripe.com/docs/file-upload#uploading-a-file) of the uploaded file. """ size: int """ The size of the file object in bytes. """ title: Optional[str] """ A suitable title for the document. """ type: Optional[str] """ The returned file type (for example, `csv`, `pdf`, `jpg`, or `png`). """ url: Optional[str] """ Use your live secret API key to download the file from this URL. """ @classmethod def create(cls, **params: Unpack["File.CreateParams"]) -> "File": """ To upload a file to Stripe, you need to send a request of type multipart/form-data. Include the file you want to upload in the request, and the parameters for creating a file. All of Stripe's officially supported Client libraries support sending multipart/form-data. """ return cast( "File", cls._static_request( "post", cls.class_url(), params=params, base_address="files", api_mode="V1FILES", ), ) @classmethod async def create_async( cls, **params: Unpack["File.CreateParams"] ) -> "File": """ To upload a file to Stripe, you need to send a request of type multipart/form-data. Include the file you want to upload in the request, and the parameters for creating a file. All of Stripe's officially supported Client libraries support sending multipart/form-data. """ return cast( "File", await cls._static_request_async( "post", cls.class_url(), params=params, base_address="files", api_mode="V1FILES", ), ) @classmethod def list(cls, **params: Unpack["File.ListParams"]) -> ListObject["File"]: """ Returns a list of the files that your account has access to. Stripe sorts and returns the files by their creation dates, placing the most recently created files at the top. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["File.ListParams"] ) -> ListObject["File"]: """ Returns a list of the files that your account has access to. Stripe sorts and returns the files by their creation dates, placing the most recently created files at the top. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def retrieve( cls, id: str, **params: Unpack["File.RetrieveParams"] ) -> "File": """ Retrieves the details of an existing file object. After you supply a unique file ID, Stripe returns the corresponding file object. Learn how to [access file contents](https://stripe.com/docs/file-upload#download-file-contents). """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["File.RetrieveParams"] ) -> "File": """ Retrieves the details of an existing file object. After you supply a unique file ID, Stripe returns the corresponding file object. Learn how to [access file contents](https://stripe.com/docs/file-upload#download-file-contents). """ instance = cls(id, **params) await instance.refresh_async() return instance # This resource can have two different object names. In latter API # versions, only `file` is used, but since stripe-python may be used with # any API version, we need to support deserializing the older # `file_upload` object into the same class. OBJECT_NAME_ALT = "file_upload" @classmethod def class_url(cls): return "/v1/files" # For backwards compatibility, the `File` class is aliased to `FileUpload`. FileUpload = File ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_file_link.py0000644000175100001770000002234314637354563016503 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import sanitize_id from typing import ClassVar, Dict, List, Optional, cast from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._file import File class FileLink( CreateableAPIResource["FileLink"], ListableAPIResource["FileLink"], UpdateableAPIResource["FileLink"], ): """ To share the contents of a `File` object with non-Stripe users, you can create a `FileLink`. `FileLink`s contain a URL that you can use to retrieve the contents of the file without authentication. """ OBJECT_NAME: ClassVar[Literal["file_link"]] = "file_link" class CreateParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ expires_at: NotRequired[int] """ The link isn't usable after this future timestamp. """ file: str """ The ID of the file. The file's `purpose` must be one of the following: `business_icon`, `business_logo`, `customer_signature`, `dispute_evidence`, `finance_report_run`, `identity_document_downloadable`, `pci_document`, `selfie`, `sigma_scheduled_query`, `tax_document_user_upload`, or `terminal_reader_splashscreen`. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ class ListParams(RequestOptions): created: NotRequired["FileLink.ListParamsCreated|int"] """ Only return links that were created during the given date interval. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ expired: NotRequired[bool] """ Filter links by their expiration status. By default, Stripe returns all links. """ file: NotRequired[str] """ Only return links for the given file. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ expires_at: NotRequired["Literal['']|Literal['now']|int"] """ A future timestamp after which the link will no longer be usable, or `now` to expire the link immediately. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ expired: bool """ Returns if the link is already expired. """ expires_at: Optional[int] """ Time that the link expires. """ file: ExpandableField["File"] """ The file object this link points to. """ id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ metadata: Dict[str, str] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ object: Literal["file_link"] """ String representing the object's type. Objects of the same type share the same value. """ url: Optional[str] """ The publicly accessible URL to download the file. """ @classmethod def create(cls, **params: Unpack["FileLink.CreateParams"]) -> "FileLink": """ Creates a new file link object. """ return cast( "FileLink", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["FileLink.CreateParams"] ) -> "FileLink": """ Creates a new file link object. """ return cast( "FileLink", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def list( cls, **params: Unpack["FileLink.ListParams"] ) -> ListObject["FileLink"]: """ Returns a list of file links. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["FileLink.ListParams"] ) -> ListObject["FileLink"]: """ Returns a list of file links. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def modify( cls, id: str, **params: Unpack["FileLink.ModifyParams"] ) -> "FileLink": """ Updates an existing file link object. Expired links can no longer be updated. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "FileLink", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["FileLink.ModifyParams"] ) -> "FileLink": """ Updates an existing file link object. Expired links can no longer be updated. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "FileLink", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["FileLink.RetrieveParams"] ) -> "FileLink": """ Retrieves the file link with the given ID. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["FileLink.RetrieveParams"] ) -> "FileLink": """ Retrieves the file link with the given ID. """ instance = cls(id, **params) await instance.refresh_async() return instance ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_file_link_service.py0000644000175100001770000002105114637354563020216 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._file_link import FileLink from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class FileLinkService(StripeService): class CreateParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ expires_at: NotRequired[int] """ The link isn't usable after this future timestamp. """ file: str """ The ID of the file. The file's `purpose` must be one of the following: `business_icon`, `business_logo`, `customer_signature`, `dispute_evidence`, `finance_report_run`, `identity_document_downloadable`, `pci_document`, `selfie`, `sigma_scheduled_query`, `tax_document_user_upload`, or `terminal_reader_splashscreen`. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ class ListParams(TypedDict): created: NotRequired["FileLinkService.ListParamsCreated|int"] """ Only return links that were created during the given date interval. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ expired: NotRequired[bool] """ Filter links by their expiration status. By default, Stripe returns all links. """ file: NotRequired[str] """ Only return links for the given file. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ expires_at: NotRequired["Literal['']|Literal['now']|int"] """ A future timestamp after which the link will no longer be usable, or `now` to expire the link immediately. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ def list( self, params: "FileLinkService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[FileLink]: """ Returns a list of file links. """ return cast( ListObject[FileLink], self._request( "get", "/v1/file_links", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "FileLinkService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[FileLink]: """ Returns a list of file links. """ return cast( ListObject[FileLink], await self._request_async( "get", "/v1/file_links", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "FileLinkService.CreateParams", options: RequestOptions = {}, ) -> FileLink: """ Creates a new file link object. """ return cast( FileLink, self._request( "post", "/v1/file_links", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "FileLinkService.CreateParams", options: RequestOptions = {}, ) -> FileLink: """ Creates a new file link object. """ return cast( FileLink, await self._request_async( "post", "/v1/file_links", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, link: str, params: "FileLinkService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> FileLink: """ Retrieves the file link with the given ID. """ return cast( FileLink, self._request( "get", "/v1/file_links/{link}".format(link=sanitize_id(link)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, link: str, params: "FileLinkService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> FileLink: """ Retrieves the file link with the given ID. """ return cast( FileLink, await self._request_async( "get", "/v1/file_links/{link}".format(link=sanitize_id(link)), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, link: str, params: "FileLinkService.UpdateParams" = {}, options: RequestOptions = {}, ) -> FileLink: """ Updates an existing file link object. Expired links can no longer be updated. """ return cast( FileLink, self._request( "post", "/v1/file_links/{link}".format(link=sanitize_id(link)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, link: str, params: "FileLinkService.UpdateParams" = {}, options: RequestOptions = {}, ) -> FileLink: """ Updates an existing file link object. Expired links can no longer be updated. """ return cast( FileLink, await self._request_async( "post", "/v1/file_links/{link}".format(link=sanitize_id(link)), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_file_service.py0000644000175100001770000002211514637354563017203 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._file import File from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import Any, Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class FileService(StripeService): class CreateParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ file: Any """ A file to upload. Make sure that the specifications follow RFC 2388, which defines file transfers for the `multipart/form-data` protocol. """ file_link_data: NotRequired["FileService.CreateParamsFileLinkData"] """ Optional parameters that automatically create a [file link](https://stripe.com/docs/api#file_links) for the newly created file. """ purpose: Literal[ "account_requirement", "additional_verification", "business_icon", "business_logo", "customer_signature", "dispute_evidence", "identity_document", "pci_document", "tax_document_user_upload", "terminal_reader_splashscreen", ] """ The [purpose](https://stripe.com/docs/file-upload#uploading-a-file) of the uploaded file. """ class CreateParamsFileLinkData(TypedDict): create: bool """ Set this to `true` to create a file link for the newly created file. Creating a link is only possible when the file's `purpose` is one of the following: `business_icon`, `business_logo`, `customer_signature`, `dispute_evidence`, `pci_document`, `tax_document_user_upload`, or `terminal_reader_splashscreen`. """ expires_at: NotRequired[int] """ The link isn't available after this future timestamp. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ class ListParams(TypedDict): created: NotRequired["FileService.ListParamsCreated|int"] """ Only return files that were created during the given date interval. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ purpose: NotRequired[ Literal[ "account_requirement", "additional_verification", "business_icon", "business_logo", "customer_signature", "dispute_evidence", "document_provider_identity_document", "finance_report_run", "identity_document", "identity_document_downloadable", "pci_document", "selfie", "sigma_scheduled_query", "tax_document_user_upload", "terminal_reader_splashscreen", ] ] """ Filter queries by the file purpose. If you don't provide a purpose, the queries return unfiltered files. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def list( self, params: "FileService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[File]: """ Returns a list of the files that your account has access to. Stripe sorts and returns the files by their creation dates, placing the most recently created files at the top. """ return cast( ListObject[File], self._request( "get", "/v1/files", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "FileService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[File]: """ Returns a list of the files that your account has access to. Stripe sorts and returns the files by their creation dates, placing the most recently created files at the top. """ return cast( ListObject[File], await self._request_async( "get", "/v1/files", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "FileService.CreateParams", options: RequestOptions = {} ) -> File: """ To upload a file to Stripe, you need to send a request of type multipart/form-data. Include the file you want to upload in the request, and the parameters for creating a file. All of Stripe's officially supported Client libraries support sending multipart/form-data. """ return cast( File, self._request( "post", "/v1/files", api_mode="V1FILES", base_address="files", params=params, options=options, ), ) async def create_async( self, params: "FileService.CreateParams", options: RequestOptions = {} ) -> File: """ To upload a file to Stripe, you need to send a request of type multipart/form-data. Include the file you want to upload in the request, and the parameters for creating a file. All of Stripe's officially supported Client libraries support sending multipart/form-data. """ return cast( File, await self._request_async( "post", "/v1/files", api_mode="V1FILES", base_address="files", params=params, options=options, ), ) def retrieve( self, file: str, params: "FileService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> File: """ Retrieves the details of an existing file object. After you supply a unique file ID, Stripe returns the corresponding file object. Learn how to [access file contents](https://stripe.com/docs/file-upload#download-file-contents). """ return cast( File, self._request( "get", "/v1/files/{file}".format(file=sanitize_id(file)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, file: str, params: "FileService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> File: """ Retrieves the details of an existing file object. After you supply a unique file ID, Stripe returns the corresponding file object. Learn how to [access file contents](https://stripe.com/docs/file-upload#download-file-contents). """ return cast( File, await self._request_async( "get", "/v1/files/{file}".format(file=sanitize_id(file)), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_financial_connections_service.py0000644000175100001770000000120714637354563022611 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_service import StripeService from stripe.financial_connections._account_service import AccountService from stripe.financial_connections._session_service import SessionService from stripe.financial_connections._transaction_service import ( TransactionService, ) class FinancialConnectionsService(StripeService): def __init__(self, requestor): super().__init__(requestor) self.accounts = AccountService(self._requestor) self.sessions = SessionService(self._requestor) self.transactions = TransactionService(self._requestor) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_forwarding_service.py0000644000175100001770000000052714637354563020431 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_service import StripeService from stripe.forwarding._request_service import RequestService class ForwardingService(StripeService): def __init__(self, requestor): super().__init__(requestor) self.requests = RequestService(self._requestor) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_funding_instructions.py0000644000175100001770000001552414637354563021030 0ustar00runnerdocker# -*- 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 FundingInstructions(StripeObject): """ Each customer has a [`balance`](https://stripe.com/docs/api/customers/object#customer_object-balance) that is automatically applied to future invoices and payments using the `customer_balance` payment method. Customers can fund this balance by initiating a bank transfer to any account in the `financial_addresses` field. Related guide: [Customer balance funding instructions](https://stripe.com/docs/payments/customer-balance/funding-instructions) """ OBJECT_NAME: ClassVar[Literal["funding_instructions"]] = ( "funding_instructions" ) class BankTransfer(StripeObject): class FinancialAddress(StripeObject): class Aba(StripeObject): account_number: str """ The ABA account number """ bank_name: str """ The bank name """ routing_number: str """ The ABA routing number """ class Iban(StripeObject): account_holder_name: str """ The name of the person or business that owns the bank account """ bic: str """ The BIC/SWIFT code of the account. """ country: str """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ iban: str """ The IBAN of the account. """ class SortCode(StripeObject): account_holder_name: str """ The name of the person or business that owns the bank account """ account_number: str """ The account number """ sort_code: str """ The six-digit sort code """ class Spei(StripeObject): bank_code: str """ The three-digit bank code """ bank_name: str """ The short banking institution name """ clabe: str """ The CLABE number """ class Swift(StripeObject): account_number: str """ The account number """ bank_name: str """ The bank name """ swift_code: str """ The SWIFT code """ class Zengin(StripeObject): account_holder_name: Optional[str] """ The account holder name """ account_number: Optional[str] """ The account number """ account_type: Optional[str] """ The bank account type. In Japan, this can only be `futsu` or `toza`. """ bank_code: Optional[str] """ The bank code of the account """ bank_name: Optional[str] """ The bank name of the account """ branch_code: Optional[str] """ The branch code of the account """ branch_name: Optional[str] """ The branch name of the account """ aba: Optional[Aba] """ ABA Records contain U.S. bank account details per the ABA format. """ iban: Optional[Iban] """ Iban Records contain E.U. bank account details per the SEPA format. """ sort_code: Optional[SortCode] """ Sort Code Records contain U.K. bank account details per the sort code format. """ spei: Optional[Spei] """ SPEI Records contain Mexico bank account details per the SPEI format. """ supported_networks: Optional[ List[ Literal[ "ach", "bacs", "domestic_wire_us", "fps", "sepa", "spei", "swift", "zengin", ] ] ] """ The payment networks supported by this FinancialAddress """ swift: Optional[Swift] """ SWIFT Records contain U.S. bank account details per the SWIFT format. """ type: Literal[ "aba", "iban", "sort_code", "spei", "swift", "zengin" ] """ The type of financial address """ zengin: Optional[Zengin] """ Zengin Records contain Japan bank account details per the Zengin format. """ _inner_class_types = { "aba": Aba, "iban": Iban, "sort_code": SortCode, "spei": Spei, "swift": Swift, "zengin": Zengin, } country: str """ The country of the bank account to fund """ financial_addresses: List[FinancialAddress] """ A list of financial addresses that can be used to fund a particular balance """ type: Literal["eu_bank_transfer", "jp_bank_transfer"] """ The bank_transfer type """ _inner_class_types = {"financial_addresses": FinancialAddress} bank_transfer: BankTransfer 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). """ funding_type: Literal["bank_transfer"] """ The `funding_type` of the returned instructions """ 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["funding_instructions"] """ String representing the object's type. Objects of the same type share the same value. """ _inner_class_types = {"bank_transfer": BankTransfer} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_http_client.py0000644000175100001770000014057514637354563017074 0ustar00runnerdockerfrom io import BytesIO import sys import textwrap import email import time import random import threading import json import asyncio import ssl from http.client import HTTPResponse # Used for global variables import stripe # noqa: IMP101 from stripe import _util from stripe._request_metrics import RequestMetrics from stripe._error import APIConnectionError from typing import ( Any, Dict, Iterable, List, Mapping, MutableMapping, Optional, Tuple, ClassVar, Union, cast, overload, AsyncIterable, ) from typing_extensions import ( Literal, NoReturn, TypedDict, Awaitable, Never, ) # - Requests is the preferred HTTP library # - Google App Engine has urlfetch # - Use Pycurl if it's there (at least it verifies SSL certs) # - Fall back to urllib2 with a warning if needed try: import urllib.request as urllibrequest import urllib.error as urlliberror except ImportError: # Try to load in urllib2, but don't sweat it if it's not available. pass try: import pycurl # pyright: ignore except ImportError: pycurl = None try: import httpx import anyio from httpx import Timeout as HTTPXTimeout from httpx import Client as HTTPXClientType except ImportError: httpx = None anyio = None try: import aiohttp from aiohttp import ClientTimeout as AIOHTTPTimeout from aiohttp import StreamReader as AIOHTTPStreamReader except ImportError: aiohttp = None try: import requests from requests import Session as RequestsSession except ImportError: requests = None else: try: # Require version 0.8.8, but don't want to depend on distutils version: str version = requests.__version__ major: int minor: int patch: int major, minor, patch = [int(i) for i in version.split(".")] except Exception: # Probably some new-fangled version, so it should support verify pass else: if (major, minor, patch) < (0, 8, 8): sys.stderr.write( "Warning: the Stripe library requires that your Python " '"requests" library be newer than version 0.8.8, but your ' '"requests" library is version %s. Stripe will fall back to ' "an alternate HTTP library so everything should work. We " 'recommend upgrading your "requests" library. If you have any ' "questions, please contact support@stripe.com. (HINT: running " '"pip install -U requests" should upgrade your requests ' "library to the latest version.)" % (version,) ) requests = None try: from google.appengine.api import urlfetch # pyright: ignore except ImportError: urlfetch = None # proxy support for the pycurl client from urllib.parse import urlparse, ParseResult def _now_ms(): return int(round(time.time() * 1000)) def new_default_http_client(*args: Any, **kwargs: Any) -> "HTTPClient": if urlfetch: impl = UrlFetchClient elif requests: impl = RequestsClient elif pycurl: impl = PycurlClient else: impl = Urllib2Client return impl(*args, **kwargs) def new_http_client_async_fallback(*args: Any, **kwargs: Any) -> "HTTPClient": if httpx: impl = HTTPXClient elif aiohttp: impl = AIOHTTPClient else: impl = NoImportFoundAsyncClient return impl(*args, **kwargs) class HTTPClient(object): name: ClassVar[str] class _Proxy(TypedDict): http: Optional[str] https: Optional[str] MAX_DELAY = 2 INITIAL_DELAY = 0.5 MAX_RETRY_AFTER = 60 _proxy: Optional[_Proxy] _verify_ssl_certs: bool def __init__( self, verify_ssl_certs: bool = True, proxy: Optional[Union[str, _Proxy]] = None, async_fallback_client: Optional["HTTPClient"] = None, ): self._verify_ssl_certs = verify_ssl_certs if proxy: if isinstance(proxy, str): proxy = {"http": proxy, "https": proxy} if not isinstance(proxy, dict): # pyright: ignore[reportUnnecessaryIsInstance] raise ValueError( "Proxy(ies) must be specified as either a string " "URL or a dict() with string URL under the" " " "https" " and/or " "http" " keys." ) self._proxy = proxy.copy() if proxy else None self._async_fallback_client = async_fallback_client self._thread_local = threading.local() def _should_retry( self, response: Optional[Tuple[Any, int, Optional[Mapping[str, str]]]], api_connection_error: Optional[APIConnectionError], num_retries: int, max_network_retries: Optional[int], ): max_network_retries = ( max_network_retries if max_network_retries is not None else 0 ) if num_retries >= max_network_retries: return False if response is None: # We generally want to retry on timeout and connection # exceptions, but defer this decision to underlying subclass # implementations. They should evaluate the driver-specific # errors worthy of retries, and set flag on the error returned. assert api_connection_error is not None return api_connection_error.should_retry _, status_code, rheaders = response # The API may ask us not to retry (eg; if doing so would be a no-op) # or advise us to retry (eg; in cases of lock timeouts); we defer to that. # # Note that we expect the headers object to be a CaseInsensitiveDict, as is the case with the requests library. if rheaders is not None and "stripe-should-retry" in rheaders: if rheaders["stripe-should-retry"] == "false": return False if rheaders["stripe-should-retry"] == "true": return True # Retry on conflict errors. if status_code == 409: return True # Retry on 500, 503, and other internal errors. # # Note that we expect the stripe-should-retry header to be false # in most cases when a 500 is returned, since our idempotency framework # would typically replay it anyway. if status_code >= 500: return True return False def _retry_after_header( self, response: Optional[Tuple[Any, Any, Mapping[str, str]]] = None ): if response is None: return None _, _, rheaders = response try: return int(rheaders["retry-after"]) except (KeyError, ValueError): return None def _sleep_time_seconds( self, num_retries: int, response: Optional[Tuple[Any, Any, Mapping[str, str]]] = None, ): # Apply exponential backoff with initial_network_retry_delay on the # number of num_retries so far as inputs. # Do not allow the number to exceed max_network_retry_delay. sleep_seconds = min( HTTPClient.INITIAL_DELAY * (2 ** (num_retries - 1)), HTTPClient.MAX_DELAY, ) sleep_seconds = self._add_jitter_time(sleep_seconds) # But never sleep less than the base sleep seconds. sleep_seconds = max(HTTPClient.INITIAL_DELAY, sleep_seconds) # And never sleep less than the time the API asks us to wait, assuming it's a reasonable ask. retry_after = self._retry_after_header(response) or 0 if retry_after <= HTTPClient.MAX_RETRY_AFTER: sleep_seconds = max(retry_after, sleep_seconds) return sleep_seconds def _add_jitter_time(self, sleep_seconds: float): # Randomize the value in [(sleep_seconds/ 2) to (sleep_seconds)] # Also separated method here to isolate randomness for tests sleep_seconds *= 0.5 * (1 + random.uniform(0, 1)) return sleep_seconds def _add_telemetry_header( self, headers: Mapping[str, str] ) -> Mapping[str, str]: last_request_metrics = getattr( self._thread_local, "last_request_metrics", None ) if stripe.enable_telemetry and last_request_metrics: telemetry = { "last_request_metrics": last_request_metrics.payload() } ret = dict(headers) ret["X-Stripe-Client-Telemetry"] = json.dumps(telemetry) return ret return headers def _record_request_metrics(self, response, request_start, usage): _, _, rheaders = response if "Request-Id" in rheaders and stripe.enable_telemetry: request_id = rheaders["Request-Id"] request_duration_ms = _now_ms() - request_start self._thread_local.last_request_metrics = RequestMetrics( request_id, request_duration_ms, usage=usage ) def request_with_retries( self, method: str, url: str, headers: Mapping[str, str], post_data: Any = None, max_network_retries: Optional[int] = None, *, _usage: Optional[List[str]] = None, ) -> Tuple[str, int, Mapping[str, str]]: return self._request_with_retries_internal( method, url, headers, post_data, is_streaming=False, max_network_retries=max_network_retries, _usage=_usage, ) def request_stream_with_retries( self, method: str, url: str, headers: Mapping[str, str], post_data=None, max_network_retries=None, *, _usage: Optional[List[str]] = None, ) -> Tuple[Any, int, Mapping[str, str]]: return self._request_with_retries_internal( method, url, headers, post_data, is_streaming=True, max_network_retries=max_network_retries, _usage=_usage, ) def _request_with_retries_internal( self, method: str, url: str, headers: Mapping[str, str], post_data: Any, is_streaming: bool, max_network_retries: Optional[int], *, _usage: Optional[List[str]] = None, ) -> Tuple[Any, int, Mapping[str, str]]: headers = self._add_telemetry_header(headers) num_retries = 0 while True: request_start = _now_ms() try: if is_streaming: response = self.request_stream( method, url, headers, post_data ) else: response = self.request(method, url, headers, post_data) connection_error = None except APIConnectionError as e: connection_error = e response = None if self._should_retry( response, connection_error, num_retries, max_network_retries ): if connection_error: _util.log_info( "Encountered a retryable error %s" % connection_error.user_message ) num_retries += 1 sleep_time = self._sleep_time_seconds(num_retries, response) _util.log_info( ( "Initiating retry %i for request %s %s after " "sleeping %.2f seconds." % (num_retries, method, url, sleep_time) ) ) time.sleep(sleep_time) else: if response is not None: self._record_request_metrics( response, request_start, usage=_usage ) return response else: assert connection_error is not None raise connection_error def request( self, method: str, url: str, headers: Optional[Mapping[str, str]], post_data: Any = None, *, _usage: Optional[List[str]] = None, ) -> Tuple[str, int, Mapping[str, str]]: raise NotImplementedError( "HTTPClient subclasses must implement `request`" ) def request_stream( self, method: str, url: str, headers: Optional[Mapping[str, str]], post_data: Any = None, *, _usage: Optional[List[str]] = None, ) -> Tuple[Any, int, Mapping[str, str]]: raise NotImplementedError( "HTTPClient subclasses must implement `request_stream`" ) def close(self): raise NotImplementedError( "HTTPClient subclasses must implement `close`" ) async def request_with_retries_async( self, method: str, url: str, headers: Mapping[str, str], post_data=None, max_network_retries: Optional[int] = None, *, _usage: Optional[List[str]] = None, ) -> Tuple[Any, int, Any]: return await self._request_with_retries_internal_async( method, url, headers, post_data, is_streaming=False, max_network_retries=max_network_retries, _usage=_usage, ) async def request_stream_with_retries_async( self, method: str, url: str, headers: Mapping[str, str], post_data=None, max_network_retries=None, *, _usage: Optional[List[str]] = None, ) -> Tuple[AsyncIterable[bytes], int, Any]: return await self._request_with_retries_internal_async( method, url, headers, post_data, is_streaming=True, max_network_retries=max_network_retries, _usage=_usage, ) @overload async def _request_with_retries_internal_async( self, method: str, url: str, headers: Mapping[str, str], post_data, is_streaming: Literal[False], max_network_retries: Optional[int], *, _usage: Optional[List[str]] = None, ) -> Tuple[Any, int, Mapping[str, str]]: ... @overload async def _request_with_retries_internal_async( self, method: str, url: str, headers: Mapping[str, str], post_data, is_streaming: Literal[True], max_network_retries: Optional[int], *, _usage: Optional[List[str]] = None, ) -> Tuple[AsyncIterable[bytes], int, Mapping[str, str]]: ... async def _request_with_retries_internal_async( self, method: str, url: str, headers: Mapping[str, str], post_data, is_streaming: bool, max_network_retries: Optional[int], *, _usage: Optional[List[str]] = None, ) -> Tuple[Any, int, Mapping[str, str]]: headers = self._add_telemetry_header(headers) num_retries = 0 while True: request_start = _now_ms() try: if is_streaming: response = await self.request_stream_async( method, url, headers, post_data ) else: response = await self.request_async( method, url, headers, post_data ) connection_error = None except APIConnectionError as e: connection_error = e response = None if self._should_retry( response, connection_error, num_retries, max_network_retries ): if connection_error: _util.log_info( "Encountered a retryable error %s" % connection_error.user_message ) num_retries += 1 sleep_time = self._sleep_time_seconds(num_retries, response) _util.log_info( ( "Initiating retry %i for request %s %s after " "sleeping %.2f seconds." % (num_retries, method, url, sleep_time) ) ) await self.sleep_async(sleep_time) else: if response is not None: self._record_request_metrics( response, request_start, usage=_usage ) return response else: assert connection_error is not None raise connection_error async def request_async( self, method: str, url: str, headers: Mapping[str, str], post_data=None ) -> Tuple[bytes, int, Mapping[str, str]]: if self._async_fallback_client is not None: return await self._async_fallback_client.request_async( method, url, headers, post_data ) raise NotImplementedError( "HTTPClient subclasses must implement `request_async`" ) async def request_stream_async( self, method: str, url: str, headers: Mapping[str, str], post_data=None ) -> Tuple[AsyncIterable[bytes], int, Mapping[str, str]]: if self._async_fallback_client is not None: return await self._async_fallback_client.request_stream_async( method, url, headers, post_data ) raise NotImplementedError( "HTTPClient subclasses must implement `request_stream_async`" ) async def close_async(self): if self._async_fallback_client is not None: return await self._async_fallback_client.close_async() raise NotImplementedError( "HTTPClient subclasses must implement `close_async`" ) def sleep_async(self, secs: float) -> Awaitable[None]: if self._async_fallback_client is not None: return self._async_fallback_client.sleep_async(secs) raise NotImplementedError( "HTTPClient subclasses must implement `sleep`" ) class RequestsClient(HTTPClient): name = "requests" def __init__( self, timeout: int = 80, session: Optional["RequestsSession"] = None, verify_ssl_certs: bool = True, proxy: Optional[Union[str, HTTPClient._Proxy]] = None, async_fallback_client: Optional[HTTPClient] = None, **kwargs, ): super(RequestsClient, self).__init__( verify_ssl_certs=verify_ssl_certs, proxy=proxy, async_fallback_client=async_fallback_client, ) self._session = session self._timeout = timeout assert requests is not None self.requests = requests def request( self, method: str, url: str, headers: Optional[Mapping[str, str]], post_data=None, ) -> Tuple[bytes, int, Mapping[str, str]]: return self._request_internal( method, url, headers, post_data, is_streaming=False ) def request_stream( self, method: str, url: str, headers: Optional[Mapping[str, str]], post_data=None, ) -> Tuple[Any, int, Mapping[str, str]]: return self._request_internal( method, url, headers, post_data, is_streaming=True ) @overload def _request_internal( self, method: str, url: str, headers: Optional[Mapping[str, str]], post_data, is_streaming: Literal[True], ) -> Tuple[Any, int, Mapping[str, str]]: ... @overload def _request_internal( self, method: str, url: str, headers: Optional[Mapping[str, str]], post_data, is_streaming: Literal[False], ) -> Tuple[bytes, int, Mapping[str, str]]: ... def _request_internal( self, method: str, url: str, headers: Optional[Mapping[str, str]], post_data, is_streaming: bool, ) -> Tuple[Union[bytes, Any], int, Mapping[str, str]]: kwargs = {} if self._verify_ssl_certs: kwargs["verify"] = stripe.ca_bundle_path else: kwargs["verify"] = False if self._proxy: kwargs["proxies"] = self._proxy if is_streaming: kwargs["stream"] = True if getattr(self._thread_local, "session", None) is None: self._thread_local.session = ( self._session or self.requests.Session() ) try: try: result = cast( "RequestsSession", self._thread_local.session ).request( method, url, headers=headers, data=post_data, timeout=self._timeout, **kwargs, ) except TypeError as e: raise TypeError( "Warning: It looks like your installed version of the " '"requests" library is not compatible with Stripe\'s ' "usage thereof. (HINT: The most likely cause is that " 'your "requests" library is out of date. You can fix ' 'that by running "pip install -U requests".) The ' "underlying error was: %s" % (e,) ) if is_streaming: content = result.raw else: # This causes the content to actually be read, which could cause # e.g. a socket timeout. TODO: The other fetch methods probably # are susceptible to the same and should be updated. content = result.content status_code = result.status_code except Exception as e: # Would catch just requests.exceptions.RequestException, but can # also raise ValueError, RuntimeError, etc. self._handle_request_error(e) return content, status_code, result.headers def _handle_request_error(self, e) -> NoReturn: # Catch SSL error first as it belongs to ConnectionError, # but we don't want to retry if isinstance(e, self.requests.exceptions.SSLError): msg = ( "Could not verify Stripe's SSL certificate. Please make " "sure that your network is not intercepting certificates. " "If this problem persists, let us know at " "support@stripe.com." ) err = "%s: %s" % (type(e).__name__, str(e)) should_retry = False # Retry only timeout and connect errors; similar to urllib3 Retry elif isinstance( e, ( self.requests.exceptions.Timeout, self.requests.exceptions.ConnectionError, ), ): msg = ( "Unexpected error communicating with Stripe. " "If this problem persists, let us know at " "support@stripe.com." ) err = "%s: %s" % (type(e).__name__, str(e)) should_retry = True # Catch remaining request exceptions elif isinstance(e, self.requests.exceptions.RequestException): msg = ( "Unexpected error communicating with Stripe. " "If this problem persists, let us know at " "support@stripe.com." ) err = "%s: %s" % (type(e).__name__, str(e)) should_retry = False else: msg = ( "Unexpected error communicating with Stripe. " "It looks like there's probably a configuration " "issue locally. If this problem persists, let us " "know at support@stripe.com." ) err = "A %s was raised" % (type(e).__name__,) if str(e): err += " with error message %s" % (str(e),) else: err += " with no error message" should_retry = False msg = textwrap.fill(msg) + "\n\n(Network error: %s)" % (err,) raise APIConnectionError(msg, should_retry=should_retry) def close(self): if getattr(self._thread_local, "session", None) is not None: self._thread_local.session.close() class UrlFetchClient(HTTPClient): name = "urlfetch" def __init__( self, verify_ssl_certs: bool = True, proxy: Optional[HTTPClient._Proxy] = None, deadline: int = 55, async_fallback_client: Optional[HTTPClient] = None, ): super(UrlFetchClient, self).__init__( verify_ssl_certs=verify_ssl_certs, proxy=proxy, async_fallback_client=async_fallback_client, ) # no proxy support in urlfetch. for a patch, see: # https://code.google.com/p/googleappengine/issues/detail?id=544 if proxy: raise ValueError( "No proxy support in urlfetch library. " "Set stripe.default_http_client to either RequestsClient, " "PycurlClient, or Urllib2Client instance to use a proxy." ) self._verify_ssl_certs = verify_ssl_certs # GAE requests time out after 60 seconds, so make sure to default # to 55 seconds to allow for a slow Stripe self._deadline = deadline assert urlfetch is not None self.urlfetch = urlfetch def request( self, method: str, url: str, headers: Mapping[str, str], post_data=None ) -> Tuple[str, int, Mapping[str, str]]: return self._request_internal( method, url, headers, post_data, is_streaming=False ) def request_stream( self, method: str, url: str, headers: Mapping[str, str], post_data=None ) -> Tuple[BytesIO, int, Mapping[str, str]]: return self._request_internal( method, url, headers, post_data, is_streaming=True ) @overload def _request_internal( self, method: str, url: str, headers: Mapping[str, str], post_data, is_streaming: Literal[True], ) -> Tuple[BytesIO, int, Any]: ... @overload def _request_internal( self, method: str, url: str, headers: Mapping[str, str], post_data, is_streaming: Literal[False], ) -> Tuple[str, int, Any]: ... def _request_internal( self, method: str, url: str, headers: Mapping[str, str], post_data, is_streaming, ): try: result = self.urlfetch.fetch( url=url, method=method, headers=headers, # Google App Engine doesn't let us specify our own cert bundle. # However, that's ok because the CA bundle they use recognizes # api.stripe.com. validate_certificate=self._verify_ssl_certs, deadline=self._deadline, payload=post_data, ) except self.urlfetch.Error as e: self._handle_request_error(e, url) if is_streaming: # This doesn't really stream. content = _util.io.BytesIO(str.encode(result.content)) else: content = result.content return content, result.status_code, result.headers def _handle_request_error(self, e, url) -> NoReturn: if isinstance(e, self.urlfetch.InvalidURLError): msg = ( "The Stripe library attempted to fetch an " "invalid URL (%r). This is likely due to a bug " "in the Stripe Python bindings. Please let us know " "at support@stripe.com." % (url,) ) elif isinstance(e, self.urlfetch.DownloadError): msg = "There was a problem retrieving data from Stripe." elif isinstance(e, self.urlfetch.ResponseTooLargeError): msg = ( "There was a problem receiving all of your data from " "Stripe. This is likely due to a bug in Stripe. " "Please let us know at support@stripe.com." ) else: msg = ( "Unexpected error communicating with Stripe. If this " "problem persists, let us know at support@stripe.com." ) msg = textwrap.fill(msg) + "\n\n(Network error: " + str(e) + ")" raise APIConnectionError(msg) def close(self): pass class PycurlClient(HTTPClient): class _ParsedProxy(TypedDict, total=False): http: Optional[ParseResult] https: Optional[ParseResult] name = "pycurl" _parsed_proxy: Optional[_ParsedProxy] def __init__( self, verify_ssl_certs: bool = True, proxy: Optional[HTTPClient._Proxy] = None, async_fallback_client: Optional[HTTPClient] = None, ): super(PycurlClient, self).__init__( verify_ssl_certs=verify_ssl_certs, proxy=proxy, async_fallback_client=async_fallback_client, ) assert pycurl is not None self.pycurl = pycurl # Initialize this within the object so that we can reuse connections. self._curl = pycurl.Curl() self._parsed_proxy = {} # need to urlparse the proxy, since PyCurl # consumes the proxy url in small pieces if self._proxy: proxy_ = self._proxy for scheme, value in proxy_.items(): # In general, TypedDict.items() gives you (key: str, value: object) # but we know value to be a string because all the value types on Proxy_ are strings. self._parsed_proxy[scheme] = urlparse(cast(str, value)) def parse_headers(self, data): if "\r\n" not in data: return {} raw_headers = data.split("\r\n", 1)[1] headers = email.message_from_string(raw_headers) return dict((k.lower(), v) for k, v in dict(headers).items()) def request( self, method, url, headers: Mapping[str, str], post_data=None ) -> Tuple[str, int, Mapping[str, str]]: return self._request_internal( method, url, headers, post_data, is_streaming=False ) def request_stream( self, method, url, headers: Mapping[str, str], post_data=None ) -> Tuple[BytesIO, int, Mapping[str, str]]: return self._request_internal( method, url, headers, post_data, is_streaming=True ) @overload def _request_internal( self, method: str, url: str, headers: Mapping[str, str], post_data, is_streaming: Literal[True], ) -> Tuple[BytesIO, int, Any]: ... @overload def _request_internal( self, method: str, url: str, headers: Mapping[str, str], post_data, is_streaming: Literal[False], ) -> Tuple[str, int, Mapping[str, str]]: ... def _request_internal( self, method: str, url: str, headers: Mapping[str, str], post_data, is_streaming, ) -> Tuple[Union[str, BytesIO], int, Mapping[str, str]]: b = _util.io.BytesIO() rheaders = _util.io.BytesIO() # Pycurl's design is a little weird: although we set per-request # options on this object, it's also capable of maintaining established # connections. Here we call reset() between uses to make sure it's in a # pristine state, but notably reset() doesn't reset connections, so we # still get to take advantage of those by virtue of re-using the same # object. self._curl.reset() proxy = self._get_proxy(url) if proxy: if proxy.hostname: self._curl.setopt(self.pycurl.PROXY, proxy.hostname) if proxy.port: self._curl.setopt(self.pycurl.PROXYPORT, proxy.port) if proxy.username or proxy.password: self._curl.setopt( self.pycurl.PROXYUSERPWD, "%s:%s" % (proxy.username, proxy.password), ) if method == "get": self._curl.setopt(self.pycurl.HTTPGET, 1) elif method == "post": self._curl.setopt(self.pycurl.POST, 1) self._curl.setopt(self.pycurl.POSTFIELDS, post_data) else: self._curl.setopt(self.pycurl.CUSTOMREQUEST, method.upper()) # pycurl doesn't like unicode URLs self._curl.setopt(self.pycurl.URL, url) self._curl.setopt(self.pycurl.WRITEFUNCTION, b.write) self._curl.setopt(self.pycurl.HEADERFUNCTION, rheaders.write) self._curl.setopt(self.pycurl.NOSIGNAL, 1) self._curl.setopt(self.pycurl.CONNECTTIMEOUT, 30) self._curl.setopt(self.pycurl.TIMEOUT, 80) self._curl.setopt( self.pycurl.HTTPHEADER, ["%s: %s" % (k, v) for k, v in iter(dict(headers).items())], ) if self._verify_ssl_certs: self._curl.setopt(self.pycurl.CAINFO, stripe.ca_bundle_path) else: self._curl.setopt(self.pycurl.SSL_VERIFYHOST, False) try: self._curl.perform() except self.pycurl.error as e: self._handle_request_error(e) if is_streaming: b.seek(0) rcontent = b else: rcontent = b.getvalue().decode("utf-8") rcode = self._curl.getinfo(self.pycurl.RESPONSE_CODE) headers = self.parse_headers(rheaders.getvalue().decode("utf-8")) return rcontent, rcode, headers def _handle_request_error(self, e) -> NoReturn: if e.args[0] in [ self.pycurl.E_COULDNT_CONNECT, self.pycurl.E_COULDNT_RESOLVE_HOST, self.pycurl.E_OPERATION_TIMEOUTED, ]: msg = ( "Could not connect to Stripe. Please check your " "internet connection and try again. If this problem " "persists, you should check Stripe's service status at " "https://twitter.com/stripestatus, or let us know at " "support@stripe.com." ) should_retry = True elif e.args[0] in [ self.pycurl.E_SSL_CACERT, self.pycurl.E_SSL_PEER_CERTIFICATE, ]: msg = ( "Could not verify Stripe's SSL certificate. Please make " "sure that your network is not intercepting certificates. " "If this problem persists, let us know at " "support@stripe.com." ) should_retry = False else: msg = ( "Unexpected error communicating with Stripe. If this " "problem persists, let us know at support@stripe.com." ) should_retry = False msg = textwrap.fill(msg) + "\n\n(Network error: " + e.args[1] + ")" raise APIConnectionError(msg, should_retry=should_retry) def _get_proxy(self, url) -> Optional[ParseResult]: if self._parsed_proxy: proxy = self._parsed_proxy scheme = url.split(":")[0] if url else None if scheme: return proxy.get(scheme, proxy.get(scheme[0:-1])) return None def close(self): pass class Urllib2Client(HTTPClient): name = "urllib.request" def __init__( self, verify_ssl_certs: bool = True, proxy: Optional[HTTPClient._Proxy] = None, async_fallback_client: Optional[HTTPClient] = None, ): super(Urllib2Client, self).__init__( verify_ssl_certs=verify_ssl_certs, proxy=proxy, async_fallback_client=async_fallback_client, ) # prepare and cache proxy tied opener here self._opener = None if self._proxy: # We have to cast _Proxy to Dict[str, str] because pyright is not smart enough to # realize that all the value types are str. proxy_handler = urllibrequest.ProxyHandler( cast(Dict[str, str], self._proxy) ) self._opener = urllibrequest.build_opener(proxy_handler) def request( self, method: str, url: str, headers: Mapping[str, str], post_data=None ) -> Tuple[str, int, Mapping[str, str]]: return self._request_internal( method, url, headers, post_data, is_streaming=False ) def request_stream( self, method: str, url: str, headers: Mapping[str, str], post_data=None ) -> Tuple[HTTPResponse, int, Mapping[str, str]]: return self._request_internal( method, url, headers, post_data, is_streaming=True ) @overload def _request_internal( self, method: str, url: str, headers: Mapping[str, str], post_data, is_streaming: Literal[False], ) -> Tuple[str, int, Any]: ... @overload def _request_internal( self, method: str, url: str, headers: Mapping[str, str], post_data, is_streaming: Literal[True], ) -> Tuple[HTTPResponse, int, Any]: ... def _request_internal( self, method: str, url: str, headers: Mapping[str, str], post_data, is_streaming, ): if isinstance(post_data, str): post_data = post_data.encode("utf-8") req = urllibrequest.Request( url, post_data, cast(MutableMapping[str, str], headers) ) if method not in ("get", "post"): req.get_method = lambda: method.upper() try: # use the custom proxy tied opener, if any. # otherwise, fall to the default urllib opener. response = ( self._opener.open(req) if self._opener else urllibrequest.urlopen(req) ) if is_streaming: rcontent = response else: rcontent = response.read() rcode = response.code headers = dict(response.info()) except urlliberror.HTTPError as e: rcode = e.code rcontent = e.read() headers = dict(e.info()) except (urlliberror.URLError, ValueError) as e: self._handle_request_error(e) lh = dict((k.lower(), v) for k, v in iter(dict(headers).items())) return rcontent, rcode, lh def _handle_request_error(self, e) -> NoReturn: msg = ( "Unexpected error communicating with Stripe. " "If this problem persists, let us know at support@stripe.com." ) msg = textwrap.fill(msg) + "\n\n(Network error: " + str(e) + ")" raise APIConnectionError(msg) def close(self): pass class HTTPXClient(HTTPClient): name = "httpx" _client: Optional["HTTPXClientType"] def __init__( self, timeout: Optional[Union[float, "HTTPXTimeout"]] = 80, allow_sync_methods=False, **kwargs, ): super(HTTPXClient, self).__init__(**kwargs) if httpx is None: raise ImportError( "Unexpected: tried to initialize HTTPXClient but the httpx module is not present." ) if anyio is None: raise ImportError( "Unexpected: tried to initialize HTTPXClient but the anyio module is not present." ) self.httpx = httpx self.anyio = anyio kwargs = {} if self._verify_ssl_certs: kwargs["verify"] = stripe.ca_bundle_path else: kwargs["verify"] = False self._client_async = httpx.AsyncClient(**kwargs) self._client = None if allow_sync_methods: self._client = httpx.Client(**kwargs) self._timeout = timeout def sleep_async(self, secs): return self.anyio.sleep(secs) def _get_request_args_kwargs( self, method: str, url: str, headers: Mapping[str, str], post_data ): kwargs = {} if self._proxy: kwargs["proxies"] = self._proxy if self._timeout: kwargs["timeout"] = self._timeout return [ (method, url), {"headers": headers, "data": post_data or {}, **kwargs}, ] def request( self, method: str, url: str, headers: Mapping[str, str], post_data=None, ) -> Tuple[bytes, int, Mapping[str, str]]: if self._client is None: raise RuntimeError( "Stripe: HTTPXClient was initialized with allow_sync_methods=False, " "so it cannot be used for synchronous requests." ) args, kwargs = self._get_request_args_kwargs( method, url, headers, post_data ) try: response = self._client.request(*args, **kwargs) except Exception as e: self._handle_request_error(e) content = response.content status_code = response.status_code response_headers = response.headers return content, status_code, response_headers async def request_async( self, method: str, url: str, headers: Mapping[str, str], post_data=None, ) -> Tuple[bytes, int, Mapping[str, str]]: args, kwargs = self._get_request_args_kwargs( method, url, headers, post_data ) try: response = await self._client_async.request(*args, **kwargs) except Exception as e: self._handle_request_error(e) content = response.content status_code = response.status_code response_headers = response.headers return content, status_code, response_headers def _handle_request_error(self, e) -> NoReturn: msg = ( "Unexpected error communicating with Stripe. If this " "problem persists, let us know at support@stripe.com." ) err = "A %s was raised" % (type(e).__name__,) should_retry = True msg = textwrap.fill(msg) + "\n\n(Network error: %s)" % (err,) raise APIConnectionError(msg, should_retry=should_retry) def request_stream( self, method: str, url: str, headers: Mapping[str, str], post_data=None ) -> Tuple[Iterable[bytes], int, Mapping[str, str]]: if self._client is None: raise RuntimeError( "Stripe: HTTPXClient was not initialized with allow_sync_methods=True, " "so it cannot be used for synchronous requests." ) args, kwargs = self._get_request_args_kwargs( method, url, headers, post_data ) try: response = self._client.send( request=self._client_async.build_request(*args, **kwargs), stream=True, ) except Exception as e: self._handle_request_error(e) content = response.iter_bytes() status_code = response.status_code headers = response.headers return content, status_code, headers async def request_stream_async( self, method: str, url: str, headers: Mapping[str, str], post_data=None ) -> Tuple[AsyncIterable[bytes], int, Mapping[str, str]]: args, kwargs = self._get_request_args_kwargs( method, url, headers, post_data ) try: response = await self._client_async.send( request=self._client_async.build_request(*args, **kwargs), stream=True, ) except Exception as e: self._handle_request_error(e) content = response.aiter_bytes() status_code = response.status_code headers = response.headers return content, status_code, headers def close(self): if self._client is not None: self._client.close() async def close_async(self): await self._client_async.aclose() class AIOHTTPClient(HTTPClient): name = "aiohttp" def __init__( self, timeout: Optional[Union[float, "AIOHTTPTimeout"]] = 80, **kwargs ): super(AIOHTTPClient, self).__init__(**kwargs) if aiohttp is None: raise ImportError( "Unexpected: tried to initialize AIOHTTPClient but the aiohttp module is not present." ) self._timeout = timeout self._cached_session = None @property def _session(self): assert aiohttp is not None if self._cached_session is None: kwargs = {} if self._verify_ssl_certs: ssl_context = ssl.create_default_context( cafile=stripe.ca_bundle_path ) kwargs["connector"] = aiohttp.TCPConnector(ssl=ssl_context) else: kwargs["connector"] = aiohttp.TCPConnector(verify_ssl=False) self._cached_session = aiohttp.ClientSession(**kwargs) return self._cached_session def sleep_async(self, secs): return asyncio.sleep(secs) def request(self) -> Tuple[bytes, int, Mapping[str, str]]: raise NotImplementedError( "AIOHTTPClient does not support synchronous requests." ) def _get_request_args_kwargs( self, method: str, url: str, headers: Mapping[str, str], post_data ): args = (method, url) kwargs = {} if self._proxy: if self._proxy["http"] != self._proxy["https"]: raise ValueError( "AIOHTTPClient does not support different proxies for HTTP and HTTPS." ) kwargs["proxy"] = self._proxy["https"] if self._timeout: kwargs["timeout"] = self._timeout kwargs["headers"] = headers kwargs["data"] = post_data return args, kwargs async def request_async( self, method: str, url: str, headers: Mapping[str, str], post_data=None, ) -> Tuple[bytes, int, Mapping[str, str]]: ( content, status_code, response_headers, ) = await self.request_stream_async( method, url, headers, post_data=post_data ) return (await content.read()), status_code, response_headers def _handle_request_error(self, e) -> NoReturn: msg = ( "Unexpected error communicating with Stripe. If this " "problem persists, let us know at support@stripe.com." ) err = "A %s was raised" % (type(e).__name__,) should_retry = True msg = textwrap.fill(msg) + "\n\n(Network error: %s)" % (err,) raise APIConnectionError(msg, should_retry=should_retry) def request_stream(self) -> Tuple[Iterable[bytes], int, Mapping[str, str]]: raise NotImplementedError( "AIOHTTPClient does not support synchronous requests." ) async def request_stream_async( self, method: str, url: str, headers: Mapping[str, str], post_data=None ) -> Tuple["AIOHTTPStreamReader", int, Mapping[str, str]]: args, kwargs = self._get_request_args_kwargs( method, url, headers, post_data ) try: response = await self._session.request(*args, **kwargs) except Exception as e: self._handle_request_error(e) content = response.content status_code = response.status response_headers = response.headers return content, status_code, response_headers def close(self): pass async def close_async(self): await self._session.close() class NoImportFoundAsyncClient(HTTPClient): def __init__(self, **kwargs): super(NoImportFoundAsyncClient, self).__init__(**kwargs) @staticmethod def raise_async_client_import_error() -> Never: raise ImportError( ( "Import httpx not found. To make async http requests," "You must either install httpx or define your own" "async http client by subclassing stripe.HTTPClient" "and setting stripe.default_http_client to an instance of it." ) ) async def request_async( self, method: str, url: str, headers: Mapping[str, str], post_data=None ) -> Tuple[bytes, int, Mapping[str, str]]: self.raise_async_client_import_error() async def request_stream_async( self, method: str, url: str, headers: Mapping[str, str], post_data=None ): self.raise_async_client_import_error() async def close_async(self): self.raise_async_client_import_error() ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_identity_service.py0000644000175100001770000000111714637354563020114 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_service import StripeService from stripe.identity._verification_report_service import ( VerificationReportService, ) from stripe.identity._verification_session_service import ( VerificationSessionService, ) class IdentityService(StripeService): def __init__(self, requestor): super().__init__(requestor) self.verification_reports = VerificationReportService(self._requestor) self.verification_sessions = VerificationSessionService( self._requestor ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_invoice.py0000644000175100001770000122545114637354563016211 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._deletable_api_resource import DeletableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._nested_resource_class_methods import nested_resource_class_methods from stripe._request_options import RequestOptions from stripe._search_result_object import SearchResultObject from stripe._searchable_api_resource import SearchableAPIResource from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ( AsyncIterator, ClassVar, Dict, Iterator, List, Optional, Union, cast, overload, ) from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._account import Account from stripe._application import Application from stripe._bank_account import BankAccount from stripe._card import Card as CardResource from stripe._charge import Charge from stripe._customer import Customer from stripe._discount import Discount from stripe._invoice_line_item import InvoiceLineItem from stripe._payment_intent import PaymentIntent from stripe._payment_method import PaymentMethod from stripe._quote import Quote from stripe._setup_intent import SetupIntent from stripe._shipping_rate import ShippingRate from stripe._source import Source from stripe._subscription import Subscription from stripe._tax_id import TaxId from stripe._tax_rate import TaxRate from stripe.test_helpers._test_clock import TestClock @nested_resource_class_methods("line") class Invoice( CreateableAPIResource["Invoice"], DeletableAPIResource["Invoice"], ListableAPIResource["Invoice"], SearchableAPIResource["Invoice"], UpdateableAPIResource["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://stripe.com/docs/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, Stripe automatically finalizes your invoice and attempts payment. Note that finalizing the invoice, [when automatic](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection), does not happen immediately as the invoice is created. Stripe waits until one hour after the last webhook was successfully sent (or the last webhook timed out after failing). If you (and the platforms you may have connected to) have no webhooks configured, Stripe waits one hour after creation to finalize the invoice. If your invoice is configured to be billed by sending an email, then based on your [email settings](https://dashboard.stripe.com/account/billing/automatic), Stripe will email the invoice to your customer and await payment. These emails can contain a link to a hosted page to pay the invoice. Stripe applies any customer credit on the account before determining the amount due for the invoice (i.e., the amount that will be actually charged). If the amount due for the invoice is less than Stripe's [minimum allowed charge per currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts), the invoice is automatically marked paid, and we add the amount due to the customer's credit balance which is applied to the next invoice. More details on the customer's credit balance are [here](https://stripe.com/docs/billing/customer/balance). Related guide: [Send invoices to customers](https://stripe.com/docs/billing/invoices/sending) """ OBJECT_NAME: ClassVar[Literal["invoice"]] = "invoice" class AutomaticTax(StripeObject): class Liability(StripeObject): account: Optional[ExpandableField["Account"]] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced. """ enabled: bool """ Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. """ liability: Optional[Liability] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ status: Optional[ Literal["complete", "failed", "requires_location_inputs"] ] """ The status of the most recent automated tax calculation for this invoice. """ _inner_class_types = {"liability": Liability} class CustomField(StripeObject): name: str """ The name of the custom field. """ value: str """ The value of the custom field. """ class CustomerAddress(StripeObject): city: Optional[str] """ City, district, suburb, town, or village. """ country: Optional[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: Optional[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State, county, province, or region. """ class CustomerShipping(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 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State, county, province, or region. """ address: Optional[Address] carrier: Optional[str] """ The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. """ name: Optional[str] """ Recipient name. """ phone: Optional[str] """ Recipient phone (including extension). """ tracking_number: Optional[str] """ The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ _inner_class_types = {"address": Address} class CustomerTaxId(StripeObject): type: Literal[ "ad_nrt", "ae_trn", "ar_cuit", "au_abn", "au_arn", "bg_uic", "bh_vat", "bo_tin", "br_cnpj", "br_cpf", "ca_bn", "ca_gst_hst", "ca_pst_bc", "ca_pst_mb", "ca_pst_sk", "ca_qst", "ch_uid", "ch_vat", "cl_tin", "cn_tin", "co_nit", "cr_tin", "de_stn", "do_rcn", "ec_ruc", "eg_tin", "es_cif", "eu_oss_vat", "eu_vat", "gb_vat", "ge_vat", "hk_br", "hu_tin", "id_npwp", "il_vat", "in_gst", "is_vat", "jp_cn", "jp_rn", "jp_trn", "ke_pin", "kr_brn", "kz_bin", "li_uid", "mx_rfc", "my_frp", "my_itn", "my_sst", "ng_tin", "no_vat", "no_voec", "nz_gst", "om_vat", "pe_ruc", "ph_tin", "ro_tin", "rs_pib", "ru_inn", "ru_kpp", "sa_vat", "sg_gst", "sg_uen", "si_tin", "sv_nit", "th_vat", "tr_tin", "tw_vat", "ua_vat", "unknown", "us_ein", "uy_ruc", "ve_rif", "vn_tin", "za_vat", ] """ The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, or `unknown` """ value: Optional[str] """ The value of the tax ID. """ class FromInvoice(StripeObject): action: str """ The relation between this invoice and the cloned invoice """ invoice: ExpandableField["Invoice"] """ The invoice that was cloned. """ class Issuer(StripeObject): account: Optional[ExpandableField["Account"]] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced. """ class LastFinalizationError(StripeObject): charge: Optional[str] """ For card errors, the ID of the failed charge. """ code: Optional[ Literal[ "account_closed", "account_country_invalid_address", "account_error_country_change_requires_additional_steps", "account_information_mismatch", "account_invalid", "account_number_invalid", "acss_debit_session_incomplete", "alipay_upgrade_required", "amount_too_large", "amount_too_small", "api_key_expired", "application_fees_not_allowed", "authentication_required", "balance_insufficient", "balance_invalid_parameter", "bank_account_bad_routing_numbers", "bank_account_declined", "bank_account_exists", "bank_account_restricted", "bank_account_unusable", "bank_account_unverified", "bank_account_verification_failed", "billing_invalid_mandate", "billing_policy_remote_function_response_invalid", "billing_policy_remote_function_timeout", "billing_policy_remote_function_unexpected_status_code", "billing_policy_remote_function_unreachable", "bitcoin_upgrade_required", "capture_charge_authorization_expired", "capture_unauthorized_payment", "card_decline_rate_limit_exceeded", "card_declined", "cardholder_phone_number_required", "charge_already_captured", "charge_already_refunded", "charge_disputed", "charge_exceeds_source_limit", "charge_expired_for_capture", "charge_invalid_parameter", "charge_not_refundable", "clearing_code_unsupported", "country_code_invalid", "country_unsupported", "coupon_expired", "customer_max_payment_methods", "customer_max_subscriptions", "customer_tax_location_invalid", "debit_not_authorized", "email_invalid", "expired_card", "financial_connections_account_inactive", "financial_connections_no_successful_transaction_refresh", "forwarding_api_inactive", "forwarding_api_invalid_parameter", "forwarding_api_upstream_connection_error", "forwarding_api_upstream_connection_timeout", "idempotency_key_in_use", "incorrect_address", "incorrect_cvc", "incorrect_number", "incorrect_zip", "instant_payouts_config_disabled", "instant_payouts_currency_disabled", "instant_payouts_limit_exceeded", "instant_payouts_unsupported", "insufficient_funds", "intent_invalid_state", "intent_verification_method_missing", "invalid_card_type", "invalid_characters", "invalid_charge_amount", "invalid_cvc", "invalid_expiry_month", "invalid_expiry_year", "invalid_number", "invalid_source_usage", "invalid_tax_location", "invoice_no_customer_line_items", "invoice_no_payment_method_types", "invoice_no_subscription_line_items", "invoice_not_editable", "invoice_on_behalf_of_not_editable", "invoice_payment_intent_requires_action", "invoice_upcoming_none", "livemode_mismatch", "lock_timeout", "missing", "no_account", "not_allowed_on_standard_account", "out_of_inventory", "ownership_declaration_not_allowed", "parameter_invalid_empty", "parameter_invalid_integer", "parameter_invalid_string_blank", "parameter_invalid_string_empty", "parameter_missing", "parameter_unknown", "parameters_exclusive", "payment_intent_action_required", "payment_intent_authentication_failure", "payment_intent_incompatible_payment_method", "payment_intent_invalid_parameter", "payment_intent_konbini_rejected_confirmation_number", "payment_intent_mandate_invalid", "payment_intent_payment_attempt_expired", "payment_intent_payment_attempt_failed", "payment_intent_unexpected_state", "payment_method_bank_account_already_verified", "payment_method_bank_account_blocked", "payment_method_billing_details_address_missing", "payment_method_configuration_failures", "payment_method_currency_mismatch", "payment_method_customer_decline", "payment_method_invalid_parameter", "payment_method_invalid_parameter_testmode", "payment_method_microdeposit_failed", "payment_method_microdeposit_verification_amounts_invalid", "payment_method_microdeposit_verification_amounts_mismatch", "payment_method_microdeposit_verification_attempts_exceeded", "payment_method_microdeposit_verification_descriptor_code_mismatch", "payment_method_microdeposit_verification_timeout", "payment_method_not_available", "payment_method_provider_decline", "payment_method_provider_timeout", "payment_method_unactivated", "payment_method_unexpected_state", "payment_method_unsupported_type", "payout_reconciliation_not_ready", "payouts_limit_exceeded", "payouts_not_allowed", "platform_account_required", "platform_api_key_expired", "postal_code_invalid", "processing_error", "product_inactive", "progressive_onboarding_limit_exceeded", "rate_limit", "refer_to_customer", "refund_disputed_payment", "resource_already_exists", "resource_missing", "return_intent_already_processed", "routing_number_invalid", "secret_key_required", "sepa_unsupported_account", "setup_attempt_failed", "setup_intent_authentication_failure", "setup_intent_invalid_parameter", "setup_intent_mandate_invalid", "setup_intent_setup_attempt_expired", "setup_intent_unexpected_state", "shipping_address_invalid", "shipping_calculation_failed", "sku_inactive", "state_unsupported", "status_transition_invalid", "stripe_tax_inactive", "tax_id_invalid", "taxes_calculation_failed", "terminal_location_country_unsupported", "terminal_reader_busy", "terminal_reader_hardware_fault", "terminal_reader_invalid_location_for_payment", "terminal_reader_offline", "terminal_reader_timeout", "testmode_charges_only", "tls_version_unsupported", "token_already_used", "token_card_network_invalid", "token_in_use", "transfer_source_balance_parameters_mismatch", "transfers_not_allowed", "url_invalid", ] ] """ For some errors that could be handled programmatically, a short string indicating the [error code](https://stripe.com/docs/error-codes) reported. """ decline_code: Optional[str] """ For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](https://stripe.com/docs/declines#issuer-declines) if they provide one. """ doc_url: Optional[str] """ A URL to more information about the [error code](https://stripe.com/docs/error-codes) reported. """ message: Optional[str] """ A human-readable message providing more details about the error. For card errors, these messages can be shown to your users. """ param: Optional[str] """ If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field. """ payment_intent: Optional["PaymentIntent"] """ A PaymentIntent guides you through the process of collecting a payment from your customer. We recommend that you create exactly one PaymentIntent for each order or customer session in your system. You can reference the PaymentIntent later to see the history of payment attempts for a particular session. A PaymentIntent transitions through [multiple statuses](https://stripe.com/docs/payments/intents#intent-statuses) throughout its lifetime as it interfaces with Stripe.js to perform authentication flows and ultimately creates at most one successful charge. Related guide: [Payment Intents API](https://stripe.com/docs/payments/payment-intents) """ payment_method: Optional["PaymentMethod"] """ PaymentMethod objects represent your customer's payment instruments. You can use them with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or save them to Customer objects to store instrument details for future payments. Related guides: [Payment Methods](https://stripe.com/docs/payments/payment-methods) and [More Payment Scenarios](https://stripe.com/docs/payments/more-payment-scenarios). """ payment_method_type: Optional[str] """ If the error is specific to the type of payment method, the payment method type that had a problem. This field is only populated for invoice-related errors. """ request_log_url: Optional[str] """ A URL to the request log entry in your dashboard. """ setup_intent: Optional["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://stripe.com/docs/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. The SetupIntent transitions through multiple [statuses](https://docs.stripe.com/payments/intents#intent-statuses) as it guides you through the setup process. Successful SetupIntents result in payment credentials that are optimized for future payments. 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://stripe.com/docs/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://stripe.com/docs/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. Related guide: [Setup Intents API](https://docs.stripe.com/payments/setup-intents) """ source: Optional[ Union["Account", "BankAccount", "CardResource", "Source"] ] type: Literal[ "api_error", "card_error", "idempotency_error", "invalid_request_error", ] """ The type of error returned. One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error` """ class PaymentSettings(StripeObject): class PaymentMethodOptions(StripeObject): class AcssDebit(StripeObject): class MandateOptions(StripeObject): transaction_type: Optional[Literal["business", "personal"]] """ Transaction type of the mandate. """ mandate_options: Optional[MandateOptions] verification_method: Optional[ Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. """ _inner_class_types = {"mandate_options": MandateOptions} class Bancontact(StripeObject): preferred_language: Literal["de", "en", "fr", "nl"] """ Preferred language of the Bancontact authorization page that the customer is redirected to. """ class Card(StripeObject): class Installments(StripeObject): enabled: Optional[bool] """ Whether Installments are enabled for this Invoice. """ installments: Optional[Installments] request_three_d_secure: Optional[ Literal["any", "automatic", "challenge"] ] """ 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://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ _inner_class_types = {"installments": Installments} class CustomerBalance(StripeObject): class BankTransfer(StripeObject): class EuBankTransfer(StripeObject): country: Literal["BE", "DE", "ES", "FR", "IE", "NL"] """ The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. """ eu_bank_transfer: Optional[EuBankTransfer] type: Optional[str] """ The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. """ _inner_class_types = {"eu_bank_transfer": EuBankTransfer} bank_transfer: Optional[BankTransfer] funding_type: Optional[Literal["bank_transfer"]] """ The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. """ _inner_class_types = {"bank_transfer": BankTransfer} class Konbini(StripeObject): pass class SepaDebit(StripeObject): pass class UsBankAccount(StripeObject): class FinancialConnections(StripeObject): class Filters(StripeObject): account_subcategories: Optional[ List[Literal["checking", "savings"]] ] """ The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`. """ filters: Optional[Filters] permissions: Optional[ List[ Literal[ "balances", "ownership", "payment_method", "transactions", ] ] ] """ The list of permissions to request. The `payment_method` permission must be included. """ prefetch: Optional[ List[Literal["balances", "ownership", "transactions"]] ] """ Data features requested to be retrieved upon account creation. """ _inner_class_types = {"filters": Filters} financial_connections: Optional[FinancialConnections] verification_method: Optional[ Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. """ _inner_class_types = { "financial_connections": FinancialConnections, } acss_debit: Optional[AcssDebit] """ If paying by `acss_debit`, this sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice's PaymentIntent. """ bancontact: Optional[Bancontact] """ If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice's PaymentIntent. """ card: Optional[Card] """ If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice's PaymentIntent. """ customer_balance: Optional[CustomerBalance] """ If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice's PaymentIntent. """ konbini: Optional[Konbini] """ If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice's PaymentIntent. """ sepa_debit: Optional[SepaDebit] """ If paying by `sepa_debit`, this sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice's PaymentIntent. """ us_bank_account: Optional[UsBankAccount] """ If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice's PaymentIntent. """ _inner_class_types = { "acss_debit": AcssDebit, "bancontact": Bancontact, "card": Card, "customer_balance": CustomerBalance, "konbini": Konbini, "sepa_debit": SepaDebit, "us_bank_account": UsBankAccount, } default_mandate: Optional[str] """ ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the invoice's default_payment_method or default_source, if set. """ payment_method_options: Optional[PaymentMethodOptions] """ Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: Optional[ List[ Literal[ "ach_credit_transfer", "ach_debit", "acss_debit", "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", "boleto", "card", "cashapp", "customer_balance", "eps", "fpx", "giropay", "grabpay", "ideal", "konbini", "link", "p24", "paynow", "paypal", "promptpay", "revolut_pay", "sepa_credit_transfer", "sepa_debit", "sofort", "swish", "us_bank_account", "wechat_pay", ] ] ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). """ _inner_class_types = {"payment_method_options": PaymentMethodOptions} class Rendering(StripeObject): class Pdf(StripeObject): page_size: Optional[Literal["a4", "auto", "letter"]] """ Page size of invoice pdf. Options include a4, letter, and auto. If set to auto, page size will be switched to a4 or letter based on customer locale. """ amount_tax_display: Optional[str] """ How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. """ pdf: Optional[Pdf] """ Invoice pdf rendering options """ _inner_class_types = {"pdf": Pdf} class ShippingCost(StripeObject): class Tax(StripeObject): amount: int """ Amount of tax applied for this rate. """ rate: "TaxRate" """ Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates) """ taxability_reason: Optional[ Literal[ "customer_exempt", "not_collecting", "not_subject_to_tax", "not_supported", "portion_product_exempt", "portion_reduced_rated", "portion_standard_rated", "product_exempt", "product_exempt_holiday", "proportionally_rated", "reduced_rated", "reverse_charge", "standard_rated", "taxable_basis_reduced", "zero_rated", ] ] """ The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. """ taxable_amount: Optional[int] """ The amount on which tax is calculated, in cents (or local equivalent). """ amount_subtotal: int """ Total shipping cost before any taxes are applied. """ amount_tax: int """ Total tax amount applied due to shipping costs. If no tax was applied, defaults to 0. """ amount_total: int """ Total shipping cost after taxes are applied. """ shipping_rate: Optional[ExpandableField["ShippingRate"]] """ The ID of the ShippingRate for this invoice. """ taxes: Optional[List[Tax]] """ The taxes applied to the shipping rate. """ _inner_class_types = {"taxes": Tax} 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 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State, county, province, or region. """ address: Optional[Address] carrier: Optional[str] """ The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. """ name: Optional[str] """ Recipient name. """ phone: Optional[str] """ Recipient phone (including extension). """ tracking_number: Optional[str] """ The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ _inner_class_types = {"address": Address} class StatusTransitions(StripeObject): finalized_at: Optional[int] """ The time that the invoice draft was finalized. """ marked_uncollectible_at: Optional[int] """ The time that the invoice was marked uncollectible. """ paid_at: Optional[int] """ The time that the invoice was paid. """ voided_at: Optional[int] """ The time that the invoice was voided. """ class SubscriptionDetails(StripeObject): metadata: Optional[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) defined as subscription metadata when an invoice is created. Becomes an immutable snapshot of the subscription metadata at the time of invoice finalization. *Note: This attribute is populated only for invoices created on or after June 29, 2023.* """ class ThresholdReason(StripeObject): class ItemReason(StripeObject): line_item_ids: List[str] """ The IDs of the line items that triggered the threshold invoice. """ usage_gte: int """ The quantity threshold boundary that applied to the given line item. """ amount_gte: Optional[int] """ The total invoice amount threshold boundary if it triggered the threshold invoice. """ item_reasons: List[ItemReason] """ Indicates which line items triggered a threshold invoice. """ _inner_class_types = {"item_reasons": ItemReason} class TotalDiscountAmount(StripeObject): amount: int """ The amount, in cents (or local equivalent), of the discount. """ discount: ExpandableField["Discount"] """ The discount that was applied to get this discount amount. """ class TotalTaxAmount(StripeObject): amount: int """ The amount, in cents (or local equivalent), of the tax. """ inclusive: bool """ Whether this tax amount is inclusive or exclusive. """ tax_rate: ExpandableField["TaxRate"] """ The tax rate that was applied to get this tax amount. """ taxability_reason: Optional[ Literal[ "customer_exempt", "not_collecting", "not_subject_to_tax", "not_supported", "portion_product_exempt", "portion_reduced_rated", "portion_standard_rated", "product_exempt", "product_exempt_holiday", "proportionally_rated", "reduced_rated", "reverse_charge", "standard_rated", "taxable_basis_reduced", "zero_rated", ] ] """ The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. """ taxable_amount: Optional[int] """ The amount on which tax is calculated, in cents (or local equivalent). """ class TransferData(StripeObject): amount: Optional[int] """ The amount in cents (or local equivalent) that will be transferred to the destination account when the invoice is paid. By default, the entire amount is transferred to the destination. """ destination: ExpandableField["Account"] """ The account where funds from the payment will be transferred to upon payment success. """ class CreateParams(RequestOptions): account_tax_ids: NotRequired["Literal['']|List[str]"] """ The account tax IDs associated with the invoice. Only editable when the invoice is a draft. """ application_fee_amount: NotRequired[int] """ A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees). """ auto_advance: NotRequired[bool] """ Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action. """ automatic_tax: NotRequired["Invoice.CreateParamsAutomaticTax"] """ Settings for automatic tax lookup for this invoice. """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions. Defaults to `charge_automatically`. """ currency: NotRequired[str] """ The currency to create this invoice in. Defaults to that of `customer` if not specified. """ custom_fields: NotRequired[ "Literal['']|List[Invoice.CreateParamsCustomField]" ] """ A list of up to 4 custom fields to be displayed on the invoice. """ customer: NotRequired[str] """ The ID of the customer who will be billed. """ days_until_due: NotRequired[int] """ The number of days from when the invoice is created until it is due. Valid only for invoices where `collection_method=send_invoice`. """ default_payment_method: NotRequired[str] """ ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. """ default_source: NotRequired[str] """ ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source. """ default_tax_rates: NotRequired[List[str]] """ The tax rates that will apply to any line item that does not have `tax_rates` set. """ description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard. """ discounts: NotRequired[ "Literal['']|List[Invoice.CreateParamsDiscount]" ] """ The coupons and promotion codes to redeem into discounts for the invoice. If not specified, inherits the discount from the invoice's customer. Pass an empty string to avoid inheriting any discounts. """ due_date: NotRequired[int] """ The date on which payment for this invoice is due. Valid only for invoices where `collection_method=send_invoice`. """ effective_at: NotRequired[int] """ The date when this invoice is in effect. Same as `finalized_at` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ footer: NotRequired[str] """ Footer to be displayed on the invoice. """ from_invoice: NotRequired["Invoice.CreateParamsFromInvoice"] """ Revise an existing invoice. The new invoice will be created in `status=draft`. See the [revision documentation](https://stripe.com/docs/invoicing/invoice-revisions) for more details. """ issuer: NotRequired["Invoice.CreateParamsIssuer"] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ number: NotRequired[str] """ Set the number for this invoice. If no number is present then a number will be assigned automatically when the invoice is finalized. In many markets, regulations require invoices to be unique, sequential and / or gapless. You are responsible for ensuring this is true across all your different invoicing systems in the event that you edit the invoice number using our API. If you use only Stripe for your invoices and do not change invoice numbers, Stripe handles this aspect of compliance for you automatically. """ on_behalf_of: NotRequired[str] """ The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. """ payment_settings: NotRequired["Invoice.CreateParamsPaymentSettings"] """ Configuration settings for the PaymentIntent that is generated when the invoice is finalized. """ pending_invoice_items_behavior: NotRequired[ Literal["exclude", "include"] ] """ How to handle pending invoice items on invoice creation. Defaults to `exclude` if the parameter is omitted. """ rendering: NotRequired["Invoice.CreateParamsRendering"] """ The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page. """ shipping_cost: NotRequired["Invoice.CreateParamsShippingCost"] """ Settings for the cost of shipping for this invoice. """ shipping_details: NotRequired["Invoice.CreateParamsShippingDetails"] """ Shipping details for the invoice. The Invoice PDF will use the `shipping_details` value if it is set, otherwise the PDF will render the shipping address from the customer. """ statement_descriptor: NotRequired[str] """ Extra information about a charge for the customer's credit card statement. It must contain at least one letter. If not specified and this invoice is part of a subscription, the default `statement_descriptor` will be set to the first subscription item's product's `statement_descriptor`. """ subscription: NotRequired[str] """ The ID of the subscription to invoice, if any. If set, the created invoice will only include pending invoice items for that subscription. The subscription's billing cycle and regular subscription events won't be affected. """ transfer_data: NotRequired["Invoice.CreateParamsTransferData"] """ If specified, the funds from the invoice will be transferred to the destination and the ID of the resulting transfer will be found on the invoice's charge. """ class CreateParamsAutomaticTax(TypedDict): enabled: bool """ Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. """ liability: NotRequired["Invoice.CreateParamsAutomaticTaxLiability"] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ class CreateParamsAutomaticTaxLiability(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class CreateParamsCustomField(TypedDict): name: str """ The name of the custom field. This may be up to 40 characters. """ value: str """ The value of the custom field. This may be up to 140 characters. """ class CreateParamsDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class CreateParamsFromInvoice(TypedDict): action: Literal["revision"] """ The relation between the new invoice and the original invoice. Currently, only 'revision' is permitted """ invoice: str """ The `id` of the invoice that will be cloned. """ class CreateParamsIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class CreateParamsPaymentSettings(TypedDict): default_mandate: NotRequired["Literal['']|str"] """ ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the invoice's default_payment_method or default_source, if set. """ payment_method_options: NotRequired[ "Invoice.CreateParamsPaymentSettingsPaymentMethodOptions" ] """ Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). """ class CreateParamsPaymentSettingsPaymentMethodOptions(TypedDict): acss_debit: NotRequired[ "Literal['']|Invoice.CreateParamsPaymentSettingsPaymentMethodOptionsAcssDebit" ] """ If paying by `acss_debit`, this sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice's PaymentIntent. """ bancontact: NotRequired[ "Literal['']|Invoice.CreateParamsPaymentSettingsPaymentMethodOptionsBancontact" ] """ If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice's PaymentIntent. """ card: NotRequired[ "Literal['']|Invoice.CreateParamsPaymentSettingsPaymentMethodOptionsCard" ] """ If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice's PaymentIntent. """ customer_balance: NotRequired[ "Literal['']|Invoice.CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalance" ] """ If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice's PaymentIntent. """ konbini: NotRequired[ "Literal['']|Invoice.CreateParamsPaymentSettingsPaymentMethodOptionsKonbini" ] """ If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice's PaymentIntent. """ sepa_debit: NotRequired[ "Literal['']|Invoice.CreateParamsPaymentSettingsPaymentMethodOptionsSepaDebit" ] """ If paying by `sepa_debit`, this sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice's PaymentIntent. """ us_bank_account: NotRequired[ "Literal['']|Invoice.CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccount" ] """ If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice's PaymentIntent. """ class CreateParamsPaymentSettingsPaymentMethodOptionsAcssDebit(TypedDict): mandate_options: NotRequired[ "Invoice.CreateParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions" ] """ Additional fields for Mandate creation """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] """ Verification method for the intent """ class CreateParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions( TypedDict, ): transaction_type: NotRequired[Literal["business", "personal"]] """ Transaction type of the mandate. """ class CreateParamsPaymentSettingsPaymentMethodOptionsBancontact(TypedDict): preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] """ Preferred language of the Bancontact authorization page that the customer is redirected to. """ class CreateParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): installments: NotRequired[ "Invoice.CreateParamsPaymentSettingsPaymentMethodOptionsCardInstallments" ] """ Installment configuration for payments attempted on this invoice (Mexico Only). For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). """ request_three_d_secure: NotRequired[ Literal["any", "automatic", "challenge"] ] """ 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://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ class CreateParamsPaymentSettingsPaymentMethodOptionsCardInstallments( TypedDict, ): enabled: NotRequired[bool] """ Setting to true enables installments for this invoice. Setting to false will prevent any selected plan from applying to a payment. """ plan: NotRequired[ "Literal['']|Invoice.CreateParamsPaymentSettingsPaymentMethodOptionsCardInstallmentsPlan" ] """ The selected installment plan to use for this invoice. """ class CreateParamsPaymentSettingsPaymentMethodOptionsCardInstallmentsPlan( TypedDict, ): count: int """ For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. """ interval: Literal["month"] """ For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. One of `month`. """ type: Literal["fixed_count"] """ Type of installment plan, one of `fixed_count`. """ class CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalance( TypedDict, ): bank_transfer: NotRequired[ "Invoice.CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer" ] """ Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. """ funding_type: NotRequired[str] """ The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. """ class CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer( TypedDict, ): eu_bank_transfer: NotRequired[ "Invoice.CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer" ] """ Configuration for eu_bank_transfer funding type. """ type: NotRequired[str] """ The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. """ class CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer( TypedDict, ): country: str """ The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. """ class CreateParamsPaymentSettingsPaymentMethodOptionsKonbini(TypedDict): pass class CreateParamsPaymentSettingsPaymentMethodOptionsSepaDebit(TypedDict): pass class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccount( TypedDict, ): financial_connections: NotRequired[ "Invoice.CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections" ] """ Additional fields for Financial Connections Session creation """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] """ Verification method for the intent """ class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): filters: NotRequired[ "Invoice.CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" ] """ Provide filters for the linked accounts that the customer can select for the payment method. """ permissions: NotRequired[ List[ Literal[ "balances", "ownership", "payment_method", "transactions" ] ] ] """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ List[Literal["balances", "ownership", "transactions"]] ] """ List of data features that you would like to retrieve upon account creation. """ class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( TypedDict, ): account_subcategories: NotRequired[ List[Literal["checking", "savings"]] ] """ The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. """ class CreateParamsRendering(TypedDict): amount_tax_display: NotRequired[ "Literal['']|Literal['exclude_tax', 'include_inclusive_tax']" ] """ How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. """ pdf: NotRequired["Invoice.CreateParamsRenderingPdf"] """ Invoice pdf rendering options """ class CreateParamsRenderingPdf(TypedDict): page_size: NotRequired[Literal["a4", "auto", "letter"]] """ Page size for invoice PDF. Can be set to `a4`, `letter`, or `auto`. If set to `auto`, invoice PDF page size defaults to `a4` for customers with Japanese locale and `letter` for customers with other locales. """ class CreateParamsShippingCost(TypedDict): shipping_rate: NotRequired[str] """ The ID of the shipping rate to use for this order. """ shipping_rate_data: NotRequired[ "Invoice.CreateParamsShippingCostShippingRateData" ] """ Parameters to create a new ad-hoc shipping rate for this order. """ class CreateParamsShippingCostShippingRateData(TypedDict): delivery_estimate: NotRequired[ "Invoice.CreateParamsShippingCostShippingRateDataDeliveryEstimate" ] """ The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions. """ display_name: str """ The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions. """ fixed_amount: NotRequired[ "Invoice.CreateParamsShippingCostShippingRateDataFixedAmount" ] """ Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. """ tax_code: NotRequired[str] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`. """ type: NotRequired[Literal["fixed_amount"]] """ The type of calculation to use on the shipping rate. """ class CreateParamsShippingCostShippingRateDataDeliveryEstimate(TypedDict): maximum: NotRequired[ "Invoice.CreateParamsShippingCostShippingRateDataDeliveryEstimateMaximum" ] """ The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. """ minimum: NotRequired[ "Invoice.CreateParamsShippingCostShippingRateDataDeliveryEstimateMinimum" ] """ The lower bound of the estimated range. If empty, represents no lower bound. """ class CreateParamsShippingCostShippingRateDataDeliveryEstimateMaximum( TypedDict, ): unit: Literal["business_day", "day", "hour", "month", "week"] """ A unit of time. """ value: int """ Must be greater than 0. """ class CreateParamsShippingCostShippingRateDataDeliveryEstimateMinimum( TypedDict, ): unit: Literal["business_day", "day", "hour", "month", "week"] """ A unit of time. """ value: int """ Must be greater than 0. """ class CreateParamsShippingCostShippingRateDataFixedAmount(TypedDict): amount: int """ A non-negative integer in cents representing how much to charge. """ 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). """ currency_options: NotRequired[ Dict[ str, "Invoice.CreateParamsShippingCostShippingRateDataFixedAmountCurrencyOptions", ] ] """ Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ class CreateParamsShippingCostShippingRateDataFixedAmountCurrencyOptions( TypedDict, ): amount: int """ A non-negative integer in cents representing how much to charge. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. """ class CreateParamsShippingDetails(TypedDict): address: "Invoice.CreateParamsShippingDetailsAddress" """ Shipping address """ name: str """ Recipient name. """ phone: NotRequired["Literal['']|str"] """ Recipient phone (including extension) """ class CreateParamsShippingDetailsAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsTransferData(TypedDict): amount: NotRequired[int] """ The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. """ destination: str """ ID of an existing, connected Stripe account. """ class CreatePreviewParams(RequestOptions): automatic_tax: NotRequired["Invoice.CreatePreviewParamsAutomaticTax"] """ Settings for automatic tax lookup for this invoice preview. """ coupon: NotRequired[str] """ The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. """ currency: NotRequired[str] """ The currency to preview this invoice in. Defaults to that of `customer` if not specified. """ customer: NotRequired[str] """ The identifier of the customer whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. """ customer_details: NotRequired[ "Invoice.CreatePreviewParamsCustomerDetails" ] """ Details about the customer you want to invoice or overrides for an existing customer. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. """ discounts: NotRequired[ "Literal['']|List[Invoice.CreatePreviewParamsDiscount]" ] """ The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ invoice_items: NotRequired[ List["Invoice.CreatePreviewParamsInvoiceItem"] ] """ List of invoice items to add or update in the upcoming invoice preview. """ issuer: NotRequired["Invoice.CreatePreviewParamsIssuer"] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ on_behalf_of: NotRequired["Literal['']|str"] """ The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. """ preview_mode: NotRequired[Literal["next", "recurring"]] """ Customizes the types of values to include when calculating the invoice. Defaults to `next` if unspecified. """ schedule: NotRequired[str] """ The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. """ schedule_details: NotRequired[ "Invoice.CreatePreviewParamsScheduleDetails" ] """ The schedule creation or modification params to apply as a preview. Cannot be used with `subscription` or `subscription_` prefixed fields. """ subscription: NotRequired[str] """ The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_details.items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_details.items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. """ subscription_details: NotRequired[ "Invoice.CreatePreviewParamsSubscriptionDetails" ] """ The subscription creation or modification params to apply as a preview. Cannot be used with `schedule` or `schedule_details` fields. """ class CreatePreviewParamsAutomaticTax(TypedDict): enabled: bool """ Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. """ liability: NotRequired[ "Invoice.CreatePreviewParamsAutomaticTaxLiability" ] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ class CreatePreviewParamsAutomaticTaxLiability(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class CreatePreviewParamsCustomerDetails(TypedDict): address: NotRequired[ "Literal['']|Invoice.CreatePreviewParamsCustomerDetailsAddress" ] """ The customer's address. """ shipping: NotRequired[ "Literal['']|Invoice.CreatePreviewParamsCustomerDetailsShipping" ] """ The customer's shipping information. Appears on invoices emailed to this customer. """ tax: NotRequired["Invoice.CreatePreviewParamsCustomerDetailsTax"] """ Tax details about the customer. """ tax_exempt: NotRequired[ "Literal['']|Literal['exempt', 'none', 'reverse']" ] """ The customer's tax exemption. One of `none`, `exempt`, or `reverse`. """ tax_ids: NotRequired[ List["Invoice.CreatePreviewParamsCustomerDetailsTaxId"] ] """ The customer's tax IDs. """ class CreatePreviewParamsCustomerDetailsAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreatePreviewParamsCustomerDetailsShipping(TypedDict): address: "Invoice.CreatePreviewParamsCustomerDetailsShippingAddress" """ Customer shipping address. """ name: str """ Customer name. """ phone: NotRequired[str] """ Customer phone (including extension). """ class CreatePreviewParamsCustomerDetailsShippingAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreatePreviewParamsCustomerDetailsTax(TypedDict): ip_address: NotRequired["Literal['']|str"] """ A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. """ class CreatePreviewParamsCustomerDetailsTaxId(TypedDict): type: Literal[ "ad_nrt", "ae_trn", "ar_cuit", "au_abn", "au_arn", "bg_uic", "bh_vat", "bo_tin", "br_cnpj", "br_cpf", "ca_bn", "ca_gst_hst", "ca_pst_bc", "ca_pst_mb", "ca_pst_sk", "ca_qst", "ch_uid", "ch_vat", "cl_tin", "cn_tin", "co_nit", "cr_tin", "de_stn", "do_rcn", "ec_ruc", "eg_tin", "es_cif", "eu_oss_vat", "eu_vat", "gb_vat", "ge_vat", "hk_br", "hu_tin", "id_npwp", "il_vat", "in_gst", "is_vat", "jp_cn", "jp_rn", "jp_trn", "ke_pin", "kr_brn", "kz_bin", "li_uid", "mx_rfc", "my_frp", "my_itn", "my_sst", "ng_tin", "no_vat", "no_voec", "nz_gst", "om_vat", "pe_ruc", "ph_tin", "ro_tin", "rs_pib", "ru_inn", "ru_kpp", "sa_vat", "sg_gst", "sg_uen", "si_tin", "sv_nit", "th_vat", "tr_tin", "tw_vat", "ua_vat", "us_ein", "uy_ruc", "ve_rif", "vn_tin", "za_vat", ] """ Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ Value of the tax ID. """ class CreatePreviewParamsDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class CreatePreviewParamsInvoiceItem(TypedDict): amount: NotRequired[int] """ The integer amount in cents (or local equivalent) of previewed invoice item. """ currency: NotRequired[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). Only applicable to new invoice items. """ description: NotRequired[str] """ An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. """ discountable: NotRequired[bool] """ Explicitly controls whether discounts apply to this invoice item. Defaults to true, except for negative invoice items. """ discounts: NotRequired[ "Literal['']|List[Invoice.CreatePreviewParamsInvoiceItemDiscount]" ] """ The coupons to redeem into discounts for the invoice item in the preview. """ invoiceitem: NotRequired[str] """ The ID of the invoice item to update in preview. If not specified, a new invoice item will be added to the preview of the upcoming invoice. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ period: NotRequired["Invoice.CreatePreviewParamsInvoiceItemPeriod"] """ The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired[ "Invoice.CreatePreviewParamsInvoiceItemPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ Non-negative integer. The quantity of units for the invoice item. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ tax_code: NotRequired["Literal['']|str"] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item. """ unit_amount: NotRequired[int] """ The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class CreatePreviewParamsInvoiceItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class CreatePreviewParamsInvoiceItemPeriod(TypedDict): end: int """ The end of the period, which must be greater than or equal to the start. This value is inclusive. """ start: int """ The start of the period. This value is inclusive. """ class CreatePreviewParamsInvoiceItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class CreatePreviewParamsIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class CreatePreviewParamsScheduleDetails(TypedDict): end_behavior: NotRequired[Literal["cancel", "release"]] """ Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription. """ phases: NotRequired[ List["Invoice.CreatePreviewParamsScheduleDetailsPhase"] ] """ List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request. """ class CreatePreviewParamsScheduleDetailsPhase(TypedDict): add_invoice_items: NotRequired[ List[ "Invoice.CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItem" ] ] """ A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items. """ application_fee_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). """ automatic_tax: NotRequired[ "Invoice.CreatePreviewParamsScheduleDetailsPhaseAutomaticTax" ] """ Automatic tax settings for this phase. """ billing_cycle_anchor: NotRequired[Literal["automatic", "phase_start"]] """ Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ billing_thresholds: NotRequired[ "Literal['']|Invoice.CreatePreviewParamsScheduleDetailsPhaseBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds. """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. """ coupon: NotRequired[str] """ The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. """ currency: NotRequired[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). """ default_payment_method: NotRequired[str] """ ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. """ default_tax_rates: NotRequired["Literal['']|List[str]"] """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase. """ description: NotRequired["Literal['']|str"] """ Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ discounts: NotRequired[ "Literal['']|List[Invoice.CreatePreviewParamsScheduleDetailsPhaseDiscount]" ] """ The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription's customer. Pass an empty string to avoid inheriting any discounts. """ end_date: NotRequired["int|Literal['now']"] """ The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set. """ invoice_settings: NotRequired[ "Invoice.CreatePreviewParamsScheduleDetailsPhaseInvoiceSettings" ] """ All invoices will be billed using the specified settings. """ items: List["Invoice.CreatePreviewParamsScheduleDetailsPhaseItem"] """ List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. """ iterations: NotRequired[int] """ Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. """ on_behalf_of: NotRequired[str] """ The account on behalf of which to charge, for each of the associated subscription's invoices. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase. """ start_date: NotRequired["int|Literal['now']"] """ The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase. """ transfer_data: NotRequired[ "Invoice.CreatePreviewParamsScheduleDetailsPhaseTransferData" ] """ The data with which to automatically create a Transfer for each of the associated subscription's invoices. """ trial: NotRequired[bool] """ If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. """ trial_end: NotRequired["int|Literal['now']"] """ Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial` """ class CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItem(TypedDict): discounts: NotRequired[ List[ "Invoice.CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemDiscount" ] ] """ The coupons to redeem into discounts for the item. """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired[ "Invoice.CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ Quantity for this item. Defaults to 1. """ tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. """ class CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemDiscount( TypedDict, ): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemPriceData( TypedDict, ): 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). """ product: str """ The ID of the product that this price will belong to. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class CreatePreviewParamsScheduleDetailsPhaseAutomaticTax(TypedDict): enabled: bool """ Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. """ liability: NotRequired[ "Invoice.CreatePreviewParamsScheduleDetailsPhaseAutomaticTaxLiability" ] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ class CreatePreviewParamsScheduleDetailsPhaseAutomaticTaxLiability( TypedDict, ): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class CreatePreviewParamsScheduleDetailsPhaseBillingThresholds(TypedDict): amount_gte: NotRequired[int] """ Monetary threshold that triggers the subscription to advance to a new billing period """ reset_billing_cycle_anchor: NotRequired[bool] """ Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. """ class CreatePreviewParamsScheduleDetailsPhaseDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class CreatePreviewParamsScheduleDetailsPhaseInvoiceSettings(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule. """ days_until_due: NotRequired[int] """ Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. """ issuer: NotRequired[ "Invoice.CreatePreviewParamsScheduleDetailsPhaseInvoiceSettingsIssuer" ] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ class CreatePreviewParamsScheduleDetailsPhaseInvoiceSettingsIssuer( TypedDict, ): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class CreatePreviewParamsScheduleDetailsPhaseItem(TypedDict): billing_thresholds: NotRequired[ "Literal['']|Invoice.CreatePreviewParamsScheduleDetailsPhaseItemBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ discounts: NotRequired[ "Literal['']|List[Invoice.CreatePreviewParamsScheduleDetailsPhaseItemDiscount]" ] """ The coupons to redeem into discounts for the subscription item. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`. """ plan: NotRequired[str] """ The plan ID to subscribe to. You may specify the same ID in `plan` and `price`. """ price: NotRequired[str] """ The ID of the price object. """ price_data: NotRequired[ "Invoice.CreatePreviewParamsScheduleDetailsPhaseItemPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ quantity: NotRequired[int] """ Quantity for the given price. Can be set only if the price's `usage_type` is `licensed` and not `metered`. """ tax_rates: NotRequired["Literal['']|List[str]"] """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ class CreatePreviewParamsScheduleDetailsPhaseItemBillingThresholds( TypedDict, ): usage_gte: int """ Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ class CreatePreviewParamsScheduleDetailsPhaseItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class CreatePreviewParamsScheduleDetailsPhaseItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ recurring: "Invoice.CreatePreviewParamsScheduleDetailsPhaseItemPriceDataRecurring" """ The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class CreatePreviewParamsScheduleDetailsPhaseItemPriceDataRecurring( TypedDict, ): interval: Literal["day", "month", "week", "year"] """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class CreatePreviewParamsScheduleDetailsPhaseTransferData(TypedDict): amount_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. """ destination: str """ ID of an existing, connected Stripe account. """ class CreatePreviewParamsSubscriptionDetails(TypedDict): billing_cycle_anchor: NotRequired["Literal['now', 'unchanged']|int"] """ For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. """ cancel_at: NotRequired["Literal['']|int"] """ A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. """ cancel_at_period_end: NotRequired[bool] """ Boolean indicating whether this subscription should cancel at the end of the current period. """ cancel_now: NotRequired[bool] """ This simulates the subscription being canceled or expired immediately. """ default_tax_rates: NotRequired["Literal['']|List[str]"] """ If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. """ items: NotRequired[ List["Invoice.CreatePreviewParamsSubscriptionDetailsItem"] ] """ A list of up to 20 subscription items, each with an attached price. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ proration_date: NotRequired[int] """ If previewing an update to a subscription, and doing proration, `subscription_details.proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_details.items`, or `subscription_details.trial_end` are required. Also, `subscription_details.proration_behavior` cannot be set to 'none'. """ resume_at: NotRequired[Literal["now"]] """ For paused subscriptions, setting `subscription_details.resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. """ start_date: NotRequired[int] """ Date a subscription is intended to start (can be future or past). """ trial_end: NotRequired["Literal['now']|int"] """ If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_details.items` or `subscription` is required. """ class CreatePreviewParamsSubscriptionDetailsItem(TypedDict): billing_thresholds: NotRequired[ "Literal['']|Invoice.CreatePreviewParamsSubscriptionDetailsItemBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ clear_usage: NotRequired[bool] """ Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. """ deleted: NotRequired[bool] """ A flag that, if set to `true`, will delete the specified item. """ discounts: NotRequired[ "Literal['']|List[Invoice.CreatePreviewParamsSubscriptionDetailsItemDiscount]" ] """ The coupons to redeem into discounts for the subscription item. """ id: NotRequired[str] """ Subscription item to update. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ plan: NotRequired[str] """ Plan ID for this item, as a string. """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ price_data: NotRequired[ "Invoice.CreatePreviewParamsSubscriptionDetailsItemPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ Quantity for this item. """ tax_rates: NotRequired["Literal['']|List[str]"] """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ class CreatePreviewParamsSubscriptionDetailsItemBillingThresholds( TypedDict, ): usage_gte: int """ Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ class CreatePreviewParamsSubscriptionDetailsItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class CreatePreviewParamsSubscriptionDetailsItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ recurring: "Invoice.CreatePreviewParamsSubscriptionDetailsItemPriceDataRecurring" """ The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class CreatePreviewParamsSubscriptionDetailsItemPriceDataRecurring( TypedDict, ): interval: Literal["day", "month", "week", "year"] """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class DeleteParams(RequestOptions): pass class FinalizeInvoiceParams(RequestOptions): auto_advance: NotRequired[bool] """ Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ListLinesParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParams(RequestOptions): collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] """ The collection method of the invoice to retrieve. Either `charge_automatically` or `send_invoice`. """ created: NotRequired["Invoice.ListParamsCreated|int"] """ Only return invoices that were created during the given date interval. """ customer: NotRequired[str] """ Only return invoices for the customer specified by this customer ID. """ due_date: NotRequired["Invoice.ListParamsDueDate|int"] ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ Literal["draft", "open", "paid", "uncollectible", "void"] ] """ The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview) """ subscription: NotRequired[str] """ Only return invoices for the subscription specified by this subscription ID. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsDueDate(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class MarkUncollectibleParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ModifyParams(RequestOptions): account_tax_ids: NotRequired["Literal['']|List[str]"] """ The account tax IDs associated with the invoice. Only editable when the invoice is a draft. """ application_fee_amount: NotRequired[int] """ A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees). """ auto_advance: NotRequired[bool] """ Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. """ automatic_tax: NotRequired["Invoice.ModifyParamsAutomaticTax"] """ Settings for automatic tax lookup for this invoice. """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically` or `send_invoice`. This field can be updated only on `draft` invoices. """ custom_fields: NotRequired[ "Literal['']|List[Invoice.ModifyParamsCustomField]" ] """ A list of up to 4 custom fields to be displayed on the invoice. If a value for `custom_fields` is specified, the list specified will replace the existing custom field list on this invoice. Pass an empty string to remove previously-defined fields. """ days_until_due: NotRequired[int] """ The number of days from which the invoice is created until it is due. Only valid for invoices where `collection_method=send_invoice`. This field can only be updated on `draft` invoices. """ default_payment_method: NotRequired[str] """ ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. """ default_source: NotRequired["Literal['']|str"] """ ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source. """ default_tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates that will apply to any line item that does not have `tax_rates` set. Pass an empty string to remove previously-defined tax rates. """ description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard. """ discounts: NotRequired[ "Literal['']|List[Invoice.ModifyParamsDiscount]" ] """ The discounts that will apply to the invoice. Pass an empty string to remove previously-defined discounts. """ due_date: NotRequired[int] """ The date on which payment for this invoice is due. Only valid for invoices where `collection_method=send_invoice`. This field can only be updated on `draft` invoices. """ effective_at: NotRequired["Literal['']|int"] """ The date when this invoice is in effect. Same as `finalized_at` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ footer: NotRequired[str] """ Footer to be displayed on the invoice. """ issuer: NotRequired["Invoice.ModifyParamsIssuer"] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ number: NotRequired["Literal['']|str"] """ Set the number for this invoice. If no number is present then a number will be assigned automatically when the invoice is finalized. In many markets, regulations require invoices to be unique, sequential and / or gapless. You are responsible for ensuring this is true across all your different invoicing systems in the event that you edit the invoice number using our API. If you use only Stripe for your invoices and do not change invoice numbers, Stripe handles this aspect of compliance for you automatically. """ on_behalf_of: NotRequired["Literal['']|str"] """ The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. """ payment_settings: NotRequired["Invoice.ModifyParamsPaymentSettings"] """ Configuration settings for the PaymentIntent that is generated when the invoice is finalized. """ rendering: NotRequired["Invoice.ModifyParamsRendering"] """ The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page. """ shipping_cost: NotRequired[ "Literal['']|Invoice.ModifyParamsShippingCost" ] """ Settings for the cost of shipping for this invoice. """ shipping_details: NotRequired[ "Literal['']|Invoice.ModifyParamsShippingDetails" ] """ Shipping details for the invoice. The Invoice PDF will use the `shipping_details` value if it is set, otherwise the PDF will render the shipping address from the customer. """ statement_descriptor: NotRequired[str] """ Extra information about a charge for the customer's credit card statement. It must contain at least one letter. If not specified and this invoice is part of a subscription, the default `statement_descriptor` will be set to the first subscription item's product's `statement_descriptor`. """ transfer_data: NotRequired[ "Literal['']|Invoice.ModifyParamsTransferData" ] """ If specified, the funds from the invoice will be transferred to the destination and the ID of the resulting transfer will be found on the invoice's charge. This will be unset if you POST an empty value. """ class ModifyParamsAutomaticTax(TypedDict): enabled: bool """ Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. """ liability: NotRequired["Invoice.ModifyParamsAutomaticTaxLiability"] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ class ModifyParamsAutomaticTaxLiability(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class ModifyParamsCustomField(TypedDict): name: str """ The name of the custom field. This may be up to 40 characters. """ value: str """ The value of the custom field. This may be up to 140 characters. """ class ModifyParamsDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class ModifyParamsIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class ModifyParamsPaymentSettings(TypedDict): default_mandate: NotRequired["Literal['']|str"] """ ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the invoice's default_payment_method or default_source, if set. """ payment_method_options: NotRequired[ "Invoice.ModifyParamsPaymentSettingsPaymentMethodOptions" ] """ Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). """ class ModifyParamsPaymentSettingsPaymentMethodOptions(TypedDict): acss_debit: NotRequired[ "Literal['']|Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsAcssDebit" ] """ If paying by `acss_debit`, this sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice's PaymentIntent. """ bancontact: NotRequired[ "Literal['']|Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsBancontact" ] """ If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice's PaymentIntent. """ card: NotRequired[ "Literal['']|Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsCard" ] """ If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice's PaymentIntent. """ customer_balance: NotRequired[ "Literal['']|Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsCustomerBalance" ] """ If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice's PaymentIntent. """ konbini: NotRequired[ "Literal['']|Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsKonbini" ] """ If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice's PaymentIntent. """ sepa_debit: NotRequired[ "Literal['']|Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsSepaDebit" ] """ If paying by `sepa_debit`, this sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice's PaymentIntent. """ us_bank_account: NotRequired[ "Literal['']|Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccount" ] """ If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice's PaymentIntent. """ class ModifyParamsPaymentSettingsPaymentMethodOptionsAcssDebit(TypedDict): mandate_options: NotRequired[ "Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions" ] """ Additional fields for Mandate creation """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] """ Verification method for the intent """ class ModifyParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions( TypedDict, ): transaction_type: NotRequired[Literal["business", "personal"]] """ Transaction type of the mandate. """ class ModifyParamsPaymentSettingsPaymentMethodOptionsBancontact(TypedDict): preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] """ Preferred language of the Bancontact authorization page that the customer is redirected to. """ class ModifyParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): installments: NotRequired[ "Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsCardInstallments" ] """ Installment configuration for payments attempted on this invoice (Mexico Only). For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). """ request_three_d_secure: NotRequired[ Literal["any", "automatic", "challenge"] ] """ 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://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ class ModifyParamsPaymentSettingsPaymentMethodOptionsCardInstallments( TypedDict, ): enabled: NotRequired[bool] """ Setting to true enables installments for this invoice. Setting to false will prevent any selected plan from applying to a payment. """ plan: NotRequired[ "Literal['']|Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsCardInstallmentsPlan" ] """ The selected installment plan to use for this invoice. """ class ModifyParamsPaymentSettingsPaymentMethodOptionsCardInstallmentsPlan( TypedDict, ): count: int """ For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. """ interval: Literal["month"] """ For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. One of `month`. """ type: Literal["fixed_count"] """ Type of installment plan, one of `fixed_count`. """ class ModifyParamsPaymentSettingsPaymentMethodOptionsCustomerBalance( TypedDict, ): bank_transfer: NotRequired[ "Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer" ] """ Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. """ funding_type: NotRequired[str] """ The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. """ class ModifyParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer( TypedDict, ): eu_bank_transfer: NotRequired[ "Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer" ] """ Configuration for eu_bank_transfer funding type. """ type: NotRequired[str] """ The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. """ class ModifyParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer( TypedDict, ): country: str """ The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. """ class ModifyParamsPaymentSettingsPaymentMethodOptionsKonbini(TypedDict): pass class ModifyParamsPaymentSettingsPaymentMethodOptionsSepaDebit(TypedDict): pass class ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccount( TypedDict, ): financial_connections: NotRequired[ "Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections" ] """ Additional fields for Financial Connections Session creation """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] """ Verification method for the intent """ class ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): filters: NotRequired[ "Invoice.ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" ] """ Provide filters for the linked accounts that the customer can select for the payment method. """ permissions: NotRequired[ List[ Literal[ "balances", "ownership", "payment_method", "transactions" ] ] ] """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ List[Literal["balances", "ownership", "transactions"]] ] """ List of data features that you would like to retrieve upon account creation. """ class ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( TypedDict, ): account_subcategories: NotRequired[ List[Literal["checking", "savings"]] ] """ The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. """ class ModifyParamsRendering(TypedDict): amount_tax_display: NotRequired[ "Literal['']|Literal['exclude_tax', 'include_inclusive_tax']" ] """ How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. """ pdf: NotRequired["Invoice.ModifyParamsRenderingPdf"] """ Invoice pdf rendering options """ class ModifyParamsRenderingPdf(TypedDict): page_size: NotRequired[Literal["a4", "auto", "letter"]] """ Page size for invoice PDF. Can be set to `a4`, `letter`, or `auto`. If set to `auto`, invoice PDF page size defaults to `a4` for customers with Japanese locale and `letter` for customers with other locales. """ class ModifyParamsShippingCost(TypedDict): shipping_rate: NotRequired[str] """ The ID of the shipping rate to use for this order. """ shipping_rate_data: NotRequired[ "Invoice.ModifyParamsShippingCostShippingRateData" ] """ Parameters to create a new ad-hoc shipping rate for this order. """ class ModifyParamsShippingCostShippingRateData(TypedDict): delivery_estimate: NotRequired[ "Invoice.ModifyParamsShippingCostShippingRateDataDeliveryEstimate" ] """ The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions. """ display_name: str """ The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions. """ fixed_amount: NotRequired[ "Invoice.ModifyParamsShippingCostShippingRateDataFixedAmount" ] """ Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. """ tax_code: NotRequired[str] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`. """ type: NotRequired[Literal["fixed_amount"]] """ The type of calculation to use on the shipping rate. """ class ModifyParamsShippingCostShippingRateDataDeliveryEstimate(TypedDict): maximum: NotRequired[ "Invoice.ModifyParamsShippingCostShippingRateDataDeliveryEstimateMaximum" ] """ The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. """ minimum: NotRequired[ "Invoice.ModifyParamsShippingCostShippingRateDataDeliveryEstimateMinimum" ] """ The lower bound of the estimated range. If empty, represents no lower bound. """ class ModifyParamsShippingCostShippingRateDataDeliveryEstimateMaximum( TypedDict, ): unit: Literal["business_day", "day", "hour", "month", "week"] """ A unit of time. """ value: int """ Must be greater than 0. """ class ModifyParamsShippingCostShippingRateDataDeliveryEstimateMinimum( TypedDict, ): unit: Literal["business_day", "day", "hour", "month", "week"] """ A unit of time. """ value: int """ Must be greater than 0. """ class ModifyParamsShippingCostShippingRateDataFixedAmount(TypedDict): amount: int """ A non-negative integer in cents representing how much to charge. """ 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). """ currency_options: NotRequired[ Dict[ str, "Invoice.ModifyParamsShippingCostShippingRateDataFixedAmountCurrencyOptions", ] ] """ Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ class ModifyParamsShippingCostShippingRateDataFixedAmountCurrencyOptions( TypedDict, ): amount: int """ A non-negative integer in cents representing how much to charge. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. """ class ModifyParamsShippingDetails(TypedDict): address: "Invoice.ModifyParamsShippingDetailsAddress" """ Shipping address """ name: str """ Recipient name. """ phone: NotRequired["Literal['']|str"] """ Recipient phone (including extension) """ class ModifyParamsShippingDetailsAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class ModifyParamsTransferData(TypedDict): amount: NotRequired[int] """ The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. """ destination: str """ ID of an existing, connected Stripe account. """ class PayParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ forgive: NotRequired[bool] """ In cases where the source used to pay the invoice has insufficient funds, passing `forgive=true` controls whether a charge should be attempted for the full amount available on the source, up to the amount to fully pay the invoice. This effectively forgives the difference between the amount available on the source and the amount due. Passing `forgive=false` will fail the charge if the source hasn't been pre-funded with the right amount. An example for this case is with ACH Credit Transfers and wires: if the amount wired is less than the amount due by a small amount, you might want to forgive the difference. Defaults to `false`. """ mandate: NotRequired["Literal['']|str"] """ ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the payment_method param or the invoice's default_payment_method or default_source, if set. """ off_session: NotRequired[bool] """ Indicates if a customer is on or off-session while an invoice payment is attempted. Defaults to `true` (off-session). """ paid_out_of_band: NotRequired[bool] """ Boolean representing whether an invoice is paid outside of Stripe. This will result in no charge being made. Defaults to `false`. """ payment_method: NotRequired[str] """ A PaymentMethod to be charged. The PaymentMethod must be the ID of a PaymentMethod belonging to the customer associated with the invoice being paid. """ source: NotRequired[str] """ A payment source to be charged. The source must be the ID of a source belonging to the customer associated with the invoice being paid. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class SearchParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ page: NotRequired[str] """ A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. """ query: str """ The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for invoices](https://stripe.com/docs/search#query-fields-for-invoices). """ class SendInvoiceParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpcomingLinesParams(RequestOptions): automatic_tax: NotRequired["Invoice.UpcomingLinesParamsAutomaticTax"] """ Settings for automatic tax lookup for this invoice preview. """ coupon: NotRequired[str] """ The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. """ currency: NotRequired[str] """ The currency to preview this invoice in. Defaults to that of `customer` if not specified. """ customer: NotRequired[str] """ The identifier of the customer whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. """ customer_details: NotRequired[ "Invoice.UpcomingLinesParamsCustomerDetails" ] """ Details about the customer you want to invoice or overrides for an existing customer. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. """ discounts: NotRequired[ "Literal['']|List[Invoice.UpcomingLinesParamsDiscount]" ] """ The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ invoice_items: NotRequired[ List["Invoice.UpcomingLinesParamsInvoiceItem"] ] """ List of invoice items to add or update in the upcoming invoice preview. """ issuer: NotRequired["Invoice.UpcomingLinesParamsIssuer"] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ on_behalf_of: NotRequired["Literal['']|str"] """ The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. """ preview_mode: NotRequired[Literal["next", "recurring"]] """ Customizes the types of values to include when calculating the invoice. Defaults to `next` if unspecified. """ schedule: NotRequired[str] """ The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. """ schedule_details: NotRequired[ "Invoice.UpcomingLinesParamsScheduleDetails" ] """ The schedule creation or modification params to apply as a preview. Cannot be used with `subscription` or `subscription_` prefixed fields. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ subscription: NotRequired[str] """ The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_details.items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_details.items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. """ subscription_billing_cycle_anchor: NotRequired[ "Literal['now', 'unchanged']|int" ] """ For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.billing_cycle_anchor` instead. """ subscription_cancel_at: NotRequired["Literal['']|int"] """ A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at` instead. """ subscription_cancel_at_period_end: NotRequired[bool] """ Boolean indicating whether this subscription should cancel at the end of the current period. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at_period_end` instead. """ subscription_cancel_now: NotRequired[bool] """ This simulates the subscription being canceled or expired immediately. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_now` instead. """ subscription_default_tax_rates: NotRequired["Literal['']|List[str]"] """ If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. This field has been deprecated and will be removed in a future API version. Use `subscription_details.default_tax_rates` instead. """ subscription_details: NotRequired[ "Invoice.UpcomingLinesParamsSubscriptionDetails" ] """ The subscription creation or modification params to apply as a preview. Cannot be used with `schedule` or `schedule_details` fields. """ subscription_items: NotRequired[ List["Invoice.UpcomingLinesParamsSubscriptionItem"] ] """ A list of up to 20 subscription items, each with an attached price. This field has been deprecated and will be removed in a future API version. Use `subscription_details.items` instead. """ subscription_proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.proration_behavior` instead. """ subscription_proration_date: NotRequired[int] """ If previewing an update to a subscription, and doing proration, `subscription_proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_items`, or `subscription_trial_end` are required. Also, `subscription_proration_behavior` cannot be set to 'none'. This field has been deprecated and will be removed in a future API version. Use `subscription_details.proration_date` instead. """ subscription_resume_at: NotRequired[Literal["now"]] """ For paused subscriptions, setting `subscription_resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. This field has been deprecated and will be removed in a future API version. Use `subscription_details.resume_at` instead. """ subscription_start_date: NotRequired[int] """ Date a subscription is intended to start (can be future or past). This field has been deprecated and will be removed in a future API version. Use `subscription_details.start_date` instead. """ subscription_trial_end: NotRequired["Literal['now']|int"] """ If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_items` or `subscription` is required. This field has been deprecated and will be removed in a future API version. Use `subscription_details.trial_end` instead. """ subscription_trial_from_plan: NotRequired[bool] """ Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `subscription_trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `subscription_trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. """ class UpcomingLinesParamsAutomaticTax(TypedDict): enabled: bool """ Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. """ liability: NotRequired[ "Invoice.UpcomingLinesParamsAutomaticTaxLiability" ] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ class UpcomingLinesParamsAutomaticTaxLiability(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class UpcomingLinesParamsCustomerDetails(TypedDict): address: NotRequired[ "Literal['']|Invoice.UpcomingLinesParamsCustomerDetailsAddress" ] """ The customer's address. """ shipping: NotRequired[ "Literal['']|Invoice.UpcomingLinesParamsCustomerDetailsShipping" ] """ The customer's shipping information. Appears on invoices emailed to this customer. """ tax: NotRequired["Invoice.UpcomingLinesParamsCustomerDetailsTax"] """ Tax details about the customer. """ tax_exempt: NotRequired[ "Literal['']|Literal['exempt', 'none', 'reverse']" ] """ The customer's tax exemption. One of `none`, `exempt`, or `reverse`. """ tax_ids: NotRequired[ List["Invoice.UpcomingLinesParamsCustomerDetailsTaxId"] ] """ The customer's tax IDs. """ class UpcomingLinesParamsCustomerDetailsAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class UpcomingLinesParamsCustomerDetailsShipping(TypedDict): address: "Invoice.UpcomingLinesParamsCustomerDetailsShippingAddress" """ Customer shipping address. """ name: str """ Customer name. """ phone: NotRequired[str] """ Customer phone (including extension). """ class UpcomingLinesParamsCustomerDetailsShippingAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class UpcomingLinesParamsCustomerDetailsTax(TypedDict): ip_address: NotRequired["Literal['']|str"] """ A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. """ class UpcomingLinesParamsCustomerDetailsTaxId(TypedDict): type: Literal[ "ad_nrt", "ae_trn", "ar_cuit", "au_abn", "au_arn", "bg_uic", "bh_vat", "bo_tin", "br_cnpj", "br_cpf", "ca_bn", "ca_gst_hst", "ca_pst_bc", "ca_pst_mb", "ca_pst_sk", "ca_qst", "ch_uid", "ch_vat", "cl_tin", "cn_tin", "co_nit", "cr_tin", "de_stn", "do_rcn", "ec_ruc", "eg_tin", "es_cif", "eu_oss_vat", "eu_vat", "gb_vat", "ge_vat", "hk_br", "hu_tin", "id_npwp", "il_vat", "in_gst", "is_vat", "jp_cn", "jp_rn", "jp_trn", "ke_pin", "kr_brn", "kz_bin", "li_uid", "mx_rfc", "my_frp", "my_itn", "my_sst", "ng_tin", "no_vat", "no_voec", "nz_gst", "om_vat", "pe_ruc", "ph_tin", "ro_tin", "rs_pib", "ru_inn", "ru_kpp", "sa_vat", "sg_gst", "sg_uen", "si_tin", "sv_nit", "th_vat", "tr_tin", "tw_vat", "ua_vat", "us_ein", "uy_ruc", "ve_rif", "vn_tin", "za_vat", ] """ Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ Value of the tax ID. """ class UpcomingLinesParamsDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class UpcomingLinesParamsInvoiceItem(TypedDict): amount: NotRequired[int] """ The integer amount in cents (or local equivalent) of previewed invoice item. """ currency: NotRequired[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). Only applicable to new invoice items. """ description: NotRequired[str] """ An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. """ discountable: NotRequired[bool] """ Explicitly controls whether discounts apply to this invoice item. Defaults to true, except for negative invoice items. """ discounts: NotRequired[ "Literal['']|List[Invoice.UpcomingLinesParamsInvoiceItemDiscount]" ] """ The coupons to redeem into discounts for the invoice item in the preview. """ invoiceitem: NotRequired[str] """ The ID of the invoice item to update in preview. If not specified, a new invoice item will be added to the preview of the upcoming invoice. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ period: NotRequired["Invoice.UpcomingLinesParamsInvoiceItemPeriod"] """ The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired[ "Invoice.UpcomingLinesParamsInvoiceItemPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ Non-negative integer. The quantity of units for the invoice item. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ tax_code: NotRequired["Literal['']|str"] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item. """ unit_amount: NotRequired[int] """ The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class UpcomingLinesParamsInvoiceItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class UpcomingLinesParamsInvoiceItemPeriod(TypedDict): end: int """ The end of the period, which must be greater than or equal to the start. This value is inclusive. """ start: int """ The start of the period. This value is inclusive. """ class UpcomingLinesParamsInvoiceItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class UpcomingLinesParamsIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class UpcomingLinesParamsScheduleDetails(TypedDict): end_behavior: NotRequired[Literal["cancel", "release"]] """ Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription. """ phases: NotRequired[ List["Invoice.UpcomingLinesParamsScheduleDetailsPhase"] ] """ List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request. """ class UpcomingLinesParamsScheduleDetailsPhase(TypedDict): add_invoice_items: NotRequired[ List[ "Invoice.UpcomingLinesParamsScheduleDetailsPhaseAddInvoiceItem" ] ] """ A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items. """ application_fee_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). """ automatic_tax: NotRequired[ "Invoice.UpcomingLinesParamsScheduleDetailsPhaseAutomaticTax" ] """ Automatic tax settings for this phase. """ billing_cycle_anchor: NotRequired[Literal["automatic", "phase_start"]] """ Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ billing_thresholds: NotRequired[ "Literal['']|Invoice.UpcomingLinesParamsScheduleDetailsPhaseBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds. """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. """ coupon: NotRequired[str] """ The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. """ currency: NotRequired[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). """ default_payment_method: NotRequired[str] """ ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. """ default_tax_rates: NotRequired["Literal['']|List[str]"] """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase. """ description: NotRequired["Literal['']|str"] """ Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ discounts: NotRequired[ "Literal['']|List[Invoice.UpcomingLinesParamsScheduleDetailsPhaseDiscount]" ] """ The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription's customer. Pass an empty string to avoid inheriting any discounts. """ end_date: NotRequired["int|Literal['now']"] """ The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set. """ invoice_settings: NotRequired[ "Invoice.UpcomingLinesParamsScheduleDetailsPhaseInvoiceSettings" ] """ All invoices will be billed using the specified settings. """ items: List["Invoice.UpcomingLinesParamsScheduleDetailsPhaseItem"] """ List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. """ iterations: NotRequired[int] """ Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. """ on_behalf_of: NotRequired[str] """ The account on behalf of which to charge, for each of the associated subscription's invoices. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase. """ start_date: NotRequired["int|Literal['now']"] """ The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase. """ transfer_data: NotRequired[ "Invoice.UpcomingLinesParamsScheduleDetailsPhaseTransferData" ] """ The data with which to automatically create a Transfer for each of the associated subscription's invoices. """ trial: NotRequired[bool] """ If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. """ trial_end: NotRequired["int|Literal['now']"] """ Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial` """ class UpcomingLinesParamsScheduleDetailsPhaseAddInvoiceItem(TypedDict): discounts: NotRequired[ List[ "Invoice.UpcomingLinesParamsScheduleDetailsPhaseAddInvoiceItemDiscount" ] ] """ The coupons to redeem into discounts for the item. """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired[ "Invoice.UpcomingLinesParamsScheduleDetailsPhaseAddInvoiceItemPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ Quantity for this item. Defaults to 1. """ tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. """ class UpcomingLinesParamsScheduleDetailsPhaseAddInvoiceItemDiscount( TypedDict, ): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class UpcomingLinesParamsScheduleDetailsPhaseAddInvoiceItemPriceData( TypedDict, ): 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). """ product: str """ The ID of the product that this price will belong to. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class UpcomingLinesParamsScheduleDetailsPhaseAutomaticTax(TypedDict): enabled: bool """ Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. """ liability: NotRequired[ "Invoice.UpcomingLinesParamsScheduleDetailsPhaseAutomaticTaxLiability" ] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ class UpcomingLinesParamsScheduleDetailsPhaseAutomaticTaxLiability( TypedDict, ): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class UpcomingLinesParamsScheduleDetailsPhaseBillingThresholds(TypedDict): amount_gte: NotRequired[int] """ Monetary threshold that triggers the subscription to advance to a new billing period """ reset_billing_cycle_anchor: NotRequired[bool] """ Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. """ class UpcomingLinesParamsScheduleDetailsPhaseDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class UpcomingLinesParamsScheduleDetailsPhaseInvoiceSettings(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule. """ days_until_due: NotRequired[int] """ Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. """ issuer: NotRequired[ "Invoice.UpcomingLinesParamsScheduleDetailsPhaseInvoiceSettingsIssuer" ] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ class UpcomingLinesParamsScheduleDetailsPhaseInvoiceSettingsIssuer( TypedDict, ): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class UpcomingLinesParamsScheduleDetailsPhaseItem(TypedDict): billing_thresholds: NotRequired[ "Literal['']|Invoice.UpcomingLinesParamsScheduleDetailsPhaseItemBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ discounts: NotRequired[ "Literal['']|List[Invoice.UpcomingLinesParamsScheduleDetailsPhaseItemDiscount]" ] """ The coupons to redeem into discounts for the subscription item. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`. """ plan: NotRequired[str] """ The plan ID to subscribe to. You may specify the same ID in `plan` and `price`. """ price: NotRequired[str] """ The ID of the price object. """ price_data: NotRequired[ "Invoice.UpcomingLinesParamsScheduleDetailsPhaseItemPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ quantity: NotRequired[int] """ Quantity for the given price. Can be set only if the price's `usage_type` is `licensed` and not `metered`. """ tax_rates: NotRequired["Literal['']|List[str]"] """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ class UpcomingLinesParamsScheduleDetailsPhaseItemBillingThresholds( TypedDict, ): usage_gte: int """ Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ class UpcomingLinesParamsScheduleDetailsPhaseItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class UpcomingLinesParamsScheduleDetailsPhaseItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ recurring: "Invoice.UpcomingLinesParamsScheduleDetailsPhaseItemPriceDataRecurring" """ The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class UpcomingLinesParamsScheduleDetailsPhaseItemPriceDataRecurring( TypedDict, ): interval: Literal["day", "month", "week", "year"] """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class UpcomingLinesParamsScheduleDetailsPhaseTransferData(TypedDict): amount_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. """ destination: str """ ID of an existing, connected Stripe account. """ class UpcomingLinesParamsSubscriptionDetails(TypedDict): billing_cycle_anchor: NotRequired["Literal['now', 'unchanged']|int"] """ For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. """ cancel_at: NotRequired["Literal['']|int"] """ A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. """ cancel_at_period_end: NotRequired[bool] """ Boolean indicating whether this subscription should cancel at the end of the current period. """ cancel_now: NotRequired[bool] """ This simulates the subscription being canceled or expired immediately. """ default_tax_rates: NotRequired["Literal['']|List[str]"] """ If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. """ items: NotRequired[ List["Invoice.UpcomingLinesParamsSubscriptionDetailsItem"] ] """ A list of up to 20 subscription items, each with an attached price. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ proration_date: NotRequired[int] """ If previewing an update to a subscription, and doing proration, `subscription_details.proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_details.items`, or `subscription_details.trial_end` are required. Also, `subscription_details.proration_behavior` cannot be set to 'none'. """ resume_at: NotRequired[Literal["now"]] """ For paused subscriptions, setting `subscription_details.resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. """ start_date: NotRequired[int] """ Date a subscription is intended to start (can be future or past). """ trial_end: NotRequired["Literal['now']|int"] """ If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_details.items` or `subscription` is required. """ class UpcomingLinesParamsSubscriptionDetailsItem(TypedDict): billing_thresholds: NotRequired[ "Literal['']|Invoice.UpcomingLinesParamsSubscriptionDetailsItemBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ clear_usage: NotRequired[bool] """ Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. """ deleted: NotRequired[bool] """ A flag that, if set to `true`, will delete the specified item. """ discounts: NotRequired[ "Literal['']|List[Invoice.UpcomingLinesParamsSubscriptionDetailsItemDiscount]" ] """ The coupons to redeem into discounts for the subscription item. """ id: NotRequired[str] """ Subscription item to update. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ plan: NotRequired[str] """ Plan ID for this item, as a string. """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ price_data: NotRequired[ "Invoice.UpcomingLinesParamsSubscriptionDetailsItemPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ Quantity for this item. """ tax_rates: NotRequired["Literal['']|List[str]"] """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ class UpcomingLinesParamsSubscriptionDetailsItemBillingThresholds( TypedDict, ): usage_gte: int """ Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ class UpcomingLinesParamsSubscriptionDetailsItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class UpcomingLinesParamsSubscriptionDetailsItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ recurring: "Invoice.UpcomingLinesParamsSubscriptionDetailsItemPriceDataRecurring" """ The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class UpcomingLinesParamsSubscriptionDetailsItemPriceDataRecurring( TypedDict, ): interval: Literal["day", "month", "week", "year"] """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class UpcomingLinesParamsSubscriptionItem(TypedDict): billing_thresholds: NotRequired[ "Literal['']|Invoice.UpcomingLinesParamsSubscriptionItemBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ clear_usage: NotRequired[bool] """ Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. """ deleted: NotRequired[bool] """ A flag that, if set to `true`, will delete the specified item. """ discounts: NotRequired[ "Literal['']|List[Invoice.UpcomingLinesParamsSubscriptionItemDiscount]" ] """ The coupons to redeem into discounts for the subscription item. """ id: NotRequired[str] """ Subscription item to update. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ plan: NotRequired[str] """ Plan ID for this item, as a string. """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ price_data: NotRequired[ "Invoice.UpcomingLinesParamsSubscriptionItemPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ Quantity for this item. """ tax_rates: NotRequired["Literal['']|List[str]"] """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ class UpcomingLinesParamsSubscriptionItemBillingThresholds(TypedDict): usage_gte: int """ Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ class UpcomingLinesParamsSubscriptionItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class UpcomingLinesParamsSubscriptionItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ recurring: ( "Invoice.UpcomingLinesParamsSubscriptionItemPriceDataRecurring" ) """ The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class UpcomingLinesParamsSubscriptionItemPriceDataRecurring(TypedDict): interval: Literal["day", "month", "week", "year"] """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class UpcomingParams(RequestOptions): automatic_tax: NotRequired["Invoice.UpcomingParamsAutomaticTax"] """ Settings for automatic tax lookup for this invoice preview. """ coupon: NotRequired[str] """ The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. """ currency: NotRequired[str] """ The currency to preview this invoice in. Defaults to that of `customer` if not specified. """ customer: NotRequired[str] """ The identifier of the customer whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. """ customer_details: NotRequired["Invoice.UpcomingParamsCustomerDetails"] """ Details about the customer you want to invoice or overrides for an existing customer. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. """ discounts: NotRequired[ "Literal['']|List[Invoice.UpcomingParamsDiscount]" ] """ The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ invoice_items: NotRequired[List["Invoice.UpcomingParamsInvoiceItem"]] """ List of invoice items to add or update in the upcoming invoice preview. """ issuer: NotRequired["Invoice.UpcomingParamsIssuer"] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ on_behalf_of: NotRequired["Literal['']|str"] """ The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. """ preview_mode: NotRequired[Literal["next", "recurring"]] """ Customizes the types of values to include when calculating the invoice. Defaults to `next` if unspecified. """ schedule: NotRequired[str] """ The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. """ schedule_details: NotRequired["Invoice.UpcomingParamsScheduleDetails"] """ The schedule creation or modification params to apply as a preview. Cannot be used with `subscription` or `subscription_` prefixed fields. """ subscription: NotRequired[str] """ The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_details.items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_details.items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. """ subscription_billing_cycle_anchor: NotRequired[ "Literal['now', 'unchanged']|int" ] """ For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.billing_cycle_anchor` instead. """ subscription_cancel_at: NotRequired["Literal['']|int"] """ A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at` instead. """ subscription_cancel_at_period_end: NotRequired[bool] """ Boolean indicating whether this subscription should cancel at the end of the current period. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at_period_end` instead. """ subscription_cancel_now: NotRequired[bool] """ This simulates the subscription being canceled or expired immediately. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_now` instead. """ subscription_default_tax_rates: NotRequired["Literal['']|List[str]"] """ If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. This field has been deprecated and will be removed in a future API version. Use `subscription_details.default_tax_rates` instead. """ subscription_details: NotRequired[ "Invoice.UpcomingParamsSubscriptionDetails" ] """ The subscription creation or modification params to apply as a preview. Cannot be used with `schedule` or `schedule_details` fields. """ subscription_items: NotRequired[ List["Invoice.UpcomingParamsSubscriptionItem"] ] """ A list of up to 20 subscription items, each with an attached price. This field has been deprecated and will be removed in a future API version. Use `subscription_details.items` instead. """ subscription_proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.proration_behavior` instead. """ subscription_proration_date: NotRequired[int] """ If previewing an update to a subscription, and doing proration, `subscription_proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_items`, or `subscription_trial_end` are required. Also, `subscription_proration_behavior` cannot be set to 'none'. This field has been deprecated and will be removed in a future API version. Use `subscription_details.proration_date` instead. """ subscription_resume_at: NotRequired[Literal["now"]] """ For paused subscriptions, setting `subscription_resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. This field has been deprecated and will be removed in a future API version. Use `subscription_details.resume_at` instead. """ subscription_start_date: NotRequired[int] """ Date a subscription is intended to start (can be future or past). This field has been deprecated and will be removed in a future API version. Use `subscription_details.start_date` instead. """ subscription_trial_end: NotRequired["Literal['now']|int"] """ If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_items` or `subscription` is required. This field has been deprecated and will be removed in a future API version. Use `subscription_details.trial_end` instead. """ subscription_trial_from_plan: NotRequired[bool] """ Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `subscription_trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `subscription_trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. """ class UpcomingParamsAutomaticTax(TypedDict): enabled: bool """ Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. """ liability: NotRequired["Invoice.UpcomingParamsAutomaticTaxLiability"] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ class UpcomingParamsAutomaticTaxLiability(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class UpcomingParamsCustomerDetails(TypedDict): address: NotRequired[ "Literal['']|Invoice.UpcomingParamsCustomerDetailsAddress" ] """ The customer's address. """ shipping: NotRequired[ "Literal['']|Invoice.UpcomingParamsCustomerDetailsShipping" ] """ The customer's shipping information. Appears on invoices emailed to this customer. """ tax: NotRequired["Invoice.UpcomingParamsCustomerDetailsTax"] """ Tax details about the customer. """ tax_exempt: NotRequired[ "Literal['']|Literal['exempt', 'none', 'reverse']" ] """ The customer's tax exemption. One of `none`, `exempt`, or `reverse`. """ tax_ids: NotRequired[ List["Invoice.UpcomingParamsCustomerDetailsTaxId"] ] """ The customer's tax IDs. """ class UpcomingParamsCustomerDetailsAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class UpcomingParamsCustomerDetailsShipping(TypedDict): address: "Invoice.UpcomingParamsCustomerDetailsShippingAddress" """ Customer shipping address. """ name: str """ Customer name. """ phone: NotRequired[str] """ Customer phone (including extension). """ class UpcomingParamsCustomerDetailsShippingAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class UpcomingParamsCustomerDetailsTax(TypedDict): ip_address: NotRequired["Literal['']|str"] """ A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. """ class UpcomingParamsCustomerDetailsTaxId(TypedDict): type: Literal[ "ad_nrt", "ae_trn", "ar_cuit", "au_abn", "au_arn", "bg_uic", "bh_vat", "bo_tin", "br_cnpj", "br_cpf", "ca_bn", "ca_gst_hst", "ca_pst_bc", "ca_pst_mb", "ca_pst_sk", "ca_qst", "ch_uid", "ch_vat", "cl_tin", "cn_tin", "co_nit", "cr_tin", "de_stn", "do_rcn", "ec_ruc", "eg_tin", "es_cif", "eu_oss_vat", "eu_vat", "gb_vat", "ge_vat", "hk_br", "hu_tin", "id_npwp", "il_vat", "in_gst", "is_vat", "jp_cn", "jp_rn", "jp_trn", "ke_pin", "kr_brn", "kz_bin", "li_uid", "mx_rfc", "my_frp", "my_itn", "my_sst", "ng_tin", "no_vat", "no_voec", "nz_gst", "om_vat", "pe_ruc", "ph_tin", "ro_tin", "rs_pib", "ru_inn", "ru_kpp", "sa_vat", "sg_gst", "sg_uen", "si_tin", "sv_nit", "th_vat", "tr_tin", "tw_vat", "ua_vat", "us_ein", "uy_ruc", "ve_rif", "vn_tin", "za_vat", ] """ Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ Value of the tax ID. """ class UpcomingParamsDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class UpcomingParamsInvoiceItem(TypedDict): amount: NotRequired[int] """ The integer amount in cents (or local equivalent) of previewed invoice item. """ currency: NotRequired[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). Only applicable to new invoice items. """ description: NotRequired[str] """ An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. """ discountable: NotRequired[bool] """ Explicitly controls whether discounts apply to this invoice item. Defaults to true, except for negative invoice items. """ discounts: NotRequired[ "Literal['']|List[Invoice.UpcomingParamsInvoiceItemDiscount]" ] """ The coupons to redeem into discounts for the invoice item in the preview. """ invoiceitem: NotRequired[str] """ The ID of the invoice item to update in preview. If not specified, a new invoice item will be added to the preview of the upcoming invoice. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ period: NotRequired["Invoice.UpcomingParamsInvoiceItemPeriod"] """ The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired["Invoice.UpcomingParamsInvoiceItemPriceData"] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ Non-negative integer. The quantity of units for the invoice item. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ tax_code: NotRequired["Literal['']|str"] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item. """ unit_amount: NotRequired[int] """ The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class UpcomingParamsInvoiceItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class UpcomingParamsInvoiceItemPeriod(TypedDict): end: int """ The end of the period, which must be greater than or equal to the start. This value is inclusive. """ start: int """ The start of the period. This value is inclusive. """ class UpcomingParamsInvoiceItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class UpcomingParamsIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class UpcomingParamsScheduleDetails(TypedDict): end_behavior: NotRequired[Literal["cancel", "release"]] """ Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription. """ phases: NotRequired[List["Invoice.UpcomingParamsScheduleDetailsPhase"]] """ List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request. """ class UpcomingParamsScheduleDetailsPhase(TypedDict): add_invoice_items: NotRequired[ List["Invoice.UpcomingParamsScheduleDetailsPhaseAddInvoiceItem"] ] """ A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items. """ application_fee_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). """ automatic_tax: NotRequired[ "Invoice.UpcomingParamsScheduleDetailsPhaseAutomaticTax" ] """ Automatic tax settings for this phase. """ billing_cycle_anchor: NotRequired[Literal["automatic", "phase_start"]] """ Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ billing_thresholds: NotRequired[ "Literal['']|Invoice.UpcomingParamsScheduleDetailsPhaseBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds. """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. """ coupon: NotRequired[str] """ The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. """ currency: NotRequired[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). """ default_payment_method: NotRequired[str] """ ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. """ default_tax_rates: NotRequired["Literal['']|List[str]"] """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase. """ description: NotRequired["Literal['']|str"] """ Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ discounts: NotRequired[ "Literal['']|List[Invoice.UpcomingParamsScheduleDetailsPhaseDiscount]" ] """ The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription's customer. Pass an empty string to avoid inheriting any discounts. """ end_date: NotRequired["int|Literal['now']"] """ The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set. """ invoice_settings: NotRequired[ "Invoice.UpcomingParamsScheduleDetailsPhaseInvoiceSettings" ] """ All invoices will be billed using the specified settings. """ items: List["Invoice.UpcomingParamsScheduleDetailsPhaseItem"] """ List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. """ iterations: NotRequired[int] """ Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. """ on_behalf_of: NotRequired[str] """ The account on behalf of which to charge, for each of the associated subscription's invoices. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase. """ start_date: NotRequired["int|Literal['now']"] """ The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase. """ transfer_data: NotRequired[ "Invoice.UpcomingParamsScheduleDetailsPhaseTransferData" ] """ The data with which to automatically create a Transfer for each of the associated subscription's invoices. """ trial: NotRequired[bool] """ If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. """ trial_end: NotRequired["int|Literal['now']"] """ Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial` """ class UpcomingParamsScheduleDetailsPhaseAddInvoiceItem(TypedDict): discounts: NotRequired[ List[ "Invoice.UpcomingParamsScheduleDetailsPhaseAddInvoiceItemDiscount" ] ] """ The coupons to redeem into discounts for the item. """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired[ "Invoice.UpcomingParamsScheduleDetailsPhaseAddInvoiceItemPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ Quantity for this item. Defaults to 1. """ tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. """ class UpcomingParamsScheduleDetailsPhaseAddInvoiceItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class UpcomingParamsScheduleDetailsPhaseAddInvoiceItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class UpcomingParamsScheduleDetailsPhaseAutomaticTax(TypedDict): enabled: bool """ Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. """ liability: NotRequired[ "Invoice.UpcomingParamsScheduleDetailsPhaseAutomaticTaxLiability" ] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ class UpcomingParamsScheduleDetailsPhaseAutomaticTaxLiability(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class UpcomingParamsScheduleDetailsPhaseBillingThresholds(TypedDict): amount_gte: NotRequired[int] """ Monetary threshold that triggers the subscription to advance to a new billing period """ reset_billing_cycle_anchor: NotRequired[bool] """ Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. """ class UpcomingParamsScheduleDetailsPhaseDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class UpcomingParamsScheduleDetailsPhaseInvoiceSettings(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule. """ days_until_due: NotRequired[int] """ Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. """ issuer: NotRequired[ "Invoice.UpcomingParamsScheduleDetailsPhaseInvoiceSettingsIssuer" ] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ class UpcomingParamsScheduleDetailsPhaseInvoiceSettingsIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class UpcomingParamsScheduleDetailsPhaseItem(TypedDict): billing_thresholds: NotRequired[ "Literal['']|Invoice.UpcomingParamsScheduleDetailsPhaseItemBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ discounts: NotRequired[ "Literal['']|List[Invoice.UpcomingParamsScheduleDetailsPhaseItemDiscount]" ] """ The coupons to redeem into discounts for the subscription item. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`. """ plan: NotRequired[str] """ The plan ID to subscribe to. You may specify the same ID in `plan` and `price`. """ price: NotRequired[str] """ The ID of the price object. """ price_data: NotRequired[ "Invoice.UpcomingParamsScheduleDetailsPhaseItemPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ quantity: NotRequired[int] """ Quantity for the given price. Can be set only if the price's `usage_type` is `licensed` and not `metered`. """ tax_rates: NotRequired["Literal['']|List[str]"] """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ class UpcomingParamsScheduleDetailsPhaseItemBillingThresholds(TypedDict): usage_gte: int """ Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ class UpcomingParamsScheduleDetailsPhaseItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class UpcomingParamsScheduleDetailsPhaseItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ recurring: ( "Invoice.UpcomingParamsScheduleDetailsPhaseItemPriceDataRecurring" ) """ The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class UpcomingParamsScheduleDetailsPhaseItemPriceDataRecurring(TypedDict): interval: Literal["day", "month", "week", "year"] """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class UpcomingParamsScheduleDetailsPhaseTransferData(TypedDict): amount_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. """ destination: str """ ID of an existing, connected Stripe account. """ class UpcomingParamsSubscriptionDetails(TypedDict): billing_cycle_anchor: NotRequired["Literal['now', 'unchanged']|int"] """ For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. """ cancel_at: NotRequired["Literal['']|int"] """ A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. """ cancel_at_period_end: NotRequired[bool] """ Boolean indicating whether this subscription should cancel at the end of the current period. """ cancel_now: NotRequired[bool] """ This simulates the subscription being canceled or expired immediately. """ default_tax_rates: NotRequired["Literal['']|List[str]"] """ If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. """ items: NotRequired[ List["Invoice.UpcomingParamsSubscriptionDetailsItem"] ] """ A list of up to 20 subscription items, each with an attached price. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ proration_date: NotRequired[int] """ If previewing an update to a subscription, and doing proration, `subscription_details.proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_details.items`, or `subscription_details.trial_end` are required. Also, `subscription_details.proration_behavior` cannot be set to 'none'. """ resume_at: NotRequired[Literal["now"]] """ For paused subscriptions, setting `subscription_details.resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. """ start_date: NotRequired[int] """ Date a subscription is intended to start (can be future or past). """ trial_end: NotRequired["Literal['now']|int"] """ If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_details.items` or `subscription` is required. """ class UpcomingParamsSubscriptionDetailsItem(TypedDict): billing_thresholds: NotRequired[ "Literal['']|Invoice.UpcomingParamsSubscriptionDetailsItemBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ clear_usage: NotRequired[bool] """ Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. """ deleted: NotRequired[bool] """ A flag that, if set to `true`, will delete the specified item. """ discounts: NotRequired[ "Literal['']|List[Invoice.UpcomingParamsSubscriptionDetailsItemDiscount]" ] """ The coupons to redeem into discounts for the subscription item. """ id: NotRequired[str] """ Subscription item to update. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ plan: NotRequired[str] """ Plan ID for this item, as a string. """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ price_data: NotRequired[ "Invoice.UpcomingParamsSubscriptionDetailsItemPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ Quantity for this item. """ tax_rates: NotRequired["Literal['']|List[str]"] """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ class UpcomingParamsSubscriptionDetailsItemBillingThresholds(TypedDict): usage_gte: int """ Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ class UpcomingParamsSubscriptionDetailsItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class UpcomingParamsSubscriptionDetailsItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ recurring: ( "Invoice.UpcomingParamsSubscriptionDetailsItemPriceDataRecurring" ) """ The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class UpcomingParamsSubscriptionDetailsItemPriceDataRecurring(TypedDict): interval: Literal["day", "month", "week", "year"] """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class UpcomingParamsSubscriptionItem(TypedDict): billing_thresholds: NotRequired[ "Literal['']|Invoice.UpcomingParamsSubscriptionItemBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ clear_usage: NotRequired[bool] """ Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. """ deleted: NotRequired[bool] """ A flag that, if set to `true`, will delete the specified item. """ discounts: NotRequired[ "Literal['']|List[Invoice.UpcomingParamsSubscriptionItemDiscount]" ] """ The coupons to redeem into discounts for the subscription item. """ id: NotRequired[str] """ Subscription item to update. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ plan: NotRequired[str] """ Plan ID for this item, as a string. """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ price_data: NotRequired[ "Invoice.UpcomingParamsSubscriptionItemPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ Quantity for this item. """ tax_rates: NotRequired["Literal['']|List[str]"] """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ class UpcomingParamsSubscriptionItemBillingThresholds(TypedDict): usage_gte: int """ Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ class UpcomingParamsSubscriptionItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class UpcomingParamsSubscriptionItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ recurring: "Invoice.UpcomingParamsSubscriptionItemPriceDataRecurring" """ The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class UpcomingParamsSubscriptionItemPriceDataRecurring(TypedDict): interval: Literal["day", "month", "week", "year"] """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class VoidInvoiceParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ account_country: Optional[str] """ The country of the business associated with this invoice, most often the business creating the invoice. """ account_name: Optional[str] """ The public name of the business associated with this invoice, most often the business creating the invoice. """ account_tax_ids: Optional[List[ExpandableField["TaxId"]]] """ The account tax IDs associated with the invoice. Only editable when the invoice is a draft. """ amount_due: int """ Final amount due at this time for this invoice. If the invoice's total is smaller than the minimum charge amount, for example, or if there is account credit that can be applied to the invoice, the `amount_due` may be 0. If there is a positive `starting_balance` for the invoice (the customer owes money), the `amount_due` will also take that into account. The charge that gets generated for the invoice will be for the amount specified in `amount_due`. """ amount_paid: int """ The amount, in cents (or local equivalent), that was paid. """ amount_remaining: int """ The difference between amount_due and amount_paid, in cents (or local equivalent). """ amount_shipping: int """ This is the sum of all the shipping amounts. """ application: Optional[ExpandableField["Application"]] """ ID of the Connect Application that created the invoice. """ application_fee_amount: Optional[int] """ The fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account when the invoice is paid. """ attempt_count: int """ Number of payment attempts made for this invoice, from the perspective of the payment retry schedule. Any payment attempt counts as the first attempt, and subsequently only automatic retries increment the attempt count. In other words, manual payment attempts after the first attempt do not affect the retry schedule. If a failure is returned with a non-retryable return code, the invoice can no longer be retried unless a new payment method is obtained. Retries will continue to be scheduled, and attempt_count will continue to increment, but retries will only be executed if a new payment method is obtained. """ attempted: bool """ Whether an attempt has been made to pay the invoice. An invoice is not attempted until 1 hour after the `invoice.created` webhook, for example, so you might not want to display that invoice as unpaid to your users. """ auto_advance: Optional[bool] """ Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action. """ automatic_tax: AutomaticTax billing_reason: Optional[ Literal[ "automatic_pending_invoice_item_invoice", "manual", "quote_accept", "subscription", "subscription_create", "subscription_cycle", "subscription_threshold", "subscription_update", "upcoming", ] ] """ Indicates the reason why the invoice was created. * `manual`: Unrelated to a subscription, for example, created via the invoice editor. * `subscription`: No longer in use. Applies to subscriptions from before May 2018 where no distinction was made between updates, cycles, and thresholds. * `subscription_create`: A new subscription was created. * `subscription_cycle`: A subscription advanced into a new period. * `subscription_threshold`: A subscription reached a billing threshold. * `subscription_update`: A subscription was updated. * `upcoming`: Reserved for simulated invoices, per the upcoming invoice endpoint. """ charge: Optional[ExpandableField["Charge"]] """ ID of the latest charge generated for this invoice, if any. """ collection_method: Literal["charge_automatically", "send_invoice"] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ 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). """ custom_fields: Optional[List[CustomField]] """ Custom fields displayed on the invoice. """ customer: Optional[ExpandableField["Customer"]] """ The ID of the customer who will be billed. """ customer_address: Optional[CustomerAddress] """ The customer's address. Until the invoice is finalized, this field will equal `customer.address`. Once the invoice is finalized, this field will no longer be updated. """ customer_email: Optional[str] """ The customer's email. Until the invoice is finalized, this field will equal `customer.email`. Once the invoice is finalized, this field will no longer be updated. """ customer_name: Optional[str] """ The customer's name. Until the invoice is finalized, this field will equal `customer.name`. Once the invoice is finalized, this field will no longer be updated. """ customer_phone: Optional[str] """ The customer's phone number. Until the invoice is finalized, this field will equal `customer.phone`. Once the invoice is finalized, this field will no longer be updated. """ customer_shipping: Optional[CustomerShipping] """ The customer's shipping information. Until the invoice is finalized, this field will equal `customer.shipping`. Once the invoice is finalized, this field will no longer be updated. """ customer_tax_exempt: Optional[Literal["exempt", "none", "reverse"]] """ The customer's tax exempt status. Until the invoice is finalized, this field will equal `customer.tax_exempt`. Once the invoice is finalized, this field will no longer be updated. """ customer_tax_ids: Optional[List[CustomerTaxId]] """ The customer's tax IDs. Until the invoice is finalized, this field will contain the same tax IDs as `customer.tax_ids`. Once the invoice is finalized, this field will no longer be updated. """ default_payment_method: Optional[ExpandableField["PaymentMethod"]] """ ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. """ default_source: Optional[ ExpandableField[ Union["Account", "BankAccount", "CardResource", "Source"] ] ] """ ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source. """ default_tax_rates: List["TaxRate"] """ The tax rates applied to this invoice, if any. """ description: Optional[str] """ An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard. """ discount: Optional["Discount"] """ Describes the current discount applied to this invoice, if there is one. Not populated if there are multiple discounts. """ discounts: List[ExpandableField["Discount"]] """ The discounts applied to the invoice. Line item discounts are applied before invoice discounts. Use `expand[]=discounts` to expand each discount. """ due_date: Optional[int] """ The date on which payment for this invoice is due. This value will be `null` for invoices where `collection_method=charge_automatically`. """ effective_at: Optional[int] """ The date when this invoice is in effect. Same as `finalized_at` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt. """ ending_balance: Optional[int] """ Ending customer balance after the invoice is finalized. Invoices are finalized approximately an hour after successful webhook delivery or when payment collection is attempted for the invoice. If the invoice has not been finalized yet, this will be null. """ footer: Optional[str] """ Footer displayed on the invoice. """ from_invoice: Optional[FromInvoice] """ Details of the invoice that was cloned. See the [revision documentation](https://stripe.com/docs/invoicing/invoice-revisions) for more details. """ hosted_invoice_url: Optional[str] """ The URL for the hosted invoice page, which allows customers to view and pay an invoice. If the invoice has not been finalized yet, this will be null. """ id: Optional[str] """ Unique identifier for the object. This property is always present unless the invoice is an upcoming invoice. See [Retrieve an upcoming invoice](https://stripe.com/docs/api/invoices/upcoming) for more details. """ invoice_pdf: Optional[str] """ The link to download the PDF for the invoice. If the invoice has not been finalized yet, this will be null. """ issuer: Issuer last_finalization_error: Optional[LastFinalizationError] """ The error encountered during the previous attempt to finalize the invoice. This field is cleared when the invoice is successfully finalized. """ latest_revision: Optional[ExpandableField["Invoice"]] """ The ID of the most recent non-draft revision of this invoice """ lines: ListObject["InvoiceLineItem"] """ The individual line items that make up the invoice. `lines` is sorted as follows: (1) pending invoice items (including prorations) in reverse chronological order, (2) subscription items in reverse chronological order, and (3) invoice items added after invoice creation in chronological order. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ metadata: Optional[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ next_payment_attempt: Optional[int] """ The time at which payment will next be attempted. This value will be `null` for invoices where `collection_method=send_invoice`. """ number: Optional[str] """ A unique, identifying string that appears on emails sent to the customer for this invoice. This starts with the customer's unique invoice_prefix if it is specified. """ object: Literal["invoice"] """ String representing the object's type. Objects of the same type share the same value. """ on_behalf_of: Optional[ExpandableField["Account"]] """ The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. """ paid: bool """ Whether payment was successfully collected for this invoice. An invoice can be paid (most commonly) with a charge or with credit from the customer's account balance. """ paid_out_of_band: bool """ Returns true if the invoice was manually marked paid, returns false if the invoice hasn't been paid yet or was paid on Stripe. """ payment_intent: Optional[ExpandableField["PaymentIntent"]] """ The PaymentIntent associated with this invoice. The PaymentIntent is generated when the invoice is finalized, and can then be used to pay the invoice. Note that voiding an invoice will cancel the PaymentIntent. """ payment_settings: PaymentSettings period_end: int """ End of the usage period during which invoice items were added to this invoice. This looks back one period for a subscription invoice. Use the [line item period](https://stripe.com/api/invoices/line_item#invoice_line_item_object-period) to get the service period for each price. """ period_start: int """ Start of the usage period during which invoice items were added to this invoice. This looks back one period for a subscription invoice. Use the [line item period](https://stripe.com/api/invoices/line_item#invoice_line_item_object-period) to get the service period for each price. """ post_payment_credit_notes_amount: int """ Total amount of all post-payment credit notes issued for this invoice. """ pre_payment_credit_notes_amount: int """ Total amount of all pre-payment credit notes issued for this invoice. """ quote: Optional[ExpandableField["Quote"]] """ The quote this invoice was generated from. """ receipt_number: Optional[str] """ This is the transaction number that appears on email receipts sent for this invoice. """ rendering: Optional[Rendering] """ The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page. """ shipping_cost: Optional[ShippingCost] """ The details of the cost of shipping, including the ShippingRate applied on the invoice. """ shipping_details: Optional[ShippingDetails] """ Shipping details for the invoice. The Invoice PDF will use the `shipping_details` value if it is set, otherwise the PDF will render the shipping address from the customer. """ starting_balance: int """ Starting customer balance before the invoice is finalized. If the invoice has not been finalized yet, this will be the current customer balance. For revision invoices, this also includes any customer balance that was applied to the original invoice. """ statement_descriptor: Optional[str] """ Extra information about an invoice for the customer's credit card statement. """ status: Optional[Literal["draft", "open", "paid", "uncollectible", "void"]] """ The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview) """ status_transitions: StatusTransitions subscription: Optional[ExpandableField["Subscription"]] """ The subscription that this invoice was prepared for, if any. """ subscription_details: Optional[SubscriptionDetails] """ Details about the subscription that created this invoice. """ subscription_proration_date: Optional[int] """ Only set for upcoming invoices that preview prorations. The time used to calculate prorations. """ subtotal: int """ Total of all subscriptions, invoice items, and prorations on the invoice before any invoice level discount or exclusive tax is applied. Item discounts are already incorporated """ subtotal_excluding_tax: Optional[int] """ The integer amount in cents (or local equivalent) representing the subtotal of the invoice before any invoice level discount or tax is applied. Item discounts are already incorporated """ tax: Optional[int] """ The amount of tax on this invoice. This is the sum of all the tax amounts on this invoice. """ test_clock: Optional[ExpandableField["TestClock"]] """ ID of the test clock this invoice belongs to. """ threshold_reason: Optional[ThresholdReason] total: int """ Total after discounts and taxes. """ total_discount_amounts: Optional[List[TotalDiscountAmount]] """ The aggregate amounts calculated per discount across all line items. """ total_excluding_tax: Optional[int] """ The integer amount in cents (or local equivalent) representing the total amount of the invoice including all discounts but excluding all tax. """ total_tax_amounts: List[TotalTaxAmount] """ The aggregate amounts calculated per tax rate for all line items. """ transfer_data: Optional[TransferData] """ The account (if any) the payment will be attributed to for tax reporting, and where funds from the payment will be transferred to for the invoice. """ webhooks_delivered_at: Optional[int] """ Invoices are automatically paid or sent 1 hour after webhooks are delivered, or until all webhook delivery attempts have [been exhausted](https://stripe.com/docs/billing/webhooks#understand). This field tracks the time when webhooks for this invoice were successfully delivered. If the invoice had no webhooks to deliver, this will be set while the invoice is being created. """ deleted: Optional[Literal[True]] """ Always true for a deleted object """ @classmethod def create(cls, **params: Unpack["Invoice.CreateParams"]) -> "Invoice": """ This endpoint creates a draft invoice for a given customer. The invoice remains a draft until you [finalize the invoice, which allows you to [pay](#pay_invoice) or send](https://stripe.com/docs/api#finalize_invoice) the invoice to your customers. """ return cast( "Invoice", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["Invoice.CreateParams"] ) -> "Invoice": """ This endpoint creates a draft invoice for a given customer. The invoice remains a draft until you [finalize the invoice, which allows you to [pay](#pay_invoice) or send](https://stripe.com/docs/api#finalize_invoice) the invoice to your customers. """ return cast( "Invoice", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def create_preview( cls, **params: Unpack["Invoice.CreatePreviewParams"] ) -> "Invoice": """ At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice. Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request. Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions) """ return cast( "Invoice", cls._static_request( "post", "/v1/invoices/create_preview", params=params, ), ) @classmethod async def create_preview_async( cls, **params: Unpack["Invoice.CreatePreviewParams"] ) -> "Invoice": """ At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice. Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request. Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions) """ return cast( "Invoice", await cls._static_request_async( "post", "/v1/invoices/create_preview", params=params, ), ) @classmethod def _cls_delete( cls, sid: str, **params: Unpack["Invoice.DeleteParams"] ) -> "Invoice": """ Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://stripe.com/docs/api#void_invoice). """ url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "Invoice", cls._static_request( "delete", url, params=params, ), ) @overload @staticmethod def delete( sid: str, **params: Unpack["Invoice.DeleteParams"] ) -> "Invoice": """ Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://stripe.com/docs/api#void_invoice). """ ... @overload def delete(self, **params: Unpack["Invoice.DeleteParams"]) -> "Invoice": """ Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://stripe.com/docs/api#void_invoice). """ ... @class_method_variant("_cls_delete") def delete( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Invoice.DeleteParams"] ) -> "Invoice": """ Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://stripe.com/docs/api#void_invoice). """ return self._request_and_refresh( "delete", self.instance_url(), params=params, ) @classmethod async def _cls_delete_async( cls, sid: str, **params: Unpack["Invoice.DeleteParams"] ) -> "Invoice": """ Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://stripe.com/docs/api#void_invoice). """ url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "Invoice", await cls._static_request_async( "delete", url, params=params, ), ) @overload @staticmethod async def delete_async( sid: str, **params: Unpack["Invoice.DeleteParams"] ) -> "Invoice": """ Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://stripe.com/docs/api#void_invoice). """ ... @overload async def delete_async( self, **params: Unpack["Invoice.DeleteParams"] ) -> "Invoice": """ Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://stripe.com/docs/api#void_invoice). """ ... @class_method_variant("_cls_delete_async") async def delete_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Invoice.DeleteParams"] ) -> "Invoice": """ Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://stripe.com/docs/api#void_invoice). """ return await self._request_and_refresh_async( "delete", self.instance_url(), params=params, ) @classmethod def _cls_finalize_invoice( cls, invoice: str, **params: Unpack["Invoice.FinalizeInvoiceParams"] ) -> "Invoice": """ Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you'd like to finalize a draft invoice manually, you can do so using this method. """ return cast( "Invoice", cls._static_request( "post", "/v1/invoices/{invoice}/finalize".format( invoice=sanitize_id(invoice) ), params=params, ), ) @overload @staticmethod def finalize_invoice( invoice: str, **params: Unpack["Invoice.FinalizeInvoiceParams"] ) -> "Invoice": """ Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you'd like to finalize a draft invoice manually, you can do so using this method. """ ... @overload def finalize_invoice( self, **params: Unpack["Invoice.FinalizeInvoiceParams"] ) -> "Invoice": """ Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you'd like to finalize a draft invoice manually, you can do so using this method. """ ... @class_method_variant("_cls_finalize_invoice") def finalize_invoice( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Invoice.FinalizeInvoiceParams"] ) -> "Invoice": """ Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you'd like to finalize a draft invoice manually, you can do so using this method. """ return cast( "Invoice", self._request( "post", "/v1/invoices/{invoice}/finalize".format( invoice=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_finalize_invoice_async( cls, invoice: str, **params: Unpack["Invoice.FinalizeInvoiceParams"] ) -> "Invoice": """ Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you'd like to finalize a draft invoice manually, you can do so using this method. """ return cast( "Invoice", await cls._static_request_async( "post", "/v1/invoices/{invoice}/finalize".format( invoice=sanitize_id(invoice) ), params=params, ), ) @overload @staticmethod async def finalize_invoice_async( invoice: str, **params: Unpack["Invoice.FinalizeInvoiceParams"] ) -> "Invoice": """ Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you'd like to finalize a draft invoice manually, you can do so using this method. """ ... @overload async def finalize_invoice_async( self, **params: Unpack["Invoice.FinalizeInvoiceParams"] ) -> "Invoice": """ Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you'd like to finalize a draft invoice manually, you can do so using this method. """ ... @class_method_variant("_cls_finalize_invoice_async") async def finalize_invoice_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Invoice.FinalizeInvoiceParams"] ) -> "Invoice": """ Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you'd like to finalize a draft invoice manually, you can do so using this method. """ return cast( "Invoice", await self._request_async( "post", "/v1/invoices/{invoice}/finalize".format( invoice=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def list( cls, **params: Unpack["Invoice.ListParams"] ) -> ListObject["Invoice"]: """ You can list all invoices, or list the invoices for a specific customer. The invoices are returned sorted by creation date, with the most recently created invoices appearing first. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["Invoice.ListParams"] ) -> ListObject["Invoice"]: """ You can list all invoices, or list the invoices for a specific customer. The invoices are returned sorted by creation date, with the most recently created invoices appearing first. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def _cls_mark_uncollectible( cls, invoice: str, **params: Unpack["Invoice.MarkUncollectibleParams"] ) -> "Invoice": """ Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes. """ return cast( "Invoice", cls._static_request( "post", "/v1/invoices/{invoice}/mark_uncollectible".format( invoice=sanitize_id(invoice) ), params=params, ), ) @overload @staticmethod def mark_uncollectible( invoice: str, **params: Unpack["Invoice.MarkUncollectibleParams"] ) -> "Invoice": """ Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes. """ ... @overload def mark_uncollectible( self, **params: Unpack["Invoice.MarkUncollectibleParams"] ) -> "Invoice": """ Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes. """ ... @class_method_variant("_cls_mark_uncollectible") def mark_uncollectible( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Invoice.MarkUncollectibleParams"] ) -> "Invoice": """ Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes. """ return cast( "Invoice", self._request( "post", "/v1/invoices/{invoice}/mark_uncollectible".format( invoice=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_mark_uncollectible_async( cls, invoice: str, **params: Unpack["Invoice.MarkUncollectibleParams"] ) -> "Invoice": """ Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes. """ return cast( "Invoice", await cls._static_request_async( "post", "/v1/invoices/{invoice}/mark_uncollectible".format( invoice=sanitize_id(invoice) ), params=params, ), ) @overload @staticmethod async def mark_uncollectible_async( invoice: str, **params: Unpack["Invoice.MarkUncollectibleParams"] ) -> "Invoice": """ Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes. """ ... @overload async def mark_uncollectible_async( self, **params: Unpack["Invoice.MarkUncollectibleParams"] ) -> "Invoice": """ Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes. """ ... @class_method_variant("_cls_mark_uncollectible_async") async def mark_uncollectible_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Invoice.MarkUncollectibleParams"] ) -> "Invoice": """ Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes. """ return cast( "Invoice", await self._request_async( "post", "/v1/invoices/{invoice}/mark_uncollectible".format( invoice=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def modify( cls, id: str, **params: Unpack["Invoice.ModifyParams"] ) -> "Invoice": """ Draft invoices are fully editable. Once an invoice is [finalized](https://stripe.com/docs/billing/invoices/workflow#finalized), monetary values, as well as collection_method, become uneditable. If you would like to stop the Stripe Billing engine from automatically finalizing, reattempting payments on, sending reminders for, or [automatically reconciling](https://stripe.com/docs/billing/invoices/reconciliation) invoices, pass auto_advance=false. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Invoice", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["Invoice.ModifyParams"] ) -> "Invoice": """ Draft invoices are fully editable. Once an invoice is [finalized](https://stripe.com/docs/billing/invoices/workflow#finalized), monetary values, as well as collection_method, become uneditable. If you would like to stop the Stripe Billing engine from automatically finalizing, reattempting payments on, sending reminders for, or [automatically reconciling](https://stripe.com/docs/billing/invoices/reconciliation) invoices, pass auto_advance=false. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Invoice", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def _cls_pay( cls, invoice: str, **params: Unpack["Invoice.PayParams"] ) -> "Invoice": """ Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so. """ return cast( "Invoice", cls._static_request( "post", "/v1/invoices/{invoice}/pay".format( invoice=sanitize_id(invoice) ), params=params, ), ) @overload @staticmethod def pay(invoice: str, **params: Unpack["Invoice.PayParams"]) -> "Invoice": """ Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so. """ ... @overload def pay(self, **params: Unpack["Invoice.PayParams"]) -> "Invoice": """ Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so. """ ... @class_method_variant("_cls_pay") def pay( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Invoice.PayParams"] ) -> "Invoice": """ Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so. """ return cast( "Invoice", self._request( "post", "/v1/invoices/{invoice}/pay".format( invoice=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_pay_async( cls, invoice: str, **params: Unpack["Invoice.PayParams"] ) -> "Invoice": """ Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so. """ return cast( "Invoice", await cls._static_request_async( "post", "/v1/invoices/{invoice}/pay".format( invoice=sanitize_id(invoice) ), params=params, ), ) @overload @staticmethod async def pay_async( invoice: str, **params: Unpack["Invoice.PayParams"] ) -> "Invoice": """ Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so. """ ... @overload async def pay_async( self, **params: Unpack["Invoice.PayParams"] ) -> "Invoice": """ Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so. """ ... @class_method_variant("_cls_pay_async") async def pay_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Invoice.PayParams"] ) -> "Invoice": """ Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so. """ return cast( "Invoice", await self._request_async( "post", "/v1/invoices/{invoice}/pay".format( invoice=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["Invoice.RetrieveParams"] ) -> "Invoice": """ Retrieves the invoice with the given ID. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["Invoice.RetrieveParams"] ) -> "Invoice": """ Retrieves the invoice with the given ID. """ instance = cls(id, **params) await instance.refresh_async() return instance @classmethod def _cls_send_invoice( cls, invoice: str, **params: Unpack["Invoice.SendInvoiceParams"] ) -> "Invoice": """ Stripe will automatically send invoices to customers according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email. Requests made in test-mode result in no emails being sent, despite sending an invoice.sent event. """ return cast( "Invoice", cls._static_request( "post", "/v1/invoices/{invoice}/send".format( invoice=sanitize_id(invoice) ), params=params, ), ) @overload @staticmethod def send_invoice( invoice: str, **params: Unpack["Invoice.SendInvoiceParams"] ) -> "Invoice": """ Stripe will automatically send invoices to customers according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email. Requests made in test-mode result in no emails being sent, despite sending an invoice.sent event. """ ... @overload def send_invoice( self, **params: Unpack["Invoice.SendInvoiceParams"] ) -> "Invoice": """ Stripe will automatically send invoices to customers according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email. Requests made in test-mode result in no emails being sent, despite sending an invoice.sent event. """ ... @class_method_variant("_cls_send_invoice") def send_invoice( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Invoice.SendInvoiceParams"] ) -> "Invoice": """ Stripe will automatically send invoices to customers according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email. Requests made in test-mode result in no emails being sent, despite sending an invoice.sent event. """ return cast( "Invoice", self._request( "post", "/v1/invoices/{invoice}/send".format( invoice=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_send_invoice_async( cls, invoice: str, **params: Unpack["Invoice.SendInvoiceParams"] ) -> "Invoice": """ Stripe will automatically send invoices to customers according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email. Requests made in test-mode result in no emails being sent, despite sending an invoice.sent event. """ return cast( "Invoice", await cls._static_request_async( "post", "/v1/invoices/{invoice}/send".format( invoice=sanitize_id(invoice) ), params=params, ), ) @overload @staticmethod async def send_invoice_async( invoice: str, **params: Unpack["Invoice.SendInvoiceParams"] ) -> "Invoice": """ Stripe will automatically send invoices to customers according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email. Requests made in test-mode result in no emails being sent, despite sending an invoice.sent event. """ ... @overload async def send_invoice_async( self, **params: Unpack["Invoice.SendInvoiceParams"] ) -> "Invoice": """ Stripe will automatically send invoices to customers according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email. Requests made in test-mode result in no emails being sent, despite sending an invoice.sent event. """ ... @class_method_variant("_cls_send_invoice_async") async def send_invoice_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Invoice.SendInvoiceParams"] ) -> "Invoice": """ Stripe will automatically send invoices to customers according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email. Requests made in test-mode result in no emails being sent, despite sending an invoice.sent event. """ return cast( "Invoice", await self._request_async( "post", "/v1/invoices/{invoice}/send".format( invoice=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def upcoming(cls, **params: Unpack["Invoice.UpcomingParams"]) -> "Invoice": """ At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice. Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request. Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions) """ return cast( "Invoice", cls._static_request( "get", "/v1/invoices/upcoming", params=params, ), ) @classmethod async def upcoming_async( cls, **params: Unpack["Invoice.UpcomingParams"] ) -> "Invoice": """ At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice. Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request. Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions) """ return cast( "Invoice", await cls._static_request_async( "get", "/v1/invoices/upcoming", params=params, ), ) @classmethod def upcoming_lines( cls, **params: Unpack["Invoice.UpcomingLinesParams"] ) -> ListObject["InvoiceLineItem"]: """ When retrieving an upcoming invoice, you'll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ return cast( ListObject["InvoiceLineItem"], cls._static_request( "get", "/v1/invoices/upcoming/lines", params=params, ), ) @classmethod async def upcoming_lines_async( cls, **params: Unpack["Invoice.UpcomingLinesParams"] ) -> ListObject["InvoiceLineItem"]: """ When retrieving an upcoming invoice, you'll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ return cast( ListObject["InvoiceLineItem"], await cls._static_request_async( "get", "/v1/invoices/upcoming/lines", params=params, ), ) @classmethod def _cls_void_invoice( cls, invoice: str, **params: Unpack["Invoice.VoidInvoiceParams"] ) -> "Invoice": """ Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://stripe.com/docs/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or credit note](https://stripe.com/docs/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business. """ return cast( "Invoice", cls._static_request( "post", "/v1/invoices/{invoice}/void".format( invoice=sanitize_id(invoice) ), params=params, ), ) @overload @staticmethod def void_invoice( invoice: str, **params: Unpack["Invoice.VoidInvoiceParams"] ) -> "Invoice": """ Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://stripe.com/docs/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or credit note](https://stripe.com/docs/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business. """ ... @overload def void_invoice( self, **params: Unpack["Invoice.VoidInvoiceParams"] ) -> "Invoice": """ Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://stripe.com/docs/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or credit note](https://stripe.com/docs/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business. """ ... @class_method_variant("_cls_void_invoice") def void_invoice( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Invoice.VoidInvoiceParams"] ) -> "Invoice": """ Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://stripe.com/docs/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or credit note](https://stripe.com/docs/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business. """ return cast( "Invoice", self._request( "post", "/v1/invoices/{invoice}/void".format( invoice=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_void_invoice_async( cls, invoice: str, **params: Unpack["Invoice.VoidInvoiceParams"] ) -> "Invoice": """ Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://stripe.com/docs/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or credit note](https://stripe.com/docs/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business. """ return cast( "Invoice", await cls._static_request_async( "post", "/v1/invoices/{invoice}/void".format( invoice=sanitize_id(invoice) ), params=params, ), ) @overload @staticmethod async def void_invoice_async( invoice: str, **params: Unpack["Invoice.VoidInvoiceParams"] ) -> "Invoice": """ Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://stripe.com/docs/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or credit note](https://stripe.com/docs/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business. """ ... @overload async def void_invoice_async( self, **params: Unpack["Invoice.VoidInvoiceParams"] ) -> "Invoice": """ Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://stripe.com/docs/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or credit note](https://stripe.com/docs/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business. """ ... @class_method_variant("_cls_void_invoice_async") async def void_invoice_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Invoice.VoidInvoiceParams"] ) -> "Invoice": """ Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://stripe.com/docs/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or credit note](https://stripe.com/docs/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business. """ return cast( "Invoice", await self._request_async( "post", "/v1/invoices/{invoice}/void".format( invoice=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def search( cls, *args, **kwargs: Unpack["Invoice.SearchParams"] ) -> SearchResultObject["Invoice"]: """ Search for invoices you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India. """ return cls._search(search_url="/v1/invoices/search", *args, **kwargs) @classmethod async def search_async( cls, *args, **kwargs: Unpack["Invoice.SearchParams"] ) -> SearchResultObject["Invoice"]: """ Search for invoices you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India. """ return await cls._search_async( search_url="/v1/invoices/search", *args, **kwargs ) @classmethod def search_auto_paging_iter( cls, *args, **kwargs: Unpack["Invoice.SearchParams"] ) -> Iterator["Invoice"]: return cls.search(*args, **kwargs).auto_paging_iter() @classmethod async def search_auto_paging_iter_async( cls, *args, **kwargs: Unpack["Invoice.SearchParams"] ) -> AsyncIterator["Invoice"]: return (await cls.search_async(*args, **kwargs)).auto_paging_iter() @classmethod def list_lines( cls, invoice: str, **params: Unpack["Invoice.ListLinesParams"] ) -> ListObject["InvoiceLineItem"]: """ When retrieving an invoice, you'll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ return cast( ListObject["InvoiceLineItem"], cls._static_request( "get", "/v1/invoices/{invoice}/lines".format( invoice=sanitize_id(invoice) ), params=params, ), ) @classmethod async def list_lines_async( cls, invoice: str, **params: Unpack["Invoice.ListLinesParams"] ) -> ListObject["InvoiceLineItem"]: """ When retrieving an invoice, you'll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ return cast( ListObject["InvoiceLineItem"], await cls._static_request_async( "get", "/v1/invoices/{invoice}/lines".format( invoice=sanitize_id(invoice) ), params=params, ), ) _inner_class_types = { "automatic_tax": AutomaticTax, "custom_fields": CustomField, "customer_address": CustomerAddress, "customer_shipping": CustomerShipping, "customer_tax_ids": CustomerTaxId, "from_invoice": FromInvoice, "issuer": Issuer, "last_finalization_error": LastFinalizationError, "payment_settings": PaymentSettings, "rendering": Rendering, "shipping_cost": ShippingCost, "shipping_details": ShippingDetails, "status_transitions": StatusTransitions, "subscription_details": SubscriptionDetails, "threshold_reason": ThresholdReason, "total_discount_amounts": TotalDiscountAmount, "total_tax_amounts": TotalTaxAmount, "transfer_data": TransferData, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_invoice_item.py0000644000175100001770000007272314637354563017230 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._deletable_api_resource import DeletableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._customer import Customer from stripe._discount import Discount from stripe._invoice import Invoice from stripe._plan import Plan from stripe._price import Price from stripe._subscription import Subscription from stripe._tax_rate import TaxRate from stripe.test_helpers._test_clock import TestClock class InvoiceItem( CreateableAPIResource["InvoiceItem"], DeletableAPIResource["InvoiceItem"], ListableAPIResource["InvoiceItem"], UpdateableAPIResource["InvoiceItem"], ): """ Invoice Items represent the component lines of an [invoice](https://stripe.com/docs/api/invoices). An invoice item is added to an invoice by creating or updating it with an `invoice` field, at which point it will be included as [an invoice line item](https://stripe.com/docs/api/invoices/line_item) within [invoice.lines](https://stripe.com/docs/api/invoices/object#invoice_object-lines). Invoice Items can be created before you are ready to actually send the invoice. This can be particularly useful when combined with a [subscription](https://stripe.com/docs/api/subscriptions). Sometimes you want to add a charge or credit to a customer, but actually charge or credit the customer's card only at the end of a regular billing cycle. This is useful for combining several charges (to minimize per-transaction fees), or for having Stripe tabulate your usage-based billing totals. Related guides: [Integrate with the Invoicing API](https://stripe.com/docs/invoicing/integration), [Subscription Invoices](https://stripe.com/docs/billing/invoices/subscription#adding-upcoming-invoice-items). """ OBJECT_NAME: ClassVar[Literal["invoiceitem"]] = "invoiceitem" class Period(StripeObject): end: int """ The end of the period, which must be greater than or equal to the start. This value is inclusive. """ start: int """ The start of the period. This value is inclusive. """ class CreateParams(RequestOptions): amount: NotRequired[int] """ The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. Passing in a negative `amount` will reduce the `amount_due` on the invoice. """ currency: NotRequired[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). """ customer: str """ The ID of the customer who will be billed when this invoice item is billed. """ description: NotRequired[str] """ An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. """ discountable: NotRequired[bool] """ Controls whether discounts apply to this invoice item. Defaults to false for prorations or negative invoice items, and true for all other invoice items. """ discounts: NotRequired[ "Literal['']|List[InvoiceItem.CreateParamsDiscount]" ] """ The coupons and promotion codes to redeem into discounts for the invoice item or invoice line item. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ invoice: NotRequired[str] """ The ID of an existing invoice to add this invoice item to. When left blank, the invoice item will be added to the next upcoming scheduled invoice. This is useful when adding invoice items in response to an invoice.created webhook. You can only add invoice items to draft invoices and there is a maximum of 250 items per invoice. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ period: NotRequired["InvoiceItem.CreateParamsPeriod"] """ The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired["InvoiceItem.CreateParamsPriceData"] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ Non-negative integer. The quantity of units for the invoice item. """ subscription: NotRequired[str] """ The ID of a subscription to add this invoice item to. When left blank, the invoice item is added to the next upcoming scheduled invoice. When set, scheduled invoices for subscriptions other than the specified subscription will ignore the invoice item. Use this when you want to express that an invoice item has been accrued within the context of a particular subscription. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ tax_code: NotRequired["Literal['']|str"] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ tax_rates: NotRequired[List[str]] """ The tax rates which apply to the invoice item. When set, the `default_tax_rates` on the invoice do not apply to this invoice item. """ unit_amount: NotRequired[int] """ The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This `unit_amount` will be multiplied by the quantity to get the full amount. Passing in a negative `unit_amount` will reduce the `amount_due` on the invoice. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class CreateParamsDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class CreateParamsPeriod(TypedDict): end: int """ The end of the period, which must be greater than or equal to the start. This value is inclusive. """ start: int """ The start of the period. This value is inclusive. """ class CreateParamsPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class DeleteParams(RequestOptions): pass class ListParams(RequestOptions): created: NotRequired["InvoiceItem.ListParamsCreated|int"] """ Only return invoice items that were created during the given date interval. """ customer: NotRequired[str] """ The identifier of the customer whose invoice items to return. If none is provided, all invoice items will be returned. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ invoice: NotRequired[str] """ Only return invoice items belonging to this invoice. If none is provided, all invoice items will be returned. If specifying an invoice, no customer identifier is needed. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ pending: NotRequired[bool] """ Set to `true` to only show pending invoice items, which are not yet attached to any invoices. Set to `false` to only show invoice items already attached to invoices. If unspecified, no filter is applied. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): amount: NotRequired[int] """ The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount. """ description: NotRequired[str] """ An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. """ discountable: NotRequired[bool] """ Controls whether discounts apply to this invoice item. Defaults to false for prorations or negative invoice items, and true for all other invoice items. Cannot be set to true for prorations. """ discounts: NotRequired[ "Literal['']|List[InvoiceItem.ModifyParamsDiscount]" ] """ The coupons, promotion codes & existing discounts which apply to the invoice item or invoice line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ period: NotRequired["InvoiceItem.ModifyParamsPeriod"] """ The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired["InvoiceItem.ModifyParamsPriceData"] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ Non-negative integer. The quantity of units for the invoice item. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ tax_code: NotRequired["Literal['']|str"] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates which apply to the invoice item. When set, the `default_tax_rates` on the invoice do not apply to this invoice item. Pass an empty string to remove previously-defined tax rates. """ unit_amount: NotRequired[int] """ The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class ModifyParamsDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class ModifyParamsPeriod(TypedDict): end: int """ The end of the period, which must be greater than or equal to the start. This value is inclusive. """ start: int """ The start of the period. This value is inclusive. """ class ModifyParamsPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ amount: int """ Amount (in the `currency` specified) of the invoice item. This should always be equal to `unit_amount * quantity`. """ 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). """ customer: ExpandableField["Customer"] """ The ID of the customer who will be billed when this invoice item is billed. """ date: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ description: Optional[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ discountable: bool """ If true, discounts will apply to this invoice item. Always false for prorations. """ discounts: Optional[List[ExpandableField["Discount"]]] """ The discounts which apply to the invoice item. Item discounts are applied before invoice discounts. Use `expand[]=discounts` to expand each discount. """ id: str """ Unique identifier for the object. """ invoice: Optional[ExpandableField["Invoice"]] """ The ID of the invoice this invoice item belongs to. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ metadata: Optional[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ object: Literal["invoiceitem"] """ String representing the object's type. Objects of the same type share the same value. """ period: Period plan: Optional["Plan"] """ If the invoice item is a proration, the plan of the subscription that the proration was computed for. """ price: Optional["Price"] """ The price of the invoice item. """ proration: bool """ Whether the invoice item was created automatically as a proration adjustment when the customer switched plans. """ quantity: int """ Quantity of units for the invoice item. If the invoice item is a proration, the quantity of the subscription that the proration was computed for. """ subscription: Optional[ExpandableField["Subscription"]] """ The subscription that this invoice item has been created for, if any. """ subscription_item: Optional[str] """ The subscription item that this invoice item has been created for, if any. """ tax_rates: Optional[List["TaxRate"]] """ The tax rates which apply to the invoice item. When set, the `default_tax_rates` on the invoice do not apply to this invoice item. """ test_clock: Optional[ExpandableField["TestClock"]] """ ID of the test clock this invoice item belongs to. """ unit_amount: Optional[int] """ Unit amount (in the `currency` specified) of the invoice item. """ unit_amount_decimal: Optional[str] """ Same as `unit_amount`, but contains a decimal value with at most 12 decimal places. """ deleted: Optional[Literal[True]] """ Always true for a deleted object """ @classmethod def create( cls, **params: Unpack["InvoiceItem.CreateParams"] ) -> "InvoiceItem": """ Creates an item to be added to a draft invoice (up to 250 items per invoice). If no invoice is specified, the item will be on the next invoice created for the customer specified. """ return cast( "InvoiceItem", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["InvoiceItem.CreateParams"] ) -> "InvoiceItem": """ Creates an item to be added to a draft invoice (up to 250 items per invoice). If no invoice is specified, the item will be on the next invoice created for the customer specified. """ return cast( "InvoiceItem", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def _cls_delete( cls, sid: str, **params: Unpack["InvoiceItem.DeleteParams"] ) -> "InvoiceItem": """ Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible when they're not attached to invoices, or if it's attached to a draft invoice. """ url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "InvoiceItem", cls._static_request( "delete", url, params=params, ), ) @overload @staticmethod def delete( sid: str, **params: Unpack["InvoiceItem.DeleteParams"] ) -> "InvoiceItem": """ Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible when they're not attached to invoices, or if it's attached to a draft invoice. """ ... @overload def delete( self, **params: Unpack["InvoiceItem.DeleteParams"] ) -> "InvoiceItem": """ Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible when they're not attached to invoices, or if it's attached to a draft invoice. """ ... @class_method_variant("_cls_delete") def delete( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["InvoiceItem.DeleteParams"] ) -> "InvoiceItem": """ Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible when they're not attached to invoices, or if it's attached to a draft invoice. """ return self._request_and_refresh( "delete", self.instance_url(), params=params, ) @classmethod async def _cls_delete_async( cls, sid: str, **params: Unpack["InvoiceItem.DeleteParams"] ) -> "InvoiceItem": """ Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible when they're not attached to invoices, or if it's attached to a draft invoice. """ url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "InvoiceItem", await cls._static_request_async( "delete", url, params=params, ), ) @overload @staticmethod async def delete_async( sid: str, **params: Unpack["InvoiceItem.DeleteParams"] ) -> "InvoiceItem": """ Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible when they're not attached to invoices, or if it's attached to a draft invoice. """ ... @overload async def delete_async( self, **params: Unpack["InvoiceItem.DeleteParams"] ) -> "InvoiceItem": """ Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible when they're not attached to invoices, or if it's attached to a draft invoice. """ ... @class_method_variant("_cls_delete_async") async def delete_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["InvoiceItem.DeleteParams"] ) -> "InvoiceItem": """ Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible when they're not attached to invoices, or if it's attached to a draft invoice. """ return await self._request_and_refresh_async( "delete", self.instance_url(), params=params, ) @classmethod def list( cls, **params: Unpack["InvoiceItem.ListParams"] ) -> ListObject["InvoiceItem"]: """ Returns a list of your invoice items. Invoice items are returned sorted by creation date, with the most recently created invoice items appearing first. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["InvoiceItem.ListParams"] ) -> ListObject["InvoiceItem"]: """ Returns a list of your invoice items. Invoice items are returned sorted by creation date, with the most recently created invoice items appearing first. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def modify( cls, id: str, **params: Unpack["InvoiceItem.ModifyParams"] ) -> "InvoiceItem": """ Updates the amount or description of an invoice item on an upcoming invoice. Updating an invoice item is only possible before the invoice it's attached to is closed. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "InvoiceItem", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["InvoiceItem.ModifyParams"] ) -> "InvoiceItem": """ Updates the amount or description of an invoice item on an upcoming invoice. Updating an invoice item is only possible before the invoice it's attached to is closed. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "InvoiceItem", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["InvoiceItem.RetrieveParams"] ) -> "InvoiceItem": """ Retrieves the invoice item with the given ID. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["InvoiceItem.RetrieveParams"] ) -> "InvoiceItem": """ Retrieves the invoice item with the given ID. """ instance = cls(id, **params) await instance.refresh_async() return instance _inner_class_types = {"period": Period} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_invoice_item_service.py0000644000175100001770000005613514637354563020747 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._invoice_item import InvoiceItem from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class InvoiceItemService(StripeService): class CreateParams(TypedDict): amount: NotRequired[int] """ The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. Passing in a negative `amount` will reduce the `amount_due` on the invoice. """ currency: NotRequired[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). """ customer: str """ The ID of the customer who will be billed when this invoice item is billed. """ description: NotRequired[str] """ An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. """ discountable: NotRequired[bool] """ Controls whether discounts apply to this invoice item. Defaults to false for prorations or negative invoice items, and true for all other invoice items. """ discounts: NotRequired[ "Literal['']|List[InvoiceItemService.CreateParamsDiscount]" ] """ The coupons and promotion codes to redeem into discounts for the invoice item or invoice line item. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ invoice: NotRequired[str] """ The ID of an existing invoice to add this invoice item to. When left blank, the invoice item will be added to the next upcoming scheduled invoice. This is useful when adding invoice items in response to an invoice.created webhook. You can only add invoice items to draft invoices and there is a maximum of 250 items per invoice. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ period: NotRequired["InvoiceItemService.CreateParamsPeriod"] """ The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired["InvoiceItemService.CreateParamsPriceData"] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ Non-negative integer. The quantity of units for the invoice item. """ subscription: NotRequired[str] """ The ID of a subscription to add this invoice item to. When left blank, the invoice item is added to the next upcoming scheduled invoice. When set, scheduled invoices for subscriptions other than the specified subscription will ignore the invoice item. Use this when you want to express that an invoice item has been accrued within the context of a particular subscription. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ tax_code: NotRequired["Literal['']|str"] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ tax_rates: NotRequired[List[str]] """ The tax rates which apply to the invoice item. When set, the `default_tax_rates` on the invoice do not apply to this invoice item. """ unit_amount: NotRequired[int] """ The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This `unit_amount` will be multiplied by the quantity to get the full amount. Passing in a negative `unit_amount` will reduce the `amount_due` on the invoice. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class CreateParamsDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class CreateParamsPeriod(TypedDict): end: int """ The end of the period, which must be greater than or equal to the start. This value is inclusive. """ start: int """ The start of the period. This value is inclusive. """ class CreateParamsPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class DeleteParams(TypedDict): pass class ListParams(TypedDict): created: NotRequired["InvoiceItemService.ListParamsCreated|int"] """ Only return invoice items that were created during the given date interval. """ customer: NotRequired[str] """ The identifier of the customer whose invoice items to return. If none is provided, all invoice items will be returned. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ invoice: NotRequired[str] """ Only return invoice items belonging to this invoice. If none is provided, all invoice items will be returned. If specifying an invoice, no customer identifier is needed. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ pending: NotRequired[bool] """ Set to `true` to only show pending invoice items, which are not yet attached to any invoices. Set to `false` to only show invoice items already attached to invoices. If unspecified, no filter is applied. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): amount: NotRequired[int] """ The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount. """ description: NotRequired[str] """ An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. """ discountable: NotRequired[bool] """ Controls whether discounts apply to this invoice item. Defaults to false for prorations or negative invoice items, and true for all other invoice items. Cannot be set to true for prorations. """ discounts: NotRequired[ "Literal['']|List[InvoiceItemService.UpdateParamsDiscount]" ] """ The coupons, promotion codes & existing discounts which apply to the invoice item or invoice line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ period: NotRequired["InvoiceItemService.UpdateParamsPeriod"] """ The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired["InvoiceItemService.UpdateParamsPriceData"] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ Non-negative integer. The quantity of units for the invoice item. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ tax_code: NotRequired["Literal['']|str"] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates which apply to the invoice item. When set, the `default_tax_rates` on the invoice do not apply to this invoice item. Pass an empty string to remove previously-defined tax rates. """ unit_amount: NotRequired[int] """ The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class UpdateParamsDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class UpdateParamsPeriod(TypedDict): end: int """ The end of the period, which must be greater than or equal to the start. This value is inclusive. """ start: int """ The start of the period. This value is inclusive. """ class UpdateParamsPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ def delete( self, invoiceitem: str, params: "InvoiceItemService.DeleteParams" = {}, options: RequestOptions = {}, ) -> InvoiceItem: """ Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible when they're not attached to invoices, or if it's attached to a draft invoice. """ return cast( InvoiceItem, self._request( "delete", "/v1/invoiceitems/{invoiceitem}".format( invoiceitem=sanitize_id(invoiceitem), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def delete_async( self, invoiceitem: str, params: "InvoiceItemService.DeleteParams" = {}, options: RequestOptions = {}, ) -> InvoiceItem: """ Deletes an invoice item, removing it from an invoice. Deleting invoice items is only possible when they're not attached to invoices, or if it's attached to a draft invoice. """ return cast( InvoiceItem, await self._request_async( "delete", "/v1/invoiceitems/{invoiceitem}".format( invoiceitem=sanitize_id(invoiceitem), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, invoiceitem: str, params: "InvoiceItemService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> InvoiceItem: """ Retrieves the invoice item with the given ID. """ return cast( InvoiceItem, self._request( "get", "/v1/invoiceitems/{invoiceitem}".format( invoiceitem=sanitize_id(invoiceitem), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, invoiceitem: str, params: "InvoiceItemService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> InvoiceItem: """ Retrieves the invoice item with the given ID. """ return cast( InvoiceItem, await self._request_async( "get", "/v1/invoiceitems/{invoiceitem}".format( invoiceitem=sanitize_id(invoiceitem), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, invoiceitem: str, params: "InvoiceItemService.UpdateParams" = {}, options: RequestOptions = {}, ) -> InvoiceItem: """ Updates the amount or description of an invoice item on an upcoming invoice. Updating an invoice item is only possible before the invoice it's attached to is closed. """ return cast( InvoiceItem, self._request( "post", "/v1/invoiceitems/{invoiceitem}".format( invoiceitem=sanitize_id(invoiceitem), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, invoiceitem: str, params: "InvoiceItemService.UpdateParams" = {}, options: RequestOptions = {}, ) -> InvoiceItem: """ Updates the amount or description of an invoice item on an upcoming invoice. Updating an invoice item is only possible before the invoice it's attached to is closed. """ return cast( InvoiceItem, await self._request_async( "post", "/v1/invoiceitems/{invoiceitem}".format( invoiceitem=sanitize_id(invoiceitem), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def list( self, params: "InvoiceItemService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[InvoiceItem]: """ Returns a list of your invoice items. Invoice items are returned sorted by creation date, with the most recently created invoice items appearing first. """ return cast( ListObject[InvoiceItem], self._request( "get", "/v1/invoiceitems", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "InvoiceItemService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[InvoiceItem]: """ Returns a list of your invoice items. Invoice items are returned sorted by creation date, with the most recently created invoice items appearing first. """ return cast( ListObject[InvoiceItem], await self._request_async( "get", "/v1/invoiceitems", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "InvoiceItemService.CreateParams", options: RequestOptions = {}, ) -> InvoiceItem: """ Creates an item to be added to a draft invoice (up to 250 items per invoice). If no invoice is specified, the item will be on the next invoice created for the customer specified. """ return cast( InvoiceItem, self._request( "post", "/v1/invoiceitems", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "InvoiceItemService.CreateParams", options: RequestOptions = {}, ) -> InvoiceItem: """ Creates an item to be added to a draft invoice (up to 250 items per invoice). If no invoice is specified, the item will be on the next invoice created for the customer specified. """ return cast( InvoiceItem, await self._request_async( "post", "/v1/invoiceitems", api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_invoice_line_item.py0000644000175100001770000004512314637354563020231 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._expandable_field import ExpandableField from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import sanitize_id from typing import ClassVar, Dict, List, Optional, cast from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._discount import Discount from stripe._invoice_item import InvoiceItem from stripe._plan import Plan from stripe._price import Price from stripe._subscription import Subscription from stripe._subscription_item import SubscriptionItem from stripe._tax_rate import TaxRate class InvoiceLineItem(UpdateableAPIResource["InvoiceLineItem"]): OBJECT_NAME: ClassVar[Literal["line_item"]] = "line_item" class DiscountAmount(StripeObject): amount: int """ The amount, in cents (or local equivalent), of the discount. """ discount: ExpandableField["Discount"] """ The discount that was applied to get this discount amount. """ class Period(StripeObject): end: int """ The end of the period, which must be greater than or equal to the start. This value is inclusive. """ start: int """ The start of the period. This value is inclusive. """ class ProrationDetails(StripeObject): class CreditedItems(StripeObject): invoice: str """ Invoice containing the credited invoice line items """ invoice_line_items: List[str] """ Credited invoice line items """ credited_items: Optional[CreditedItems] """ For a credit proration `line_item`, the original debit line_items to which the credit proration applies. """ _inner_class_types = {"credited_items": CreditedItems} class TaxAmount(StripeObject): amount: int """ The amount, in cents (or local equivalent), of the tax. """ inclusive: bool """ Whether this tax amount is inclusive or exclusive. """ tax_rate: ExpandableField["TaxRate"] """ The tax rate that was applied to get this tax amount. """ taxability_reason: Optional[ Literal[ "customer_exempt", "not_collecting", "not_subject_to_tax", "not_supported", "portion_product_exempt", "portion_reduced_rated", "portion_standard_rated", "product_exempt", "product_exempt_holiday", "proportionally_rated", "reduced_rated", "reverse_charge", "standard_rated", "taxable_basis_reduced", "zero_rated", ] ] """ The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. """ taxable_amount: Optional[int] """ The amount on which tax is calculated, in cents (or local equivalent). """ class ModifyParams(RequestOptions): amount: NotRequired[int] """ The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount. """ description: NotRequired[str] """ An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. """ discountable: NotRequired[bool] """ Controls whether discounts apply to this line item. Defaults to false for prorations or negative line items, and true for all other line items. Cannot be set to true for prorations. """ discounts: NotRequired[ "Literal['']|List[InvoiceLineItem.ModifyParamsDiscount]" ] """ The coupons, promotion codes & existing discounts which apply to the line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. For `type=recurring` line items, the incoming metadata specified on the request is directly used to set this value, in contrast to `type=invoiceitem` line items, where any existing metadata on the invoice line is merged with the incoming data. """ period: NotRequired["InvoiceLineItem.ModifyParamsPeriod"] """ The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired["InvoiceLineItem.ModifyParamsPriceData"] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ Non-negative integer. The quantity of units for the line item. """ tax_amounts: NotRequired[ "Literal['']|List[InvoiceLineItem.ModifyParamsTaxAmount]" ] """ A list of up to 10 tax amounts for this line item. This can be useful if you calculate taxes on your own or use a third-party to calculate them. You cannot set tax amounts if any line item has [tax_rates](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://stripe.com/docs/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://stripe.com/docs/tax/invoicing). Pass an empty string to remove previously defined tax amounts. """ tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates which apply to the line item. When set, the `default_tax_rates` on the invoice do not apply to this line item. Pass an empty string to remove previously-defined tax rates. """ class ModifyParamsDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class ModifyParamsPeriod(TypedDict): end: int """ The end of the period, which must be greater than or equal to the start. This value is inclusive. """ start: int """ The start of the period. This value is inclusive. """ class ModifyParamsPriceData(TypedDict): 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). """ product: NotRequired[str] """ The ID of the product that this price will belong to. One of `product` or `product_data` is required. """ product_data: NotRequired[ "InvoiceLineItem.ModifyParamsPriceDataProductData" ] """ Data used to generate a new product object inline. One of `product` or `product_data` is required. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class ModifyParamsPriceDataProductData(TypedDict): description: NotRequired[str] """ The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. """ images: NotRequired[List[str]] """ A list of up to 8 URLs of images for this product, meant to be displayable to the customer. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ name: str """ The product's name, meant to be displayable to the customer. """ tax_code: NotRequired[str] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ class ModifyParamsTaxAmount(TypedDict): amount: int """ The amount, in cents (or local equivalent), of the tax. """ tax_rate_data: "InvoiceLineItem.ModifyParamsTaxAmountTaxRateData" """ Data to find or create a TaxRate object. Stripe automatically creates or reuses a TaxRate object for each tax amount. If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item's `tax_rates`, and cannot be directly added to invoices, payments, or line items. """ taxable_amount: int """ The amount on which tax is calculated, in cents (or local equivalent). """ class ModifyParamsTaxAmountTaxRateData(TypedDict): country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ description: NotRequired[str] """ An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers. """ display_name: str """ The display name of the tax rate, which will be shown to users. """ inclusive: bool """ This specifies if the tax rate is inclusive or exclusive. """ jurisdiction: NotRequired[str] """ The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice. """ percentage: float """ The statutory tax rate percent. This field accepts decimal values between 0 and 100 inclusive with at most 4 decimal places. To accommodate fixed-amount taxes, set the percentage to zero. Stripe will not display zero percentages on the invoice unless the `amount` of the tax is also zero. """ state: NotRequired[str] """ [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. """ tax_type: NotRequired[ Literal[ "amusement_tax", "communications_tax", "gst", "hst", "igst", "jct", "lease_tax", "pst", "qst", "rst", "sales_tax", "vat", ] ] """ The high-level tax type, such as `vat` or `sales_tax`. """ amount: int """ The amount, in cents (or local equivalent). """ amount_excluding_tax: Optional[int] """ The integer amount in cents (or local equivalent) representing the amount for this line item, excluding all tax and discounts. """ 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. """ discount_amounts: Optional[List[DiscountAmount]] """ The amount of discount calculated per discount for this line item. """ discountable: bool """ If true, discounts will apply to this line item. Always false for prorations. """ discounts: List[ExpandableField["Discount"]] """ The discounts applied to the invoice line item. Line item discounts are applied before invoice discounts. Use `expand[]=discounts` to expand each discount. """ id: str """ Unique identifier for the object. """ invoice: Optional[str] """ The ID of the invoice that contains this line item. """ invoice_item: Optional[ExpandableField["InvoiceItem"]] """ The ID of the [invoice item](https://stripe.com/docs/api/invoiceitems) associated with this line item if any. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ metadata: Dict[str, str] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Note that for line items with `type=subscription`, `metadata` reflects the current metadata from the subscription associated with the line item, unless the invoice line was directly updated with different metadata after creation. """ object: Literal["line_item"] """ String representing the object's type. Objects of the same type share the same value. """ period: Period plan: Optional["Plan"] """ The plan of the subscription, if the line item is a subscription or a proration. """ price: Optional["Price"] """ The price of the line item. """ proration: bool """ Whether this is a proration. """ proration_details: Optional[ProrationDetails] """ Additional details for proration line items """ quantity: Optional[int] """ The quantity of the subscription, if the line item is a subscription or a proration. """ subscription: Optional[ExpandableField["Subscription"]] """ The subscription that the invoice item pertains to, if any. """ subscription_item: Optional[ExpandableField["SubscriptionItem"]] """ The subscription item that generated this line item. Left empty if the line item is not an explicit result of a subscription. """ tax_amounts: Optional[List[TaxAmount]] """ The amount of tax calculated per tax rate for this line item """ tax_rates: Optional[List["TaxRate"]] """ The tax rates which apply to the line item. """ type: Literal["invoiceitem", "subscription"] """ A string identifying the type of the source of this line item, either an `invoiceitem` or a `subscription`. """ unit_amount_excluding_tax: Optional[str] """ The amount in cents (or local equivalent) representing the unit amount for this line item, excluding all tax and discounts. """ @classmethod def modify( cls, id: str, **params: Unpack["InvoiceLineItem.ModifyParams"] ) -> "InvoiceLineItem": """ Updates an invoice's line item. Some fields, such as tax_amounts, only live on the invoice line item, so they can only be updated through this endpoint. Other fields, such as amount, live on both the invoice item and the invoice line item, so updates on this endpoint will propagate to the invoice item as well. Updating an invoice's line item is only possible before the invoice is finalized. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "InvoiceLineItem", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["InvoiceLineItem.ModifyParams"] ) -> "InvoiceLineItem": """ Updates an invoice's line item. Some fields, such as tax_amounts, only live on the invoice line item, so they can only be updated through this endpoint. Other fields, such as amount, live on both the invoice item and the invoice line item, so updates on this endpoint will propagate to the invoice item as well. Updating an invoice's line item is only possible before the invoice is finalized. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "InvoiceLineItem", await cls._static_request_async( "post", url, params=params, ), ) _inner_class_types = { "discount_amounts": DiscountAmount, "period": Period, "proration_details": ProrationDetails, "tax_amounts": TaxAmount, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_invoice_line_item_service.py0000644000175100001770000003625714637354563021761 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._invoice_line_item import InvoiceLineItem from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class InvoiceLineItemService(StripeService): class ListParams(TypedDict): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class UpdateParams(TypedDict): amount: NotRequired[int] """ The integer amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. If you want to apply a credit to the customer's account, pass a negative amount. """ description: NotRequired[str] """ An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. """ discountable: NotRequired[bool] """ Controls whether discounts apply to this line item. Defaults to false for prorations or negative line items, and true for all other line items. Cannot be set to true for prorations. """ discounts: NotRequired[ "Literal['']|List[InvoiceLineItemService.UpdateParamsDiscount]" ] """ The coupons, promotion codes & existing discounts which apply to the line item. Item discounts are applied before invoice discounts. Pass an empty string to remove previously-defined discounts. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. For `type=recurring` line items, the incoming metadata specified on the request is directly used to set this value, in contrast to `type=invoiceitem` line items, where any existing metadata on the invoice line is merged with the incoming data. """ period: NotRequired["InvoiceLineItemService.UpdateParamsPeriod"] """ The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired["InvoiceLineItemService.UpdateParamsPriceData"] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ Non-negative integer. The quantity of units for the line item. """ tax_amounts: NotRequired[ "Literal['']|List[InvoiceLineItemService.UpdateParamsTaxAmount]" ] """ A list of up to 10 tax amounts for this line item. This can be useful if you calculate taxes on your own or use a third-party to calculate them. You cannot set tax amounts if any line item has [tax_rates](https://stripe.com/docs/api/invoices/line_item#invoice_line_item_object-tax_rates) or if the invoice has [default_tax_rates](https://stripe.com/docs/api/invoices/object#invoice_object-default_tax_rates) or uses [automatic tax](https://stripe.com/docs/tax/invoicing). Pass an empty string to remove previously defined tax amounts. """ tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates which apply to the line item. When set, the `default_tax_rates` on the invoice do not apply to this line item. Pass an empty string to remove previously-defined tax rates. """ class UpdateParamsDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class UpdateParamsPeriod(TypedDict): end: int """ The end of the period, which must be greater than or equal to the start. This value is inclusive. """ start: int """ The start of the period. This value is inclusive. """ class UpdateParamsPriceData(TypedDict): 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). """ product: NotRequired[str] """ The ID of the product that this price will belong to. One of `product` or `product_data` is required. """ product_data: NotRequired[ "InvoiceLineItemService.UpdateParamsPriceDataProductData" ] """ Data used to generate a new product object inline. One of `product` or `product_data` is required. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class UpdateParamsPriceDataProductData(TypedDict): description: NotRequired[str] """ The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. """ images: NotRequired[List[str]] """ A list of up to 8 URLs of images for this product, meant to be displayable to the customer. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ name: str """ The product's name, meant to be displayable to the customer. """ tax_code: NotRequired[str] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ class UpdateParamsTaxAmount(TypedDict): amount: int """ The amount, in cents (or local equivalent), of the tax. """ tax_rate_data: ( "InvoiceLineItemService.UpdateParamsTaxAmountTaxRateData" ) """ Data to find or create a TaxRate object. Stripe automatically creates or reuses a TaxRate object for each tax amount. If the `tax_rate_data` exactly matches a previous value, Stripe will reuse the TaxRate object. TaxRate objects created automatically by Stripe are immediately archived, do not appear in the line item's `tax_rates`, and cannot be directly added to invoices, payments, or line items. """ taxable_amount: int """ The amount on which tax is calculated, in cents (or local equivalent). """ class UpdateParamsTaxAmountTaxRateData(TypedDict): country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ description: NotRequired[str] """ An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers. """ display_name: str """ The display name of the tax rate, which will be shown to users. """ inclusive: bool """ This specifies if the tax rate is inclusive or exclusive. """ jurisdiction: NotRequired[str] """ The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice. """ percentage: float """ The statutory tax rate percent. This field accepts decimal values between 0 and 100 inclusive with at most 4 decimal places. To accommodate fixed-amount taxes, set the percentage to zero. Stripe will not display zero percentages on the invoice unless the `amount` of the tax is also zero. """ state: NotRequired[str] """ [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. """ tax_type: NotRequired[ Literal[ "amusement_tax", "communications_tax", "gst", "hst", "igst", "jct", "lease_tax", "pst", "qst", "rst", "sales_tax", "vat", ] ] """ The high-level tax type, such as `vat` or `sales_tax`. """ def list( self, invoice: str, params: "InvoiceLineItemService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[InvoiceLineItem]: """ When retrieving an invoice, you'll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ return cast( ListObject[InvoiceLineItem], self._request( "get", "/v1/invoices/{invoice}/lines".format( invoice=sanitize_id(invoice), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, invoice: str, params: "InvoiceLineItemService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[InvoiceLineItem]: """ When retrieving an invoice, you'll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ return cast( ListObject[InvoiceLineItem], await self._request_async( "get", "/v1/invoices/{invoice}/lines".format( invoice=sanitize_id(invoice), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, invoice: str, line_item_id: str, params: "InvoiceLineItemService.UpdateParams" = {}, options: RequestOptions = {}, ) -> InvoiceLineItem: """ Updates an invoice's line item. Some fields, such as tax_amounts, only live on the invoice line item, so they can only be updated through this endpoint. Other fields, such as amount, live on both the invoice item and the invoice line item, so updates on this endpoint will propagate to the invoice item as well. Updating an invoice's line item is only possible before the invoice is finalized. """ return cast( InvoiceLineItem, self._request( "post", "/v1/invoices/{invoice}/lines/{line_item_id}".format( invoice=sanitize_id(invoice), line_item_id=sanitize_id(line_item_id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, invoice: str, line_item_id: str, params: "InvoiceLineItemService.UpdateParams" = {}, options: RequestOptions = {}, ) -> InvoiceLineItem: """ Updates an invoice's line item. Some fields, such as tax_amounts, only live on the invoice line item, so they can only be updated through this endpoint. Other fields, such as amount, live on both the invoice item and the invoice line item, so updates on this endpoint will propagate to the invoice item as well. Updating an invoice's line item is only possible before the invoice is finalized. """ return cast( InvoiceLineItem, await self._request_async( "post", "/v1/invoices/{invoice}/lines/{line_item_id}".format( invoice=sanitize_id(invoice), line_item_id=sanitize_id(line_item_id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_invoice_service.py0000644000175100001770000060211114637354563017720 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._invoice import Invoice from stripe._invoice_line_item_service import InvoiceLineItemService from stripe._invoice_upcoming_lines_service import InvoiceUpcomingLinesService from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._search_result_object import SearchResultObject from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class InvoiceService(StripeService): def __init__(self, requestor): super().__init__(requestor) self.line_items = InvoiceLineItemService(self._requestor) self.upcoming_lines = InvoiceUpcomingLinesService(self._requestor) class CreateParams(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ The account tax IDs associated with the invoice. Only editable when the invoice is a draft. """ application_fee_amount: NotRequired[int] """ A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees). """ auto_advance: NotRequired[bool] """ Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action. """ automatic_tax: NotRequired["InvoiceService.CreateParamsAutomaticTax"] """ Settings for automatic tax lookup for this invoice. """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this invoice using the default source attached to the customer. When sending an invoice, Stripe will email this invoice to the customer with payment instructions. Defaults to `charge_automatically`. """ currency: NotRequired[str] """ The currency to create this invoice in. Defaults to that of `customer` if not specified. """ custom_fields: NotRequired[ "Literal['']|List[InvoiceService.CreateParamsCustomField]" ] """ A list of up to 4 custom fields to be displayed on the invoice. """ customer: NotRequired[str] """ The ID of the customer who will be billed. """ days_until_due: NotRequired[int] """ The number of days from when the invoice is created until it is due. Valid only for invoices where `collection_method=send_invoice`. """ default_payment_method: NotRequired[str] """ ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. """ default_source: NotRequired[str] """ ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source. """ default_tax_rates: NotRequired[List[str]] """ The tax rates that will apply to any line item that does not have `tax_rates` set. """ description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard. """ discounts: NotRequired[ "Literal['']|List[InvoiceService.CreateParamsDiscount]" ] """ The coupons and promotion codes to redeem into discounts for the invoice. If not specified, inherits the discount from the invoice's customer. Pass an empty string to avoid inheriting any discounts. """ due_date: NotRequired[int] """ The date on which payment for this invoice is due. Valid only for invoices where `collection_method=send_invoice`. """ effective_at: NotRequired[int] """ The date when this invoice is in effect. Same as `finalized_at` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ footer: NotRequired[str] """ Footer to be displayed on the invoice. """ from_invoice: NotRequired["InvoiceService.CreateParamsFromInvoice"] """ Revise an existing invoice. The new invoice will be created in `status=draft`. See the [revision documentation](https://stripe.com/docs/invoicing/invoice-revisions) for more details. """ issuer: NotRequired["InvoiceService.CreateParamsIssuer"] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ number: NotRequired[str] """ Set the number for this invoice. If no number is present then a number will be assigned automatically when the invoice is finalized. In many markets, regulations require invoices to be unique, sequential and / or gapless. You are responsible for ensuring this is true across all your different invoicing systems in the event that you edit the invoice number using our API. If you use only Stripe for your invoices and do not change invoice numbers, Stripe handles this aspect of compliance for you automatically. """ on_behalf_of: NotRequired[str] """ The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. """ payment_settings: NotRequired[ "InvoiceService.CreateParamsPaymentSettings" ] """ Configuration settings for the PaymentIntent that is generated when the invoice is finalized. """ pending_invoice_items_behavior: NotRequired[ Literal["exclude", "include"] ] """ How to handle pending invoice items on invoice creation. Defaults to `exclude` if the parameter is omitted. """ rendering: NotRequired["InvoiceService.CreateParamsRendering"] """ The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page. """ shipping_cost: NotRequired["InvoiceService.CreateParamsShippingCost"] """ Settings for the cost of shipping for this invoice. """ shipping_details: NotRequired[ "InvoiceService.CreateParamsShippingDetails" ] """ Shipping details for the invoice. The Invoice PDF will use the `shipping_details` value if it is set, otherwise the PDF will render the shipping address from the customer. """ statement_descriptor: NotRequired[str] """ Extra information about a charge for the customer's credit card statement. It must contain at least one letter. If not specified and this invoice is part of a subscription, the default `statement_descriptor` will be set to the first subscription item's product's `statement_descriptor`. """ subscription: NotRequired[str] """ The ID of the subscription to invoice, if any. If set, the created invoice will only include pending invoice items for that subscription. The subscription's billing cycle and regular subscription events won't be affected. """ transfer_data: NotRequired["InvoiceService.CreateParamsTransferData"] """ If specified, the funds from the invoice will be transferred to the destination and the ID of the resulting transfer will be found on the invoice's charge. """ class CreateParamsAutomaticTax(TypedDict): enabled: bool """ Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. """ liability: NotRequired[ "InvoiceService.CreateParamsAutomaticTaxLiability" ] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ class CreateParamsAutomaticTaxLiability(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class CreateParamsCustomField(TypedDict): name: str """ The name of the custom field. This may be up to 40 characters. """ value: str """ The value of the custom field. This may be up to 140 characters. """ class CreateParamsDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class CreateParamsFromInvoice(TypedDict): action: Literal["revision"] """ The relation between the new invoice and the original invoice. Currently, only 'revision' is permitted """ invoice: str """ The `id` of the invoice that will be cloned. """ class CreateParamsIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class CreateParamsPaymentSettings(TypedDict): default_mandate: NotRequired["Literal['']|str"] """ ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the invoice's default_payment_method or default_source, if set. """ payment_method_options: NotRequired[ "InvoiceService.CreateParamsPaymentSettingsPaymentMethodOptions" ] """ Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). """ class CreateParamsPaymentSettingsPaymentMethodOptions(TypedDict): acss_debit: NotRequired[ "Literal['']|InvoiceService.CreateParamsPaymentSettingsPaymentMethodOptionsAcssDebit" ] """ If paying by `acss_debit`, this sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice's PaymentIntent. """ bancontact: NotRequired[ "Literal['']|InvoiceService.CreateParamsPaymentSettingsPaymentMethodOptionsBancontact" ] """ If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice's PaymentIntent. """ card: NotRequired[ "Literal['']|InvoiceService.CreateParamsPaymentSettingsPaymentMethodOptionsCard" ] """ If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice's PaymentIntent. """ customer_balance: NotRequired[ "Literal['']|InvoiceService.CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalance" ] """ If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice's PaymentIntent. """ konbini: NotRequired[ "Literal['']|InvoiceService.CreateParamsPaymentSettingsPaymentMethodOptionsKonbini" ] """ If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice's PaymentIntent. """ sepa_debit: NotRequired[ "Literal['']|InvoiceService.CreateParamsPaymentSettingsPaymentMethodOptionsSepaDebit" ] """ If paying by `sepa_debit`, this sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice's PaymentIntent. """ us_bank_account: NotRequired[ "Literal['']|InvoiceService.CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccount" ] """ If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice's PaymentIntent. """ class CreateParamsPaymentSettingsPaymentMethodOptionsAcssDebit(TypedDict): mandate_options: NotRequired[ "InvoiceService.CreateParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions" ] """ Additional fields for Mandate creation """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] """ Verification method for the intent """ class CreateParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions( TypedDict, ): transaction_type: NotRequired[Literal["business", "personal"]] """ Transaction type of the mandate. """ class CreateParamsPaymentSettingsPaymentMethodOptionsBancontact(TypedDict): preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] """ Preferred language of the Bancontact authorization page that the customer is redirected to. """ class CreateParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): installments: NotRequired[ "InvoiceService.CreateParamsPaymentSettingsPaymentMethodOptionsCardInstallments" ] """ Installment configuration for payments attempted on this invoice (Mexico Only). For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). """ request_three_d_secure: NotRequired[ Literal["any", "automatic", "challenge"] ] """ 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://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ class CreateParamsPaymentSettingsPaymentMethodOptionsCardInstallments( TypedDict, ): enabled: NotRequired[bool] """ Setting to true enables installments for this invoice. Setting to false will prevent any selected plan from applying to a payment. """ plan: NotRequired[ "Literal['']|InvoiceService.CreateParamsPaymentSettingsPaymentMethodOptionsCardInstallmentsPlan" ] """ The selected installment plan to use for this invoice. """ class CreateParamsPaymentSettingsPaymentMethodOptionsCardInstallmentsPlan( TypedDict, ): count: int """ For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. """ interval: Literal["month"] """ For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. One of `month`. """ type: Literal["fixed_count"] """ Type of installment plan, one of `fixed_count`. """ class CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalance( TypedDict, ): bank_transfer: NotRequired[ "InvoiceService.CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer" ] """ Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. """ funding_type: NotRequired[str] """ The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. """ class CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer( TypedDict, ): eu_bank_transfer: NotRequired[ "InvoiceService.CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer" ] """ Configuration for eu_bank_transfer funding type. """ type: NotRequired[str] """ The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. """ class CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer( TypedDict, ): country: str """ The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. """ class CreateParamsPaymentSettingsPaymentMethodOptionsKonbini(TypedDict): pass class CreateParamsPaymentSettingsPaymentMethodOptionsSepaDebit(TypedDict): pass class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccount( TypedDict, ): financial_connections: NotRequired[ "InvoiceService.CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections" ] """ Additional fields for Financial Connections Session creation """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] """ Verification method for the intent """ class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): filters: NotRequired[ "InvoiceService.CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" ] """ Provide filters for the linked accounts that the customer can select for the payment method. """ permissions: NotRequired[ List[ Literal[ "balances", "ownership", "payment_method", "transactions" ] ] ] """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ List[Literal["balances", "ownership", "transactions"]] ] """ List of data features that you would like to retrieve upon account creation. """ class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( TypedDict, ): account_subcategories: NotRequired[ List[Literal["checking", "savings"]] ] """ The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. """ class CreateParamsRendering(TypedDict): amount_tax_display: NotRequired[ "Literal['']|Literal['exclude_tax', 'include_inclusive_tax']" ] """ How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. """ pdf: NotRequired["InvoiceService.CreateParamsRenderingPdf"] """ Invoice pdf rendering options """ class CreateParamsRenderingPdf(TypedDict): page_size: NotRequired[Literal["a4", "auto", "letter"]] """ Page size for invoice PDF. Can be set to `a4`, `letter`, or `auto`. If set to `auto`, invoice PDF page size defaults to `a4` for customers with Japanese locale and `letter` for customers with other locales. """ class CreateParamsShippingCost(TypedDict): shipping_rate: NotRequired[str] """ The ID of the shipping rate to use for this order. """ shipping_rate_data: NotRequired[ "InvoiceService.CreateParamsShippingCostShippingRateData" ] """ Parameters to create a new ad-hoc shipping rate for this order. """ class CreateParamsShippingCostShippingRateData(TypedDict): delivery_estimate: NotRequired[ "InvoiceService.CreateParamsShippingCostShippingRateDataDeliveryEstimate" ] """ The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions. """ display_name: str """ The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions. """ fixed_amount: NotRequired[ "InvoiceService.CreateParamsShippingCostShippingRateDataFixedAmount" ] """ Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. """ tax_code: NotRequired[str] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`. """ type: NotRequired[Literal["fixed_amount"]] """ The type of calculation to use on the shipping rate. """ class CreateParamsShippingCostShippingRateDataDeliveryEstimate(TypedDict): maximum: NotRequired[ "InvoiceService.CreateParamsShippingCostShippingRateDataDeliveryEstimateMaximum" ] """ The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. """ minimum: NotRequired[ "InvoiceService.CreateParamsShippingCostShippingRateDataDeliveryEstimateMinimum" ] """ The lower bound of the estimated range. If empty, represents no lower bound. """ class CreateParamsShippingCostShippingRateDataDeliveryEstimateMaximum( TypedDict, ): unit: Literal["business_day", "day", "hour", "month", "week"] """ A unit of time. """ value: int """ Must be greater than 0. """ class CreateParamsShippingCostShippingRateDataDeliveryEstimateMinimum( TypedDict, ): unit: Literal["business_day", "day", "hour", "month", "week"] """ A unit of time. """ value: int """ Must be greater than 0. """ class CreateParamsShippingCostShippingRateDataFixedAmount(TypedDict): amount: int """ A non-negative integer in cents representing how much to charge. """ 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). """ currency_options: NotRequired[ Dict[ str, "InvoiceService.CreateParamsShippingCostShippingRateDataFixedAmountCurrencyOptions", ] ] """ Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ class CreateParamsShippingCostShippingRateDataFixedAmountCurrencyOptions( TypedDict, ): amount: int """ A non-negative integer in cents representing how much to charge. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. """ class CreateParamsShippingDetails(TypedDict): address: "InvoiceService.CreateParamsShippingDetailsAddress" """ Shipping address """ name: str """ Recipient name. """ phone: NotRequired["Literal['']|str"] """ Recipient phone (including extension) """ class CreateParamsShippingDetailsAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsTransferData(TypedDict): amount: NotRequired[int] """ The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. """ destination: str """ ID of an existing, connected Stripe account. """ class CreatePreviewParams(TypedDict): automatic_tax: NotRequired[ "InvoiceService.CreatePreviewParamsAutomaticTax" ] """ Settings for automatic tax lookup for this invoice preview. """ coupon: NotRequired[str] """ The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. """ currency: NotRequired[str] """ The currency to preview this invoice in. Defaults to that of `customer` if not specified. """ customer: NotRequired[str] """ The identifier of the customer whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. """ customer_details: NotRequired[ "InvoiceService.CreatePreviewParamsCustomerDetails" ] """ Details about the customer you want to invoice or overrides for an existing customer. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. """ discounts: NotRequired[ "Literal['']|List[InvoiceService.CreatePreviewParamsDiscount]" ] """ The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ invoice_items: NotRequired[ List["InvoiceService.CreatePreviewParamsInvoiceItem"] ] """ List of invoice items to add or update in the upcoming invoice preview. """ issuer: NotRequired["InvoiceService.CreatePreviewParamsIssuer"] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ on_behalf_of: NotRequired["Literal['']|str"] """ The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. """ preview_mode: NotRequired[Literal["next", "recurring"]] """ Customizes the types of values to include when calculating the invoice. Defaults to `next` if unspecified. """ schedule: NotRequired[str] """ The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. """ schedule_details: NotRequired[ "InvoiceService.CreatePreviewParamsScheduleDetails" ] """ The schedule creation or modification params to apply as a preview. Cannot be used with `subscription` or `subscription_` prefixed fields. """ subscription: NotRequired[str] """ The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_details.items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_details.items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. """ subscription_details: NotRequired[ "InvoiceService.CreatePreviewParamsSubscriptionDetails" ] """ The subscription creation or modification params to apply as a preview. Cannot be used with `schedule` or `schedule_details` fields. """ class CreatePreviewParamsAutomaticTax(TypedDict): enabled: bool """ Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. """ liability: NotRequired[ "InvoiceService.CreatePreviewParamsAutomaticTaxLiability" ] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ class CreatePreviewParamsAutomaticTaxLiability(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class CreatePreviewParamsCustomerDetails(TypedDict): address: NotRequired[ "Literal['']|InvoiceService.CreatePreviewParamsCustomerDetailsAddress" ] """ The customer's address. """ shipping: NotRequired[ "Literal['']|InvoiceService.CreatePreviewParamsCustomerDetailsShipping" ] """ The customer's shipping information. Appears on invoices emailed to this customer. """ tax: NotRequired[ "InvoiceService.CreatePreviewParamsCustomerDetailsTax" ] """ Tax details about the customer. """ tax_exempt: NotRequired[ "Literal['']|Literal['exempt', 'none', 'reverse']" ] """ The customer's tax exemption. One of `none`, `exempt`, or `reverse`. """ tax_ids: NotRequired[ List["InvoiceService.CreatePreviewParamsCustomerDetailsTaxId"] ] """ The customer's tax IDs. """ class CreatePreviewParamsCustomerDetailsAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreatePreviewParamsCustomerDetailsShipping(TypedDict): address: ( "InvoiceService.CreatePreviewParamsCustomerDetailsShippingAddress" ) """ Customer shipping address. """ name: str """ Customer name. """ phone: NotRequired[str] """ Customer phone (including extension). """ class CreatePreviewParamsCustomerDetailsShippingAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreatePreviewParamsCustomerDetailsTax(TypedDict): ip_address: NotRequired["Literal['']|str"] """ A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. """ class CreatePreviewParamsCustomerDetailsTaxId(TypedDict): type: Literal[ "ad_nrt", "ae_trn", "ar_cuit", "au_abn", "au_arn", "bg_uic", "bh_vat", "bo_tin", "br_cnpj", "br_cpf", "ca_bn", "ca_gst_hst", "ca_pst_bc", "ca_pst_mb", "ca_pst_sk", "ca_qst", "ch_uid", "ch_vat", "cl_tin", "cn_tin", "co_nit", "cr_tin", "de_stn", "do_rcn", "ec_ruc", "eg_tin", "es_cif", "eu_oss_vat", "eu_vat", "gb_vat", "ge_vat", "hk_br", "hu_tin", "id_npwp", "il_vat", "in_gst", "is_vat", "jp_cn", "jp_rn", "jp_trn", "ke_pin", "kr_brn", "kz_bin", "li_uid", "mx_rfc", "my_frp", "my_itn", "my_sst", "ng_tin", "no_vat", "no_voec", "nz_gst", "om_vat", "pe_ruc", "ph_tin", "ro_tin", "rs_pib", "ru_inn", "ru_kpp", "sa_vat", "sg_gst", "sg_uen", "si_tin", "sv_nit", "th_vat", "tr_tin", "tw_vat", "ua_vat", "us_ein", "uy_ruc", "ve_rif", "vn_tin", "za_vat", ] """ Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ Value of the tax ID. """ class CreatePreviewParamsDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class CreatePreviewParamsInvoiceItem(TypedDict): amount: NotRequired[int] """ The integer amount in cents (or local equivalent) of previewed invoice item. """ currency: NotRequired[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). Only applicable to new invoice items. """ description: NotRequired[str] """ An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. """ discountable: NotRequired[bool] """ Explicitly controls whether discounts apply to this invoice item. Defaults to true, except for negative invoice items. """ discounts: NotRequired[ "Literal['']|List[InvoiceService.CreatePreviewParamsInvoiceItemDiscount]" ] """ The coupons to redeem into discounts for the invoice item in the preview. """ invoiceitem: NotRequired[str] """ The ID of the invoice item to update in preview. If not specified, a new invoice item will be added to the preview of the upcoming invoice. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ period: NotRequired[ "InvoiceService.CreatePreviewParamsInvoiceItemPeriod" ] """ The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired[ "InvoiceService.CreatePreviewParamsInvoiceItemPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ Non-negative integer. The quantity of units for the invoice item. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ tax_code: NotRequired["Literal['']|str"] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item. """ unit_amount: NotRequired[int] """ The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class CreatePreviewParamsInvoiceItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class CreatePreviewParamsInvoiceItemPeriod(TypedDict): end: int """ The end of the period, which must be greater than or equal to the start. This value is inclusive. """ start: int """ The start of the period. This value is inclusive. """ class CreatePreviewParamsInvoiceItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class CreatePreviewParamsIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class CreatePreviewParamsScheduleDetails(TypedDict): end_behavior: NotRequired[Literal["cancel", "release"]] """ Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription. """ phases: NotRequired[ List["InvoiceService.CreatePreviewParamsScheduleDetailsPhase"] ] """ List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request. """ class CreatePreviewParamsScheduleDetailsPhase(TypedDict): add_invoice_items: NotRequired[ List[ "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItem" ] ] """ A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items. """ application_fee_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). """ automatic_tax: NotRequired[ "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseAutomaticTax" ] """ Automatic tax settings for this phase. """ billing_cycle_anchor: NotRequired[Literal["automatic", "phase_start"]] """ Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ billing_thresholds: NotRequired[ "Literal['']|InvoiceService.CreatePreviewParamsScheduleDetailsPhaseBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds. """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. """ coupon: NotRequired[str] """ The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. """ currency: NotRequired[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). """ default_payment_method: NotRequired[str] """ ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. """ default_tax_rates: NotRequired["Literal['']|List[str]"] """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase. """ description: NotRequired["Literal['']|str"] """ Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ discounts: NotRequired[ "Literal['']|List[InvoiceService.CreatePreviewParamsScheduleDetailsPhaseDiscount]" ] """ The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription's customer. Pass an empty string to avoid inheriting any discounts. """ end_date: NotRequired["int|Literal['now']"] """ The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set. """ invoice_settings: NotRequired[ "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseInvoiceSettings" ] """ All invoices will be billed using the specified settings. """ items: List[ "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseItem" ] """ List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. """ iterations: NotRequired[int] """ Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. """ on_behalf_of: NotRequired[str] """ The account on behalf of which to charge, for each of the associated subscription's invoices. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase. """ start_date: NotRequired["int|Literal['now']"] """ The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase. """ transfer_data: NotRequired[ "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseTransferData" ] """ The data with which to automatically create a Transfer for each of the associated subscription's invoices. """ trial: NotRequired[bool] """ If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. """ trial_end: NotRequired["int|Literal['now']"] """ Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial` """ class CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItem(TypedDict): discounts: NotRequired[ List[ "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemDiscount" ] ] """ The coupons to redeem into discounts for the item. """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired[ "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ Quantity for this item. Defaults to 1. """ tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. """ class CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemDiscount( TypedDict, ): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class CreatePreviewParamsScheduleDetailsPhaseAddInvoiceItemPriceData( TypedDict, ): 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). """ product: str """ The ID of the product that this price will belong to. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class CreatePreviewParamsScheduleDetailsPhaseAutomaticTax(TypedDict): enabled: bool """ Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. """ liability: NotRequired[ "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseAutomaticTaxLiability" ] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ class CreatePreviewParamsScheduleDetailsPhaseAutomaticTaxLiability( TypedDict, ): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class CreatePreviewParamsScheduleDetailsPhaseBillingThresholds(TypedDict): amount_gte: NotRequired[int] """ Monetary threshold that triggers the subscription to advance to a new billing period """ reset_billing_cycle_anchor: NotRequired[bool] """ Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. """ class CreatePreviewParamsScheduleDetailsPhaseDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class CreatePreviewParamsScheduleDetailsPhaseInvoiceSettings(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule. """ days_until_due: NotRequired[int] """ Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. """ issuer: NotRequired[ "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseInvoiceSettingsIssuer" ] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ class CreatePreviewParamsScheduleDetailsPhaseInvoiceSettingsIssuer( TypedDict, ): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class CreatePreviewParamsScheduleDetailsPhaseItem(TypedDict): billing_thresholds: NotRequired[ "Literal['']|InvoiceService.CreatePreviewParamsScheduleDetailsPhaseItemBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ discounts: NotRequired[ "Literal['']|List[InvoiceService.CreatePreviewParamsScheduleDetailsPhaseItemDiscount]" ] """ The coupons to redeem into discounts for the subscription item. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`. """ plan: NotRequired[str] """ The plan ID to subscribe to. You may specify the same ID in `plan` and `price`. """ price: NotRequired[str] """ The ID of the price object. """ price_data: NotRequired[ "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseItemPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ quantity: NotRequired[int] """ Quantity for the given price. Can be set only if the price's `usage_type` is `licensed` and not `metered`. """ tax_rates: NotRequired["Literal['']|List[str]"] """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ class CreatePreviewParamsScheduleDetailsPhaseItemBillingThresholds( TypedDict, ): usage_gte: int """ Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ class CreatePreviewParamsScheduleDetailsPhaseItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class CreatePreviewParamsScheduleDetailsPhaseItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ recurring: "InvoiceService.CreatePreviewParamsScheduleDetailsPhaseItemPriceDataRecurring" """ The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class CreatePreviewParamsScheduleDetailsPhaseItemPriceDataRecurring( TypedDict, ): interval: Literal["day", "month", "week", "year"] """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class CreatePreviewParamsScheduleDetailsPhaseTransferData(TypedDict): amount_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. """ destination: str """ ID of an existing, connected Stripe account. """ class CreatePreviewParamsSubscriptionDetails(TypedDict): billing_cycle_anchor: NotRequired["Literal['now', 'unchanged']|int"] """ For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. """ cancel_at: NotRequired["Literal['']|int"] """ A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. """ cancel_at_period_end: NotRequired[bool] """ Boolean indicating whether this subscription should cancel at the end of the current period. """ cancel_now: NotRequired[bool] """ This simulates the subscription being canceled or expired immediately. """ default_tax_rates: NotRequired["Literal['']|List[str]"] """ If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. """ items: NotRequired[ List["InvoiceService.CreatePreviewParamsSubscriptionDetailsItem"] ] """ A list of up to 20 subscription items, each with an attached price. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ proration_date: NotRequired[int] """ If previewing an update to a subscription, and doing proration, `subscription_details.proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_details.items`, or `subscription_details.trial_end` are required. Also, `subscription_details.proration_behavior` cannot be set to 'none'. """ resume_at: NotRequired[Literal["now"]] """ For paused subscriptions, setting `subscription_details.resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. """ start_date: NotRequired[int] """ Date a subscription is intended to start (can be future or past). """ trial_end: NotRequired["Literal['now']|int"] """ If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_details.items` or `subscription` is required. """ class CreatePreviewParamsSubscriptionDetailsItem(TypedDict): billing_thresholds: NotRequired[ "Literal['']|InvoiceService.CreatePreviewParamsSubscriptionDetailsItemBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ clear_usage: NotRequired[bool] """ Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. """ deleted: NotRequired[bool] """ A flag that, if set to `true`, will delete the specified item. """ discounts: NotRequired[ "Literal['']|List[InvoiceService.CreatePreviewParamsSubscriptionDetailsItemDiscount]" ] """ The coupons to redeem into discounts for the subscription item. """ id: NotRequired[str] """ Subscription item to update. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ plan: NotRequired[str] """ Plan ID for this item, as a string. """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ price_data: NotRequired[ "InvoiceService.CreatePreviewParamsSubscriptionDetailsItemPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ Quantity for this item. """ tax_rates: NotRequired["Literal['']|List[str]"] """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ class CreatePreviewParamsSubscriptionDetailsItemBillingThresholds( TypedDict, ): usage_gte: int """ Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ class CreatePreviewParamsSubscriptionDetailsItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class CreatePreviewParamsSubscriptionDetailsItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ recurring: "InvoiceService.CreatePreviewParamsSubscriptionDetailsItemPriceDataRecurring" """ The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class CreatePreviewParamsSubscriptionDetailsItemPriceDataRecurring( TypedDict, ): interval: Literal["day", "month", "week", "year"] """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class DeleteParams(TypedDict): pass class FinalizeInvoiceParams(TypedDict): auto_advance: NotRequired[bool] """ Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. If `false`, the invoice's state doesn't automatically advance without an explicit action. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ListParams(TypedDict): collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] """ The collection method of the invoice to retrieve. Either `charge_automatically` or `send_invoice`. """ created: NotRequired["InvoiceService.ListParamsCreated|int"] """ Only return invoices that were created during the given date interval. """ customer: NotRequired[str] """ Only return invoices for the customer specified by this customer ID. """ due_date: NotRequired["InvoiceService.ListParamsDueDate|int"] ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ Literal["draft", "open", "paid", "uncollectible", "void"] ] """ The status of the invoice, one of `draft`, `open`, `paid`, `uncollectible`, or `void`. [Learn more](https://stripe.com/docs/billing/invoices/workflow#workflow-overview) """ subscription: NotRequired[str] """ Only return invoices for the subscription specified by this subscription ID. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsDueDate(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class MarkUncollectibleParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class PayParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ forgive: NotRequired[bool] """ In cases where the source used to pay the invoice has insufficient funds, passing `forgive=true` controls whether a charge should be attempted for the full amount available on the source, up to the amount to fully pay the invoice. This effectively forgives the difference between the amount available on the source and the amount due. Passing `forgive=false` will fail the charge if the source hasn't been pre-funded with the right amount. An example for this case is with ACH Credit Transfers and wires: if the amount wired is less than the amount due by a small amount, you might want to forgive the difference. Defaults to `false`. """ mandate: NotRequired["Literal['']|str"] """ ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the payment_method param or the invoice's default_payment_method or default_source, if set. """ off_session: NotRequired[bool] """ Indicates if a customer is on or off-session while an invoice payment is attempted. Defaults to `true` (off-session). """ paid_out_of_band: NotRequired[bool] """ Boolean representing whether an invoice is paid outside of Stripe. This will result in no charge being made. Defaults to `false`. """ payment_method: NotRequired[str] """ A PaymentMethod to be charged. The PaymentMethod must be the ID of a PaymentMethod belonging to the customer associated with the invoice being paid. """ source: NotRequired[str] """ A payment source to be charged. The source must be the ID of a source belonging to the customer associated with the invoice being paid. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class SearchParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ page: NotRequired[str] """ A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. """ query: str """ The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for invoices](https://stripe.com/docs/search#query-fields-for-invoices). """ class SendInvoiceParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpcomingParams(TypedDict): automatic_tax: NotRequired["InvoiceService.UpcomingParamsAutomaticTax"] """ Settings for automatic tax lookup for this invoice preview. """ coupon: NotRequired[str] """ The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. """ currency: NotRequired[str] """ The currency to preview this invoice in. Defaults to that of `customer` if not specified. """ customer: NotRequired[str] """ The identifier of the customer whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. """ customer_details: NotRequired[ "InvoiceService.UpcomingParamsCustomerDetails" ] """ Details about the customer you want to invoice or overrides for an existing customer. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. """ discounts: NotRequired[ "Literal['']|List[InvoiceService.UpcomingParamsDiscount]" ] """ The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ invoice_items: NotRequired[ List["InvoiceService.UpcomingParamsInvoiceItem"] ] """ List of invoice items to add or update in the upcoming invoice preview. """ issuer: NotRequired["InvoiceService.UpcomingParamsIssuer"] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ on_behalf_of: NotRequired["Literal['']|str"] """ The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. """ preview_mode: NotRequired[Literal["next", "recurring"]] """ Customizes the types of values to include when calculating the invoice. Defaults to `next` if unspecified. """ schedule: NotRequired[str] """ The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. """ schedule_details: NotRequired[ "InvoiceService.UpcomingParamsScheduleDetails" ] """ The schedule creation or modification params to apply as a preview. Cannot be used with `subscription` or `subscription_` prefixed fields. """ subscription: NotRequired[str] """ The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_details.items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_details.items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. """ subscription_billing_cycle_anchor: NotRequired[ "Literal['now', 'unchanged']|int" ] """ For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.billing_cycle_anchor` instead. """ subscription_cancel_at: NotRequired["Literal['']|int"] """ A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at` instead. """ subscription_cancel_at_period_end: NotRequired[bool] """ Boolean indicating whether this subscription should cancel at the end of the current period. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at_period_end` instead. """ subscription_cancel_now: NotRequired[bool] """ This simulates the subscription being canceled or expired immediately. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_now` instead. """ subscription_default_tax_rates: NotRequired["Literal['']|List[str]"] """ If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. This field has been deprecated and will be removed in a future API version. Use `subscription_details.default_tax_rates` instead. """ subscription_details: NotRequired[ "InvoiceService.UpcomingParamsSubscriptionDetails" ] """ The subscription creation or modification params to apply as a preview. Cannot be used with `schedule` or `schedule_details` fields. """ subscription_items: NotRequired[ List["InvoiceService.UpcomingParamsSubscriptionItem"] ] """ A list of up to 20 subscription items, each with an attached price. This field has been deprecated and will be removed in a future API version. Use `subscription_details.items` instead. """ subscription_proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.proration_behavior` instead. """ subscription_proration_date: NotRequired[int] """ If previewing an update to a subscription, and doing proration, `subscription_proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_items`, or `subscription_trial_end` are required. Also, `subscription_proration_behavior` cannot be set to 'none'. This field has been deprecated and will be removed in a future API version. Use `subscription_details.proration_date` instead. """ subscription_resume_at: NotRequired[Literal["now"]] """ For paused subscriptions, setting `subscription_resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. This field has been deprecated and will be removed in a future API version. Use `subscription_details.resume_at` instead. """ subscription_start_date: NotRequired[int] """ Date a subscription is intended to start (can be future or past). This field has been deprecated and will be removed in a future API version. Use `subscription_details.start_date` instead. """ subscription_trial_end: NotRequired["Literal['now']|int"] """ If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_items` or `subscription` is required. This field has been deprecated and will be removed in a future API version. Use `subscription_details.trial_end` instead. """ subscription_trial_from_plan: NotRequired[bool] """ Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `subscription_trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `subscription_trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. """ class UpcomingParamsAutomaticTax(TypedDict): enabled: bool """ Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. """ liability: NotRequired[ "InvoiceService.UpcomingParamsAutomaticTaxLiability" ] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ class UpcomingParamsAutomaticTaxLiability(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class UpcomingParamsCustomerDetails(TypedDict): address: NotRequired[ "Literal['']|InvoiceService.UpcomingParamsCustomerDetailsAddress" ] """ The customer's address. """ shipping: NotRequired[ "Literal['']|InvoiceService.UpcomingParamsCustomerDetailsShipping" ] """ The customer's shipping information. Appears on invoices emailed to this customer. """ tax: NotRequired["InvoiceService.UpcomingParamsCustomerDetailsTax"] """ Tax details about the customer. """ tax_exempt: NotRequired[ "Literal['']|Literal['exempt', 'none', 'reverse']" ] """ The customer's tax exemption. One of `none`, `exempt`, or `reverse`. """ tax_ids: NotRequired[ List["InvoiceService.UpcomingParamsCustomerDetailsTaxId"] ] """ The customer's tax IDs. """ class UpcomingParamsCustomerDetailsAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class UpcomingParamsCustomerDetailsShipping(TypedDict): address: "InvoiceService.UpcomingParamsCustomerDetailsShippingAddress" """ Customer shipping address. """ name: str """ Customer name. """ phone: NotRequired[str] """ Customer phone (including extension). """ class UpcomingParamsCustomerDetailsShippingAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class UpcomingParamsCustomerDetailsTax(TypedDict): ip_address: NotRequired["Literal['']|str"] """ A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. """ class UpcomingParamsCustomerDetailsTaxId(TypedDict): type: Literal[ "ad_nrt", "ae_trn", "ar_cuit", "au_abn", "au_arn", "bg_uic", "bh_vat", "bo_tin", "br_cnpj", "br_cpf", "ca_bn", "ca_gst_hst", "ca_pst_bc", "ca_pst_mb", "ca_pst_sk", "ca_qst", "ch_uid", "ch_vat", "cl_tin", "cn_tin", "co_nit", "cr_tin", "de_stn", "do_rcn", "ec_ruc", "eg_tin", "es_cif", "eu_oss_vat", "eu_vat", "gb_vat", "ge_vat", "hk_br", "hu_tin", "id_npwp", "il_vat", "in_gst", "is_vat", "jp_cn", "jp_rn", "jp_trn", "ke_pin", "kr_brn", "kz_bin", "li_uid", "mx_rfc", "my_frp", "my_itn", "my_sst", "ng_tin", "no_vat", "no_voec", "nz_gst", "om_vat", "pe_ruc", "ph_tin", "ro_tin", "rs_pib", "ru_inn", "ru_kpp", "sa_vat", "sg_gst", "sg_uen", "si_tin", "sv_nit", "th_vat", "tr_tin", "tw_vat", "ua_vat", "us_ein", "uy_ruc", "ve_rif", "vn_tin", "za_vat", ] """ Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ Value of the tax ID. """ class UpcomingParamsDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class UpcomingParamsInvoiceItem(TypedDict): amount: NotRequired[int] """ The integer amount in cents (or local equivalent) of previewed invoice item. """ currency: NotRequired[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). Only applicable to new invoice items. """ description: NotRequired[str] """ An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. """ discountable: NotRequired[bool] """ Explicitly controls whether discounts apply to this invoice item. Defaults to true, except for negative invoice items. """ discounts: NotRequired[ "Literal['']|List[InvoiceService.UpcomingParamsInvoiceItemDiscount]" ] """ The coupons to redeem into discounts for the invoice item in the preview. """ invoiceitem: NotRequired[str] """ The ID of the invoice item to update in preview. If not specified, a new invoice item will be added to the preview of the upcoming invoice. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ period: NotRequired["InvoiceService.UpcomingParamsInvoiceItemPeriod"] """ The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired[ "InvoiceService.UpcomingParamsInvoiceItemPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ Non-negative integer. The quantity of units for the invoice item. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ tax_code: NotRequired["Literal['']|str"] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item. """ unit_amount: NotRequired[int] """ The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class UpcomingParamsInvoiceItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class UpcomingParamsInvoiceItemPeriod(TypedDict): end: int """ The end of the period, which must be greater than or equal to the start. This value is inclusive. """ start: int """ The start of the period. This value is inclusive. """ class UpcomingParamsInvoiceItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class UpcomingParamsIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class UpcomingParamsScheduleDetails(TypedDict): end_behavior: NotRequired[Literal["cancel", "release"]] """ Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription. """ phases: NotRequired[ List["InvoiceService.UpcomingParamsScheduleDetailsPhase"] ] """ List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request. """ class UpcomingParamsScheduleDetailsPhase(TypedDict): add_invoice_items: NotRequired[ List[ "InvoiceService.UpcomingParamsScheduleDetailsPhaseAddInvoiceItem" ] ] """ A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items. """ application_fee_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). """ automatic_tax: NotRequired[ "InvoiceService.UpcomingParamsScheduleDetailsPhaseAutomaticTax" ] """ Automatic tax settings for this phase. """ billing_cycle_anchor: NotRequired[Literal["automatic", "phase_start"]] """ Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ billing_thresholds: NotRequired[ "Literal['']|InvoiceService.UpcomingParamsScheduleDetailsPhaseBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds. """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. """ coupon: NotRequired[str] """ The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. """ currency: NotRequired[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). """ default_payment_method: NotRequired[str] """ ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. """ default_tax_rates: NotRequired["Literal['']|List[str]"] """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase. """ description: NotRequired["Literal['']|str"] """ Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ discounts: NotRequired[ "Literal['']|List[InvoiceService.UpcomingParamsScheduleDetailsPhaseDiscount]" ] """ The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription's customer. Pass an empty string to avoid inheriting any discounts. """ end_date: NotRequired["int|Literal['now']"] """ The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set. """ invoice_settings: NotRequired[ "InvoiceService.UpcomingParamsScheduleDetailsPhaseInvoiceSettings" ] """ All invoices will be billed using the specified settings. """ items: List["InvoiceService.UpcomingParamsScheduleDetailsPhaseItem"] """ List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. """ iterations: NotRequired[int] """ Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. """ on_behalf_of: NotRequired[str] """ The account on behalf of which to charge, for each of the associated subscription's invoices. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase. """ start_date: NotRequired["int|Literal['now']"] """ The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase. """ transfer_data: NotRequired[ "InvoiceService.UpcomingParamsScheduleDetailsPhaseTransferData" ] """ The data with which to automatically create a Transfer for each of the associated subscription's invoices. """ trial: NotRequired[bool] """ If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. """ trial_end: NotRequired["int|Literal['now']"] """ Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial` """ class UpcomingParamsScheduleDetailsPhaseAddInvoiceItem(TypedDict): discounts: NotRequired[ List[ "InvoiceService.UpcomingParamsScheduleDetailsPhaseAddInvoiceItemDiscount" ] ] """ The coupons to redeem into discounts for the item. """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired[ "InvoiceService.UpcomingParamsScheduleDetailsPhaseAddInvoiceItemPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ Quantity for this item. Defaults to 1. """ tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. """ class UpcomingParamsScheduleDetailsPhaseAddInvoiceItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class UpcomingParamsScheduleDetailsPhaseAddInvoiceItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class UpcomingParamsScheduleDetailsPhaseAutomaticTax(TypedDict): enabled: bool """ Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. """ liability: NotRequired[ "InvoiceService.UpcomingParamsScheduleDetailsPhaseAutomaticTaxLiability" ] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ class UpcomingParamsScheduleDetailsPhaseAutomaticTaxLiability(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class UpcomingParamsScheduleDetailsPhaseBillingThresholds(TypedDict): amount_gte: NotRequired[int] """ Monetary threshold that triggers the subscription to advance to a new billing period """ reset_billing_cycle_anchor: NotRequired[bool] """ Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. """ class UpcomingParamsScheduleDetailsPhaseDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class UpcomingParamsScheduleDetailsPhaseInvoiceSettings(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule. """ days_until_due: NotRequired[int] """ Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. """ issuer: NotRequired[ "InvoiceService.UpcomingParamsScheduleDetailsPhaseInvoiceSettingsIssuer" ] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ class UpcomingParamsScheduleDetailsPhaseInvoiceSettingsIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class UpcomingParamsScheduleDetailsPhaseItem(TypedDict): billing_thresholds: NotRequired[ "Literal['']|InvoiceService.UpcomingParamsScheduleDetailsPhaseItemBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ discounts: NotRequired[ "Literal['']|List[InvoiceService.UpcomingParamsScheduleDetailsPhaseItemDiscount]" ] """ The coupons to redeem into discounts for the subscription item. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`. """ plan: NotRequired[str] """ The plan ID to subscribe to. You may specify the same ID in `plan` and `price`. """ price: NotRequired[str] """ The ID of the price object. """ price_data: NotRequired[ "InvoiceService.UpcomingParamsScheduleDetailsPhaseItemPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ quantity: NotRequired[int] """ Quantity for the given price. Can be set only if the price's `usage_type` is `licensed` and not `metered`. """ tax_rates: NotRequired["Literal['']|List[str]"] """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ class UpcomingParamsScheduleDetailsPhaseItemBillingThresholds(TypedDict): usage_gte: int """ Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ class UpcomingParamsScheduleDetailsPhaseItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class UpcomingParamsScheduleDetailsPhaseItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ recurring: "InvoiceService.UpcomingParamsScheduleDetailsPhaseItemPriceDataRecurring" """ The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class UpcomingParamsScheduleDetailsPhaseItemPriceDataRecurring(TypedDict): interval: Literal["day", "month", "week", "year"] """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class UpcomingParamsScheduleDetailsPhaseTransferData(TypedDict): amount_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. """ destination: str """ ID of an existing, connected Stripe account. """ class UpcomingParamsSubscriptionDetails(TypedDict): billing_cycle_anchor: NotRequired["Literal['now', 'unchanged']|int"] """ For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. """ cancel_at: NotRequired["Literal['']|int"] """ A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. """ cancel_at_period_end: NotRequired[bool] """ Boolean indicating whether this subscription should cancel at the end of the current period. """ cancel_now: NotRequired[bool] """ This simulates the subscription being canceled or expired immediately. """ default_tax_rates: NotRequired["Literal['']|List[str]"] """ If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. """ items: NotRequired[ List["InvoiceService.UpcomingParamsSubscriptionDetailsItem"] ] """ A list of up to 20 subscription items, each with an attached price. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ proration_date: NotRequired[int] """ If previewing an update to a subscription, and doing proration, `subscription_details.proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_details.items`, or `subscription_details.trial_end` are required. Also, `subscription_details.proration_behavior` cannot be set to 'none'. """ resume_at: NotRequired[Literal["now"]] """ For paused subscriptions, setting `subscription_details.resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. """ start_date: NotRequired[int] """ Date a subscription is intended to start (can be future or past). """ trial_end: NotRequired["Literal['now']|int"] """ If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_details.items` or `subscription` is required. """ class UpcomingParamsSubscriptionDetailsItem(TypedDict): billing_thresholds: NotRequired[ "Literal['']|InvoiceService.UpcomingParamsSubscriptionDetailsItemBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ clear_usage: NotRequired[bool] """ Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. """ deleted: NotRequired[bool] """ A flag that, if set to `true`, will delete the specified item. """ discounts: NotRequired[ "Literal['']|List[InvoiceService.UpcomingParamsSubscriptionDetailsItemDiscount]" ] """ The coupons to redeem into discounts for the subscription item. """ id: NotRequired[str] """ Subscription item to update. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ plan: NotRequired[str] """ Plan ID for this item, as a string. """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ price_data: NotRequired[ "InvoiceService.UpcomingParamsSubscriptionDetailsItemPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ Quantity for this item. """ tax_rates: NotRequired["Literal['']|List[str]"] """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ class UpcomingParamsSubscriptionDetailsItemBillingThresholds(TypedDict): usage_gte: int """ Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ class UpcomingParamsSubscriptionDetailsItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class UpcomingParamsSubscriptionDetailsItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ recurring: "InvoiceService.UpcomingParamsSubscriptionDetailsItemPriceDataRecurring" """ The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class UpcomingParamsSubscriptionDetailsItemPriceDataRecurring(TypedDict): interval: Literal["day", "month", "week", "year"] """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class UpcomingParamsSubscriptionItem(TypedDict): billing_thresholds: NotRequired[ "Literal['']|InvoiceService.UpcomingParamsSubscriptionItemBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ clear_usage: NotRequired[bool] """ Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. """ deleted: NotRequired[bool] """ A flag that, if set to `true`, will delete the specified item. """ discounts: NotRequired[ "Literal['']|List[InvoiceService.UpcomingParamsSubscriptionItemDiscount]" ] """ The coupons to redeem into discounts for the subscription item. """ id: NotRequired[str] """ Subscription item to update. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ plan: NotRequired[str] """ Plan ID for this item, as a string. """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ price_data: NotRequired[ "InvoiceService.UpcomingParamsSubscriptionItemPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ Quantity for this item. """ tax_rates: NotRequired["Literal['']|List[str]"] """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ class UpcomingParamsSubscriptionItemBillingThresholds(TypedDict): usage_gte: int """ Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ class UpcomingParamsSubscriptionItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class UpcomingParamsSubscriptionItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ recurring: ( "InvoiceService.UpcomingParamsSubscriptionItemPriceDataRecurring" ) """ The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class UpcomingParamsSubscriptionItemPriceDataRecurring(TypedDict): interval: Literal["day", "month", "week", "year"] """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class UpdateParams(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ The account tax IDs associated with the invoice. Only editable when the invoice is a draft. """ application_fee_amount: NotRequired[int] """ A fee in cents (or local equivalent) that will be applied to the invoice and transferred to the application owner's Stripe account. The request must be made with an OAuth key or the Stripe-Account header in order to take an application fee. For more information, see the application fees [documentation](https://stripe.com/docs/billing/invoices/connect#collecting-fees). """ auto_advance: NotRequired[bool] """ Controls whether Stripe performs [automatic collection](https://stripe.com/docs/invoicing/integration/automatic-advancement-collection) of the invoice. """ automatic_tax: NotRequired["InvoiceService.UpdateParamsAutomaticTax"] """ Settings for automatic tax lookup for this invoice. """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically` or `send_invoice`. This field can be updated only on `draft` invoices. """ custom_fields: NotRequired[ "Literal['']|List[InvoiceService.UpdateParamsCustomField]" ] """ A list of up to 4 custom fields to be displayed on the invoice. If a value for `custom_fields` is specified, the list specified will replace the existing custom field list on this invoice. Pass an empty string to remove previously-defined fields. """ days_until_due: NotRequired[int] """ The number of days from which the invoice is created until it is due. Only valid for invoices where `collection_method=send_invoice`. This field can only be updated on `draft` invoices. """ default_payment_method: NotRequired[str] """ ID of the default payment method for the invoice. It must belong to the customer associated with the invoice. If not set, defaults to the subscription's default payment method, if any, or to the default payment method in the customer's invoice settings. """ default_source: NotRequired["Literal['']|str"] """ ID of the default payment source for the invoice. It must belong to the customer associated with the invoice and be in a chargeable state. If not set, defaults to the subscription's default source, if any, or to the customer's default source. """ default_tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates that will apply to any line item that does not have `tax_rates` set. Pass an empty string to remove previously-defined tax rates. """ description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. Referenced as 'memo' in the Dashboard. """ discounts: NotRequired[ "Literal['']|List[InvoiceService.UpdateParamsDiscount]" ] """ The discounts that will apply to the invoice. Pass an empty string to remove previously-defined discounts. """ due_date: NotRequired[int] """ The date on which payment for this invoice is due. Only valid for invoices where `collection_method=send_invoice`. This field can only be updated on `draft` invoices. """ effective_at: NotRequired["Literal['']|int"] """ The date when this invoice is in effect. Same as `finalized_at` unless overwritten. When defined, this value replaces the system-generated 'Date of issue' printed on the invoice PDF and receipt. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ footer: NotRequired[str] """ Footer to be displayed on the invoice. """ issuer: NotRequired["InvoiceService.UpdateParamsIssuer"] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ number: NotRequired["Literal['']|str"] """ Set the number for this invoice. If no number is present then a number will be assigned automatically when the invoice is finalized. In many markets, regulations require invoices to be unique, sequential and / or gapless. You are responsible for ensuring this is true across all your different invoicing systems in the event that you edit the invoice number using our API. If you use only Stripe for your invoices and do not change invoice numbers, Stripe handles this aspect of compliance for you automatically. """ on_behalf_of: NotRequired["Literal['']|str"] """ The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. """ payment_settings: NotRequired[ "InvoiceService.UpdateParamsPaymentSettings" ] """ Configuration settings for the PaymentIntent that is generated when the invoice is finalized. """ rendering: NotRequired["InvoiceService.UpdateParamsRendering"] """ The rendering-related settings that control how the invoice is displayed on customer-facing surfaces such as PDF and Hosted Invoice Page. """ shipping_cost: NotRequired[ "Literal['']|InvoiceService.UpdateParamsShippingCost" ] """ Settings for the cost of shipping for this invoice. """ shipping_details: NotRequired[ "Literal['']|InvoiceService.UpdateParamsShippingDetails" ] """ Shipping details for the invoice. The Invoice PDF will use the `shipping_details` value if it is set, otherwise the PDF will render the shipping address from the customer. """ statement_descriptor: NotRequired[str] """ Extra information about a charge for the customer's credit card statement. It must contain at least one letter. If not specified and this invoice is part of a subscription, the default `statement_descriptor` will be set to the first subscription item's product's `statement_descriptor`. """ transfer_data: NotRequired[ "Literal['']|InvoiceService.UpdateParamsTransferData" ] """ If specified, the funds from the invoice will be transferred to the destination and the ID of the resulting transfer will be found on the invoice's charge. This will be unset if you POST an empty value. """ class UpdateParamsAutomaticTax(TypedDict): enabled: bool """ Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. """ liability: NotRequired[ "InvoiceService.UpdateParamsAutomaticTaxLiability" ] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ class UpdateParamsAutomaticTaxLiability(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class UpdateParamsCustomField(TypedDict): name: str """ The name of the custom field. This may be up to 40 characters. """ value: str """ The value of the custom field. This may be up to 140 characters. """ class UpdateParamsDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class UpdateParamsIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class UpdateParamsPaymentSettings(TypedDict): default_mandate: NotRequired["Literal['']|str"] """ ID of the mandate to be used for this invoice. It must correspond to the payment method used to pay the invoice, including the invoice's default_payment_method or default_source, if set. """ payment_method_options: NotRequired[ "InvoiceService.UpdateParamsPaymentSettingsPaymentMethodOptions" ] """ Payment-method-specific configuration to provide to the invoice's PaymentIntent. """ payment_method_types: NotRequired[ "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). """ class UpdateParamsPaymentSettingsPaymentMethodOptions(TypedDict): acss_debit: NotRequired[ "Literal['']|InvoiceService.UpdateParamsPaymentSettingsPaymentMethodOptionsAcssDebit" ] """ If paying by `acss_debit`, this sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice's PaymentIntent. """ bancontact: NotRequired[ "Literal['']|InvoiceService.UpdateParamsPaymentSettingsPaymentMethodOptionsBancontact" ] """ If paying by `bancontact`, this sub-hash contains details about the Bancontact payment method options to pass to the invoice's PaymentIntent. """ card: NotRequired[ "Literal['']|InvoiceService.UpdateParamsPaymentSettingsPaymentMethodOptionsCard" ] """ If paying by `card`, this sub-hash contains details about the Card payment method options to pass to the invoice's PaymentIntent. """ customer_balance: NotRequired[ "Literal['']|InvoiceService.UpdateParamsPaymentSettingsPaymentMethodOptionsCustomerBalance" ] """ If paying by `customer_balance`, this sub-hash contains details about the Bank transfer payment method options to pass to the invoice's PaymentIntent. """ konbini: NotRequired[ "Literal['']|InvoiceService.UpdateParamsPaymentSettingsPaymentMethodOptionsKonbini" ] """ If paying by `konbini`, this sub-hash contains details about the Konbini payment method options to pass to the invoice's PaymentIntent. """ sepa_debit: NotRequired[ "Literal['']|InvoiceService.UpdateParamsPaymentSettingsPaymentMethodOptionsSepaDebit" ] """ If paying by `sepa_debit`, this sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice's PaymentIntent. """ us_bank_account: NotRequired[ "Literal['']|InvoiceService.UpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccount" ] """ If paying by `us_bank_account`, this sub-hash contains details about the ACH direct debit payment method options to pass to the invoice's PaymentIntent. """ class UpdateParamsPaymentSettingsPaymentMethodOptionsAcssDebit(TypedDict): mandate_options: NotRequired[ "InvoiceService.UpdateParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions" ] """ Additional fields for Mandate creation """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] """ Verification method for the intent """ class UpdateParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions( TypedDict, ): transaction_type: NotRequired[Literal["business", "personal"]] """ Transaction type of the mandate. """ class UpdateParamsPaymentSettingsPaymentMethodOptionsBancontact(TypedDict): preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] """ Preferred language of the Bancontact authorization page that the customer is redirected to. """ class UpdateParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): installments: NotRequired[ "InvoiceService.UpdateParamsPaymentSettingsPaymentMethodOptionsCardInstallments" ] """ Installment configuration for payments attempted on this invoice (Mexico Only). For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). """ request_three_d_secure: NotRequired[ Literal["any", "automatic", "challenge"] ] """ 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://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ class UpdateParamsPaymentSettingsPaymentMethodOptionsCardInstallments( TypedDict, ): enabled: NotRequired[bool] """ Setting to true enables installments for this invoice. Setting to false will prevent any selected plan from applying to a payment. """ plan: NotRequired[ "Literal['']|InvoiceService.UpdateParamsPaymentSettingsPaymentMethodOptionsCardInstallmentsPlan" ] """ The selected installment plan to use for this invoice. """ class UpdateParamsPaymentSettingsPaymentMethodOptionsCardInstallmentsPlan( TypedDict, ): count: int """ For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. """ interval: Literal["month"] """ For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. One of `month`. """ type: Literal["fixed_count"] """ Type of installment plan, one of `fixed_count`. """ class UpdateParamsPaymentSettingsPaymentMethodOptionsCustomerBalance( TypedDict, ): bank_transfer: NotRequired[ "InvoiceService.UpdateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer" ] """ Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. """ funding_type: NotRequired[str] """ The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. """ class UpdateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer( TypedDict, ): eu_bank_transfer: NotRequired[ "InvoiceService.UpdateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer" ] """ Configuration for eu_bank_transfer funding type. """ type: NotRequired[str] """ The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. """ class UpdateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer( TypedDict, ): country: str """ The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. """ class UpdateParamsPaymentSettingsPaymentMethodOptionsKonbini(TypedDict): pass class UpdateParamsPaymentSettingsPaymentMethodOptionsSepaDebit(TypedDict): pass class UpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccount( TypedDict, ): financial_connections: NotRequired[ "InvoiceService.UpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections" ] """ Additional fields for Financial Connections Session creation """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] """ Verification method for the intent """ class UpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): filters: NotRequired[ "InvoiceService.UpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" ] """ Provide filters for the linked accounts that the customer can select for the payment method. """ permissions: NotRequired[ List[ Literal[ "balances", "ownership", "payment_method", "transactions" ] ] ] """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ List[Literal["balances", "ownership", "transactions"]] ] """ List of data features that you would like to retrieve upon account creation. """ class UpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( TypedDict, ): account_subcategories: NotRequired[ List[Literal["checking", "savings"]] ] """ The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. """ class UpdateParamsRendering(TypedDict): amount_tax_display: NotRequired[ "Literal['']|Literal['exclude_tax', 'include_inclusive_tax']" ] """ How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. """ pdf: NotRequired["InvoiceService.UpdateParamsRenderingPdf"] """ Invoice pdf rendering options """ class UpdateParamsRenderingPdf(TypedDict): page_size: NotRequired[Literal["a4", "auto", "letter"]] """ Page size for invoice PDF. Can be set to `a4`, `letter`, or `auto`. If set to `auto`, invoice PDF page size defaults to `a4` for customers with Japanese locale and `letter` for customers with other locales. """ class UpdateParamsShippingCost(TypedDict): shipping_rate: NotRequired[str] """ The ID of the shipping rate to use for this order. """ shipping_rate_data: NotRequired[ "InvoiceService.UpdateParamsShippingCostShippingRateData" ] """ Parameters to create a new ad-hoc shipping rate for this order. """ class UpdateParamsShippingCostShippingRateData(TypedDict): delivery_estimate: NotRequired[ "InvoiceService.UpdateParamsShippingCostShippingRateDataDeliveryEstimate" ] """ The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions. """ display_name: str """ The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions. """ fixed_amount: NotRequired[ "InvoiceService.UpdateParamsShippingCostShippingRateDataFixedAmount" ] """ Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. """ tax_code: NotRequired[str] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`. """ type: NotRequired[Literal["fixed_amount"]] """ The type of calculation to use on the shipping rate. """ class UpdateParamsShippingCostShippingRateDataDeliveryEstimate(TypedDict): maximum: NotRequired[ "InvoiceService.UpdateParamsShippingCostShippingRateDataDeliveryEstimateMaximum" ] """ The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. """ minimum: NotRequired[ "InvoiceService.UpdateParamsShippingCostShippingRateDataDeliveryEstimateMinimum" ] """ The lower bound of the estimated range. If empty, represents no lower bound. """ class UpdateParamsShippingCostShippingRateDataDeliveryEstimateMaximum( TypedDict, ): unit: Literal["business_day", "day", "hour", "month", "week"] """ A unit of time. """ value: int """ Must be greater than 0. """ class UpdateParamsShippingCostShippingRateDataDeliveryEstimateMinimum( TypedDict, ): unit: Literal["business_day", "day", "hour", "month", "week"] """ A unit of time. """ value: int """ Must be greater than 0. """ class UpdateParamsShippingCostShippingRateDataFixedAmount(TypedDict): amount: int """ A non-negative integer in cents representing how much to charge. """ 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). """ currency_options: NotRequired[ Dict[ str, "InvoiceService.UpdateParamsShippingCostShippingRateDataFixedAmountCurrencyOptions", ] ] """ Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ class UpdateParamsShippingCostShippingRateDataFixedAmountCurrencyOptions( TypedDict, ): amount: int """ A non-negative integer in cents representing how much to charge. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. """ class UpdateParamsShippingDetails(TypedDict): address: "InvoiceService.UpdateParamsShippingDetailsAddress" """ Shipping address """ name: str """ Recipient name. """ phone: NotRequired["Literal['']|str"] """ Recipient phone (including extension) """ class UpdateParamsShippingDetailsAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class UpdateParamsTransferData(TypedDict): amount: NotRequired[int] """ The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. """ destination: str """ ID of an existing, connected Stripe account. """ class VoidInvoiceParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def delete( self, invoice: str, params: "InvoiceService.DeleteParams" = {}, options: RequestOptions = {}, ) -> Invoice: """ Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://stripe.com/docs/api#void_invoice). """ return cast( Invoice, self._request( "delete", "/v1/invoices/{invoice}".format(invoice=sanitize_id(invoice)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def delete_async( self, invoice: str, params: "InvoiceService.DeleteParams" = {}, options: RequestOptions = {}, ) -> Invoice: """ Permanently deletes a one-off invoice draft. This cannot be undone. Attempts to delete invoices that are no longer in a draft state will fail; once an invoice has been finalized or if an invoice is for a subscription, it must be [voided](https://stripe.com/docs/api#void_invoice). """ return cast( Invoice, await self._request_async( "delete", "/v1/invoices/{invoice}".format(invoice=sanitize_id(invoice)), api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, invoice: str, params: "InvoiceService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Invoice: """ Retrieves the invoice with the given ID. """ return cast( Invoice, self._request( "get", "/v1/invoices/{invoice}".format(invoice=sanitize_id(invoice)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, invoice: str, params: "InvoiceService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Invoice: """ Retrieves the invoice with the given ID. """ return cast( Invoice, await self._request_async( "get", "/v1/invoices/{invoice}".format(invoice=sanitize_id(invoice)), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, invoice: str, params: "InvoiceService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Invoice: """ Draft invoices are fully editable. Once an invoice is [finalized](https://stripe.com/docs/billing/invoices/workflow#finalized), monetary values, as well as collection_method, become uneditable. If you would like to stop the Stripe Billing engine from automatically finalizing, reattempting payments on, sending reminders for, or [automatically reconciling](https://stripe.com/docs/billing/invoices/reconciliation) invoices, pass auto_advance=false. """ return cast( Invoice, self._request( "post", "/v1/invoices/{invoice}".format(invoice=sanitize_id(invoice)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, invoice: str, params: "InvoiceService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Invoice: """ Draft invoices are fully editable. Once an invoice is [finalized](https://stripe.com/docs/billing/invoices/workflow#finalized), monetary values, as well as collection_method, become uneditable. If you would like to stop the Stripe Billing engine from automatically finalizing, reattempting payments on, sending reminders for, or [automatically reconciling](https://stripe.com/docs/billing/invoices/reconciliation) invoices, pass auto_advance=false. """ return cast( Invoice, await self._request_async( "post", "/v1/invoices/{invoice}".format(invoice=sanitize_id(invoice)), api_mode="V1", base_address="api", params=params, options=options, ), ) def list( self, params: "InvoiceService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Invoice]: """ You can list all invoices, or list the invoices for a specific customer. The invoices are returned sorted by creation date, with the most recently created invoices appearing first. """ return cast( ListObject[Invoice], self._request( "get", "/v1/invoices", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "InvoiceService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Invoice]: """ You can list all invoices, or list the invoices for a specific customer. The invoices are returned sorted by creation date, with the most recently created invoices appearing first. """ return cast( ListObject[Invoice], await self._request_async( "get", "/v1/invoices", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "InvoiceService.CreateParams" = {}, options: RequestOptions = {}, ) -> Invoice: """ This endpoint creates a draft invoice for a given customer. The invoice remains a draft until you [finalize the invoice, which allows you to [pay](#pay_invoice) or send](https://stripe.com/docs/api#finalize_invoice) the invoice to your customers. """ return cast( Invoice, self._request( "post", "/v1/invoices", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "InvoiceService.CreateParams" = {}, options: RequestOptions = {}, ) -> Invoice: """ This endpoint creates a draft invoice for a given customer. The invoice remains a draft until you [finalize the invoice, which allows you to [pay](#pay_invoice) or send](https://stripe.com/docs/api#finalize_invoice) the invoice to your customers. """ return cast( Invoice, await self._request_async( "post", "/v1/invoices", api_mode="V1", base_address="api", params=params, options=options, ), ) def search( self, params: "InvoiceService.SearchParams", options: RequestOptions = {}, ) -> SearchResultObject[Invoice]: """ Search for invoices you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India. """ return cast( SearchResultObject[Invoice], self._request( "get", "/v1/invoices/search", api_mode="V1", base_address="api", params=params, options=options, ), ) async def search_async( self, params: "InvoiceService.SearchParams", options: RequestOptions = {}, ) -> SearchResultObject[Invoice]: """ Search for invoices you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India. """ return cast( SearchResultObject[Invoice], await self._request_async( "get", "/v1/invoices/search", api_mode="V1", base_address="api", params=params, options=options, ), ) def upcoming( self, params: "InvoiceService.UpcomingParams" = {}, options: RequestOptions = {}, ) -> Invoice: """ At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice. Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request. Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions) """ return cast( Invoice, self._request( "get", "/v1/invoices/upcoming", api_mode="V1", base_address="api", params=params, options=options, ), ) async def upcoming_async( self, params: "InvoiceService.UpcomingParams" = {}, options: RequestOptions = {}, ) -> Invoice: """ At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice. Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request. Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions) """ return cast( Invoice, await self._request_async( "get", "/v1/invoices/upcoming", api_mode="V1", base_address="api", params=params, options=options, ), ) def finalize_invoice( self, invoice: str, params: "InvoiceService.FinalizeInvoiceParams" = {}, options: RequestOptions = {}, ) -> Invoice: """ Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you'd like to finalize a draft invoice manually, you can do so using this method. """ return cast( Invoice, self._request( "post", "/v1/invoices/{invoice}/finalize".format( invoice=sanitize_id(invoice), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def finalize_invoice_async( self, invoice: str, params: "InvoiceService.FinalizeInvoiceParams" = {}, options: RequestOptions = {}, ) -> Invoice: """ Stripe automatically finalizes drafts before sending and attempting payment on invoices. However, if you'd like to finalize a draft invoice manually, you can do so using this method. """ return cast( Invoice, await self._request_async( "post", "/v1/invoices/{invoice}/finalize".format( invoice=sanitize_id(invoice), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def mark_uncollectible( self, invoice: str, params: "InvoiceService.MarkUncollectibleParams" = {}, options: RequestOptions = {}, ) -> Invoice: """ Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes. """ return cast( Invoice, self._request( "post", "/v1/invoices/{invoice}/mark_uncollectible".format( invoice=sanitize_id(invoice), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def mark_uncollectible_async( self, invoice: str, params: "InvoiceService.MarkUncollectibleParams" = {}, options: RequestOptions = {}, ) -> Invoice: """ Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes. """ return cast( Invoice, await self._request_async( "post", "/v1/invoices/{invoice}/mark_uncollectible".format( invoice=sanitize_id(invoice), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def pay( self, invoice: str, params: "InvoiceService.PayParams" = {}, options: RequestOptions = {}, ) -> Invoice: """ Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so. """ return cast( Invoice, self._request( "post", "/v1/invoices/{invoice}/pay".format( invoice=sanitize_id(invoice), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def pay_async( self, invoice: str, params: "InvoiceService.PayParams" = {}, options: RequestOptions = {}, ) -> Invoice: """ Stripe automatically creates and then attempts to collect payment on invoices for customers on subscriptions according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to attempt payment on an invoice out of the normal collection schedule or for some other reason, you can do so. """ return cast( Invoice, await self._request_async( "post", "/v1/invoices/{invoice}/pay".format( invoice=sanitize_id(invoice), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def send_invoice( self, invoice: str, params: "InvoiceService.SendInvoiceParams" = {}, options: RequestOptions = {}, ) -> Invoice: """ Stripe will automatically send invoices to customers according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email. Requests made in test-mode result in no emails being sent, despite sending an invoice.sent event. """ return cast( Invoice, self._request( "post", "/v1/invoices/{invoice}/send".format( invoice=sanitize_id(invoice), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def send_invoice_async( self, invoice: str, params: "InvoiceService.SendInvoiceParams" = {}, options: RequestOptions = {}, ) -> Invoice: """ Stripe will automatically send invoices to customers according to your [subscriptions settings](https://dashboard.stripe.com/account/billing/automatic). However, if you'd like to manually send an invoice to your customer out of the normal schedule, you can do so. When sending invoices that have already been paid, there will be no reference to the payment in the email. Requests made in test-mode result in no emails being sent, despite sending an invoice.sent event. """ return cast( Invoice, await self._request_async( "post", "/v1/invoices/{invoice}/send".format( invoice=sanitize_id(invoice), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def void_invoice( self, invoice: str, params: "InvoiceService.VoidInvoiceParams" = {}, options: RequestOptions = {}, ) -> Invoice: """ Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://stripe.com/docs/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or credit note](https://stripe.com/docs/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business. """ return cast( Invoice, self._request( "post", "/v1/invoices/{invoice}/void".format( invoice=sanitize_id(invoice), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def void_invoice_async( self, invoice: str, params: "InvoiceService.VoidInvoiceParams" = {}, options: RequestOptions = {}, ) -> Invoice: """ Mark a finalized invoice as void. This cannot be undone. Voiding an invoice is similar to [deletion](https://stripe.com/docs/api#delete_invoice), however it only applies to finalized invoices and maintains a papertrail where the invoice can still be found. Consult with local regulations to determine whether and how an invoice might be amended, canceled, or voided in the jurisdiction you're doing business in. You might need to [issue another invoice or credit note](https://stripe.com/docs/api#create_invoice) instead. Stripe recommends that you consult with your legal counsel for advice specific to your business. """ return cast( Invoice, await self._request_async( "post", "/v1/invoices/{invoice}/void".format( invoice=sanitize_id(invoice), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def create_preview( self, params: "InvoiceService.CreatePreviewParams" = {}, options: RequestOptions = {}, ) -> Invoice: """ At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice. Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request. Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions) """ return cast( Invoice, self._request( "post", "/v1/invoices/create_preview", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_preview_async( self, params: "InvoiceService.CreatePreviewParams" = {}, options: RequestOptions = {}, ) -> Invoice: """ At any time, you can preview the upcoming invoice for a customer. This will show you all the charges that are pending, including subscription renewal charges, invoice item charges, etc. It will also show you any discounts that are applicable to the invoice. Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the invoice has not yet been created. As such, the upcoming invoice will not show up in invoice listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the amount that your customer will be billed, you can add, remove, or update pending invoice items, or update the customer's discount. You can preview the effects of updating a subscription, including a preview of what proration will take place. To ensure that the actual proration is calculated exactly the same as the previewed proration, you should pass the subscription_details.proration_date parameter when doing the actual subscription update. The recommended way to get only the prorations being previewed is to consider only proration line items where period[start] is equal to the subscription_details.proration_date value passed in the request. Note: Currency conversion calculations use the latest exchange rates. Exchange rates may vary between the time of the preview and the time of the actual invoice creation. [Learn more](https://docs.stripe.com/currencies/conversions) """ return cast( Invoice, await self._request_async( "post", "/v1/invoices/create_preview", api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_invoice_upcoming_lines_service.py0000644000175100001770000017054214637354563023023 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._invoice_line_item import InvoiceLineItem from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class InvoiceUpcomingLinesService(StripeService): class ListParams(TypedDict): automatic_tax: NotRequired[ "InvoiceUpcomingLinesService.ListParamsAutomaticTax" ] """ Settings for automatic tax lookup for this invoice preview. """ coupon: NotRequired[str] """ The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. """ currency: NotRequired[str] """ The currency to preview this invoice in. Defaults to that of `customer` if not specified. """ customer: NotRequired[str] """ The identifier of the customer whose upcoming invoice you'd like to retrieve. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. """ customer_details: NotRequired[ "InvoiceUpcomingLinesService.ListParamsCustomerDetails" ] """ Details about the customer you want to invoice or overrides for an existing customer. If `automatic_tax` is enabled then one of `customer`, `customer_details`, `subscription`, or `schedule` must be set. """ discounts: NotRequired[ "Literal['']|List[InvoiceUpcomingLinesService.ListParamsDiscount]" ] """ The coupons to redeem into discounts for the invoice preview. If not specified, inherits the discount from the subscription or customer. This works for both coupons directly applied to an invoice and coupons applied to a subscription. Pass an empty string to avoid inheriting any discounts. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ invoice_items: NotRequired[ List["InvoiceUpcomingLinesService.ListParamsInvoiceItem"] ] """ List of invoice items to add or update in the upcoming invoice preview. """ issuer: NotRequired["InvoiceUpcomingLinesService.ListParamsIssuer"] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ on_behalf_of: NotRequired["Literal['']|str"] """ The account (if any) for which the funds of the invoice payment are intended. If set, the invoice will be presented with the branding and support information of the specified account. See the [Invoices with Connect](https://stripe.com/docs/billing/invoices/connect) documentation for details. """ preview_mode: NotRequired[Literal["next", "recurring"]] """ Customizes the types of values to include when calculating the invoice. Defaults to `next` if unspecified. """ schedule: NotRequired[str] """ The identifier of the schedule whose upcoming invoice you'd like to retrieve. Cannot be used with subscription or subscription fields. """ schedule_details: NotRequired[ "InvoiceUpcomingLinesService.ListParamsScheduleDetails" ] """ The schedule creation or modification params to apply as a preview. Cannot be used with `subscription` or `subscription_` prefixed fields. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ subscription: NotRequired[str] """ The identifier of the subscription for which you'd like to retrieve the upcoming invoice. If not provided, but a `subscription_details.items` is provided, you will preview creating a subscription with those items. If neither `subscription` nor `subscription_details.items` is provided, you will retrieve the next upcoming invoice from among the customer's subscriptions. """ subscription_billing_cycle_anchor: NotRequired[ "Literal['now', 'unchanged']|int" ] """ For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.billing_cycle_anchor` instead. """ subscription_cancel_at: NotRequired["Literal['']|int"] """ A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at` instead. """ subscription_cancel_at_period_end: NotRequired[bool] """ Boolean indicating whether this subscription should cancel at the end of the current period. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_at_period_end` instead. """ subscription_cancel_now: NotRequired[bool] """ This simulates the subscription being canceled or expired immediately. This field has been deprecated and will be removed in a future API version. Use `subscription_details.cancel_now` instead. """ subscription_default_tax_rates: NotRequired["Literal['']|List[str]"] """ If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. This field has been deprecated and will be removed in a future API version. Use `subscription_details.default_tax_rates` instead. """ subscription_details: NotRequired[ "InvoiceUpcomingLinesService.ListParamsSubscriptionDetails" ] """ The subscription creation or modification params to apply as a preview. Cannot be used with `schedule` or `schedule_details` fields. """ subscription_items: NotRequired[ List["InvoiceUpcomingLinesService.ListParamsSubscriptionItem"] ] """ A list of up to 20 subscription items, each with an attached price. This field has been deprecated and will be removed in a future API version. Use `subscription_details.items` instead. """ subscription_proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. This field has been deprecated and will be removed in a future API version. Use `subscription_details.proration_behavior` instead. """ subscription_proration_date: NotRequired[int] """ If previewing an update to a subscription, and doing proration, `subscription_proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_items`, or `subscription_trial_end` are required. Also, `subscription_proration_behavior` cannot be set to 'none'. This field has been deprecated and will be removed in a future API version. Use `subscription_details.proration_date` instead. """ subscription_resume_at: NotRequired[Literal["now"]] """ For paused subscriptions, setting `subscription_resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. This field has been deprecated and will be removed in a future API version. Use `subscription_details.resume_at` instead. """ subscription_start_date: NotRequired[int] """ Date a subscription is intended to start (can be future or past). This field has been deprecated and will be removed in a future API version. Use `subscription_details.start_date` instead. """ subscription_trial_end: NotRequired["Literal['now']|int"] """ If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_items` or `subscription` is required. This field has been deprecated and will be removed in a future API version. Use `subscription_details.trial_end` instead. """ subscription_trial_from_plan: NotRequired[bool] """ Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `subscription_trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `subscription_trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. """ class ListParamsAutomaticTax(TypedDict): enabled: bool """ Whether Stripe automatically computes tax on this invoice. Note that incompatible invoice items (invoice items with manually specified [tax rates](https://stripe.com/docs/api/tax_rates), negative amounts, or `tax_behavior=unspecified`) cannot be added to automatic tax invoices. """ liability: NotRequired[ "InvoiceUpcomingLinesService.ListParamsAutomaticTaxLiability" ] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ class ListParamsAutomaticTaxLiability(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class ListParamsCustomerDetails(TypedDict): address: NotRequired[ "Literal['']|InvoiceUpcomingLinesService.ListParamsCustomerDetailsAddress" ] """ The customer's address. """ shipping: NotRequired[ "Literal['']|InvoiceUpcomingLinesService.ListParamsCustomerDetailsShipping" ] """ The customer's shipping information. Appears on invoices emailed to this customer. """ tax: NotRequired[ "InvoiceUpcomingLinesService.ListParamsCustomerDetailsTax" ] """ Tax details about the customer. """ tax_exempt: NotRequired[ "Literal['']|Literal['exempt', 'none', 'reverse']" ] """ The customer's tax exemption. One of `none`, `exempt`, or `reverse`. """ tax_ids: NotRequired[ List["InvoiceUpcomingLinesService.ListParamsCustomerDetailsTaxId"] ] """ The customer's tax IDs. """ class ListParamsCustomerDetailsAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class ListParamsCustomerDetailsShipping(TypedDict): address: "InvoiceUpcomingLinesService.ListParamsCustomerDetailsShippingAddress" """ Customer shipping address. """ name: str """ Customer name. """ phone: NotRequired[str] """ Customer phone (including extension). """ class ListParamsCustomerDetailsShippingAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class ListParamsCustomerDetailsTax(TypedDict): ip_address: NotRequired["Literal['']|str"] """ A recent IP address of the customer used for tax reporting and tax location inference. Stripe recommends updating the IP address when a new PaymentMethod is attached or the address field on the customer is updated. We recommend against updating this field more frequently since it could result in unexpected tax location/reporting outcomes. """ class ListParamsCustomerDetailsTaxId(TypedDict): type: Literal[ "ad_nrt", "ae_trn", "ar_cuit", "au_abn", "au_arn", "bg_uic", "bh_vat", "bo_tin", "br_cnpj", "br_cpf", "ca_bn", "ca_gst_hst", "ca_pst_bc", "ca_pst_mb", "ca_pst_sk", "ca_qst", "ch_uid", "ch_vat", "cl_tin", "cn_tin", "co_nit", "cr_tin", "de_stn", "do_rcn", "ec_ruc", "eg_tin", "es_cif", "eu_oss_vat", "eu_vat", "gb_vat", "ge_vat", "hk_br", "hu_tin", "id_npwp", "il_vat", "in_gst", "is_vat", "jp_cn", "jp_rn", "jp_trn", "ke_pin", "kr_brn", "kz_bin", "li_uid", "mx_rfc", "my_frp", "my_itn", "my_sst", "ng_tin", "no_vat", "no_voec", "nz_gst", "om_vat", "pe_ruc", "ph_tin", "ro_tin", "rs_pib", "ru_inn", "ru_kpp", "sa_vat", "sg_gst", "sg_uen", "si_tin", "sv_nit", "th_vat", "tr_tin", "tw_vat", "ua_vat", "us_ein", "uy_ruc", "ve_rif", "vn_tin", "za_vat", ] """ Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ Value of the tax ID. """ class ListParamsDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class ListParamsInvoiceItem(TypedDict): amount: NotRequired[int] """ The integer amount in cents (or local equivalent) of previewed invoice item. """ currency: NotRequired[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). Only applicable to new invoice items. """ description: NotRequired[str] """ An arbitrary string which you can attach to the invoice item. The description is displayed in the invoice for easy tracking. """ discountable: NotRequired[bool] """ Explicitly controls whether discounts apply to this invoice item. Defaults to true, except for negative invoice items. """ discounts: NotRequired[ "Literal['']|List[InvoiceUpcomingLinesService.ListParamsInvoiceItemDiscount]" ] """ The coupons to redeem into discounts for the invoice item in the preview. """ invoiceitem: NotRequired[str] """ The ID of the invoice item to update in preview. If not specified, a new invoice item will be added to the preview of the upcoming invoice. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ period: NotRequired[ "InvoiceUpcomingLinesService.ListParamsInvoiceItemPeriod" ] """ The period associated with this invoice item. When set to different values, the period will be rendered on the invoice. If you have [Stripe Revenue Recognition](https://stripe.com/docs/revenue-recognition) enabled, the period will be used to recognize and defer revenue. See the [Revenue Recognition documentation](https://stripe.com/docs/revenue-recognition/methodology/subscriptions-and-invoicing) for details. """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired[ "InvoiceUpcomingLinesService.ListParamsInvoiceItemPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ Non-negative integer. The quantity of units for the invoice item. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ tax_code: NotRequired["Literal['']|str"] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates that apply to the item. When set, any `default_tax_rates` do not apply to this item. """ unit_amount: NotRequired[int] """ The integer unit amount in cents (or local equivalent) of the charge to be applied to the upcoming invoice. This unit_amount will be multiplied by the quantity to get the full amount. If you want to apply a credit to the customer's account, pass a negative unit_amount. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class ListParamsInvoiceItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class ListParamsInvoiceItemPeriod(TypedDict): end: int """ The end of the period, which must be greater than or equal to the start. This value is inclusive. """ start: int """ The start of the period. This value is inclusive. """ class ListParamsInvoiceItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class ListParamsIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class ListParamsScheduleDetails(TypedDict): end_behavior: NotRequired[Literal["cancel", "release"]] """ Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription. """ phases: NotRequired[ List["InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhase"] ] """ List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ In cases where the `schedule_details` params update the currently active phase, specifies if and how to prorate at the time of the request. """ class ListParamsScheduleDetailsPhase(TypedDict): add_invoice_items: NotRequired[ List[ "InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseAddInvoiceItem" ] ] """ A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items. """ application_fee_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). """ automatic_tax: NotRequired[ "InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseAutomaticTax" ] """ Automatic tax settings for this phase. """ billing_cycle_anchor: NotRequired[Literal["automatic", "phase_start"]] """ Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ billing_thresholds: NotRequired[ "Literal['']|InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds. """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. """ coupon: NotRequired[str] """ The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. """ currency: NotRequired[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). """ default_payment_method: NotRequired[str] """ ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. """ default_tax_rates: NotRequired["Literal['']|List[str]"] """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase. """ description: NotRequired["Literal['']|str"] """ Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ discounts: NotRequired[ "Literal['']|List[InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseDiscount]" ] """ The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription's customer. Pass an empty string to avoid inheriting any discounts. """ end_date: NotRequired["int|Literal['now']"] """ The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set. """ invoice_settings: NotRequired[ "InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseInvoiceSettings" ] """ All invoices will be billed using the specified settings. """ items: List[ "InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseItem" ] """ List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. """ iterations: NotRequired[int] """ Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. """ on_behalf_of: NotRequired[str] """ The account on behalf of which to charge, for each of the associated subscription's invoices. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase. """ start_date: NotRequired["int|Literal['now']"] """ The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase. """ transfer_data: NotRequired[ "InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseTransferData" ] """ The data with which to automatically create a Transfer for each of the associated subscription's invoices. """ trial: NotRequired[bool] """ If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. """ trial_end: NotRequired["int|Literal['now']"] """ Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial` """ class ListParamsScheduleDetailsPhaseAddInvoiceItem(TypedDict): discounts: NotRequired[ List[ "InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseAddInvoiceItemDiscount" ] ] """ The coupons to redeem into discounts for the item. """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired[ "InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseAddInvoiceItemPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ Quantity for this item. Defaults to 1. """ tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. """ class ListParamsScheduleDetailsPhaseAddInvoiceItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class ListParamsScheduleDetailsPhaseAddInvoiceItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class ListParamsScheduleDetailsPhaseAutomaticTax(TypedDict): enabled: bool """ Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. """ liability: NotRequired[ "InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseAutomaticTaxLiability" ] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ class ListParamsScheduleDetailsPhaseAutomaticTaxLiability(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class ListParamsScheduleDetailsPhaseBillingThresholds(TypedDict): amount_gte: NotRequired[int] """ Monetary threshold that triggers the subscription to advance to a new billing period """ reset_billing_cycle_anchor: NotRequired[bool] """ Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. """ class ListParamsScheduleDetailsPhaseDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class ListParamsScheduleDetailsPhaseInvoiceSettings(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule. """ days_until_due: NotRequired[int] """ Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. """ issuer: NotRequired[ "InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseInvoiceSettingsIssuer" ] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ class ListParamsScheduleDetailsPhaseInvoiceSettingsIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class ListParamsScheduleDetailsPhaseItem(TypedDict): billing_thresholds: NotRequired[ "Literal['']|InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseItemBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ discounts: NotRequired[ "Literal['']|List[InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseItemDiscount]" ] """ The coupons to redeem into discounts for the subscription item. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`. """ plan: NotRequired[str] """ The plan ID to subscribe to. You may specify the same ID in `plan` and `price`. """ price: NotRequired[str] """ The ID of the price object. """ price_data: NotRequired[ "InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseItemPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ quantity: NotRequired[int] """ Quantity for the given price. Can be set only if the price's `usage_type` is `licensed` and not `metered`. """ tax_rates: NotRequired["Literal['']|List[str]"] """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ class ListParamsScheduleDetailsPhaseItemBillingThresholds(TypedDict): usage_gte: int """ Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ class ListParamsScheduleDetailsPhaseItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class ListParamsScheduleDetailsPhaseItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ recurring: "InvoiceUpcomingLinesService.ListParamsScheduleDetailsPhaseItemPriceDataRecurring" """ The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class ListParamsScheduleDetailsPhaseItemPriceDataRecurring(TypedDict): interval: Literal["day", "month", "week", "year"] """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class ListParamsScheduleDetailsPhaseTransferData(TypedDict): amount_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. """ destination: str """ ID of an existing, connected Stripe account. """ class ListParamsSubscriptionDetails(TypedDict): billing_cycle_anchor: NotRequired["Literal['now', 'unchanged']|int"] """ For new subscriptions, a future timestamp to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). This is used to determine the date of the first full invoice, and, for plans with `month` or `year` intervals, the day of the month for subsequent invoices. For existing subscriptions, the value can only be set to `now` or `unchanged`. """ cancel_at: NotRequired["Literal['']|int"] """ A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. """ cancel_at_period_end: NotRequired[bool] """ Boolean indicating whether this subscription should cancel at the end of the current period. """ cancel_now: NotRequired[bool] """ This simulates the subscription being canceled or expired immediately. """ default_tax_rates: NotRequired["Literal['']|List[str]"] """ If provided, the invoice returned will preview updating or creating a subscription with these default tax rates. The default tax rates will apply to any line item that does not have `tax_rates` set. """ items: NotRequired[ List[ "InvoiceUpcomingLinesService.ListParamsSubscriptionDetailsItem" ] ] """ A list of up to 20 subscription items, each with an attached price. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ proration_date: NotRequired[int] """ If previewing an update to a subscription, and doing proration, `subscription_details.proration_date` forces the proration to be calculated as though the update was done at the specified time. The time given must be within the current subscription period and within the current phase of the schedule backing this subscription, if the schedule exists. If set, `subscription`, and one of `subscription_details.items`, or `subscription_details.trial_end` are required. Also, `subscription_details.proration_behavior` cannot be set to 'none'. """ resume_at: NotRequired[Literal["now"]] """ For paused subscriptions, setting `subscription_details.resume_at` to `now` will preview the invoice that will be generated if the subscription is resumed. """ start_date: NotRequired[int] """ Date a subscription is intended to start (can be future or past). """ trial_end: NotRequired["Literal['now']|int"] """ If provided, the invoice returned will preview updating or creating a subscription with that trial end. If set, one of `subscription_details.items` or `subscription` is required. """ class ListParamsSubscriptionDetailsItem(TypedDict): billing_thresholds: NotRequired[ "Literal['']|InvoiceUpcomingLinesService.ListParamsSubscriptionDetailsItemBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ clear_usage: NotRequired[bool] """ Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. """ deleted: NotRequired[bool] """ A flag that, if set to `true`, will delete the specified item. """ discounts: NotRequired[ "Literal['']|List[InvoiceUpcomingLinesService.ListParamsSubscriptionDetailsItemDiscount]" ] """ The coupons to redeem into discounts for the subscription item. """ id: NotRequired[str] """ Subscription item to update. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ plan: NotRequired[str] """ Plan ID for this item, as a string. """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ price_data: NotRequired[ "InvoiceUpcomingLinesService.ListParamsSubscriptionDetailsItemPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ Quantity for this item. """ tax_rates: NotRequired["Literal['']|List[str]"] """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ class ListParamsSubscriptionDetailsItemBillingThresholds(TypedDict): usage_gte: int """ Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ class ListParamsSubscriptionDetailsItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class ListParamsSubscriptionDetailsItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ recurring: "InvoiceUpcomingLinesService.ListParamsSubscriptionDetailsItemPriceDataRecurring" """ The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class ListParamsSubscriptionDetailsItemPriceDataRecurring(TypedDict): interval: Literal["day", "month", "week", "year"] """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class ListParamsSubscriptionItem(TypedDict): billing_thresholds: NotRequired[ "Literal['']|InvoiceUpcomingLinesService.ListParamsSubscriptionItemBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ clear_usage: NotRequired[bool] """ Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. """ deleted: NotRequired[bool] """ A flag that, if set to `true`, will delete the specified item. """ discounts: NotRequired[ "Literal['']|List[InvoiceUpcomingLinesService.ListParamsSubscriptionItemDiscount]" ] """ The coupons to redeem into discounts for the subscription item. """ id: NotRequired[str] """ Subscription item to update. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ plan: NotRequired[str] """ Plan ID for this item, as a string. """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ price_data: NotRequired[ "InvoiceUpcomingLinesService.ListParamsSubscriptionItemPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ Quantity for this item. """ tax_rates: NotRequired["Literal['']|List[str]"] """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ class ListParamsSubscriptionItemBillingThresholds(TypedDict): usage_gte: int """ Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ class ListParamsSubscriptionItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class ListParamsSubscriptionItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ recurring: "InvoiceUpcomingLinesService.ListParamsSubscriptionItemPriceDataRecurring" """ The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class ListParamsSubscriptionItemPriceDataRecurring(TypedDict): interval: Literal["day", "month", "week", "year"] """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ def list( self, params: "InvoiceUpcomingLinesService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[InvoiceLineItem]: """ When retrieving an upcoming invoice, you'll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ return cast( ListObject[InvoiceLineItem], self._request( "get", "/v1/invoices/upcoming/lines", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "InvoiceUpcomingLinesService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[InvoiceLineItem]: """ When retrieving an upcoming invoice, you'll get a lines property containing the total count of line items and the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ return cast( ListObject[InvoiceLineItem], await self._request_async( "get", "/v1/invoices/upcoming/lines", api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_issuing_service.py0000644000175100001770000000241614637354563017747 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_service import StripeService from stripe.issuing._authorization_service import AuthorizationService from stripe.issuing._card_service import CardService from stripe.issuing._cardholder_service import CardholderService from stripe.issuing._dispute_service import DisputeService from stripe.issuing._personalization_design_service import ( PersonalizationDesignService, ) from stripe.issuing._physical_bundle_service import PhysicalBundleService from stripe.issuing._token_service import TokenService from stripe.issuing._transaction_service import TransactionService class IssuingService(StripeService): def __init__(self, requestor): super().__init__(requestor) self.authorizations = AuthorizationService(self._requestor) self.cards = CardService(self._requestor) self.cardholders = CardholderService(self._requestor) self.disputes = DisputeService(self._requestor) self.personalization_designs = PersonalizationDesignService( self._requestor, ) self.physical_bundles = PhysicalBundleService(self._requestor) self.tokens = TokenService(self._requestor) self.transactions = TransactionService(self._requestor) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_line_item.py0000644000175100001770000000753314637354563016520 0ustar00runnerdocker# -*- 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, TYPE_CHECKING if TYPE_CHECKING: from stripe._discount import Discount as DiscountResource from stripe._price import Price from stripe._tax_rate import TaxRate class LineItem(StripeObject): """ A line item. """ OBJECT_NAME: ClassVar[Literal["item"]] = "item" class Discount(StripeObject): amount: int """ The amount discounted. """ discount: "DiscountResource" """ A discount represents the actual application of a [coupon](https://stripe.com/docs/api#coupons) or [promotion code](https://stripe.com/docs/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://stripe.com/docs/billing/subscriptions/discounts) """ class Tax(StripeObject): amount: int """ Amount of tax applied for this rate. """ rate: "TaxRate" """ Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates) """ taxability_reason: Optional[ Literal[ "customer_exempt", "not_collecting", "not_subject_to_tax", "not_supported", "portion_product_exempt", "portion_reduced_rated", "portion_standard_rated", "product_exempt", "product_exempt_holiday", "proportionally_rated", "reduced_rated", "reverse_charge", "standard_rated", "taxable_basis_reduced", "zero_rated", ] ] """ The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. """ taxable_amount: Optional[int] """ The amount on which tax is calculated, in cents (or local equivalent). """ amount_discount: int """ Total discount amount applied. If no discounts were applied, defaults to 0. """ amount_subtotal: int """ Total before any discounts or taxes are applied. """ amount_tax: int """ Total tax amount applied. If no tax was applied, defaults to 0. """ amount_total: int """ Total after discounts and taxes. """ 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: str """ An arbitrary string attached to the object. Often useful for displaying to users. Defaults to product name. """ discounts: Optional[List[Discount]] """ The discounts applied to the line item. """ id: str """ Unique identifier for the object. """ object: Literal["item"] """ String representing the object's type. Objects of the same type share the same value. """ price: Optional["Price"] """ The price used to generate the line item. """ quantity: Optional[int] """ The quantity of products being purchased. """ taxes: Optional[List[Tax]] """ The taxes applied to the line item. """ _inner_class_types = {"discounts": Discount, "taxes": Tax} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_list_object.py0000644000175100001770000001771014637354563017052 0ustar00runnerdocker# pyright: strict, reportUnnecessaryTypeIgnoreComment=false # reportUnnecessaryTypeIgnoreComment is set to false because some type ignores are required in some # python versions but not the others from typing_extensions import Self, Unpack from typing import ( Any, AsyncIterator, Iterator, List, Generic, TypeVar, cast, Mapping, ) from stripe._api_requestor import ( _APIRequestor, # pyright: ignore[reportPrivateUsage] ) from stripe._any_iterator import AnyIterator from stripe._stripe_object import StripeObject from stripe._request_options import RequestOptions, extract_options_from_dict from urllib.parse import quote_plus T = TypeVar("T", bound=StripeObject) class ListObject(StripeObject, Generic[T]): OBJECT_NAME = "list" data: List[T] has_more: bool url: str def _get_url_for_list(self) -> str: url = self.get("url") if not isinstance(url, str): raise ValueError( 'Cannot call .list on a list object without a string "url" property' ) return url def list(self, **params: Mapping[str, Any]) -> Self: return cast( Self, self._request( "get", self._get_url_for_list(), params=params, base_address="api", api_mode="V1", ), ) async def list_async(self, **params: Mapping[str, Any]) -> Self: return cast( Self, await self._request_async( "get", self._get_url_for_list(), params=params, base_address="api", api_mode="V1", ), ) def create(self, **params: Mapping[str, Any]) -> T: url = self.get("url") if not isinstance(url, str): raise ValueError( 'Cannot call .create on a list object for the collection of an object without a string "url" property' ) return cast( T, self._request( "post", url, params=params, base_address="api", api_mode="V1", ), ) def retrieve(self, id: str, **params: Mapping[str, Any]): url = self.get("url") if not isinstance(url, str): raise ValueError( 'Cannot call .retrieve on a list object for the collection of an object without a string "url" property' ) url = "%s/%s" % (self.get("url"), quote_plus(id)) return cast( T, self._request( "get", url, params=params, base_address="api", api_mode="V1", ), ) def __getitem__(self, k: str) -> T: if isinstance(k, str): # pyright: ignore return super(ListObject, self).__getitem__(k) else: raise KeyError( "You tried to access the %s index, but ListObject types only " "support string keys. (HINT: List calls return an object with " "a 'data' (which is the data array). You likely want to call " ".data[%s])" % (repr(k), repr(k)) ) # Pyright doesn't like this because ListObject inherits from StripeObject inherits from Dict[str, Any] # and so it wants the type of __iter__ to agree with __iter__ from Dict[str, Any] # But we are iterating through "data", which is a List[T]. def __iter__( # pyright: ignore self, ) -> Iterator[T]: return getattr(self, "data", []).__iter__() def __len__(self) -> int: return getattr(self, "data", []).__len__() def __reversed__(self) -> Iterator[T]: # pyright: ignore (see above) return getattr(self, "data", []).__reversed__() def auto_paging_iter(self) -> AnyIterator[T]: return AnyIterator( self._auto_paging_iter(), self._auto_paging_iter_async(), ) def _auto_paging_iter(self) -> Iterator[T]: page = self while True: if ( "ending_before" in self._retrieve_params and "starting_after" not in self._retrieve_params ): for item in reversed(page): yield item page = page.previous_page() else: for item in page: yield item page = page.next_page() if page.is_empty: break async def _auto_paging_iter_async(self) -> AsyncIterator[T]: page = self while True: if ( "ending_before" in self._retrieve_params and "starting_after" not in self._retrieve_params ): for item in reversed(page): yield item page = await page.previous_page_async() else: for item in page: yield item page = await page.next_page_async() if page.is_empty: break @classmethod def _empty_list( cls, **params: Unpack[RequestOptions], ) -> Self: return cls._construct_from( values={"data": []}, last_response=None, requestor=_APIRequestor._global_with_options( # pyright: ignore[reportPrivateUsage] **params, ), api_mode="V1", ) @property def is_empty(self) -> bool: return not self.data def _get_filters_for_next_page( self, params: RequestOptions ) -> Mapping[str, Any]: last_id = getattr(self.data[-1], "id") if not last_id: raise ValueError( "Unexpected: element in .data of list object had no id" ) params_with_filters = dict(self._retrieve_params) params_with_filters.update({"starting_after": last_id}) params_with_filters.update(params) return params_with_filters def next_page(self, **params: Unpack[RequestOptions]) -> Self: if not self.has_more: request_options, _ = extract_options_from_dict(params) return self._empty_list( **request_options, ) return self.list( **self._get_filters_for_next_page(params), ) async def next_page_async(self, **params: Unpack[RequestOptions]) -> Self: if not self.has_more: request_options, _ = extract_options_from_dict(params) return self._empty_list( **request_options, ) return await self.list_async(**self._get_filters_for_next_page(params)) def _get_filters_for_previous_page( self, params: RequestOptions ) -> Mapping[str, Any]: first_id = getattr(self.data[0], "id") if not first_id: raise ValueError( "Unexpected: element in .data of list object had no id" ) params_with_filters = dict(self._retrieve_params) params_with_filters.update({"ending_before": first_id}) params_with_filters.update(params) return params_with_filters def previous_page(self, **params: Unpack[RequestOptions]) -> Self: if not self.has_more: request_options, _ = extract_options_from_dict(params) return self._empty_list( **request_options, ) result = self.list( **self._get_filters_for_previous_page(params), ) return result async def previous_page_async( self, **params: Unpack[RequestOptions] ) -> Self: if not self.has_more: request_options, _ = extract_options_from_dict(params) return self._empty_list( **request_options, ) result = await self.list_async( **self._get_filters_for_previous_page(params) ) return result ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_listable_api_resource.py0000644000175100001770000000167514637354563021113 0ustar00runnerdockerfrom stripe._api_resource import APIResource from stripe._list_object import ListObject from stripe._stripe_object import StripeObject from typing import TypeVar T = TypeVar("T", bound=StripeObject) # TODO(major): 1704 - remove this class and all internal usages. `.list` is already inlined into the resource classes. # Although we should inline .auto_paging_iter into the resource classes as well. class ListableAPIResource(APIResource[T]): @classmethod def auto_paging_iter(cls, **params): return cls.list(**params).auto_paging_iter() @classmethod def list(cls, **params) -> ListObject[T]: result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__,) ) return result ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_login_link.py0000644000175100001770000000162314637354563016672 0ustar00runnerdocker# -*- 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 LoginLink(StripeObject): """ Login Links are single-use URLs for a connected account to access the Express Dashboard. The connected account's [account.controller.stripe_dashboard.type](https://stripe.com/api/accounts/object#account_object-controller-stripe_dashboard-type) must be `express` to have access to the Express Dashboard. """ OBJECT_NAME: ClassVar[Literal["login_link"]] = "login_link" created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ object: Literal["login_link"] """ String representing the object's type. Objects of the same type share the same value. """ url: str """ The URL for the login link. """ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_mandate.py0000644000175100001770000001771214637354563016164 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._api_resource import APIResource from stripe._expandable_field import ExpandableField from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from typing import ClassVar, List, Optional from typing_extensions import Literal, NotRequired, Unpack, TYPE_CHECKING if TYPE_CHECKING: from stripe._payment_method import PaymentMethod class Mandate(APIResource["Mandate"]): """ A Mandate is a record of the permission that your customer gives you to debit their payment method. """ OBJECT_NAME: ClassVar[Literal["mandate"]] = "mandate" class CustomerAcceptance(StripeObject): class Offline(StripeObject): pass class Online(StripeObject): ip_address: Optional[str] """ The customer accepts the mandate from this IP address. """ user_agent: Optional[str] """ The customer accepts the mandate using the user agent of the browser. """ accepted_at: Optional[int] """ The time that the customer accepts the mandate. """ offline: Optional[Offline] online: Optional[Online] type: Literal["offline", "online"] """ The mandate includes the type of customer acceptance information, such as: `online` or `offline`. """ _inner_class_types = {"offline": Offline, "online": Online} class MultiUse(StripeObject): pass class PaymentMethodDetails(StripeObject): class AcssDebit(StripeObject): default_for: Optional[List[Literal["invoice", "subscription"]]] """ List of Stripe products where this mandate can be selected automatically. """ interval_description: Optional[str] """ Description of the interval. Only required if the 'payment_schedule' parameter is 'interval' or 'combined'. """ payment_schedule: Literal["combined", "interval", "sporadic"] """ Payment schedule for the mandate. """ transaction_type: Literal["business", "personal"] """ Transaction type of the mandate. """ class AmazonPay(StripeObject): pass class AuBecsDebit(StripeObject): url: str """ The URL of the mandate. This URL generally contains sensitive information about the customer and should be shared with them exclusively. """ class BacsDebit(StripeObject): network_status: Literal[ "accepted", "pending", "refused", "revoked" ] """ The status of the mandate on the Bacs network. Can be one of `pending`, `revoked`, `refused`, or `accepted`. """ reference: str """ The unique reference identifying the mandate on the Bacs network. """ revocation_reason: Optional[ Literal[ "account_closed", "bank_account_restricted", "bank_ownership_changed", "could_not_process", "debit_not_authorized", ] ] """ When the mandate is revoked on the Bacs network this field displays the reason for the revocation. """ url: str """ The URL that will contain the mandate that the customer has signed. """ class Card(StripeObject): pass class Cashapp(StripeObject): pass class Link(StripeObject): pass class Paypal(StripeObject): billing_agreement_id: Optional[str] """ The PayPal Billing Agreement ID (BAID). This is an ID generated by PayPal which represents the mandate between the merchant and the customer. """ payer_id: Optional[str] """ PayPal account PayerID. This identifier uniquely identifies the PayPal customer. """ class RevolutPay(StripeObject): pass class SepaDebit(StripeObject): reference: str """ The unique reference of the mandate. """ url: str """ The URL of the mandate. This URL generally contains sensitive information about the customer and should be shared with them exclusively. """ class UsBankAccount(StripeObject): collection_method: Optional[Literal["paper"]] """ Mandate collection method """ acss_debit: Optional[AcssDebit] amazon_pay: Optional[AmazonPay] au_becs_debit: Optional[AuBecsDebit] bacs_debit: Optional[BacsDebit] card: Optional[Card] cashapp: Optional[Cashapp] link: Optional[Link] paypal: Optional[Paypal] revolut_pay: Optional[RevolutPay] sepa_debit: Optional[SepaDebit] type: str """ This mandate corresponds with a specific payment method type. The `payment_method_details` includes an additional hash with the same name and contains mandate information that's specific to that payment method. """ us_bank_account: Optional[UsBankAccount] _inner_class_types = { "acss_debit": AcssDebit, "amazon_pay": AmazonPay, "au_becs_debit": AuBecsDebit, "bacs_debit": BacsDebit, "card": Card, "cashapp": Cashapp, "link": Link, "paypal": Paypal, "revolut_pay": RevolutPay, "sepa_debit": SepaDebit, "us_bank_account": UsBankAccount, } class SingleUse(StripeObject): amount: int """ The amount of the payment on a single use mandate. """ currency: str """ The currency of the payment on a single use mandate. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ customer_acceptance: CustomerAcceptance id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ multi_use: Optional[MultiUse] object: Literal["mandate"] """ String representing the object's type. Objects of the same type share the same value. """ on_behalf_of: Optional[str] """ The account (if any) that the mandate is intended for. """ payment_method: ExpandableField["PaymentMethod"] """ ID of the payment method associated with this mandate. """ payment_method_details: PaymentMethodDetails single_use: Optional[SingleUse] status: Literal["active", "inactive", "pending"] """ The mandate status indicates whether or not you can use it to initiate a payment. """ type: Literal["multi_use", "single_use"] """ The type of the mandate. """ @classmethod def retrieve( cls, id: str, **params: Unpack["Mandate.RetrieveParams"] ) -> "Mandate": """ Retrieves a Mandate object. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["Mandate.RetrieveParams"] ) -> "Mandate": """ Retrieves a Mandate object. """ instance = cls(id, **params) await instance.refresh_async() return instance _inner_class_types = { "customer_acceptance": CustomerAcceptance, "multi_use": MultiUse, "payment_method_details": PaymentMethodDetails, "single_use": SingleUse, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_mandate_service.py0000644000175100001770000000316514637354563017701 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._mandate import Mandate from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict class MandateService(StripeService): class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def retrieve( self, mandate: str, params: "MandateService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Mandate: """ Retrieves a Mandate object. """ return cast( Mandate, self._request( "get", "/v1/mandates/{mandate}".format(mandate=sanitize_id(mandate)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, mandate: str, params: "MandateService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Mandate: """ Retrieves a Mandate object. """ return cast( Mandate, await self._request_async( "get", "/v1/mandates/{mandate}".format(mandate=sanitize_id(mandate)), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_multipart_data_generator.py0000644000175100001770000000522014637354563021622 0ustar00runnerdockerimport random import io from stripe._encode import _api_encode class MultipartDataGenerator(object): data: io.BytesIO line_break: str boundary: int chunk_size: int def __init__(self, chunk_size: int = 1028): self.data = io.BytesIO() self.line_break = "\r\n" self.boundary = self._initialize_boundary() self.chunk_size = chunk_size def add_params(self, params): # Flatten parameters first params = dict(_api_encode(params)) for key, value in params.items(): if value is None: continue self._write(self.param_header()) self._write(self.line_break) if hasattr(value, "read"): filename = "blob" if hasattr(value, "name"): # Convert the filename to string, just in case it's not # already one. E.g. `tempfile.TemporaryFile` has a `name` # attribute but it's an `int`. filename = str(value.name) self._write('Content-Disposition: form-data; name="') self._write(key) self._write('"; filename="') self._write(filename) self._write('"') self._write(self.line_break) self._write("Content-Type: application/octet-stream") self._write(self.line_break) self._write(self.line_break) self._write_file(value) else: self._write('Content-Disposition: form-data; name="') self._write(key) self._write('"') self._write(self.line_break) self._write(self.line_break) self._write(str(value)) self._write(self.line_break) def param_header(self): return "--%s" % self.boundary def get_post_data(self): self._write("--%s--" % (self.boundary,)) self._write(self.line_break) return self.data.getvalue() def _write(self, value): if isinstance(value, bytes): array = bytearray(value) elif isinstance(value, str): array = bytearray(value, encoding="utf-8") else: raise TypeError( "unexpected type: {value_type}".format(value_type=type(value)) ) self.data.write(array) def _write_file(self, f): while True: file_contents = f.read(self.chunk_size) if not file_contents: break self._write(file_contents) def _initialize_boundary(self): return random.randint(0, 2**63) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_nested_resource_class_methods.py0000644000175100001770000000777414637354563022663 0ustar00runnerdockerfrom typing import List, Optional from urllib.parse import quote_plus from stripe._api_resource import APIResource # TODO(major): 1704. Remove this. It is no longer used except for "nested_resource_url" and "nested_resource_request", # which are unnecessary and deprecated and should also be removed. def nested_resource_class_methods( resource: str, path: Optional[str] = None, operations: Optional[List[str]] = None, resource_plural: Optional[str] = None, ): if resource_plural is None: resource_plural = "%ss" % resource if path is None: path = resource_plural def wrapper(cls): def nested_resource_url(cls, id, nested_id=None): url = "%s/%s/%s" % ( cls.class_url(), quote_plus(id), quote_plus(path), ) if nested_id is not None: url += "/%s" % quote_plus(nested_id) return url resource_url_method = "%ss_url" % resource setattr(cls, resource_url_method, classmethod(nested_resource_url)) def nested_resource_request(cls, method, url, **params): return APIResource._static_request( method, url, params=params, ) resource_request_method = "%ss_request" % resource setattr( cls, resource_request_method, classmethod(nested_resource_request) ) if operations is None: return cls for operation in operations: if operation == "create": def create_nested_resource(cls, id, **params): url = getattr(cls, resource_url_method)(id) return getattr(cls, resource_request_method)( "post", url, **params ) create_method = "create_%s" % resource setattr( cls, create_method, classmethod(create_nested_resource) ) elif operation == "retrieve": def retrieve_nested_resource(cls, id, nested_id, **params): url = getattr(cls, resource_url_method)(id, nested_id) return getattr(cls, resource_request_method)( "get", url, **params ) retrieve_method = "retrieve_%s" % resource setattr( cls, retrieve_method, classmethod(retrieve_nested_resource) ) elif operation == "update": def modify_nested_resource(cls, id, nested_id, **params): url = getattr(cls, resource_url_method)(id, nested_id) return getattr(cls, resource_request_method)( "post", url, **params ) modify_method = "modify_%s" % resource setattr( cls, modify_method, classmethod(modify_nested_resource) ) elif operation == "delete": def delete_nested_resource(cls, id, nested_id, **params): url = getattr(cls, resource_url_method)(id, nested_id) return getattr(cls, resource_request_method)( "delete", url, **params ) delete_method = "delete_%s" % resource setattr( cls, delete_method, classmethod(delete_nested_resource) ) elif operation == "list": def list_nested_resources(cls, id, **params): url = getattr(cls, resource_url_method)(id) return getattr(cls, resource_request_method)( "get", url, **params ) list_method = "list_%s" % resource_plural setattr(cls, list_method, classmethod(list_nested_resources)) else: raise ValueError("Unknown operation: %s" % operation) return cls return wrapper ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_oauth.py0000644000175100001770000003565714637354563015703 0ustar00runnerdocker# Used for global variables from stripe import connect_api_base from stripe._error import AuthenticationError from stripe._api_requestor import _APIRequestor from stripe._encode import _api_encode from urllib.parse import urlencode from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from typing import List, cast, Optional from typing_extensions import Literal, NotRequired, TypedDict, Unpack class OAuth(object): class OAuthToken(StripeObject): access_token: Optional[str] """ The access token you can use to make requests on behalf of this Stripe account. Use it as you would any Stripe secret API key. This key does not expire, but may be revoked by the user at any time (you'll get a account.application.deauthorized webhook event when this happens). """ scope: Optional[str] """ The scope granted to the access token, depending on the scope of the authorization code and scope parameter. """ livemode: Optional[bool] """ The live mode indicator for the token. If true, the access_token can be used as a live secret key. If false, the access_token can be used as a test secret key. Depends on the mode of the secret API key used to make the request. """ token_type: Optional[Literal["bearer"]] """ Will always have a value of bearer. """ refresh_token: Optional[str] """ Can be used to get a new access token of an equal or lesser scope, or of a different live mode (where applicable). """ stripe_user_id: Optional[str] """ The unique id of the account you have been granted access to, as a string. """ stripe_publishable_key: Optional[str] """ A publishable key that can be used with this account. Matches the mode—live or test—of the token. """ class OAuthDeauthorization(StripeObject): stripe_user_id: str """ The unique id of the account you have revoked access to, as a string. This is the same as the stripe_user_id you passed in. If this is returned, the revocation was successful. """ class OAuthAuthorizeUrlParams(TypedDict): client_id: NotRequired[str] """ The unique identifier provided to your application, found in your application settings. """ response_type: NotRequired[Literal["code"]] """ The only option at the moment is `'code'`. """ redirect_uri: NotRequired[str] """ The URL for the authorize response redirect. If provided, this must exactly match one of the comma-separated redirect_uri values in your application settings. To protect yourself from certain forms of man-in-the-middle attacks, the live mode redirect_uri must use a secure HTTPS connection. Defaults to the redirect_uri in your application settings if not provided. """ scope: NotRequired[str] """ read_write or read_only, depending on the level of access you need. Defaults to read_only. """ state: NotRequired[str] """ An arbitrary string value we will pass back to you, useful for CSRF protection. """ stripe_landing: NotRequired[str] """ login or register, depending on what type of screen you want your users to see. Only override this to be login if you expect all your users to have Stripe accounts already (e.g., most read-only applications, like analytics dashboards or accounting software). Defaults to login for scope read_only and register for scope read_write. """ always_prompt: NotRequired[bool] """ Boolean to indicate that the user should always be asked to connect, even if they're already connected. Defaults to false. """ suggested_capabilities: NotRequired[List[str]] """ Express only An array of capabilities to apply to the connected account. """ stripe_user: NotRequired["OAuth.OAuthAuthorizeUrlParamsStripeUser"] """ Stripe will use these to prefill details in the account form for new users. Some prefilled fields (e.g., URL or product category) may be automatically hidden from the user's view. Any parameters with invalid values will be silently ignored. """ class OAuthAuthorizeUrlParamsStripeUser(TypedDict): """ A more detailed explanation of what it means for a field to be required or optional can be found in our API documentation. See `Account Creation (Overview)` and `Account Update` """ email: NotRequired[str] """ Recommended The user's email address. Must be a valid email format. """ url: NotRequired[str] """ Recommended The URL for the user's business. This may be the user's website, a profile page within your application, or another publicly available profile for the business, such as a LinkedIn or Facebook profile. Must be URL-encoded and include a scheme (http or https). If you will be prefilling this field, we highly recommend that the linked page contain a description of the user's products or services and their contact information. If we don't have enough information, we'll have to reach out to the user directly before initiating payouts. """ country: NotRequired[str] """ Two-letter country code (e.g., US or CA). Must be a country that Stripe currently supports. """ phone_number: NotRequired[str] """ The business phone number. Must be 10 digits only. Must also prefill stripe_user[country] with the corresponding country. """ business_name: NotRequired[str] """ The legal name of the business, also used for the statement descriptor. """ business_type: NotRequired[str] """ The type of the business. Must be one of sole_prop, corporation, non_profit, partnership, or llc. """ first_name: NotRequired[str] """ First name of the person who will be filling out a Stripe application. """ last_name: NotRequired[str] """ Last name of the person who will be filling out a Stripe application. """ dob_day: NotRequired[str] """ Day (0-31), month (1-12), and year (YYYY, greater than 1900) for the birth date of the person who will be filling out a Stripe application. If you choose to pass these parameters, you must pass all three. """ dob_month: NotRequired[str] """ Day (0-31), month (1-12), and year (YYYY, greater than 1900) for the birth date of the person who will be filling out a Stripe application. If you choose to pass these parameters, you must pass all three. """ dob_year: NotRequired[str] """ Day (0-31), month (1-12), and year (YYYY, greater than 1900) for the birth date of the person who will be filling out a Stripe application. If you choose to pass these parameters, you must pass all three. """ street_address: NotRequired[str] """ Standard only Street address of the business. """ city: NotRequired[str] """ Address city of the business. We highly recommend that you also prefill stripe_user[country] with the corresponding country. """ state: NotRequired[str] """ Standard only Address state of the business, must be the two-letter state or province code (e.g., NY for a U.S. business or AB for a Canadian one). Must also prefill stripe_user[country] with the corresponding country. """ zip: NotRequired[str] """ Standard only Address ZIP code of the business, must be a string. We highly recommend that you also prefill stripe_user[country] with the corresponding country. """ physical_product: NotRequired[str] """ Standard only A string: true if the user sells a physical product, false otherwise. """ product_description: NotRequired[str] """ A description of what the business is accepting payments for. """ currency: NotRequired[str] """ Standard only Three-letter ISO code representing currency, in lowercase (e.g., usd or cad). Must be a valid country and currency combination that Stripe supports. Must prefill stripe_user[country] with the corresponding country. """ first_name_kana: NotRequired[str] """ The Kana variation of the first name of the person who will be filling out a Stripe application. Must prefill stripe_user[country] with JP, as this parameter is only relevant for Japan. """ first_name_kanji: NotRequired[str] """ The Kanji variation of the first name of the person who will be filling out a Stripe application. Must prefill stripe_user[country] with JP, as this parameter is only relevant for Japan. """ last_name_kana: NotRequired[str] """ The Kana variation of the last name of the person who will be filling out a Stripe application. Must prefill stripe_user[country] with JP, as this parameter is only relevant for Japan. """ last_name_kanji: NotRequired[str] """ The Kanji variation of the last name of the person who will be filling out a Stripe application. Must prefill stripe_user[country] with JP, as this parameter is only relevant for Japan. """ gender: NotRequired[str] """ The gender of the person who will be filling out a Stripe application. (International regulations require either male or female.) Must prefill stripe_user[country] with JP, as this parameter is only relevant for Japan. """ block_kana: NotRequired[str] """ Standard only The Kana variation of the address block. This parameter is only relevant for Japan. You must prefill stripe_user[country] with JP and stripe_user[zip] with a valid Japanese postal code to use this parameter. """ block_kanji: NotRequired[str] """ Standard only The Kanji variation of the address block. This parameter is only relevant for Japan. You must prefill stripe_user[country] with JP and stripe_user[zip] with a valid Japanese postal code to use this parameter. """ building_kana: NotRequired[str] """ Standard only The Kana variation of the address building. This parameter is only relevant for Japan. You must prefill stripe_user[country] with JP and stripe_user[zip] with a valid Japanese postal code to use this parameter. """ building_kanji: NotRequired[str] """ Standard only The Kanji variation of the address building. This parameter is only relevant for Japan. You must prefill stripe_user[country] with JP and stripe_user[zip] with a valid Japanese postal code to use this parameter. """ class OAuthTokenParams(TypedDict): grant_type: Literal["authorization_code", "refresh_token"] """ `'authorization_code'` when turning an authorization code into an access token, or `'refresh_token'` when using a refresh token to get a new access token. """ code: NotRequired[str] """ The value of the code or refresh_token, depending on the grant_type. """ refresh_token: NotRequired[str] """ The value of the code or refresh_token, depending on the grant_type. """ scope: NotRequired[str] """ When requesting a new access token from a refresh token, any scope that has an equal or lesser scope as the refresh token. Has no effect when requesting an access token from an authorization code. Defaults to the scope of the refresh token. """ assert_capabilities: NotRequired[List[str]] """ Express only Check whether the suggested_capabilities were applied to the connected account. """ class OAuthDeauthorizeParams(TypedDict): client_id: NotRequired[str] """ The client_id of the application that you'd like to disconnect the account from. The account must be connected to this application. """ stripe_user_id: str """ The account you'd like to disconnect from. """ @staticmethod def _set_client_id(params): if "client_id" in params: return from stripe import client_id if client_id: params["client_id"] = client_id return raise AuthenticationError( "No client_id provided. (HINT: set your client_id using " '"stripe.client_id = "). You can find your client_ids ' "in your Stripe dashboard at " "https://dashboard.stripe.com/account/applications/settings, " "after registering your account as a platform. See " "https://stripe.com/docs/connect/standalone-accounts for details, " "or email support@stripe.com if you have any questions." ) @staticmethod def authorize_url( express: bool = False, **params: Unpack[OAuthAuthorizeUrlParams] ) -> str: if express is False: path = "/oauth/authorize" else: path = "/express/oauth/authorize" OAuth._set_client_id(params) if "response_type" not in params: params["response_type"] = "code" query = urlencode(list(_api_encode(params))) url = connect_api_base + path + "?" + query return url @staticmethod def token( api_key: Optional[str] = None, **params: Unpack[OAuthTokenParams] ) -> OAuthToken: options: RequestOptions = {"api_key": api_key} requestor = _APIRequestor._global_instance() return cast( "OAuth.OAuthToken", requestor.request( "post", "/oauth/token", params=params, options=options, base_address="connect", api_mode="V1", ), ) @staticmethod def deauthorize( api_key: Optional[str] = None, **params: Unpack[OAuthDeauthorizeParams] ) -> OAuthDeauthorization: options: RequestOptions = {"api_key": api_key} requestor = _APIRequestor._global_instance() OAuth._set_client_id(params) return cast( "OAuth.OAuthDeauthorization", requestor.request( "post", "/oauth/deauthorize", params=params, options=options, base_address="connect", api_mode="V1", ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_oauth_service.py0000644000175100001770000000650414637354563017410 0ustar00runnerdockerfrom stripe._stripe_service import StripeService from stripe._error import AuthenticationError from stripe._encode import _api_encode from stripe._oauth import OAuth from urllib.parse import urlencode from stripe._request_options import RequestOptions from stripe._client_options import _ClientOptions from typing import cast, Optional from typing_extensions import NotRequired, TypedDict class OAuthService(StripeService): _options: Optional[_ClientOptions] def __init__(self, client, options=None): super(OAuthService, self).__init__(client) self._options = options class OAuthAuthorizeUrlOptions(TypedDict): express: NotRequired[bool] """ Express only Boolean to indicate that the user should be sent to the express onboarding flow instead of the standard onboarding flow. """ def _set_client_id(self, params): if "client_id" in params: return client_id = self._options and self._options.client_id if client_id: params["client_id"] = client_id return raise AuthenticationError( "No client_id provided. (HINT: set your client_id when configuring " 'your StripeClient: "stripe.StripeClient(..., client_id=)"). ' "You can find your client_ids in your Stripe dashboard at " "https://dashboard.stripe.com/account/applications/settings, " "after registering your account as a platform. See " "https://stripe.com/docs/connect/standalone-accounts for details, " "or email support@stripe.com if you have any questions." ) def authorize_url( self, params: OAuth.OAuthAuthorizeUrlParams = {}, options: OAuthAuthorizeUrlOptions = {}, ) -> str: if options.get("express"): path = "/express/oauth/authorize" else: path = "/oauth/authorize" self._set_client_id(params) if "response_type" not in params: params["response_type"] = "code" query = urlencode(list(_api_encode(params))) # connect_api_base will be always set to stripe.DEFAULT_CONNECT_API_BASE # if it is not overridden on the client explicitly. connect_api_base = self._requestor.base_addresses.get("connect") assert connect_api_base is not None url = connect_api_base + path + "?" + query return url def token( self, params: OAuth.OAuthTokenParams, options: RequestOptions = {} ) -> OAuth.OAuthToken: return cast( OAuth.OAuthToken, self._requestor.request( "post", "/oauth/token", params=params, options=options, base_address="connect", api_mode="V1", ), ) def deauthorize( self, params: OAuth.OAuthDeauthorizeParams, options: RequestOptions = {}, ) -> OAuth.OAuthDeauthorization: self._set_client_id(params) return cast( OAuth.OAuthDeauthorization, self._requestor.request( "post", "/oauth/deauthorize", params=params, options=options, base_address="connect", api_mode="V1", ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_object_classes.py0000644000175100001770000002173614637354563017537 0ustar00runnerdocker# -*- coding: utf-8 -*- import stripe # noqa: IMP101 OBJECT_CLASSES = { # data structures stripe.ListObject.OBJECT_NAME: stripe.ListObject, stripe.SearchResultObject.OBJECT_NAME: stripe.SearchResultObject, stripe.File.OBJECT_NAME_ALT: stripe.File, # Object classes: The beginning of the section generated from our OpenAPI spec stripe.Account.OBJECT_NAME: stripe.Account, stripe.AccountLink.OBJECT_NAME: stripe.AccountLink, stripe.AccountSession.OBJECT_NAME: stripe.AccountSession, stripe.ApplePayDomain.OBJECT_NAME: stripe.ApplePayDomain, stripe.Application.OBJECT_NAME: stripe.Application, stripe.ApplicationFee.OBJECT_NAME: stripe.ApplicationFee, stripe.ApplicationFeeRefund.OBJECT_NAME: stripe.ApplicationFeeRefund, stripe.apps.Secret.OBJECT_NAME: stripe.apps.Secret, stripe.Balance.OBJECT_NAME: stripe.Balance, stripe.BalanceTransaction.OBJECT_NAME: stripe.BalanceTransaction, stripe.BankAccount.OBJECT_NAME: stripe.BankAccount, stripe.billing_portal.Configuration.OBJECT_NAME: stripe.billing_portal.Configuration, stripe.billing_portal.Session.OBJECT_NAME: stripe.billing_portal.Session, stripe.billing.Meter.OBJECT_NAME: stripe.billing.Meter, stripe.billing.MeterEvent.OBJECT_NAME: stripe.billing.MeterEvent, stripe.billing.MeterEventAdjustment.OBJECT_NAME: stripe.billing.MeterEventAdjustment, stripe.billing.MeterEventSummary.OBJECT_NAME: stripe.billing.MeterEventSummary, stripe.Capability.OBJECT_NAME: stripe.Capability, stripe.Card.OBJECT_NAME: stripe.Card, stripe.CashBalance.OBJECT_NAME: stripe.CashBalance, stripe.Charge.OBJECT_NAME: stripe.Charge, stripe.checkout.Session.OBJECT_NAME: stripe.checkout.Session, stripe.climate.Order.OBJECT_NAME: stripe.climate.Order, stripe.climate.Product.OBJECT_NAME: stripe.climate.Product, stripe.climate.Supplier.OBJECT_NAME: stripe.climate.Supplier, stripe.ConfirmationToken.OBJECT_NAME: stripe.ConfirmationToken, stripe.ConnectCollectionTransfer.OBJECT_NAME: stripe.ConnectCollectionTransfer, stripe.CountrySpec.OBJECT_NAME: stripe.CountrySpec, stripe.Coupon.OBJECT_NAME: stripe.Coupon, stripe.CreditNote.OBJECT_NAME: stripe.CreditNote, stripe.CreditNoteLineItem.OBJECT_NAME: stripe.CreditNoteLineItem, stripe.Customer.OBJECT_NAME: stripe.Customer, stripe.CustomerBalanceTransaction.OBJECT_NAME: stripe.CustomerBalanceTransaction, stripe.CustomerCashBalanceTransaction.OBJECT_NAME: stripe.CustomerCashBalanceTransaction, stripe.CustomerSession.OBJECT_NAME: stripe.CustomerSession, stripe.Discount.OBJECT_NAME: stripe.Discount, stripe.Dispute.OBJECT_NAME: stripe.Dispute, stripe.entitlements.ActiveEntitlement.OBJECT_NAME: stripe.entitlements.ActiveEntitlement, stripe.entitlements.ActiveEntitlementSummary.OBJECT_NAME: stripe.entitlements.ActiveEntitlementSummary, stripe.entitlements.Feature.OBJECT_NAME: stripe.entitlements.Feature, stripe.EphemeralKey.OBJECT_NAME: stripe.EphemeralKey, stripe.Event.OBJECT_NAME: stripe.Event, stripe.ExchangeRate.OBJECT_NAME: stripe.ExchangeRate, stripe.File.OBJECT_NAME: stripe.File, stripe.FileLink.OBJECT_NAME: stripe.FileLink, stripe.financial_connections.Account.OBJECT_NAME: stripe.financial_connections.Account, stripe.financial_connections.AccountOwner.OBJECT_NAME: stripe.financial_connections.AccountOwner, stripe.financial_connections.AccountOwnership.OBJECT_NAME: stripe.financial_connections.AccountOwnership, stripe.financial_connections.Session.OBJECT_NAME: stripe.financial_connections.Session, stripe.financial_connections.Transaction.OBJECT_NAME: stripe.financial_connections.Transaction, stripe.forwarding.Request.OBJECT_NAME: stripe.forwarding.Request, stripe.FundingInstructions.OBJECT_NAME: stripe.FundingInstructions, stripe.identity.VerificationReport.OBJECT_NAME: stripe.identity.VerificationReport, stripe.identity.VerificationSession.OBJECT_NAME: stripe.identity.VerificationSession, stripe.Invoice.OBJECT_NAME: stripe.Invoice, stripe.InvoiceItem.OBJECT_NAME: stripe.InvoiceItem, stripe.InvoiceLineItem.OBJECT_NAME: stripe.InvoiceLineItem, stripe.issuing.Authorization.OBJECT_NAME: stripe.issuing.Authorization, stripe.issuing.Card.OBJECT_NAME: stripe.issuing.Card, stripe.issuing.Cardholder.OBJECT_NAME: stripe.issuing.Cardholder, stripe.issuing.Dispute.OBJECT_NAME: stripe.issuing.Dispute, stripe.issuing.PersonalizationDesign.OBJECT_NAME: stripe.issuing.PersonalizationDesign, stripe.issuing.PhysicalBundle.OBJECT_NAME: stripe.issuing.PhysicalBundle, stripe.issuing.Token.OBJECT_NAME: stripe.issuing.Token, stripe.issuing.Transaction.OBJECT_NAME: stripe.issuing.Transaction, stripe.LineItem.OBJECT_NAME: stripe.LineItem, stripe.LoginLink.OBJECT_NAME: stripe.LoginLink, stripe.Mandate.OBJECT_NAME: stripe.Mandate, stripe.PaymentIntent.OBJECT_NAME: stripe.PaymentIntent, stripe.PaymentLink.OBJECT_NAME: stripe.PaymentLink, stripe.PaymentMethod.OBJECT_NAME: stripe.PaymentMethod, stripe.PaymentMethodConfiguration.OBJECT_NAME: stripe.PaymentMethodConfiguration, stripe.PaymentMethodDomain.OBJECT_NAME: stripe.PaymentMethodDomain, stripe.Payout.OBJECT_NAME: stripe.Payout, stripe.Person.OBJECT_NAME: stripe.Person, stripe.Plan.OBJECT_NAME: stripe.Plan, stripe.Price.OBJECT_NAME: stripe.Price, stripe.Product.OBJECT_NAME: stripe.Product, stripe.ProductFeature.OBJECT_NAME: stripe.ProductFeature, stripe.PromotionCode.OBJECT_NAME: stripe.PromotionCode, stripe.Quote.OBJECT_NAME: stripe.Quote, stripe.radar.EarlyFraudWarning.OBJECT_NAME: stripe.radar.EarlyFraudWarning, stripe.radar.ValueList.OBJECT_NAME: stripe.radar.ValueList, stripe.radar.ValueListItem.OBJECT_NAME: stripe.radar.ValueListItem, stripe.Refund.OBJECT_NAME: stripe.Refund, stripe.reporting.ReportRun.OBJECT_NAME: stripe.reporting.ReportRun, stripe.reporting.ReportType.OBJECT_NAME: stripe.reporting.ReportType, stripe.ReserveTransaction.OBJECT_NAME: stripe.ReserveTransaction, stripe.Reversal.OBJECT_NAME: stripe.Reversal, stripe.Review.OBJECT_NAME: stripe.Review, stripe.SetupAttempt.OBJECT_NAME: stripe.SetupAttempt, stripe.SetupIntent.OBJECT_NAME: stripe.SetupIntent, stripe.ShippingRate.OBJECT_NAME: stripe.ShippingRate, stripe.sigma.ScheduledQueryRun.OBJECT_NAME: stripe.sigma.ScheduledQueryRun, stripe.Source.OBJECT_NAME: stripe.Source, stripe.SourceMandateNotification.OBJECT_NAME: stripe.SourceMandateNotification, stripe.SourceTransaction.OBJECT_NAME: stripe.SourceTransaction, stripe.Subscription.OBJECT_NAME: stripe.Subscription, stripe.SubscriptionItem.OBJECT_NAME: stripe.SubscriptionItem, stripe.SubscriptionSchedule.OBJECT_NAME: stripe.SubscriptionSchedule, stripe.tax.Calculation.OBJECT_NAME: stripe.tax.Calculation, stripe.tax.CalculationLineItem.OBJECT_NAME: stripe.tax.CalculationLineItem, stripe.tax.Registration.OBJECT_NAME: stripe.tax.Registration, stripe.tax.Settings.OBJECT_NAME: stripe.tax.Settings, stripe.tax.Transaction.OBJECT_NAME: stripe.tax.Transaction, stripe.tax.TransactionLineItem.OBJECT_NAME: stripe.tax.TransactionLineItem, stripe.TaxCode.OBJECT_NAME: stripe.TaxCode, stripe.TaxDeductedAtSource.OBJECT_NAME: stripe.TaxDeductedAtSource, stripe.TaxId.OBJECT_NAME: stripe.TaxId, stripe.TaxRate.OBJECT_NAME: stripe.TaxRate, stripe.terminal.Configuration.OBJECT_NAME: stripe.terminal.Configuration, stripe.terminal.ConnectionToken.OBJECT_NAME: stripe.terminal.ConnectionToken, stripe.terminal.Location.OBJECT_NAME: stripe.terminal.Location, stripe.terminal.Reader.OBJECT_NAME: stripe.terminal.Reader, stripe.test_helpers.TestClock.OBJECT_NAME: stripe.test_helpers.TestClock, stripe.Token.OBJECT_NAME: stripe.Token, stripe.Topup.OBJECT_NAME: stripe.Topup, stripe.Transfer.OBJECT_NAME: stripe.Transfer, stripe.treasury.CreditReversal.OBJECT_NAME: stripe.treasury.CreditReversal, stripe.treasury.DebitReversal.OBJECT_NAME: stripe.treasury.DebitReversal, stripe.treasury.FinancialAccount.OBJECT_NAME: stripe.treasury.FinancialAccount, stripe.treasury.FinancialAccountFeatures.OBJECT_NAME: stripe.treasury.FinancialAccountFeatures, stripe.treasury.InboundTransfer.OBJECT_NAME: stripe.treasury.InboundTransfer, stripe.treasury.OutboundPayment.OBJECT_NAME: stripe.treasury.OutboundPayment, stripe.treasury.OutboundTransfer.OBJECT_NAME: stripe.treasury.OutboundTransfer, stripe.treasury.ReceivedCredit.OBJECT_NAME: stripe.treasury.ReceivedCredit, stripe.treasury.ReceivedDebit.OBJECT_NAME: stripe.treasury.ReceivedDebit, stripe.treasury.Transaction.OBJECT_NAME: stripe.treasury.Transaction, stripe.treasury.TransactionEntry.OBJECT_NAME: stripe.treasury.TransactionEntry, stripe.UsageRecord.OBJECT_NAME: stripe.UsageRecord, stripe.UsageRecordSummary.OBJECT_NAME: stripe.UsageRecordSummary, stripe.WebhookEndpoint.OBJECT_NAME: stripe.WebhookEndpoint, # Object classes: The end of the section generated from our OpenAPI spec } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_payment_intent.py0000644000175100001770000200645614637354563017616 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._search_result_object import SearchResultObject from stripe._searchable_api_resource import SearchableAPIResource from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ( Any, AsyncIterator, ClassVar, Dict, Iterator, List, Optional, Union, cast, overload, ) from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._account import Account from stripe._application import Application from stripe._bank_account import BankAccount from stripe._card import Card as CardResource from stripe._charge import Charge from stripe._customer import Customer from stripe._invoice import Invoice from stripe._payment_method import PaymentMethod from stripe._review import Review from stripe._setup_intent import SetupIntent from stripe._source import Source class PaymentIntent( CreateableAPIResource["PaymentIntent"], ListableAPIResource["PaymentIntent"], SearchableAPIResource["PaymentIntent"], UpdateableAPIResource["PaymentIntent"], ): """ A PaymentIntent guides you through the process of collecting a payment from your customer. We recommend that you create exactly one PaymentIntent for each order or customer session in your system. You can reference the PaymentIntent later to see the history of payment attempts for a particular session. A PaymentIntent transitions through [multiple statuses](https://stripe.com/docs/payments/intents#intent-statuses) throughout its lifetime as it interfaces with Stripe.js to perform authentication flows and ultimately creates at most one successful charge. Related guide: [Payment Intents API](https://stripe.com/docs/payments/payment-intents) """ OBJECT_NAME: ClassVar[Literal["payment_intent"]] = "payment_intent" class AmountDetails(StripeObject): class Tip(StripeObject): amount: Optional[int] """ Portion of the amount that corresponds to a tip. """ tip: Optional[Tip] _inner_class_types = {"tip": Tip} class AutomaticPaymentMethods(StripeObject): allow_redirects: Optional[Literal["always", "never"]] """ Controls whether this PaymentIntent will accept redirect-based payment methods. Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. To [confirm](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the payment. """ enabled: bool """ Automatically calculates compatible payment methods """ class LastPaymentError(StripeObject): charge: Optional[str] """ For card errors, the ID of the failed charge. """ code: Optional[ Literal[ "account_closed", "account_country_invalid_address", "account_error_country_change_requires_additional_steps", "account_information_mismatch", "account_invalid", "account_number_invalid", "acss_debit_session_incomplete", "alipay_upgrade_required", "amount_too_large", "amount_too_small", "api_key_expired", "application_fees_not_allowed", "authentication_required", "balance_insufficient", "balance_invalid_parameter", "bank_account_bad_routing_numbers", "bank_account_declined", "bank_account_exists", "bank_account_restricted", "bank_account_unusable", "bank_account_unverified", "bank_account_verification_failed", "billing_invalid_mandate", "billing_policy_remote_function_response_invalid", "billing_policy_remote_function_timeout", "billing_policy_remote_function_unexpected_status_code", "billing_policy_remote_function_unreachable", "bitcoin_upgrade_required", "capture_charge_authorization_expired", "capture_unauthorized_payment", "card_decline_rate_limit_exceeded", "card_declined", "cardholder_phone_number_required", "charge_already_captured", "charge_already_refunded", "charge_disputed", "charge_exceeds_source_limit", "charge_expired_for_capture", "charge_invalid_parameter", "charge_not_refundable", "clearing_code_unsupported", "country_code_invalid", "country_unsupported", "coupon_expired", "customer_max_payment_methods", "customer_max_subscriptions", "customer_tax_location_invalid", "debit_not_authorized", "email_invalid", "expired_card", "financial_connections_account_inactive", "financial_connections_no_successful_transaction_refresh", "forwarding_api_inactive", "forwarding_api_invalid_parameter", "forwarding_api_upstream_connection_error", "forwarding_api_upstream_connection_timeout", "idempotency_key_in_use", "incorrect_address", "incorrect_cvc", "incorrect_number", "incorrect_zip", "instant_payouts_config_disabled", "instant_payouts_currency_disabled", "instant_payouts_limit_exceeded", "instant_payouts_unsupported", "insufficient_funds", "intent_invalid_state", "intent_verification_method_missing", "invalid_card_type", "invalid_characters", "invalid_charge_amount", "invalid_cvc", "invalid_expiry_month", "invalid_expiry_year", "invalid_number", "invalid_source_usage", "invalid_tax_location", "invoice_no_customer_line_items", "invoice_no_payment_method_types", "invoice_no_subscription_line_items", "invoice_not_editable", "invoice_on_behalf_of_not_editable", "invoice_payment_intent_requires_action", "invoice_upcoming_none", "livemode_mismatch", "lock_timeout", "missing", "no_account", "not_allowed_on_standard_account", "out_of_inventory", "ownership_declaration_not_allowed", "parameter_invalid_empty", "parameter_invalid_integer", "parameter_invalid_string_blank", "parameter_invalid_string_empty", "parameter_missing", "parameter_unknown", "parameters_exclusive", "payment_intent_action_required", "payment_intent_authentication_failure", "payment_intent_incompatible_payment_method", "payment_intent_invalid_parameter", "payment_intent_konbini_rejected_confirmation_number", "payment_intent_mandate_invalid", "payment_intent_payment_attempt_expired", "payment_intent_payment_attempt_failed", "payment_intent_unexpected_state", "payment_method_bank_account_already_verified", "payment_method_bank_account_blocked", "payment_method_billing_details_address_missing", "payment_method_configuration_failures", "payment_method_currency_mismatch", "payment_method_customer_decline", "payment_method_invalid_parameter", "payment_method_invalid_parameter_testmode", "payment_method_microdeposit_failed", "payment_method_microdeposit_verification_amounts_invalid", "payment_method_microdeposit_verification_amounts_mismatch", "payment_method_microdeposit_verification_attempts_exceeded", "payment_method_microdeposit_verification_descriptor_code_mismatch", "payment_method_microdeposit_verification_timeout", "payment_method_not_available", "payment_method_provider_decline", "payment_method_provider_timeout", "payment_method_unactivated", "payment_method_unexpected_state", "payment_method_unsupported_type", "payout_reconciliation_not_ready", "payouts_limit_exceeded", "payouts_not_allowed", "platform_account_required", "platform_api_key_expired", "postal_code_invalid", "processing_error", "product_inactive", "progressive_onboarding_limit_exceeded", "rate_limit", "refer_to_customer", "refund_disputed_payment", "resource_already_exists", "resource_missing", "return_intent_already_processed", "routing_number_invalid", "secret_key_required", "sepa_unsupported_account", "setup_attempt_failed", "setup_intent_authentication_failure", "setup_intent_invalid_parameter", "setup_intent_mandate_invalid", "setup_intent_setup_attempt_expired", "setup_intent_unexpected_state", "shipping_address_invalid", "shipping_calculation_failed", "sku_inactive", "state_unsupported", "status_transition_invalid", "stripe_tax_inactive", "tax_id_invalid", "taxes_calculation_failed", "terminal_location_country_unsupported", "terminal_reader_busy", "terminal_reader_hardware_fault", "terminal_reader_invalid_location_for_payment", "terminal_reader_offline", "terminal_reader_timeout", "testmode_charges_only", "tls_version_unsupported", "token_already_used", "token_card_network_invalid", "token_in_use", "transfer_source_balance_parameters_mismatch", "transfers_not_allowed", "url_invalid", ] ] """ For some errors that could be handled programmatically, a short string indicating the [error code](https://stripe.com/docs/error-codes) reported. """ decline_code: Optional[str] """ For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](https://stripe.com/docs/declines#issuer-declines) if they provide one. """ doc_url: Optional[str] """ A URL to more information about the [error code](https://stripe.com/docs/error-codes) reported. """ message: Optional[str] """ A human-readable message providing more details about the error. For card errors, these messages can be shown to your users. """ param: Optional[str] """ If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field. """ payment_intent: Optional["PaymentIntent"] """ A PaymentIntent guides you through the process of collecting a payment from your customer. We recommend that you create exactly one PaymentIntent for each order or customer session in your system. You can reference the PaymentIntent later to see the history of payment attempts for a particular session. A PaymentIntent transitions through [multiple statuses](https://stripe.com/docs/payments/intents#intent-statuses) throughout its lifetime as it interfaces with Stripe.js to perform authentication flows and ultimately creates at most one successful charge. Related guide: [Payment Intents API](https://stripe.com/docs/payments/payment-intents) """ payment_method: Optional["PaymentMethod"] """ PaymentMethod objects represent your customer's payment instruments. You can use them with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or save them to Customer objects to store instrument details for future payments. Related guides: [Payment Methods](https://stripe.com/docs/payments/payment-methods) and [More Payment Scenarios](https://stripe.com/docs/payments/more-payment-scenarios). """ payment_method_type: Optional[str] """ If the error is specific to the type of payment method, the payment method type that had a problem. This field is only populated for invoice-related errors. """ request_log_url: Optional[str] """ A URL to the request log entry in your dashboard. """ setup_intent: Optional["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://stripe.com/docs/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. The SetupIntent transitions through multiple [statuses](https://docs.stripe.com/payments/intents#intent-statuses) as it guides you through the setup process. Successful SetupIntents result in payment credentials that are optimized for future payments. 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://stripe.com/docs/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://stripe.com/docs/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. Related guide: [Setup Intents API](https://docs.stripe.com/payments/setup-intents) """ source: Optional[ Union["Account", "BankAccount", "CardResource", "Source"] ] type: Literal[ "api_error", "card_error", "idempotency_error", "invalid_request_error", ] """ The type of error returned. One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error` """ class NextAction(StripeObject): class AlipayHandleRedirect(StripeObject): native_data: Optional[str] """ The native data to be used with Alipay SDK you must redirect your customer to in order to authenticate the payment in an Android App. """ native_url: Optional[str] """ The native URL you must redirect your customer to in order to authenticate the payment in an iOS App. """ return_url: Optional[str] """ If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion. """ url: Optional[str] """ The URL you must redirect your customer to in order to authenticate the payment. """ class BoletoDisplayDetails(StripeObject): expires_at: Optional[int] """ The timestamp after which the boleto expires. """ hosted_voucher_url: Optional[str] """ The URL to the hosted boleto voucher page, which allows customers to view the boleto voucher. """ number: Optional[str] """ The boleto number. """ pdf: Optional[str] """ The URL to the downloadable boleto voucher PDF. """ class CardAwaitNotification(StripeObject): charge_attempt_at: Optional[int] """ The time that payment will be attempted. If customer approval is required, they need to provide approval before this time. """ customer_approval_required: Optional[bool] """ For payments greater than INR 15000, the customer must provide explicit approval of the payment with their bank. For payments of lower amount, no customer action is required. """ class CashappHandleRedirectOrDisplayQrCode(StripeObject): class QrCode(StripeObject): expires_at: int """ The date (unix timestamp) when the QR code expires. """ image_url_png: str """ The image_url_png string used to render QR code """ image_url_svg: str """ The image_url_svg string used to render QR code """ hosted_instructions_url: str """ The URL to the hosted Cash App Pay instructions page, which allows customers to view the QR code, and supports QR code refreshing on expiration. """ mobile_auth_url: str """ The url for mobile redirect based auth """ qr_code: QrCode _inner_class_types = {"qr_code": QrCode} class DisplayBankTransferInstructions(StripeObject): class FinancialAddress(StripeObject): class Aba(StripeObject): account_number: str """ The ABA account number """ bank_name: str """ The bank name """ routing_number: str """ The ABA routing number """ class Iban(StripeObject): account_holder_name: str """ The name of the person or business that owns the bank account """ bic: str """ The BIC/SWIFT code of the account. """ country: str """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ iban: str """ The IBAN of the account. """ class SortCode(StripeObject): account_holder_name: str """ The name of the person or business that owns the bank account """ account_number: str """ The account number """ sort_code: str """ The six-digit sort code """ class Spei(StripeObject): bank_code: str """ The three-digit bank code """ bank_name: str """ The short banking institution name """ clabe: str """ The CLABE number """ class Swift(StripeObject): account_number: str """ The account number """ bank_name: str """ The bank name """ swift_code: str """ The SWIFT code """ class Zengin(StripeObject): account_holder_name: Optional[str] """ The account holder name """ account_number: Optional[str] """ The account number """ account_type: Optional[str] """ The bank account type. In Japan, this can only be `futsu` or `toza`. """ bank_code: Optional[str] """ The bank code of the account """ bank_name: Optional[str] """ The bank name of the account """ branch_code: Optional[str] """ The branch code of the account """ branch_name: Optional[str] """ The branch name of the account """ aba: Optional[Aba] """ ABA Records contain U.S. bank account details per the ABA format. """ iban: Optional[Iban] """ Iban Records contain E.U. bank account details per the SEPA format. """ sort_code: Optional[SortCode] """ Sort Code Records contain U.K. bank account details per the sort code format. """ spei: Optional[Spei] """ SPEI Records contain Mexico bank account details per the SPEI format. """ supported_networks: Optional[ List[ Literal[ "ach", "bacs", "domestic_wire_us", "fps", "sepa", "spei", "swift", "zengin", ] ] ] """ The payment networks supported by this FinancialAddress """ swift: Optional[Swift] """ SWIFT Records contain U.S. bank account details per the SWIFT format. """ type: Literal[ "aba", "iban", "sort_code", "spei", "swift", "zengin" ] """ The type of financial address """ zengin: Optional[Zengin] """ Zengin Records contain Japan bank account details per the Zengin format. """ _inner_class_types = { "aba": Aba, "iban": Iban, "sort_code": SortCode, "spei": Spei, "swift": Swift, "zengin": Zengin, } amount_remaining: Optional[int] """ The remaining amount that needs to be transferred to complete the payment. """ currency: Optional[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). """ financial_addresses: Optional[List[FinancialAddress]] """ A list of financial addresses that can be used to fund the customer balance """ hosted_instructions_url: Optional[str] """ A link to a hosted page that guides your customer through completing the transfer. """ reference: Optional[str] """ A string identifying this payment. Instruct your customer to include this code in the reference or memo field of their bank transfer. """ type: Literal[ "eu_bank_transfer", "gb_bank_transfer", "jp_bank_transfer", "mx_bank_transfer", "us_bank_transfer", ] """ Type of bank transfer """ _inner_class_types = {"financial_addresses": FinancialAddress} class KonbiniDisplayDetails(StripeObject): class Stores(StripeObject): class Familymart(StripeObject): confirmation_number: Optional[str] """ The confirmation number. """ payment_code: str """ The payment code. """ class Lawson(StripeObject): confirmation_number: Optional[str] """ The confirmation number. """ payment_code: str """ The payment code. """ class Ministop(StripeObject): confirmation_number: Optional[str] """ The confirmation number. """ payment_code: str """ The payment code. """ class Seicomart(StripeObject): confirmation_number: Optional[str] """ The confirmation number. """ payment_code: str """ The payment code. """ familymart: Optional[Familymart] """ FamilyMart instruction details. """ lawson: Optional[Lawson] """ Lawson instruction details. """ ministop: Optional[Ministop] """ Ministop instruction details. """ seicomart: Optional[Seicomart] """ Seicomart instruction details. """ _inner_class_types = { "familymart": Familymart, "lawson": Lawson, "ministop": Ministop, "seicomart": Seicomart, } expires_at: int """ The timestamp at which the pending Konbini payment expires. """ hosted_voucher_url: Optional[str] """ The URL for the Konbini payment instructions page, which allows customers to view and print a Konbini voucher. """ stores: Stores _inner_class_types = {"stores": Stores} class MultibancoDisplayDetails(StripeObject): entity: Optional[str] """ Entity number associated with this Multibanco payment. """ expires_at: Optional[int] """ The timestamp at which the Multibanco voucher expires. """ hosted_voucher_url: Optional[str] """ The URL for the hosted Multibanco voucher page, which allows customers to view a Multibanco voucher. """ reference: Optional[str] """ Reference number associated with this Multibanco payment. """ class OxxoDisplayDetails(StripeObject): expires_after: Optional[int] """ The timestamp after which the OXXO voucher expires. """ hosted_voucher_url: Optional[str] """ The URL for the hosted OXXO voucher page, which allows customers to view and print an OXXO voucher. """ number: Optional[str] """ OXXO reference number. """ class PaynowDisplayQrCode(StripeObject): data: str """ The raw data string used to generate QR code, it should be used together with QR code library. """ hosted_instructions_url: Optional[str] """ The URL to the hosted PayNow instructions page, which allows customers to view the PayNow QR code. """ image_url_png: str """ The image_url_png string used to render QR code """ image_url_svg: str """ The image_url_svg string used to render QR code """ class PixDisplayQrCode(StripeObject): data: Optional[str] """ The raw data string used to generate QR code, it should be used together with QR code library. """ expires_at: Optional[int] """ The date (unix timestamp) when the PIX expires. """ hosted_instructions_url: Optional[str] """ The URL to the hosted pix instructions page, which allows customers to view the pix QR code. """ image_url_png: Optional[str] """ The image_url_png string used to render png QR code """ image_url_svg: Optional[str] """ The image_url_svg string used to render svg QR code """ class PromptpayDisplayQrCode(StripeObject): data: str """ The raw data string used to generate QR code, it should be used together with QR code library. """ hosted_instructions_url: str """ The URL to the hosted PromptPay instructions page, which allows customers to view the PromptPay QR code. """ image_url_png: str """ The PNG path used to render the QR code, can be used as the source in an HTML img tag """ image_url_svg: str """ The SVG path used to render the QR code, can be used as the source in an HTML img tag """ class RedirectToUrl(StripeObject): return_url: Optional[str] """ If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion. """ url: Optional[str] """ The URL you must redirect your customer to in order to authenticate the payment. """ class SwishHandleRedirectOrDisplayQrCode(StripeObject): class QrCode(StripeObject): data: str """ The raw data string used to generate QR code, it should be used together with QR code library. """ image_url_png: str """ The image_url_png string used to render QR code """ image_url_svg: str """ The image_url_svg string used to render QR code """ hosted_instructions_url: str """ The URL to the hosted Swish instructions page, which allows customers to view the QR code. """ mobile_auth_url: str """ The url for mobile redirect based auth (for internal use only and not typically available in standard API requests). """ qr_code: QrCode _inner_class_types = {"qr_code": QrCode} class VerifyWithMicrodeposits(StripeObject): arrival_date: int """ The timestamp when the microdeposits are expected to land. """ hosted_verification_url: str """ The URL for the hosted verification page, which allows customers to verify their bank account. """ microdeposit_type: Optional[Literal["amounts", "descriptor_code"]] """ The type of the microdeposit sent to the customer. Used to distinguish between different verification methods. """ class WechatPayDisplayQrCode(StripeObject): data: str """ The data being used to generate QR code """ hosted_instructions_url: str """ The URL to the hosted WeChat Pay instructions page, which allows customers to view the WeChat Pay QR code. """ image_data_url: str """ The base64 image data for a pre-generated QR code """ image_url_png: str """ The image_url_png string used to render QR code """ image_url_svg: str """ The image_url_svg string used to render QR code """ class WechatPayRedirectToAndroidApp(StripeObject): app_id: str """ app_id is the APP ID registered on WeChat open platform """ nonce_str: str """ nonce_str is a random string """ package: str """ package is static value """ partner_id: str """ an unique merchant ID assigned by WeChat Pay """ prepay_id: str """ an unique trading ID assigned by WeChat Pay """ sign: str """ A signature """ timestamp: str """ Specifies the current time in epoch format """ class WechatPayRedirectToIosApp(StripeObject): native_url: str """ An universal link that redirect to WeChat Pay app """ alipay_handle_redirect: Optional[AlipayHandleRedirect] boleto_display_details: Optional[BoletoDisplayDetails] card_await_notification: Optional[CardAwaitNotification] cashapp_handle_redirect_or_display_qr_code: Optional[ CashappHandleRedirectOrDisplayQrCode ] display_bank_transfer_instructions: Optional[ DisplayBankTransferInstructions ] konbini_display_details: Optional[KonbiniDisplayDetails] multibanco_display_details: Optional[MultibancoDisplayDetails] oxxo_display_details: Optional[OxxoDisplayDetails] paynow_display_qr_code: Optional[PaynowDisplayQrCode] pix_display_qr_code: Optional[PixDisplayQrCode] promptpay_display_qr_code: Optional[PromptpayDisplayQrCode] redirect_to_url: Optional[RedirectToUrl] swish_handle_redirect_or_display_qr_code: Optional[ SwishHandleRedirectOrDisplayQrCode ] type: str """ Type of the next action to perform, one of `redirect_to_url`, `use_stripe_sdk`, `alipay_handle_redirect`, `oxxo_display_details`, or `verify_with_microdeposits`. """ use_stripe_sdk: Optional[Dict[str, Any]] """ When confirming a PaymentIntent with Stripe.js, Stripe.js depends on the contents of this dictionary to invoke authentication flows. The shape of the contents is subject to change and is only intended to be used by Stripe.js. """ verify_with_microdeposits: Optional[VerifyWithMicrodeposits] wechat_pay_display_qr_code: Optional[WechatPayDisplayQrCode] wechat_pay_redirect_to_android_app: Optional[ WechatPayRedirectToAndroidApp ] wechat_pay_redirect_to_ios_app: Optional[WechatPayRedirectToIosApp] _inner_class_types = { "alipay_handle_redirect": AlipayHandleRedirect, "boleto_display_details": BoletoDisplayDetails, "card_await_notification": CardAwaitNotification, "cashapp_handle_redirect_or_display_qr_code": CashappHandleRedirectOrDisplayQrCode, "display_bank_transfer_instructions": DisplayBankTransferInstructions, "konbini_display_details": KonbiniDisplayDetails, "multibanco_display_details": MultibancoDisplayDetails, "oxxo_display_details": OxxoDisplayDetails, "paynow_display_qr_code": PaynowDisplayQrCode, "pix_display_qr_code": PixDisplayQrCode, "promptpay_display_qr_code": PromptpayDisplayQrCode, "redirect_to_url": RedirectToUrl, "swish_handle_redirect_or_display_qr_code": SwishHandleRedirectOrDisplayQrCode, "verify_with_microdeposits": VerifyWithMicrodeposits, "wechat_pay_display_qr_code": WechatPayDisplayQrCode, "wechat_pay_redirect_to_android_app": WechatPayRedirectToAndroidApp, "wechat_pay_redirect_to_ios_app": WechatPayRedirectToIosApp, } class PaymentMethodConfigurationDetails(StripeObject): id: str """ ID of the payment method configuration used. """ parent: Optional[str] """ ID of the parent payment method configuration used. """ class PaymentMethodOptions(StripeObject): class AcssDebit(StripeObject): class MandateOptions(StripeObject): custom_mandate_url: Optional[str] """ A URL for custom mandate text """ interval_description: Optional[str] """ Description of the interval. Only required if the 'payment_schedule' parameter is 'interval' or 'combined'. """ payment_schedule: Optional[ Literal["combined", "interval", "sporadic"] ] """ Payment schedule for the mandate. """ transaction_type: Optional[Literal["business", "personal"]] """ Transaction type of the mandate. """ mandate_options: Optional[MandateOptions] setup_future_usage: Optional[ Literal["none", "off_session", "on_session"] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ verification_method: Optional[ Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. """ _inner_class_types = {"mandate_options": MandateOptions} class Affirm(StripeObject): capture_method: Optional[Literal["manual"]] """ Controls when the funds will be captured from the customer's account. """ preferred_locale: Optional[str] """ Preferred language of the Affirm authorization page that the customer is redirected to. """ setup_future_usage: Optional[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class AfterpayClearpay(StripeObject): capture_method: Optional[Literal["manual"]] """ Controls when the funds will be captured from the customer's account. """ reference: Optional[str] """ An internal identifier or reference that this payment corresponds to. You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes. This field differs from the statement descriptor and item name. """ setup_future_usage: Optional[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class Alipay(StripeObject): setup_future_usage: Optional[Literal["none", "off_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class AmazonPay(StripeObject): capture_method: Optional[Literal["manual"]] """ Controls when the funds will be captured from the customer's account. """ setup_future_usage: Optional[Literal["none", "off_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class AuBecsDebit(StripeObject): setup_future_usage: Optional[ Literal["none", "off_session", "on_session"] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class BacsDebit(StripeObject): setup_future_usage: Optional[ Literal["none", "off_session", "on_session"] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class Bancontact(StripeObject): preferred_language: Literal["de", "en", "fr", "nl"] """ Preferred language of the Bancontact authorization page that the customer is redirected to. """ setup_future_usage: Optional[Literal["none", "off_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class Blik(StripeObject): setup_future_usage: Optional[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class Boleto(StripeObject): expires_after_days: int """ The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto voucher will expire on Wednesday at 23:59 America/Sao_Paulo time. """ setup_future_usage: Optional[ Literal["none", "off_session", "on_session"] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class Card(StripeObject): class Installments(StripeObject): class AvailablePlan(StripeObject): count: Optional[int] """ For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. """ interval: Optional[Literal["month"]] """ For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. One of `month`. """ type: Literal["fixed_count"] """ Type of installment plan, one of `fixed_count`. """ class Plan(StripeObject): count: Optional[int] """ For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. """ interval: Optional[Literal["month"]] """ For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. One of `month`. """ type: Literal["fixed_count"] """ Type of installment plan, one of `fixed_count`. """ available_plans: Optional[List[AvailablePlan]] """ Installment plans that may be selected for this PaymentIntent. """ enabled: bool """ Whether Installments are enabled for this PaymentIntent. """ plan: Optional[Plan] """ Installment plan selected for this PaymentIntent. """ _inner_class_types = { "available_plans": AvailablePlan, "plan": Plan, } class MandateOptions(StripeObject): amount: int """ Amount to be charged for future payments. """ amount_type: Literal["fixed", "maximum"] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ description: Optional[str] """ A description of the mandate or subscription that is meant to be displayed to the customer. """ end_date: Optional[int] """ End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. """ interval: Literal["day", "month", "sporadic", "week", "year"] """ Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. """ interval_count: Optional[int] """ The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. """ reference: str """ Unique identifier for the mandate or subscription. """ start_date: int """ Start date of the mandate or subscription. Start date should not be lesser than yesterday. """ supported_types: Optional[List[Literal["india"]]] """ Specifies the type of mandates supported. Possible values are `india`. """ capture_method: Optional[Literal["manual"]] """ Controls when the funds will be captured from the customer's account. """ installments: Optional[Installments] """ Installment details for this payment (Mexico only). For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). """ mandate_options: Optional[MandateOptions] """ Configuration options for setting up an eMandate for cards issued in India. """ network: Optional[ Literal[ "amex", "cartes_bancaires", "diners", "discover", "eftpos_au", "interac", "jcb", "mastercard", "unionpay", "unknown", "visa", ] ] """ Selected network to process this payment intent on. Depends on the available networks of the card attached to the payment intent. Can be only set confirm-time. """ request_extended_authorization: Optional[ Literal["if_available", "never"] ] """ Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent. """ request_incremental_authorization: Optional[ Literal["if_available", "never"] ] """ Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. """ request_multicapture: Optional[Literal["if_available", "never"]] """ Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent. """ request_overcapture: Optional[Literal["if_available", "never"]] """ Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. """ request_three_d_secure: Optional[ Literal["any", "automatic", "challenge"] ] """ 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://stripe.com/docs/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://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ require_cvc_recollection: Optional[bool] """ When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. using the cvc_token parameter). """ setup_future_usage: Optional[ Literal["none", "off_session", "on_session"] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ statement_descriptor_suffix_kana: Optional[str] """ Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. """ statement_descriptor_suffix_kanji: Optional[str] """ 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. """ _inner_class_types = { "installments": Installments, "mandate_options": MandateOptions, } class CardPresent(StripeObject): class Routing(StripeObject): requested_priority: Optional[ Literal["domestic", "international"] ] """ Requested routing priority """ request_extended_authorization: Optional[bool] """ Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity) """ request_incremental_authorization_support: Optional[bool] """ Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. """ routing: Optional[Routing] _inner_class_types = {"routing": Routing} class Cashapp(StripeObject): capture_method: Optional[Literal["manual"]] """ Controls when the funds will be captured from the customer's account. """ setup_future_usage: Optional[ Literal["none", "off_session", "on_session"] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CustomerBalance(StripeObject): class BankTransfer(StripeObject): class EuBankTransfer(StripeObject): country: Literal["BE", "DE", "ES", "FR", "IE", "NL"] """ The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. """ eu_bank_transfer: Optional[EuBankTransfer] requested_address_types: Optional[ List[ Literal[ "aba", "iban", "sepa", "sort_code", "spei", "swift", "zengin", ] ] ] """ List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. """ type: Optional[ Literal[ "eu_bank_transfer", "gb_bank_transfer", "jp_bank_transfer", "mx_bank_transfer", "us_bank_transfer", ] ] """ The bank transfer type that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. """ _inner_class_types = {"eu_bank_transfer": EuBankTransfer} bank_transfer: Optional[BankTransfer] funding_type: Optional[Literal["bank_transfer"]] """ The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. """ setup_future_usage: Optional[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ _inner_class_types = {"bank_transfer": BankTransfer} class Eps(StripeObject): setup_future_usage: Optional[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class Fpx(StripeObject): setup_future_usage: Optional[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class Giropay(StripeObject): setup_future_usage: Optional[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class Grabpay(StripeObject): setup_future_usage: Optional[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class Ideal(StripeObject): setup_future_usage: Optional[Literal["none", "off_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class InteracPresent(StripeObject): pass class Klarna(StripeObject): capture_method: Optional[Literal["manual"]] """ Controls when the funds will be captured from the customer's account. """ preferred_locale: Optional[str] """ Preferred locale of the Klarna checkout page that the customer is redirected to. """ setup_future_usage: Optional[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class Konbini(StripeObject): confirmation_number: Optional[str] """ An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores. """ expires_after_days: Optional[int] """ The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. """ expires_at: Optional[int] """ The timestamp at which the Konbini payment instructions will expire. Only one of `expires_after_days` or `expires_at` may be set. """ product_description: Optional[str] """ A product descriptor of up to 22 characters, which will appear to customers at the convenience store. """ setup_future_usage: Optional[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class Link(StripeObject): capture_method: Optional[Literal["manual"]] """ Controls when the funds will be captured from the customer's account. """ persistent_token: Optional[str] """ [Deprecated] This is a legacy parameter that no longer has any function. """ setup_future_usage: Optional[Literal["none", "off_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class Mobilepay(StripeObject): capture_method: Optional[Literal["manual"]] """ Controls when the funds will be captured from the customer's account. """ setup_future_usage: Optional[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class Multibanco(StripeObject): setup_future_usage: Optional[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class Oxxo(StripeObject): expires_after_days: int """ The number of calendar days before an OXXO invoice expires. For example, if you create an OXXO invoice on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. """ setup_future_usage: Optional[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class P24(StripeObject): setup_future_usage: Optional[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class Paynow(StripeObject): setup_future_usage: Optional[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class Paypal(StripeObject): capture_method: Optional[Literal["manual"]] """ Controls when the funds will be captured from the customer's account. """ preferred_locale: Optional[str] """ Preferred locale of the PayPal checkout page that the customer is redirected to. """ reference: Optional[str] """ A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. """ setup_future_usage: Optional[Literal["none", "off_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class Pix(StripeObject): expires_after_seconds: Optional[int] """ The number of seconds (between 10 and 1209600) after which Pix payment will expire. """ expires_at: Optional[int] """ The timestamp at which the Pix expires. """ setup_future_usage: Optional[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class Promptpay(StripeObject): setup_future_usage: Optional[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class RevolutPay(StripeObject): capture_method: Optional[Literal["manual"]] """ Controls when the funds will be captured from the customer's account. """ setup_future_usage: Optional[Literal["none", "off_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class SepaDebit(StripeObject): class MandateOptions(StripeObject): pass mandate_options: Optional[MandateOptions] setup_future_usage: Optional[ Literal["none", "off_session", "on_session"] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ _inner_class_types = {"mandate_options": MandateOptions} class Sofort(StripeObject): preferred_language: Optional[ Literal["de", "en", "es", "fr", "it", "nl", "pl"] ] """ Preferred language of the SOFORT authorization page that the customer is redirected to. """ setup_future_usage: Optional[Literal["none", "off_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class Swish(StripeObject): reference: Optional[str] """ The order ID displayed in the Swish app after the payment is authorized. """ setup_future_usage: Optional[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class Twint(StripeObject): setup_future_usage: Optional[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class UsBankAccount(StripeObject): class FinancialConnections(StripeObject): class Filters(StripeObject): account_subcategories: Optional[ List[Literal["checking", "savings"]] ] """ The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`. """ filters: Optional[Filters] permissions: Optional[ List[ Literal[ "balances", "ownership", "payment_method", "transactions", ] ] ] """ The list of permissions to request. The `payment_method` permission must be included. """ prefetch: Optional[ List[Literal["balances", "ownership", "transactions"]] ] """ Data features requested to be retrieved upon account creation. """ return_url: Optional[str] """ For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. """ _inner_class_types = {"filters": Filters} class MandateOptions(StripeObject): collection_method: Optional[Literal["paper"]] """ Mandate collection method """ financial_connections: Optional[FinancialConnections] mandate_options: Optional[MandateOptions] preferred_settlement_speed: Optional[ Literal["fastest", "standard"] ] """ Preferred transaction settlement speed """ setup_future_usage: Optional[ Literal["none", "off_session", "on_session"] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ verification_method: Optional[ Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. """ _inner_class_types = { "financial_connections": FinancialConnections, "mandate_options": MandateOptions, } class WechatPay(StripeObject): app_id: Optional[str] """ The app ID registered with WeChat Pay. Only required when client is ios or android. """ client: Optional[Literal["android", "ios", "web"]] """ The client type that the end customer will pay from """ setup_future_usage: Optional[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class Zip(StripeObject): setup_future_usage: Optional[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ acss_debit: Optional[AcssDebit] affirm: Optional[Affirm] afterpay_clearpay: Optional[AfterpayClearpay] alipay: Optional[Alipay] amazon_pay: Optional[AmazonPay] 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] cashapp: Optional[Cashapp] customer_balance: Optional[CustomerBalance] eps: Optional[Eps] fpx: Optional[Fpx] giropay: Optional[Giropay] grabpay: Optional[Grabpay] ideal: Optional[Ideal] interac_present: Optional[InteracPresent] klarna: Optional[Klarna] konbini: Optional[Konbini] link: Optional[Link] mobilepay: Optional[Mobilepay] multibanco: Optional[Multibanco] oxxo: Optional[Oxxo] p24: Optional[P24] paynow: Optional[Paynow] paypal: Optional[Paypal] pix: Optional[Pix] promptpay: Optional[Promptpay] revolut_pay: Optional[RevolutPay] sepa_debit: Optional[SepaDebit] sofort: Optional[Sofort] swish: Optional[Swish] twint: Optional[Twint] us_bank_account: Optional[UsBankAccount] wechat_pay: Optional[WechatPay] zip: Optional[Zip] _inner_class_types = { "acss_debit": AcssDebit, "affirm": Affirm, "afterpay_clearpay": AfterpayClearpay, "alipay": Alipay, "amazon_pay": AmazonPay, "au_becs_debit": AuBecsDebit, "bacs_debit": BacsDebit, "bancontact": Bancontact, "blik": Blik, "boleto": Boleto, "card": Card, "card_present": CardPresent, "cashapp": Cashapp, "customer_balance": CustomerBalance, "eps": Eps, "fpx": Fpx, "giropay": Giropay, "grabpay": Grabpay, "ideal": Ideal, "interac_present": InteracPresent, "klarna": Klarna, "konbini": Konbini, "link": Link, "mobilepay": Mobilepay, "multibanco": Multibanco, "oxxo": Oxxo, "p24": P24, "paynow": Paynow, "paypal": Paypal, "pix": Pix, "promptpay": Promptpay, "revolut_pay": RevolutPay, "sepa_debit": SepaDebit, "sofort": Sofort, "swish": Swish, "twint": Twint, "us_bank_account": UsBankAccount, "wechat_pay": WechatPay, "zip": Zip, } class Processing(StripeObject): class Card(StripeObject): class CustomerNotification(StripeObject): approval_requested: Optional[bool] """ Whether customer approval has been requested for this payment. For payments greater than INR 15000 or mandate amount, the customer must provide explicit approval of the payment with their bank. """ completes_at: Optional[int] """ If customer approval is required, they need to provide approval before this time. """ customer_notification: Optional[CustomerNotification] _inner_class_types = { "customer_notification": CustomerNotification } card: Optional[Card] type: Literal["card"] """ Type of the payment method for which payment is in `processing` state, one of `card`. """ _inner_class_types = {"card": Card} class Shipping(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 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State, county, province, or region. """ address: Optional[Address] carrier: Optional[str] """ The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. """ name: Optional[str] """ Recipient name. """ phone: Optional[str] """ Recipient phone (including extension). """ tracking_number: Optional[str] """ The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ _inner_class_types = {"address": Address} class TransferData(StripeObject): amount: Optional[int] """ Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/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://stripe.com/docs/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). """ destination: ExpandableField["Account"] """ The account (if any) that the payment is attributed to for tax reporting, and where funds from the payment are transferred to after payment success. """ class ApplyCustomerBalanceParams(RequestOptions): amount: NotRequired[int] """ Amount that you intend to apply to this PaymentIntent from the customer's cash balance. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (for example, 100 cents to charge 1 USD or 100 to charge 100 JPY, a zero-decimal currency). The maximum amount is the amount of the PaymentIntent. When you omit the amount, it defaults to the remaining amount requested on the PaymentIntent. """ currency: NotRequired[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). """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CancelParams(RequestOptions): cancellation_reason: NotRequired[ Literal[ "abandoned", "duplicate", "fraudulent", "requested_by_customer" ] ] """ Reason for canceling this PaymentIntent. Possible values are: `duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned` """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CaptureParams(RequestOptions): amount_to_capture: NotRequired[int] """ The amount to capture from the PaymentIntent, which must be less than or equal to the original amount. Any additional amount is automatically refunded. Defaults to the full `amount_capturable` if it's not provided. """ application_fee_amount: NotRequired[int] """ The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ final_capture: NotRequired[bool] """ Defaults to `true`. When capturing a PaymentIntent, setting `final_capture` to `false` notifies Stripe to not release the remaining uncaptured funds to make sure that they're captured in future requests. You can only use this setting when [multicapture](https://stripe.com/docs/payments/multicapture) is available for PaymentIntents. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ statement_descriptor: NotRequired[str] """ For card charges, use [statement_descriptor_suffix](https://stripe.com/docs/payments/account/statement-descriptors#dynamic). Otherwise, you can use this value as the complete description of a charge on your customers' statements. It must contain at least one letter and be 1–22 characters long. """ statement_descriptor_suffix: NotRequired[str] """ Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. The concatenated descriptor must be 1-22 characters long. """ transfer_data: NotRequired["PaymentIntent.CaptureParamsTransferData"] """ The parameters that you can use to automatically create a transfer after the payment is captured. Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ class CaptureParamsTransferData(TypedDict): amount: NotRequired[int] """ The amount that will be transferred automatically when a charge succeeds. """ class ConfirmParams(RequestOptions): capture_method: NotRequired[ Literal["automatic", "automatic_async", "manual"] ] """ Controls when the funds will be captured from the customer's account. """ confirmation_token: NotRequired[str] """ ID of the ConfirmationToken used to confirm this PaymentIntent. If the provided ConfirmationToken contains properties that are also being provided in this request, such as `payment_method`, then the values in this request will take precedence. """ error_on_requires_action: NotRequired[bool] """ Set to `true` to fail the payment attempt if the PaymentIntent transitions into `requires_action`. This parameter is intended for simpler integrations that do not handle customer actions, like [saving cards without authentication](https://stripe.com/docs/payments/save-card-without-authentication). """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ mandate: NotRequired[str] """ ID of the mandate that's used for this payment. """ mandate_data: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsMandateData" ] off_session: NotRequired["bool|Literal['one_off', 'recurring']"] """ Set to `true` to indicate that the customer isn't in your checkout flow during this payment attempt and can't authenticate. Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards). """ payment_method: NotRequired[str] """ ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods/transitioning#compatibility) object) to attach to this PaymentIntent. """ payment_method_data: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodData" ] """ If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method) property on the PaymentIntent. """ payment_method_options: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodOptions" ] """ Payment method-specific configuration for this PaymentIntent. """ payment_method_types: NotRequired[List[str]] """ The list of payment method types (for example, a card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). """ radar_options: NotRequired["PaymentIntent.ConfirmParamsRadarOptions"] """ Options to configure Radar. Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session). """ receipt_email: NotRequired["Literal['']|str"] """ Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). """ return_url: NotRequired[str] """ The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. This parameter is only used for cards and other redirect-based payment methods. """ setup_future_usage: NotRequired[ "Literal['']|Literal['off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ shipping: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsShipping" ] """ Shipping information for this PaymentIntent. """ use_stripe_sdk: NotRequired[bool] """ Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. """ class ConfirmParamsMandateData(TypedDict): customer_acceptance: NotRequired[ "PaymentIntent.ConfirmParamsMandateDataCustomerAcceptance" ] """ This hash contains details about the customer acceptance of the Mandate. """ class ConfirmParamsMandateDataCustomerAcceptance(TypedDict): accepted_at: NotRequired[int] """ The time at which the customer accepted the Mandate. """ offline: NotRequired[ "PaymentIntent.ConfirmParamsMandateDataCustomerAcceptanceOffline" ] """ If this is a Mandate accepted offline, this hash contains details about the offline acceptance. """ online: NotRequired[ "PaymentIntent.ConfirmParamsMandateDataCustomerAcceptanceOnline" ] """ If this is a Mandate accepted online, this hash contains details about the online acceptance. """ type: Literal["offline", "online"] """ The type of customer acceptance information included with the Mandate. One of `online` or `offline`. """ class ConfirmParamsMandateDataCustomerAcceptanceOffline(TypedDict): pass class ConfirmParamsMandateDataCustomerAcceptanceOnline(TypedDict): ip_address: NotRequired[str] """ The IP address from which the Mandate was accepted by the customer. """ user_agent: NotRequired[str] """ The user agent of the browser from which the Mandate was accepted by the customer. """ class ConfirmParamsPaymentMethodData(TypedDict): acss_debit: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodDataAcssDebit" ] """ If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. """ affirm: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodDataAffirm" ] """ If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. """ afterpay_clearpay: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodDataAfterpayClearpay" ] """ If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. """ alipay: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodDataAlipay" ] """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ allow_redisplay: NotRequired[ Literal["always", "limited", "unspecified"] ] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ amazon_pay: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodDataAmazonPay" ] """ If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. """ au_becs_debit: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodDataAuBecsDebit" ] """ If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. """ bacs_debit: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodDataBacsDebit" ] """ If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. """ bancontact: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodDataBancontact" ] """ If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. """ billing_details: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodDataBillingDetails" ] """ Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. """ blik: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataBlik"] """ If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. """ boleto: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodDataBoleto" ] """ If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. """ cashapp: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodDataCashapp" ] """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ customer_balance: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodDataCustomerBalance" ] """ If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. """ eps: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataEps"] """ If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. """ fpx: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataFpx"] """ If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. """ giropay: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodDataGiropay" ] """ If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. """ grabpay: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodDataGrabpay" ] """ If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ ideal: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataIdeal"] """ If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. """ interac_present: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodDataInteracPresent" ] """ If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. """ klarna: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodDataKlarna" ] """ If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. """ konbini: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodDataKonbini" ] """ If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. """ link: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataLink"] """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ mobilepay: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodDataMobilepay" ] """ If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. """ multibanco: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodDataMultibanco" ] """ If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. """ oxxo: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataOxxo"] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. """ p24: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataP24"] """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ paynow: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodDataPaynow" ] """ If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. """ paypal: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodDataPaypal" ] """ If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. """ pix: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataPix"] """ If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. """ promptpay: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodDataPromptpay" ] """ If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. """ radar_options: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodDataRadarOptions" ] """ Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. """ revolut_pay: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodDataRevolutPay" ] """ If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. """ sepa_debit: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodDataSepaDebit" ] """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ sofort: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodDataSofort" ] """ If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. """ swish: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataSwish"] """ If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. """ twint: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataTwint"] """ If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. """ type: Literal[ "acss_debit", "affirm", "afterpay_clearpay", "alipay", "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", "blik", "boleto", "cashapp", "customer_balance", "eps", "fpx", "giropay", "grabpay", "ideal", "klarna", "konbini", "link", "mobilepay", "multibanco", "oxxo", "p24", "paynow", "paypal", "pix", "promptpay", "revolut_pay", "sepa_debit", "sofort", "swish", "twint", "us_bank_account", "wechat_pay", "zip", ] """ The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. """ us_bank_account: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodDataUsBankAccount" ] """ If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. """ wechat_pay: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodDataWechatPay" ] """ If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. """ zip: NotRequired["PaymentIntent.ConfirmParamsPaymentMethodDataZip"] """ If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. """ class ConfirmParamsPaymentMethodDataAcssDebit(TypedDict): account_number: str """ Customer's bank account number. """ institution_number: str """ Institution number of the customer's bank. """ transit_number: str """ Transit number of the customer's bank. """ class ConfirmParamsPaymentMethodDataAffirm(TypedDict): pass class ConfirmParamsPaymentMethodDataAfterpayClearpay(TypedDict): pass class ConfirmParamsPaymentMethodDataAlipay(TypedDict): pass class ConfirmParamsPaymentMethodDataAmazonPay(TypedDict): pass class ConfirmParamsPaymentMethodDataAuBecsDebit(TypedDict): account_number: str """ The account number for the bank account. """ bsb_number: str """ Bank-State-Branch number of the bank account. """ class ConfirmParamsPaymentMethodDataBacsDebit(TypedDict): account_number: NotRequired[str] """ Account number of the bank account that the funds will be debited from. """ sort_code: NotRequired[str] """ Sort code of the bank account. (e.g., `10-20-30`) """ class ConfirmParamsPaymentMethodDataBancontact(TypedDict): pass class ConfirmParamsPaymentMethodDataBillingDetails(TypedDict): address: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodDataBillingDetailsAddress" ] """ Billing address. """ email: NotRequired["Literal['']|str"] """ Email address. """ name: NotRequired["Literal['']|str"] """ Full name. """ phone: NotRequired["Literal['']|str"] """ Billing phone number (including extension). """ class ConfirmParamsPaymentMethodDataBillingDetailsAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class ConfirmParamsPaymentMethodDataBlik(TypedDict): pass class ConfirmParamsPaymentMethodDataBoleto(TypedDict): tax_id: str """ The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) """ class ConfirmParamsPaymentMethodDataCashapp(TypedDict): pass class ConfirmParamsPaymentMethodDataCustomerBalance(TypedDict): pass class ConfirmParamsPaymentMethodDataEps(TypedDict): bank: NotRequired[ Literal[ "arzte_und_apotheker_bank", "austrian_anadi_bank_ag", "bank_austria", "bankhaus_carl_spangler", "bankhaus_schelhammer_und_schattera_ag", "bawag_psk_ag", "bks_bank_ag", "brull_kallmus_bank_ag", "btv_vier_lander_bank", "capital_bank_grawe_gruppe_ag", "deutsche_bank_ag", "dolomitenbank", "easybank_ag", "erste_bank_und_sparkassen", "hypo_alpeadriabank_international_ag", "hypo_bank_burgenland_aktiengesellschaft", "hypo_noe_lb_fur_niederosterreich_u_wien", "hypo_oberosterreich_salzburg_steiermark", "hypo_tirol_bank_ag", "hypo_vorarlberg_bank_ag", "marchfelder_bank", "oberbank_ag", "raiffeisen_bankengruppe_osterreich", "schoellerbank_ag", "sparda_bank_wien", "volksbank_gruppe", "volkskreditbank_ag", "vr_bank_braunau", ] ] """ The customer's bank. """ class ConfirmParamsPaymentMethodDataFpx(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type for FPX transaction """ bank: Literal[ "affin_bank", "agrobank", "alliance_bank", "ambank", "bank_islam", "bank_muamalat", "bank_of_china", "bank_rakyat", "bsn", "cimb", "deutsche_bank", "hong_leong_bank", "hsbc", "kfh", "maybank2e", "maybank2u", "ocbc", "pb_enterprise", "public_bank", "rhb", "standard_chartered", "uob", ] """ The customer's bank. """ class ConfirmParamsPaymentMethodDataGiropay(TypedDict): pass class ConfirmParamsPaymentMethodDataGrabpay(TypedDict): pass class ConfirmParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ Literal[ "abn_amro", "asn_bank", "bunq", "handelsbanken", "ing", "knab", "moneyou", "n26", "nn", "rabobank", "regiobank", "revolut", "sns_bank", "triodos_bank", "van_lanschot", "yoursafe", ] ] """ The customer's bank. """ class ConfirmParamsPaymentMethodDataInteracPresent(TypedDict): pass class ConfirmParamsPaymentMethodDataKlarna(TypedDict): dob: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodDataKlarnaDob" ] """ Customer's date of birth """ class ConfirmParamsPaymentMethodDataKlarnaDob(TypedDict): day: int """ The day of birth, between 1 and 31. """ month: int """ The month of birth, between 1 and 12. """ year: int """ The four-digit year of birth. """ class ConfirmParamsPaymentMethodDataKonbini(TypedDict): pass class ConfirmParamsPaymentMethodDataLink(TypedDict): pass class ConfirmParamsPaymentMethodDataMobilepay(TypedDict): pass class ConfirmParamsPaymentMethodDataMultibanco(TypedDict): pass class ConfirmParamsPaymentMethodDataOxxo(TypedDict): pass class ConfirmParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ Literal[ "alior_bank", "bank_millennium", "bank_nowy_bfg_sa", "bank_pekao_sa", "banki_spbdzielcze", "blik", "bnp_paribas", "boz", "citi_handlowy", "credit_agricole", "envelobank", "etransfer_pocztowy24", "getin_bank", "ideabank", "ing", "inteligo", "mbank_mtransfer", "nest_przelew", "noble_pay", "pbac_z_ipko", "plus_bank", "santander_przelew24", "tmobile_usbugi_bankowe", "toyota_bank", "velobank", "volkswagen_bank", ] ] """ The customer's bank. """ class ConfirmParamsPaymentMethodDataPaynow(TypedDict): pass class ConfirmParamsPaymentMethodDataPaypal(TypedDict): pass class ConfirmParamsPaymentMethodDataPix(TypedDict): pass class ConfirmParamsPaymentMethodDataPromptpay(TypedDict): pass class ConfirmParamsPaymentMethodDataRadarOptions(TypedDict): session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ class ConfirmParamsPaymentMethodDataRevolutPay(TypedDict): pass class ConfirmParamsPaymentMethodDataSepaDebit(TypedDict): iban: str """ IBAN of the bank account. """ class ConfirmParamsPaymentMethodDataSofort(TypedDict): country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] """ Two-letter ISO code representing the country the bank account is located in. """ class ConfirmParamsPaymentMethodDataSwish(TypedDict): pass class ConfirmParamsPaymentMethodDataTwint(TypedDict): pass class ConfirmParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type: individual or company. """ account_number: NotRequired[str] """ Account number of the bank account. """ account_type: NotRequired[Literal["checking", "savings"]] """ Account type: checkings or savings. Defaults to checking if omitted. """ financial_connections_account: NotRequired[str] """ The ID of a Financial Connections Account to use as a payment method. """ routing_number: NotRequired[str] """ Routing number of the bank account. """ class ConfirmParamsPaymentMethodDataWechatPay(TypedDict): pass class ConfirmParamsPaymentMethodDataZip(TypedDict): pass class ConfirmParamsPaymentMethodOptions(TypedDict): acss_debit: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsAcssDebit" ] """ If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options. """ affirm: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsAffirm" ] """ If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options. """ afterpay_clearpay: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsAfterpayClearpay" ] """ If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options. """ alipay: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsAlipay" ] """ If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. """ amazon_pay: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsAmazonPay" ] """ If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options. """ au_becs_debit: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsAuBecsDebit" ] """ If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options. """ bacs_debit: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsBacsDebit" ] """ If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options. """ bancontact: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsBancontact" ] """ If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options. """ blik: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsBlik" ] """ If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options. """ boleto: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsBoleto" ] """ If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options. """ card: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsCard" ] """ Configuration for any card payments attempted on this PaymentIntent. """ card_present: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsCardPresent" ] """ If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. """ cashapp: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsCashapp" ] """ If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options. """ customer_balance: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsCustomerBalance" ] """ If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options. """ eps: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsEps" ] """ If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options. """ fpx: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsFpx" ] """ If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options. """ giropay: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsGiropay" ] """ If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options. """ grabpay: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsGrabpay" ] """ If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. """ ideal: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsIdeal" ] """ If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options. """ interac_present: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsInteracPresent" ] """ If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. """ klarna: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsKlarna" ] """ If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options. """ konbini: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsKonbini" ] """ If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options. """ link: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsLink" ] """ If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. """ mobilepay: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsMobilepay" ] """ If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options. """ multibanco: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsMultibanco" ] """ If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options. """ oxxo: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsOxxo" ] """ If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options. """ p24: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsP24" ] """ If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. """ paynow: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsPaynow" ] """ If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options. """ paypal: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsPaypal" ] """ If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. """ pix: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsPix" ] """ If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options. """ promptpay: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsPromptpay" ] """ If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options. """ revolut_pay: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsRevolutPay" ] """ If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options. """ sepa_debit: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsSepaDebit" ] """ If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options. """ sofort: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsSofort" ] """ If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. """ swish: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsSwish" ] """ If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options. """ twint: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsTwint" ] """ If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options. """ us_bank_account: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsUsBankAccount" ] """ If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options. """ wechat_pay: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsWechatPay" ] """ If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options. """ zip: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsZip" ] """ If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options. """ class ConfirmParamsPaymentMethodOptionsAcssDebit(TypedDict): mandate_options: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodOptionsAcssDebitMandateOptions" ] """ Additional fields for Mandate creation """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. """ class ConfirmParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): custom_mandate_url: NotRequired["Literal['']|str"] """ A URL for custom mandate text to render during confirmation step. The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. """ interval_description: NotRequired[str] """ Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. """ payment_schedule: NotRequired[ Literal["combined", "interval", "sporadic"] ] """ Payment schedule for the mandate. """ transaction_type: NotRequired[Literal["business", "personal"]] """ Transaction type of the mandate. """ class ConfirmParamsPaymentMethodOptionsAffirm(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ preferred_locale: NotRequired[str] """ Preferred language of the Affirm authorization page that the customer is redirected to. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ reference: NotRequired[str] """ An internal identifier or reference that this payment corresponds to. You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes. This field differs from the statement descriptor and item name. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsAlipay(TypedDict): setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsAmazonPay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class ConfirmParamsPaymentMethodOptionsAuBecsDebit(TypedDict): setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsBacsDebit(TypedDict): setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsBancontact(TypedDict): preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] """ Preferred language of the Bancontact authorization page that the customer is redirected to. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsBlik(TypedDict): code: NotRequired[str] """ The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. """ setup_future_usage: NotRequired["Literal['']|Literal['none']"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsBoleto(TypedDict): expires_after_days: NotRequired[int] """ The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsCard(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ cvc_token: NotRequired[str] """ A single-use `cvc_update` Token that represents a card CVC value. When provided, the CVC value will be verified during the card payment attempt. This parameter can only be provided during confirmation. """ installments: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodOptionsCardInstallments" ] """ Installment configuration for payments attempted on this PaymentIntent (Mexico Only). For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). """ mandate_options: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodOptionsCardMandateOptions" ] """ Configuration options for setting up an eMandate for cards issued in India. """ moto: NotRequired[bool] """ When specified, this parameter indicates that a transaction will be marked as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This parameter can only be provided during confirmation. """ network: NotRequired[ Literal[ "amex", "cartes_bancaires", "diners", "discover", "eftpos_au", "interac", "jcb", "mastercard", "unionpay", "unknown", "visa", ] ] """ Selected network to process this PaymentIntent on. Depends on the available networks of the card attached to the PaymentIntent. Can be only set confirm-time. """ request_extended_authorization: NotRequired[ Literal["if_available", "never"] ] """ Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent. """ request_incremental_authorization: NotRequired[ Literal["if_available", "never"] ] """ Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. """ request_multicapture: NotRequired[Literal["if_available", "never"]] """ Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent. """ request_overcapture: NotRequired[Literal["if_available", "never"]] """ Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. """ request_three_d_secure: NotRequired[ Literal["any", "automatic", "challenge"] ] """ 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://stripe.com/docs/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://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ require_cvc_recollection: NotRequired[bool] """ When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. using the cvc_token parameter). """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ statement_descriptor_suffix_kana: NotRequired["Literal['']|str"] """ Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. """ statement_descriptor_suffix_kanji: NotRequired["Literal['']|str"] """ 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. """ three_d_secure: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodOptionsCardThreeDSecure" ] """ If 3D Secure authentication was performed with a third-party provider, the authentication details to use for this payment. """ class ConfirmParamsPaymentMethodOptionsCardInstallments(TypedDict): enabled: NotRequired[bool] """ Setting to true enables installments for this PaymentIntent. This will cause the response to contain a list of available installment plans. Setting to false will prevent any selected plan from applying to a charge. """ plan: NotRequired[ "Literal['']|PaymentIntent.ConfirmParamsPaymentMethodOptionsCardInstallmentsPlan" ] """ The selected installment plan to use for this payment attempt. This parameter can only be provided during confirmation. """ class ConfirmParamsPaymentMethodOptionsCardInstallmentsPlan(TypedDict): count: int """ For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. """ interval: Literal["month"] """ For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. One of `month`. """ type: Literal["fixed_count"] """ Type of installment plan, one of `fixed_count`. """ class ConfirmParamsPaymentMethodOptionsCardMandateOptions(TypedDict): amount: int """ Amount to be charged for future payments. """ amount_type: Literal["fixed", "maximum"] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ description: NotRequired[str] """ A description of the mandate or subscription that is meant to be displayed to the customer. """ end_date: NotRequired[int] """ End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. """ interval: Literal["day", "month", "sporadic", "week", "year"] """ Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. """ interval_count: NotRequired[int] """ The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. """ reference: str """ Unique identifier for the mandate or subscription. """ start_date: int """ Start date of the mandate or subscription. Start date should not be lesser than yesterday. """ supported_types: NotRequired[List[Literal["india"]]] """ Specifies the type of mandates supported. Possible values are `india`. """ class ConfirmParamsPaymentMethodOptionsCardPresent(TypedDict): request_extended_authorization: NotRequired[bool] """ Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity) """ request_incremental_authorization_support: NotRequired[bool] """ Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. """ routing: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodOptionsCardPresentRouting" ] """ Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes. """ class ConfirmParamsPaymentMethodOptionsCardPresentRouting(TypedDict): requested_priority: NotRequired[Literal["domestic", "international"]] """ Routing requested priority """ class ConfirmParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): ares_trans_status: NotRequired[ Literal["A", "C", "I", "N", "R", "U", "Y"] ] """ The `transStatus` returned from the card Issuer's ACS in the ARes. """ cryptogram: str """ The cryptogram, also known as the "authentication value" (AAV, CAVV or AEVV). This value is 20 bytes, base64-encoded into a 28-character string. (Most 3D Secure providers will return the base64-encoded version, which is what you should specify here.) """ electronic_commerce_indicator: NotRequired[ Literal["01", "02", "05", "06", "07"] ] """ The Electronic Commerce Indicator (ECI) is returned by your 3D Secure provider and indicates what degree of authentication was performed. """ exemption_indicator: NotRequired[Literal["low_risk", "none"]] """ The exemption requested via 3DS and accepted by the issuer at authentication time. """ network_options: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions" ] """ Network specific 3DS fields. Network specific arguments require an explicit card brand choice. The parameter `payment_method_options.card.network`` must be populated accordingly """ requestor_challenge_indicator: NotRequired[str] """ The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. """ transaction_id: str """ For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server Transaction ID (dsTransID). """ version: Literal["1.0.2", "2.1.0", "2.2.0"] """ The version of 3D Secure that was performed. """ class ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions( TypedDict, ): cartes_bancaires: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires" ] """ Cartes Bancaires-specific 3DS fields. """ class ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires( TypedDict, ): cb_avalgo: Literal["0", "1", "2", "3", "4", "A"] """ The cryptogram calculation algorithm used by the card Issuer's ACS to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. messageExtension: CB-AVALGO """ cb_exemption: NotRequired[str] """ The exemption indicator returned from Cartes Bancaires in the ARes. message extension: CB-EXEMPTION; string (4 characters) This is a 3 byte bitmap (low significant byte first and most significant bit first) that has been Base64 encoded """ cb_score: NotRequired[int] """ The risk score returned from Cartes Bancaires in the ARes. message extension: CB-SCORE; numeric value 0-99 """ class ConfirmParamsPaymentMethodOptionsCashapp(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsCustomerBalance(TypedDict): bank_transfer: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodOptionsCustomerBalanceBankTransfer" ] """ Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. """ funding_type: NotRequired[Literal["bank_transfer"]] """ The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsCustomerBalanceBankTransfer( TypedDict, ): eu_bank_transfer: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer" ] """ Configuration for the eu_bank_transfer funding type. """ requested_address_types: NotRequired[ List[ Literal[ "aba", "iban", "sepa", "sort_code", "spei", "swift", "zengin", ] ] ] """ List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. """ type: Literal[ "eu_bank_transfer", "gb_bank_transfer", "jp_bank_transfer", "mx_bank_transfer", "us_bank_transfer", ] """ The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. """ class ConfirmParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer( TypedDict, ): country: str """ The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. """ class ConfirmParamsPaymentMethodOptionsEps(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsFpx(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsGiropay(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsGrabpay(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsIdeal(TypedDict): setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsInteracPresent(TypedDict): pass class ConfirmParamsPaymentMethodOptionsKlarna(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ preferred_locale: NotRequired[ Literal[ "cs-CZ", "da-DK", "de-AT", "de-CH", "de-DE", "el-GR", "en-AT", "en-AU", "en-BE", "en-CA", "en-CH", "en-CZ", "en-DE", "en-DK", "en-ES", "en-FI", "en-FR", "en-GB", "en-GR", "en-IE", "en-IT", "en-NL", "en-NO", "en-NZ", "en-PL", "en-PT", "en-RO", "en-SE", "en-US", "es-ES", "es-US", "fi-FI", "fr-BE", "fr-CA", "fr-CH", "fr-FR", "it-CH", "it-IT", "nb-NO", "nl-BE", "nl-NL", "pl-PL", "pt-PT", "ro-RO", "sv-FI", "sv-SE", ] ] """ Preferred language of the Klarna authorization page that the customer is redirected to """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsKonbini(TypedDict): confirmation_number: NotRequired["Literal['']|str"] """ An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores. Must not consist of only zeroes and could be rejected in case of insufficient uniqueness. We recommend to use the customer's phone number. """ expires_after_days: NotRequired["Literal['']|int"] """ The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. Defaults to 3 days. """ expires_at: NotRequired["Literal['']|int"] """ The timestamp at which the Konbini payment instructions will expire. Only one of `expires_after_days` or `expires_at` may be set. """ product_description: NotRequired["Literal['']|str"] """ A product descriptor of up to 22 characters, which will appear to customers at the convenience store. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsLink(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ persistent_token: NotRequired[str] """ [Deprecated] This is a legacy parameter that no longer has any function. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsMobilepay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsMultibanco(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsOxxo(TypedDict): expires_after_days: NotRequired[int] """ The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsP24(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ tos_shown_and_accepted: NotRequired[bool] """ Confirm that the payer has accepted the P24 terms and conditions. """ class ConfirmParamsPaymentMethodOptionsPaynow(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsPaypal(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds will be captured from the customer's account. """ preferred_locale: NotRequired[ Literal[ "cs-CZ", "da-DK", "de-AT", "de-DE", "de-LU", "el-GR", "en-GB", "en-US", "es-ES", "fi-FI", "fr-BE", "fr-FR", "fr-LU", "hu-HU", "it-IT", "nl-BE", "nl-NL", "pl-PL", "pt-PT", "sk-SK", "sv-SE", ] ] """ [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. """ reference: NotRequired[str] """ A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. """ risk_correlation_id: NotRequired[str] """ The risk correlation ID for an on-session payment using a saved PayPal payment method. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsPix(TypedDict): expires_after_seconds: NotRequired[int] """ The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. """ expires_at: NotRequired[int] """ The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). Defaults to 1 day in the future. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsPromptpay(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsRevolutPay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class ConfirmParamsPaymentMethodOptionsSepaDebit(TypedDict): mandate_options: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodOptionsSepaDebitMandateOptions" ] """ Additional fields for Mandate creation """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): pass class ConfirmParamsPaymentMethodOptionsSofort(TypedDict): preferred_language: NotRequired[ "Literal['']|Literal['de', 'en', 'es', 'fr', 'it', 'nl', 'pl']" ] """ Language shown to the payer on redirect. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsSwish(TypedDict): reference: NotRequired["Literal['']|str"] """ The order ID displayed in the Swish app after the payment is authorized. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsTwint(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsUsBankAccount(TypedDict): financial_connections: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections" ] """ Additional fields for Financial Connections Session creation """ mandate_options: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodOptionsUsBankAccountMandateOptions" ] """ Additional fields for Mandate creation """ networks: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodOptionsUsBankAccountNetworks" ] """ Additional fields for network related functions """ preferred_settlement_speed: NotRequired[ "Literal['']|Literal['fastest', 'standard']" ] """ Preferred transaction settlement speed """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. """ class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): filters: NotRequired[ "PaymentIntent.ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" ] """ Provide filters for the linked accounts that the customer can select for the payment method """ permissions: NotRequired[ List[ Literal[ "balances", "ownership", "payment_method", "transactions" ] ] ] """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ List[Literal["balances", "ownership", "transactions"]] ] """ List of data features that you would like to retrieve upon account creation. """ return_url: NotRequired[str] """ For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. """ class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( TypedDict, ): account_subcategories: NotRequired[ List[Literal["checking", "savings"]] ] """ The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. """ class ConfirmParamsPaymentMethodOptionsUsBankAccountMandateOptions( TypedDict, ): collection_method: NotRequired["Literal['']|Literal['paper']"] """ The method used to collect offline mandate customer acceptance. """ class ConfirmParamsPaymentMethodOptionsUsBankAccountNetworks(TypedDict): requested: NotRequired[List[Literal["ach", "us_domestic_wire"]]] """ Triggers validations to run across the selected networks """ class ConfirmParamsPaymentMethodOptionsWechatPay(TypedDict): app_id: NotRequired[str] """ The app ID registered with WeChat Pay. Only required when client is ios or android. """ client: Literal["android", "ios", "web"] """ The client type that the end customer will pay from """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsZip(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsRadarOptions(TypedDict): session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ class ConfirmParamsShipping(TypedDict): address: "PaymentIntent.ConfirmParamsShippingAddress" """ Shipping address. """ carrier: NotRequired[str] """ The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. """ name: str """ Recipient name. """ phone: NotRequired[str] """ Recipient phone (including extension). """ tracking_number: NotRequired[str] """ The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ class ConfirmParamsShippingAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParams(RequestOptions): amount: int """ Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/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://stripe.com/docs/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). """ application_fee_amount: NotRequired[int] """ The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ automatic_payment_methods: NotRequired[ "PaymentIntent.CreateParamsAutomaticPaymentMethods" ] """ When you enable this parameter, this PaymentIntent accepts payment methods that you enable in the Dashboard and that are compatible with this PaymentIntent's other parameters. """ capture_method: NotRequired[ Literal["automatic", "automatic_async", "manual"] ] """ Controls when the funds will be captured from the customer's account. """ confirm: NotRequired[bool] """ Set to `true` to attempt to [confirm this PaymentIntent](https://stripe.com/docs/api/payment_intents/confirm) immediately. This parameter defaults to `false`. When creating and confirming a PaymentIntent at the same time, you can also provide the parameters available in the [Confirm API](https://stripe.com/docs/api/payment_intents/confirm). """ confirmation_method: NotRequired[Literal["automatic", "manual"]] """ Describes whether we can confirm this PaymentIntent automatically, or if it requires customer action to confirm the payment. """ confirmation_token: NotRequired[str] """ ID of the ConfirmationToken used to confirm this PaymentIntent. If the provided ConfirmationToken contains properties that are also being provided in this request, such as `payment_method`, then the values in this request will take precedence. """ 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). """ customer: NotRequired[str] """ ID of the Customer this PaymentIntent belongs to, if one exists. Payment methods attached to other Customers cannot be used with this PaymentIntent. If present in combination with [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage), this PaymentIntent's payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. """ description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ error_on_requires_action: NotRequired[bool] """ Set to `true` to fail the payment attempt if the PaymentIntent transitions into `requires_action`. Use this parameter for simpler integrations that don't handle customer actions, such as [saving cards without authentication](https://stripe.com/docs/payments/save-card-without-authentication). This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ mandate: NotRequired[str] """ ID of the mandate that's used for this payment. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). """ mandate_data: NotRequired[ "Literal['']|PaymentIntent.CreateParamsMandateData" ] """ This hash contains details about the Mandate to create. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ off_session: NotRequired["bool|Literal['one_off', 'recurring']"] """ Set to `true` to indicate that the customer isn't in your checkout flow during this payment attempt and can't authenticate. Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards). This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). """ on_behalf_of: NotRequired[str] """ The Stripe account ID that these funds are intended for. Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ payment_method: NotRequired[str] """ ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/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. """ payment_method_configuration: NotRequired[str] """ The ID of the payment method configuration to use with this PaymentIntent. """ payment_method_data: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodData" ] """ If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method) property on the PaymentIntent. """ payment_method_options: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodOptions" ] """ Payment method-specific configuration for this PaymentIntent. """ payment_method_types: NotRequired[List[str]] """ The list of payment method types (for example, a card) that this PaymentIntent can use. If you don't provide this, it defaults to ["card"]. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). """ radar_options: NotRequired["PaymentIntent.CreateParamsRadarOptions"] """ Options to configure Radar. Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session). """ receipt_email: NotRequired[str] """ Email address to send the receipt to. If you specify `receipt_email` for a payment in live mode, you send a receipt regardless of your [email settings](https://dashboard.stripe.com/account/emails). """ return_url: NotRequired[str] """ The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). """ setup_future_usage: NotRequired[Literal["off_session", "on_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ shipping: NotRequired["PaymentIntent.CreateParamsShipping"] """ Shipping information for this PaymentIntent. """ statement_descriptor: NotRequired[str] """ For card charges, use [statement_descriptor_suffix](https://stripe.com/docs/payments/account/statement-descriptors#dynamic). Otherwise, you can use this value as the complete description of a charge on your customers' statements. It must contain at least one letter and be 1–22 characters long. """ statement_descriptor_suffix: NotRequired[str] """ Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. The concatenated descriptor must contain 1-22 characters. """ transfer_data: NotRequired["PaymentIntent.CreateParamsTransferData"] """ The parameters that you can use to automatically create a Transfer. Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ transfer_group: NotRequired[str] """ A string that identifies the resulting payment as part of a group. Learn more about the [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers). """ use_stripe_sdk: NotRequired[bool] """ Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. """ class CreateParamsAutomaticPaymentMethods(TypedDict): allow_redirects: NotRequired[Literal["always", "never"]] """ Controls whether this PaymentIntent will accept redirect-based payment methods. Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. To [confirm](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the payment. """ enabled: bool """ Whether this feature is enabled. """ class CreateParamsMandateData(TypedDict): customer_acceptance: ( "PaymentIntent.CreateParamsMandateDataCustomerAcceptance" ) """ This hash contains details about the customer acceptance of the Mandate. """ class CreateParamsMandateDataCustomerAcceptance(TypedDict): accepted_at: NotRequired[int] """ The time at which the customer accepted the Mandate. """ offline: NotRequired[ "PaymentIntent.CreateParamsMandateDataCustomerAcceptanceOffline" ] """ If this is a Mandate accepted offline, this hash contains details about the offline acceptance. """ online: NotRequired[ "PaymentIntent.CreateParamsMandateDataCustomerAcceptanceOnline" ] """ If this is a Mandate accepted online, this hash contains details about the online acceptance. """ type: Literal["offline", "online"] """ The type of customer acceptance information included with the Mandate. One of `online` or `offline`. """ class CreateParamsMandateDataCustomerAcceptanceOffline(TypedDict): pass class CreateParamsMandateDataCustomerAcceptanceOnline(TypedDict): ip_address: str """ The IP address from which the Mandate was accepted by the customer. """ user_agent: str """ The user agent of the browser from which the Mandate was accepted by the customer. """ class CreateParamsPaymentMethodData(TypedDict): acss_debit: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodDataAcssDebit" ] """ If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. """ affirm: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodDataAffirm" ] """ If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. """ afterpay_clearpay: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodDataAfterpayClearpay" ] """ If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. """ alipay: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodDataAlipay" ] """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ allow_redisplay: NotRequired[ Literal["always", "limited", "unspecified"] ] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ amazon_pay: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodDataAmazonPay" ] """ If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. """ au_becs_debit: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodDataAuBecsDebit" ] """ If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. """ bacs_debit: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodDataBacsDebit" ] """ If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. """ bancontact: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodDataBancontact" ] """ If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. """ billing_details: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodDataBillingDetails" ] """ Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. """ blik: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataBlik"] """ If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. """ boleto: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodDataBoleto" ] """ If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. """ cashapp: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodDataCashapp" ] """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ customer_balance: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodDataCustomerBalance" ] """ If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. """ eps: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataEps"] """ If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. """ fpx: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataFpx"] """ If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. """ giropay: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodDataGiropay" ] """ If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. """ grabpay: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodDataGrabpay" ] """ If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ ideal: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataIdeal"] """ If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. """ interac_present: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodDataInteracPresent" ] """ If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. """ klarna: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodDataKlarna" ] """ If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. """ konbini: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodDataKonbini" ] """ If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. """ link: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataLink"] """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ mobilepay: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodDataMobilepay" ] """ If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. """ multibanco: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodDataMultibanco" ] """ If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. """ oxxo: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataOxxo"] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. """ p24: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataP24"] """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ paynow: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodDataPaynow" ] """ If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. """ paypal: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodDataPaypal" ] """ If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. """ pix: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataPix"] """ If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. """ promptpay: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodDataPromptpay" ] """ If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. """ radar_options: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodDataRadarOptions" ] """ Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. """ revolut_pay: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodDataRevolutPay" ] """ If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. """ sepa_debit: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodDataSepaDebit" ] """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ sofort: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodDataSofort" ] """ If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. """ swish: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataSwish"] """ If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. """ twint: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataTwint"] """ If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. """ type: Literal[ "acss_debit", "affirm", "afterpay_clearpay", "alipay", "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", "blik", "boleto", "cashapp", "customer_balance", "eps", "fpx", "giropay", "grabpay", "ideal", "klarna", "konbini", "link", "mobilepay", "multibanco", "oxxo", "p24", "paynow", "paypal", "pix", "promptpay", "revolut_pay", "sepa_debit", "sofort", "swish", "twint", "us_bank_account", "wechat_pay", "zip", ] """ The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. """ us_bank_account: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodDataUsBankAccount" ] """ If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. """ wechat_pay: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodDataWechatPay" ] """ If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. """ zip: NotRequired["PaymentIntent.CreateParamsPaymentMethodDataZip"] """ If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. """ class CreateParamsPaymentMethodDataAcssDebit(TypedDict): account_number: str """ Customer's bank account number. """ institution_number: str """ Institution number of the customer's bank. """ transit_number: str """ Transit number of the customer's bank. """ class CreateParamsPaymentMethodDataAffirm(TypedDict): pass class CreateParamsPaymentMethodDataAfterpayClearpay(TypedDict): pass class CreateParamsPaymentMethodDataAlipay(TypedDict): pass class CreateParamsPaymentMethodDataAmazonPay(TypedDict): pass class CreateParamsPaymentMethodDataAuBecsDebit(TypedDict): account_number: str """ The account number for the bank account. """ bsb_number: str """ Bank-State-Branch number of the bank account. """ class CreateParamsPaymentMethodDataBacsDebit(TypedDict): account_number: NotRequired[str] """ Account number of the bank account that the funds will be debited from. """ sort_code: NotRequired[str] """ Sort code of the bank account. (e.g., `10-20-30`) """ class CreateParamsPaymentMethodDataBancontact(TypedDict): pass class CreateParamsPaymentMethodDataBillingDetails(TypedDict): address: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodDataBillingDetailsAddress" ] """ Billing address. """ email: NotRequired["Literal['']|str"] """ Email address. """ name: NotRequired["Literal['']|str"] """ Full name. """ phone: NotRequired["Literal['']|str"] """ Billing phone number (including extension). """ class CreateParamsPaymentMethodDataBillingDetailsAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsPaymentMethodDataBlik(TypedDict): pass class CreateParamsPaymentMethodDataBoleto(TypedDict): tax_id: str """ The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) """ class CreateParamsPaymentMethodDataCashapp(TypedDict): pass class CreateParamsPaymentMethodDataCustomerBalance(TypedDict): pass class CreateParamsPaymentMethodDataEps(TypedDict): bank: NotRequired[ Literal[ "arzte_und_apotheker_bank", "austrian_anadi_bank_ag", "bank_austria", "bankhaus_carl_spangler", "bankhaus_schelhammer_und_schattera_ag", "bawag_psk_ag", "bks_bank_ag", "brull_kallmus_bank_ag", "btv_vier_lander_bank", "capital_bank_grawe_gruppe_ag", "deutsche_bank_ag", "dolomitenbank", "easybank_ag", "erste_bank_und_sparkassen", "hypo_alpeadriabank_international_ag", "hypo_bank_burgenland_aktiengesellschaft", "hypo_noe_lb_fur_niederosterreich_u_wien", "hypo_oberosterreich_salzburg_steiermark", "hypo_tirol_bank_ag", "hypo_vorarlberg_bank_ag", "marchfelder_bank", "oberbank_ag", "raiffeisen_bankengruppe_osterreich", "schoellerbank_ag", "sparda_bank_wien", "volksbank_gruppe", "volkskreditbank_ag", "vr_bank_braunau", ] ] """ The customer's bank. """ class CreateParamsPaymentMethodDataFpx(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type for FPX transaction """ bank: Literal[ "affin_bank", "agrobank", "alliance_bank", "ambank", "bank_islam", "bank_muamalat", "bank_of_china", "bank_rakyat", "bsn", "cimb", "deutsche_bank", "hong_leong_bank", "hsbc", "kfh", "maybank2e", "maybank2u", "ocbc", "pb_enterprise", "public_bank", "rhb", "standard_chartered", "uob", ] """ The customer's bank. """ class CreateParamsPaymentMethodDataGiropay(TypedDict): pass class CreateParamsPaymentMethodDataGrabpay(TypedDict): pass class CreateParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ Literal[ "abn_amro", "asn_bank", "bunq", "handelsbanken", "ing", "knab", "moneyou", "n26", "nn", "rabobank", "regiobank", "revolut", "sns_bank", "triodos_bank", "van_lanschot", "yoursafe", ] ] """ The customer's bank. """ class CreateParamsPaymentMethodDataInteracPresent(TypedDict): pass class CreateParamsPaymentMethodDataKlarna(TypedDict): dob: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodDataKlarnaDob" ] """ Customer's date of birth """ class CreateParamsPaymentMethodDataKlarnaDob(TypedDict): day: int """ The day of birth, between 1 and 31. """ month: int """ The month of birth, between 1 and 12. """ year: int """ The four-digit year of birth. """ class CreateParamsPaymentMethodDataKonbini(TypedDict): pass class CreateParamsPaymentMethodDataLink(TypedDict): pass class CreateParamsPaymentMethodDataMobilepay(TypedDict): pass class CreateParamsPaymentMethodDataMultibanco(TypedDict): pass class CreateParamsPaymentMethodDataOxxo(TypedDict): pass class CreateParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ Literal[ "alior_bank", "bank_millennium", "bank_nowy_bfg_sa", "bank_pekao_sa", "banki_spbdzielcze", "blik", "bnp_paribas", "boz", "citi_handlowy", "credit_agricole", "envelobank", "etransfer_pocztowy24", "getin_bank", "ideabank", "ing", "inteligo", "mbank_mtransfer", "nest_przelew", "noble_pay", "pbac_z_ipko", "plus_bank", "santander_przelew24", "tmobile_usbugi_bankowe", "toyota_bank", "velobank", "volkswagen_bank", ] ] """ The customer's bank. """ class CreateParamsPaymentMethodDataPaynow(TypedDict): pass class CreateParamsPaymentMethodDataPaypal(TypedDict): pass class CreateParamsPaymentMethodDataPix(TypedDict): pass class CreateParamsPaymentMethodDataPromptpay(TypedDict): pass class CreateParamsPaymentMethodDataRadarOptions(TypedDict): session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ class CreateParamsPaymentMethodDataRevolutPay(TypedDict): pass class CreateParamsPaymentMethodDataSepaDebit(TypedDict): iban: str """ IBAN of the bank account. """ class CreateParamsPaymentMethodDataSofort(TypedDict): country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] """ Two-letter ISO code representing the country the bank account is located in. """ class CreateParamsPaymentMethodDataSwish(TypedDict): pass class CreateParamsPaymentMethodDataTwint(TypedDict): pass class CreateParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type: individual or company. """ account_number: NotRequired[str] """ Account number of the bank account. """ account_type: NotRequired[Literal["checking", "savings"]] """ Account type: checkings or savings. Defaults to checking if omitted. """ financial_connections_account: NotRequired[str] """ The ID of a Financial Connections Account to use as a payment method. """ routing_number: NotRequired[str] """ Routing number of the bank account. """ class CreateParamsPaymentMethodDataWechatPay(TypedDict): pass class CreateParamsPaymentMethodDataZip(TypedDict): pass class CreateParamsPaymentMethodOptions(TypedDict): acss_debit: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsAcssDebit" ] """ If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options. """ affirm: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsAffirm" ] """ If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options. """ afterpay_clearpay: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsAfterpayClearpay" ] """ If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options. """ alipay: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsAlipay" ] """ If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. """ amazon_pay: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsAmazonPay" ] """ If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options. """ au_becs_debit: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsAuBecsDebit" ] """ If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options. """ bacs_debit: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsBacsDebit" ] """ If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options. """ bancontact: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsBancontact" ] """ If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options. """ blik: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsBlik" ] """ If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options. """ boleto: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsBoleto" ] """ If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options. """ card: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsCard" ] """ Configuration for any card payments attempted on this PaymentIntent. """ card_present: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsCardPresent" ] """ If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. """ cashapp: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsCashapp" ] """ If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options. """ customer_balance: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsCustomerBalance" ] """ If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options. """ eps: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsEps" ] """ If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options. """ fpx: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsFpx" ] """ If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options. """ giropay: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsGiropay" ] """ If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options. """ grabpay: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsGrabpay" ] """ If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. """ ideal: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsIdeal" ] """ If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options. """ interac_present: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsInteracPresent" ] """ If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. """ klarna: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsKlarna" ] """ If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options. """ konbini: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsKonbini" ] """ If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options. """ link: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsLink" ] """ If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. """ mobilepay: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsMobilepay" ] """ If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options. """ multibanco: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsMultibanco" ] """ If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options. """ oxxo: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsOxxo" ] """ If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options. """ p24: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsP24" ] """ If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. """ paynow: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsPaynow" ] """ If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options. """ paypal: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsPaypal" ] """ If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. """ pix: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsPix" ] """ If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options. """ promptpay: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsPromptpay" ] """ If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options. """ revolut_pay: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsRevolutPay" ] """ If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options. """ sepa_debit: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsSepaDebit" ] """ If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options. """ sofort: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsSofort" ] """ If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. """ swish: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsSwish" ] """ If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options. """ twint: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsTwint" ] """ If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options. """ us_bank_account: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsUsBankAccount" ] """ If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options. """ wechat_pay: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsWechatPay" ] """ If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options. """ zip: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsZip" ] """ If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options. """ class CreateParamsPaymentMethodOptionsAcssDebit(TypedDict): mandate_options: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodOptionsAcssDebitMandateOptions" ] """ Additional fields for Mandate creation """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. """ class CreateParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): custom_mandate_url: NotRequired["Literal['']|str"] """ A URL for custom mandate text to render during confirmation step. The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. """ interval_description: NotRequired[str] """ Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. """ payment_schedule: NotRequired[ Literal["combined", "interval", "sporadic"] ] """ Payment schedule for the mandate. """ transaction_type: NotRequired[Literal["business", "personal"]] """ Transaction type of the mandate. """ class CreateParamsPaymentMethodOptionsAffirm(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ preferred_locale: NotRequired[str] """ Preferred language of the Affirm authorization page that the customer is redirected to. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ reference: NotRequired[str] """ An internal identifier or reference that this payment corresponds to. You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes. This field differs from the statement descriptor and item name. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsAlipay(TypedDict): setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsAmazonPay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsBancontact(TypedDict): preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] """ Preferred language of the Bancontact authorization page that the customer is redirected to. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsBlik(TypedDict): code: NotRequired[str] """ The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. """ setup_future_usage: NotRequired["Literal['']|Literal['none']"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsBoleto(TypedDict): expires_after_days: NotRequired[int] """ The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsCard(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ cvc_token: NotRequired[str] """ A single-use `cvc_update` Token that represents a card CVC value. When provided, the CVC value will be verified during the card payment attempt. This parameter can only be provided during confirmation. """ installments: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodOptionsCardInstallments" ] """ Installment configuration for payments attempted on this PaymentIntent (Mexico Only). For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). """ mandate_options: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodOptionsCardMandateOptions" ] """ Configuration options for setting up an eMandate for cards issued in India. """ moto: NotRequired[bool] """ When specified, this parameter indicates that a transaction will be marked as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This parameter can only be provided during confirmation. """ network: NotRequired[ Literal[ "amex", "cartes_bancaires", "diners", "discover", "eftpos_au", "interac", "jcb", "mastercard", "unionpay", "unknown", "visa", ] ] """ Selected network to process this PaymentIntent on. Depends on the available networks of the card attached to the PaymentIntent. Can be only set confirm-time. """ request_extended_authorization: NotRequired[ Literal["if_available", "never"] ] """ Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent. """ request_incremental_authorization: NotRequired[ Literal["if_available", "never"] ] """ Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. """ request_multicapture: NotRequired[Literal["if_available", "never"]] """ Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent. """ request_overcapture: NotRequired[Literal["if_available", "never"]] """ Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. """ request_three_d_secure: NotRequired[ Literal["any", "automatic", "challenge"] ] """ 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://stripe.com/docs/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://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ require_cvc_recollection: NotRequired[bool] """ When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. using the cvc_token parameter). """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ statement_descriptor_suffix_kana: NotRequired["Literal['']|str"] """ Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. """ statement_descriptor_suffix_kanji: NotRequired["Literal['']|str"] """ 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. """ three_d_secure: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodOptionsCardThreeDSecure" ] """ If 3D Secure authentication was performed with a third-party provider, the authentication details to use for this payment. """ class CreateParamsPaymentMethodOptionsCardInstallments(TypedDict): enabled: NotRequired[bool] """ Setting to true enables installments for this PaymentIntent. This will cause the response to contain a list of available installment plans. Setting to false will prevent any selected plan from applying to a charge. """ plan: NotRequired[ "Literal['']|PaymentIntent.CreateParamsPaymentMethodOptionsCardInstallmentsPlan" ] """ The selected installment plan to use for this payment attempt. This parameter can only be provided during confirmation. """ class CreateParamsPaymentMethodOptionsCardInstallmentsPlan(TypedDict): count: int """ For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. """ interval: Literal["month"] """ For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. One of `month`. """ type: Literal["fixed_count"] """ Type of installment plan, one of `fixed_count`. """ class CreateParamsPaymentMethodOptionsCardMandateOptions(TypedDict): amount: int """ Amount to be charged for future payments. """ amount_type: Literal["fixed", "maximum"] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ description: NotRequired[str] """ A description of the mandate or subscription that is meant to be displayed to the customer. """ end_date: NotRequired[int] """ End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. """ interval: Literal["day", "month", "sporadic", "week", "year"] """ Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. """ interval_count: NotRequired[int] """ The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. """ reference: str """ Unique identifier for the mandate or subscription. """ start_date: int """ Start date of the mandate or subscription. Start date should not be lesser than yesterday. """ supported_types: NotRequired[List[Literal["india"]]] """ Specifies the type of mandates supported. Possible values are `india`. """ class CreateParamsPaymentMethodOptionsCardPresent(TypedDict): request_extended_authorization: NotRequired[bool] """ Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity) """ request_incremental_authorization_support: NotRequired[bool] """ Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. """ routing: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodOptionsCardPresentRouting" ] """ Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes. """ class CreateParamsPaymentMethodOptionsCardPresentRouting(TypedDict): requested_priority: NotRequired[Literal["domestic", "international"]] """ Routing requested priority """ class CreateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): ares_trans_status: NotRequired[ Literal["A", "C", "I", "N", "R", "U", "Y"] ] """ The `transStatus` returned from the card Issuer's ACS in the ARes. """ cryptogram: str """ The cryptogram, also known as the "authentication value" (AAV, CAVV or AEVV). This value is 20 bytes, base64-encoded into a 28-character string. (Most 3D Secure providers will return the base64-encoded version, which is what you should specify here.) """ electronic_commerce_indicator: NotRequired[ Literal["01", "02", "05", "06", "07"] ] """ The Electronic Commerce Indicator (ECI) is returned by your 3D Secure provider and indicates what degree of authentication was performed. """ exemption_indicator: NotRequired[Literal["low_risk", "none"]] """ The exemption requested via 3DS and accepted by the issuer at authentication time. """ network_options: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions" ] """ Network specific 3DS fields. Network specific arguments require an explicit card brand choice. The parameter `payment_method_options.card.network`` must be populated accordingly """ requestor_challenge_indicator: NotRequired[str] """ The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. """ transaction_id: str """ For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server Transaction ID (dsTransID). """ version: Literal["1.0.2", "2.1.0", "2.2.0"] """ The version of 3D Secure that was performed. """ class CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions( TypedDict, ): cartes_bancaires: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires" ] """ Cartes Bancaires-specific 3DS fields. """ class CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires( TypedDict, ): cb_avalgo: Literal["0", "1", "2", "3", "4", "A"] """ The cryptogram calculation algorithm used by the card Issuer's ACS to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. messageExtension: CB-AVALGO """ cb_exemption: NotRequired[str] """ The exemption indicator returned from Cartes Bancaires in the ARes. message extension: CB-EXEMPTION; string (4 characters) This is a 3 byte bitmap (low significant byte first and most significant bit first) that has been Base64 encoded """ cb_score: NotRequired[int] """ The risk score returned from Cartes Bancaires in the ARes. message extension: CB-SCORE; numeric value 0-99 """ class CreateParamsPaymentMethodOptionsCashapp(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsCustomerBalance(TypedDict): bank_transfer: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodOptionsCustomerBalanceBankTransfer" ] """ Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. """ funding_type: NotRequired[Literal["bank_transfer"]] """ The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsCustomerBalanceBankTransfer( TypedDict, ): eu_bank_transfer: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer" ] """ Configuration for the eu_bank_transfer funding type. """ requested_address_types: NotRequired[ List[ Literal[ "aba", "iban", "sepa", "sort_code", "spei", "swift", "zengin", ] ] ] """ List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. """ type: Literal[ "eu_bank_transfer", "gb_bank_transfer", "jp_bank_transfer", "mx_bank_transfer", "us_bank_transfer", ] """ The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. """ class CreateParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer( TypedDict, ): country: str """ The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. """ class CreateParamsPaymentMethodOptionsEps(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsFpx(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsGiropay(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsGrabpay(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsIdeal(TypedDict): setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsInteracPresent(TypedDict): pass class CreateParamsPaymentMethodOptionsKlarna(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ preferred_locale: NotRequired[ Literal[ "cs-CZ", "da-DK", "de-AT", "de-CH", "de-DE", "el-GR", "en-AT", "en-AU", "en-BE", "en-CA", "en-CH", "en-CZ", "en-DE", "en-DK", "en-ES", "en-FI", "en-FR", "en-GB", "en-GR", "en-IE", "en-IT", "en-NL", "en-NO", "en-NZ", "en-PL", "en-PT", "en-RO", "en-SE", "en-US", "es-ES", "es-US", "fi-FI", "fr-BE", "fr-CA", "fr-CH", "fr-FR", "it-CH", "it-IT", "nb-NO", "nl-BE", "nl-NL", "pl-PL", "pt-PT", "ro-RO", "sv-FI", "sv-SE", ] ] """ Preferred language of the Klarna authorization page that the customer is redirected to """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsKonbini(TypedDict): confirmation_number: NotRequired["Literal['']|str"] """ An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores. Must not consist of only zeroes and could be rejected in case of insufficient uniqueness. We recommend to use the customer's phone number. """ expires_after_days: NotRequired["Literal['']|int"] """ The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. Defaults to 3 days. """ expires_at: NotRequired["Literal['']|int"] """ The timestamp at which the Konbini payment instructions will expire. Only one of `expires_after_days` or `expires_at` may be set. """ product_description: NotRequired["Literal['']|str"] """ A product descriptor of up to 22 characters, which will appear to customers at the convenience store. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsLink(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ persistent_token: NotRequired[str] """ [Deprecated] This is a legacy parameter that no longer has any function. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsMobilepay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsMultibanco(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsOxxo(TypedDict): expires_after_days: NotRequired[int] """ The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsP24(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ tos_shown_and_accepted: NotRequired[bool] """ Confirm that the payer has accepted the P24 terms and conditions. """ class CreateParamsPaymentMethodOptionsPaynow(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsPaypal(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds will be captured from the customer's account. """ preferred_locale: NotRequired[ Literal[ "cs-CZ", "da-DK", "de-AT", "de-DE", "de-LU", "el-GR", "en-GB", "en-US", "es-ES", "fi-FI", "fr-BE", "fr-FR", "fr-LU", "hu-HU", "it-IT", "nl-BE", "nl-NL", "pl-PL", "pt-PT", "sk-SK", "sv-SE", ] ] """ [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. """ reference: NotRequired[str] """ A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. """ risk_correlation_id: NotRequired[str] """ The risk correlation ID for an on-session payment using a saved PayPal payment method. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsPix(TypedDict): expires_after_seconds: NotRequired[int] """ The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. """ expires_at: NotRequired[int] """ The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). Defaults to 1 day in the future. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsPromptpay(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsRevolutPay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): mandate_options: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodOptionsSepaDebitMandateOptions" ] """ Additional fields for Mandate creation """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): pass class CreateParamsPaymentMethodOptionsSofort(TypedDict): preferred_language: NotRequired[ "Literal['']|Literal['de', 'en', 'es', 'fr', 'it', 'nl', 'pl']" ] """ Language shown to the payer on redirect. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsSwish(TypedDict): reference: NotRequired["Literal['']|str"] """ The order ID displayed in the Swish app after the payment is authorized. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsTwint(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): financial_connections: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections" ] """ Additional fields for Financial Connections Session creation """ mandate_options: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodOptionsUsBankAccountMandateOptions" ] """ Additional fields for Mandate creation """ networks: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodOptionsUsBankAccountNetworks" ] """ Additional fields for network related functions """ preferred_settlement_speed: NotRequired[ "Literal['']|Literal['fastest', 'standard']" ] """ Preferred transaction settlement speed """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. """ class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): filters: NotRequired[ "PaymentIntent.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" ] """ Provide filters for the linked accounts that the customer can select for the payment method """ permissions: NotRequired[ List[ Literal[ "balances", "ownership", "payment_method", "transactions" ] ] ] """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ List[Literal["balances", "ownership", "transactions"]] ] """ List of data features that you would like to retrieve upon account creation. """ return_url: NotRequired[str] """ For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. """ class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( TypedDict, ): account_subcategories: NotRequired[ List[Literal["checking", "savings"]] ] """ The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. """ class CreateParamsPaymentMethodOptionsUsBankAccountMandateOptions( TypedDict, ): collection_method: NotRequired["Literal['']|Literal['paper']"] """ The method used to collect offline mandate customer acceptance. """ class CreateParamsPaymentMethodOptionsUsBankAccountNetworks(TypedDict): requested: NotRequired[List[Literal["ach", "us_domestic_wire"]]] """ Triggers validations to run across the selected networks """ class CreateParamsPaymentMethodOptionsWechatPay(TypedDict): app_id: NotRequired[str] """ The app ID registered with WeChat Pay. Only required when client is ios or android. """ client: Literal["android", "ios", "web"] """ The client type that the end customer will pay from """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsZip(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsRadarOptions(TypedDict): session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ class CreateParamsShipping(TypedDict): address: "PaymentIntent.CreateParamsShippingAddress" """ Shipping address. """ carrier: NotRequired[str] """ The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. """ name: str """ Recipient name. """ phone: NotRequired[str] """ Recipient phone (including extension). """ tracking_number: NotRequired[str] """ The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ class CreateParamsShippingAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsTransferData(TypedDict): amount: NotRequired[int] """ The amount that will be transferred automatically when a charge succeeds. The amount is capped at the total transaction amount and if no amount is set, the full amount is transferred. If you intend to collect a fee and you need a more robust reporting experience, using [application_fee_amount](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-application_fee_amount) might be a better fit for your integration. """ destination: str """ If specified, successful charges will be attributed to the destination account for tax reporting, and the funds from charges will be transferred to the destination account. The ID of the resulting transfer will be returned on the successful charge's `transfer` field. """ class IncrementAuthorizationParams(RequestOptions): amount: int """ The updated total amount that you intend to collect from the cardholder. This amount must be greater than the currently authorized amount. """ application_fee_amount: NotRequired[int] """ The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ statement_descriptor: NotRequired[str] """ For card charges, use [statement_descriptor_suffix](https://stripe.com/docs/payments/account/statement-descriptors#dynamic). Otherwise, you can use this value as the complete description of a charge on your customers' statements. It must contain at least one letter and be 1–22 characters long. """ transfer_data: NotRequired[ "PaymentIntent.IncrementAuthorizationParamsTransferData" ] """ The parameters used to automatically create a transfer after the payment is captured. Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ class IncrementAuthorizationParamsTransferData(TypedDict): amount: NotRequired[int] """ The amount that will be transferred automatically when a charge succeeds. """ class ListParams(RequestOptions): created: NotRequired["PaymentIntent.ListParamsCreated|int"] """ A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp or a dictionary with a number of different query options. """ customer: NotRequired[str] """ Only return PaymentIntents for the customer that this customer ID specifies. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): amount: NotRequired[int] """ Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/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://stripe.com/docs/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). """ application_fee_amount: NotRequired["Literal['']|int"] """ The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ capture_method: NotRequired[ Literal["automatic", "automatic_async", "manual"] ] """ Controls when the funds will be captured from the customer's account. """ currency: NotRequired[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). """ customer: NotRequired[str] """ ID of the Customer this PaymentIntent belongs to, if one exists. Payment methods attached to other Customers cannot be used with this PaymentIntent. If present in combination with [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage), this PaymentIntent's payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. """ description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ payment_method: NotRequired[str] """ ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods/transitioning#compatibility) object) to attach to this PaymentIntent. """ payment_method_configuration: NotRequired[str] """ The ID of the payment method configuration to use with this PaymentIntent. """ payment_method_data: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodData" ] """ If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method) property on the PaymentIntent. """ payment_method_options: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodOptions" ] """ Payment-method-specific configuration for this PaymentIntent. """ payment_method_types: NotRequired[List[str]] """ The list of payment method types (for example, card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). """ receipt_email: NotRequired["Literal['']|str"] """ Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). """ setup_future_usage: NotRequired[ "Literal['']|Literal['off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ shipping: NotRequired["Literal['']|PaymentIntent.ModifyParamsShipping"] """ Shipping information for this PaymentIntent. """ statement_descriptor: NotRequired[str] """ For card charges, use [statement_descriptor_suffix](https://stripe.com/docs/payments/account/statement-descriptors#dynamic). Otherwise, you can use this value as the complete description of a charge on your customers' statements. It must contain at least one letter and be 1–22 characters long. """ statement_descriptor_suffix: NotRequired[str] """ Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. """ transfer_data: NotRequired["PaymentIntent.ModifyParamsTransferData"] """ Use this parameter to automatically create a Transfer when the payment succeeds. Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ transfer_group: NotRequired[str] """ A string that identifies the resulting payment as part of a group. You can only provide `transfer_group` if it hasn't been set. Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ class ModifyParamsPaymentMethodData(TypedDict): acss_debit: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodDataAcssDebit" ] """ If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. """ affirm: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodDataAffirm" ] """ If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. """ afterpay_clearpay: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodDataAfterpayClearpay" ] """ If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. """ alipay: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodDataAlipay" ] """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ allow_redisplay: NotRequired[ Literal["always", "limited", "unspecified"] ] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ amazon_pay: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodDataAmazonPay" ] """ If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. """ au_becs_debit: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodDataAuBecsDebit" ] """ If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. """ bacs_debit: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodDataBacsDebit" ] """ If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. """ bancontact: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodDataBancontact" ] """ If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. """ billing_details: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodDataBillingDetails" ] """ Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. """ blik: NotRequired["PaymentIntent.ModifyParamsPaymentMethodDataBlik"] """ If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. """ boleto: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodDataBoleto" ] """ If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. """ cashapp: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodDataCashapp" ] """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ customer_balance: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodDataCustomerBalance" ] """ If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. """ eps: NotRequired["PaymentIntent.ModifyParamsPaymentMethodDataEps"] """ If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. """ fpx: NotRequired["PaymentIntent.ModifyParamsPaymentMethodDataFpx"] """ If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. """ giropay: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodDataGiropay" ] """ If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. """ grabpay: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodDataGrabpay" ] """ If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ ideal: NotRequired["PaymentIntent.ModifyParamsPaymentMethodDataIdeal"] """ If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. """ interac_present: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodDataInteracPresent" ] """ If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. """ klarna: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodDataKlarna" ] """ If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. """ konbini: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodDataKonbini" ] """ If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. """ link: NotRequired["PaymentIntent.ModifyParamsPaymentMethodDataLink"] """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ mobilepay: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodDataMobilepay" ] """ If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. """ multibanco: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodDataMultibanco" ] """ If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. """ oxxo: NotRequired["PaymentIntent.ModifyParamsPaymentMethodDataOxxo"] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. """ p24: NotRequired["PaymentIntent.ModifyParamsPaymentMethodDataP24"] """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ paynow: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodDataPaynow" ] """ If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. """ paypal: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodDataPaypal" ] """ If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. """ pix: NotRequired["PaymentIntent.ModifyParamsPaymentMethodDataPix"] """ If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. """ promptpay: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodDataPromptpay" ] """ If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. """ radar_options: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodDataRadarOptions" ] """ Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. """ revolut_pay: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodDataRevolutPay" ] """ If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. """ sepa_debit: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodDataSepaDebit" ] """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ sofort: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodDataSofort" ] """ If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. """ swish: NotRequired["PaymentIntent.ModifyParamsPaymentMethodDataSwish"] """ If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. """ twint: NotRequired["PaymentIntent.ModifyParamsPaymentMethodDataTwint"] """ If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. """ type: Literal[ "acss_debit", "affirm", "afterpay_clearpay", "alipay", "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", "blik", "boleto", "cashapp", "customer_balance", "eps", "fpx", "giropay", "grabpay", "ideal", "klarna", "konbini", "link", "mobilepay", "multibanco", "oxxo", "p24", "paynow", "paypal", "pix", "promptpay", "revolut_pay", "sepa_debit", "sofort", "swish", "twint", "us_bank_account", "wechat_pay", "zip", ] """ The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. """ us_bank_account: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodDataUsBankAccount" ] """ If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. """ wechat_pay: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodDataWechatPay" ] """ If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. """ zip: NotRequired["PaymentIntent.ModifyParamsPaymentMethodDataZip"] """ If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. """ class ModifyParamsPaymentMethodDataAcssDebit(TypedDict): account_number: str """ Customer's bank account number. """ institution_number: str """ Institution number of the customer's bank. """ transit_number: str """ Transit number of the customer's bank. """ class ModifyParamsPaymentMethodDataAffirm(TypedDict): pass class ModifyParamsPaymentMethodDataAfterpayClearpay(TypedDict): pass class ModifyParamsPaymentMethodDataAlipay(TypedDict): pass class ModifyParamsPaymentMethodDataAmazonPay(TypedDict): pass class ModifyParamsPaymentMethodDataAuBecsDebit(TypedDict): account_number: str """ The account number for the bank account. """ bsb_number: str """ Bank-State-Branch number of the bank account. """ class ModifyParamsPaymentMethodDataBacsDebit(TypedDict): account_number: NotRequired[str] """ Account number of the bank account that the funds will be debited from. """ sort_code: NotRequired[str] """ Sort code of the bank account. (e.g., `10-20-30`) """ class ModifyParamsPaymentMethodDataBancontact(TypedDict): pass class ModifyParamsPaymentMethodDataBillingDetails(TypedDict): address: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodDataBillingDetailsAddress" ] """ Billing address. """ email: NotRequired["Literal['']|str"] """ Email address. """ name: NotRequired["Literal['']|str"] """ Full name. """ phone: NotRequired["Literal['']|str"] """ Billing phone number (including extension). """ class ModifyParamsPaymentMethodDataBillingDetailsAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class ModifyParamsPaymentMethodDataBlik(TypedDict): pass class ModifyParamsPaymentMethodDataBoleto(TypedDict): tax_id: str """ The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) """ class ModifyParamsPaymentMethodDataCashapp(TypedDict): pass class ModifyParamsPaymentMethodDataCustomerBalance(TypedDict): pass class ModifyParamsPaymentMethodDataEps(TypedDict): bank: NotRequired[ Literal[ "arzte_und_apotheker_bank", "austrian_anadi_bank_ag", "bank_austria", "bankhaus_carl_spangler", "bankhaus_schelhammer_und_schattera_ag", "bawag_psk_ag", "bks_bank_ag", "brull_kallmus_bank_ag", "btv_vier_lander_bank", "capital_bank_grawe_gruppe_ag", "deutsche_bank_ag", "dolomitenbank", "easybank_ag", "erste_bank_und_sparkassen", "hypo_alpeadriabank_international_ag", "hypo_bank_burgenland_aktiengesellschaft", "hypo_noe_lb_fur_niederosterreich_u_wien", "hypo_oberosterreich_salzburg_steiermark", "hypo_tirol_bank_ag", "hypo_vorarlberg_bank_ag", "marchfelder_bank", "oberbank_ag", "raiffeisen_bankengruppe_osterreich", "schoellerbank_ag", "sparda_bank_wien", "volksbank_gruppe", "volkskreditbank_ag", "vr_bank_braunau", ] ] """ The customer's bank. """ class ModifyParamsPaymentMethodDataFpx(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type for FPX transaction """ bank: Literal[ "affin_bank", "agrobank", "alliance_bank", "ambank", "bank_islam", "bank_muamalat", "bank_of_china", "bank_rakyat", "bsn", "cimb", "deutsche_bank", "hong_leong_bank", "hsbc", "kfh", "maybank2e", "maybank2u", "ocbc", "pb_enterprise", "public_bank", "rhb", "standard_chartered", "uob", ] """ The customer's bank. """ class ModifyParamsPaymentMethodDataGiropay(TypedDict): pass class ModifyParamsPaymentMethodDataGrabpay(TypedDict): pass class ModifyParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ Literal[ "abn_amro", "asn_bank", "bunq", "handelsbanken", "ing", "knab", "moneyou", "n26", "nn", "rabobank", "regiobank", "revolut", "sns_bank", "triodos_bank", "van_lanschot", "yoursafe", ] ] """ The customer's bank. """ class ModifyParamsPaymentMethodDataInteracPresent(TypedDict): pass class ModifyParamsPaymentMethodDataKlarna(TypedDict): dob: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodDataKlarnaDob" ] """ Customer's date of birth """ class ModifyParamsPaymentMethodDataKlarnaDob(TypedDict): day: int """ The day of birth, between 1 and 31. """ month: int """ The month of birth, between 1 and 12. """ year: int """ The four-digit year of birth. """ class ModifyParamsPaymentMethodDataKonbini(TypedDict): pass class ModifyParamsPaymentMethodDataLink(TypedDict): pass class ModifyParamsPaymentMethodDataMobilepay(TypedDict): pass class ModifyParamsPaymentMethodDataMultibanco(TypedDict): pass class ModifyParamsPaymentMethodDataOxxo(TypedDict): pass class ModifyParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ Literal[ "alior_bank", "bank_millennium", "bank_nowy_bfg_sa", "bank_pekao_sa", "banki_spbdzielcze", "blik", "bnp_paribas", "boz", "citi_handlowy", "credit_agricole", "envelobank", "etransfer_pocztowy24", "getin_bank", "ideabank", "ing", "inteligo", "mbank_mtransfer", "nest_przelew", "noble_pay", "pbac_z_ipko", "plus_bank", "santander_przelew24", "tmobile_usbugi_bankowe", "toyota_bank", "velobank", "volkswagen_bank", ] ] """ The customer's bank. """ class ModifyParamsPaymentMethodDataPaynow(TypedDict): pass class ModifyParamsPaymentMethodDataPaypal(TypedDict): pass class ModifyParamsPaymentMethodDataPix(TypedDict): pass class ModifyParamsPaymentMethodDataPromptpay(TypedDict): pass class ModifyParamsPaymentMethodDataRadarOptions(TypedDict): session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ class ModifyParamsPaymentMethodDataRevolutPay(TypedDict): pass class ModifyParamsPaymentMethodDataSepaDebit(TypedDict): iban: str """ IBAN of the bank account. """ class ModifyParamsPaymentMethodDataSofort(TypedDict): country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] """ Two-letter ISO code representing the country the bank account is located in. """ class ModifyParamsPaymentMethodDataSwish(TypedDict): pass class ModifyParamsPaymentMethodDataTwint(TypedDict): pass class ModifyParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type: individual or company. """ account_number: NotRequired[str] """ Account number of the bank account. """ account_type: NotRequired[Literal["checking", "savings"]] """ Account type: checkings or savings. Defaults to checking if omitted. """ financial_connections_account: NotRequired[str] """ The ID of a Financial Connections Account to use as a payment method. """ routing_number: NotRequired[str] """ Routing number of the bank account. """ class ModifyParamsPaymentMethodDataWechatPay(TypedDict): pass class ModifyParamsPaymentMethodDataZip(TypedDict): pass class ModifyParamsPaymentMethodOptions(TypedDict): acss_debit: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsAcssDebit" ] """ If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options. """ affirm: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsAffirm" ] """ If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options. """ afterpay_clearpay: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsAfterpayClearpay" ] """ If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options. """ alipay: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsAlipay" ] """ If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. """ amazon_pay: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsAmazonPay" ] """ If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options. """ au_becs_debit: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsAuBecsDebit" ] """ If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options. """ bacs_debit: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsBacsDebit" ] """ If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options. """ bancontact: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsBancontact" ] """ If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options. """ blik: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsBlik" ] """ If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options. """ boleto: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsBoleto" ] """ If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options. """ card: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsCard" ] """ Configuration for any card payments attempted on this PaymentIntent. """ card_present: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsCardPresent" ] """ If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. """ cashapp: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsCashapp" ] """ If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options. """ customer_balance: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsCustomerBalance" ] """ If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options. """ eps: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsEps" ] """ If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options. """ fpx: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsFpx" ] """ If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options. """ giropay: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsGiropay" ] """ If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options. """ grabpay: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsGrabpay" ] """ If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. """ ideal: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsIdeal" ] """ If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options. """ interac_present: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsInteracPresent" ] """ If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. """ klarna: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsKlarna" ] """ If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options. """ konbini: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsKonbini" ] """ If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options. """ link: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsLink" ] """ If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. """ mobilepay: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsMobilepay" ] """ If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options. """ multibanco: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsMultibanco" ] """ If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options. """ oxxo: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsOxxo" ] """ If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options. """ p24: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsP24" ] """ If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. """ paynow: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsPaynow" ] """ If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options. """ paypal: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsPaypal" ] """ If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. """ pix: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsPix" ] """ If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options. """ promptpay: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsPromptpay" ] """ If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options. """ revolut_pay: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsRevolutPay" ] """ If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options. """ sepa_debit: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsSepaDebit" ] """ If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options. """ sofort: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsSofort" ] """ If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. """ swish: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsSwish" ] """ If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options. """ twint: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsTwint" ] """ If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options. """ us_bank_account: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsUsBankAccount" ] """ If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options. """ wechat_pay: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsWechatPay" ] """ If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options. """ zip: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsZip" ] """ If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options. """ class ModifyParamsPaymentMethodOptionsAcssDebit(TypedDict): mandate_options: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodOptionsAcssDebitMandateOptions" ] """ Additional fields for Mandate creation """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. """ class ModifyParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): custom_mandate_url: NotRequired["Literal['']|str"] """ A URL for custom mandate text to render during confirmation step. The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. """ interval_description: NotRequired[str] """ Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. """ payment_schedule: NotRequired[ Literal["combined", "interval", "sporadic"] ] """ Payment schedule for the mandate. """ transaction_type: NotRequired[Literal["business", "personal"]] """ Transaction type of the mandate. """ class ModifyParamsPaymentMethodOptionsAffirm(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ preferred_locale: NotRequired[str] """ Preferred language of the Affirm authorization page that the customer is redirected to. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ reference: NotRequired[str] """ An internal identifier or reference that this payment corresponds to. You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes. This field differs from the statement descriptor and item name. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsAlipay(TypedDict): setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsAmazonPay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class ModifyParamsPaymentMethodOptionsAuBecsDebit(TypedDict): setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsBacsDebit(TypedDict): setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsBancontact(TypedDict): preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] """ Preferred language of the Bancontact authorization page that the customer is redirected to. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsBlik(TypedDict): code: NotRequired[str] """ The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. """ setup_future_usage: NotRequired["Literal['']|Literal['none']"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsBoleto(TypedDict): expires_after_days: NotRequired[int] """ The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsCard(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ cvc_token: NotRequired[str] """ A single-use `cvc_update` Token that represents a card CVC value. When provided, the CVC value will be verified during the card payment attempt. This parameter can only be provided during confirmation. """ installments: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodOptionsCardInstallments" ] """ Installment configuration for payments attempted on this PaymentIntent (Mexico Only). For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). """ mandate_options: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodOptionsCardMandateOptions" ] """ Configuration options for setting up an eMandate for cards issued in India. """ moto: NotRequired[bool] """ When specified, this parameter indicates that a transaction will be marked as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This parameter can only be provided during confirmation. """ network: NotRequired[ Literal[ "amex", "cartes_bancaires", "diners", "discover", "eftpos_au", "interac", "jcb", "mastercard", "unionpay", "unknown", "visa", ] ] """ Selected network to process this PaymentIntent on. Depends on the available networks of the card attached to the PaymentIntent. Can be only set confirm-time. """ request_extended_authorization: NotRequired[ Literal["if_available", "never"] ] """ Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent. """ request_incremental_authorization: NotRequired[ Literal["if_available", "never"] ] """ Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. """ request_multicapture: NotRequired[Literal["if_available", "never"]] """ Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent. """ request_overcapture: NotRequired[Literal["if_available", "never"]] """ Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. """ request_three_d_secure: NotRequired[ Literal["any", "automatic", "challenge"] ] """ 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://stripe.com/docs/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://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ require_cvc_recollection: NotRequired[bool] """ When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. using the cvc_token parameter). """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ statement_descriptor_suffix_kana: NotRequired["Literal['']|str"] """ Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. """ statement_descriptor_suffix_kanji: NotRequired["Literal['']|str"] """ 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. """ three_d_secure: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodOptionsCardThreeDSecure" ] """ If 3D Secure authentication was performed with a third-party provider, the authentication details to use for this payment. """ class ModifyParamsPaymentMethodOptionsCardInstallments(TypedDict): enabled: NotRequired[bool] """ Setting to true enables installments for this PaymentIntent. This will cause the response to contain a list of available installment plans. Setting to false will prevent any selected plan from applying to a charge. """ plan: NotRequired[ "Literal['']|PaymentIntent.ModifyParamsPaymentMethodOptionsCardInstallmentsPlan" ] """ The selected installment plan to use for this payment attempt. This parameter can only be provided during confirmation. """ class ModifyParamsPaymentMethodOptionsCardInstallmentsPlan(TypedDict): count: int """ For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. """ interval: Literal["month"] """ For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. One of `month`. """ type: Literal["fixed_count"] """ Type of installment plan, one of `fixed_count`. """ class ModifyParamsPaymentMethodOptionsCardMandateOptions(TypedDict): amount: int """ Amount to be charged for future payments. """ amount_type: Literal["fixed", "maximum"] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ description: NotRequired[str] """ A description of the mandate or subscription that is meant to be displayed to the customer. """ end_date: NotRequired[int] """ End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. """ interval: Literal["day", "month", "sporadic", "week", "year"] """ Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. """ interval_count: NotRequired[int] """ The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. """ reference: str """ Unique identifier for the mandate or subscription. """ start_date: int """ Start date of the mandate or subscription. Start date should not be lesser than yesterday. """ supported_types: NotRequired[List[Literal["india"]]] """ Specifies the type of mandates supported. Possible values are `india`. """ class ModifyParamsPaymentMethodOptionsCardPresent(TypedDict): request_extended_authorization: NotRequired[bool] """ Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity) """ request_incremental_authorization_support: NotRequired[bool] """ Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. """ routing: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodOptionsCardPresentRouting" ] """ Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes. """ class ModifyParamsPaymentMethodOptionsCardPresentRouting(TypedDict): requested_priority: NotRequired[Literal["domestic", "international"]] """ Routing requested priority """ class ModifyParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): ares_trans_status: NotRequired[ Literal["A", "C", "I", "N", "R", "U", "Y"] ] """ The `transStatus` returned from the card Issuer's ACS in the ARes. """ cryptogram: str """ The cryptogram, also known as the "authentication value" (AAV, CAVV or AEVV). This value is 20 bytes, base64-encoded into a 28-character string. (Most 3D Secure providers will return the base64-encoded version, which is what you should specify here.) """ electronic_commerce_indicator: NotRequired[ Literal["01", "02", "05", "06", "07"] ] """ The Electronic Commerce Indicator (ECI) is returned by your 3D Secure provider and indicates what degree of authentication was performed. """ exemption_indicator: NotRequired[Literal["low_risk", "none"]] """ The exemption requested via 3DS and accepted by the issuer at authentication time. """ network_options: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions" ] """ Network specific 3DS fields. Network specific arguments require an explicit card brand choice. The parameter `payment_method_options.card.network`` must be populated accordingly """ requestor_challenge_indicator: NotRequired[str] """ The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. """ transaction_id: str """ For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server Transaction ID (dsTransID). """ version: Literal["1.0.2", "2.1.0", "2.2.0"] """ The version of 3D Secure that was performed. """ class ModifyParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions( TypedDict, ): cartes_bancaires: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires" ] """ Cartes Bancaires-specific 3DS fields. """ class ModifyParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires( TypedDict, ): cb_avalgo: Literal["0", "1", "2", "3", "4", "A"] """ The cryptogram calculation algorithm used by the card Issuer's ACS to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. messageExtension: CB-AVALGO """ cb_exemption: NotRequired[str] """ The exemption indicator returned from Cartes Bancaires in the ARes. message extension: CB-EXEMPTION; string (4 characters) This is a 3 byte bitmap (low significant byte first and most significant bit first) that has been Base64 encoded """ cb_score: NotRequired[int] """ The risk score returned from Cartes Bancaires in the ARes. message extension: CB-SCORE; numeric value 0-99 """ class ModifyParamsPaymentMethodOptionsCashapp(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsCustomerBalance(TypedDict): bank_transfer: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodOptionsCustomerBalanceBankTransfer" ] """ Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. """ funding_type: NotRequired[Literal["bank_transfer"]] """ The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsCustomerBalanceBankTransfer( TypedDict, ): eu_bank_transfer: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer" ] """ Configuration for the eu_bank_transfer funding type. """ requested_address_types: NotRequired[ List[ Literal[ "aba", "iban", "sepa", "sort_code", "spei", "swift", "zengin", ] ] ] """ List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. """ type: Literal[ "eu_bank_transfer", "gb_bank_transfer", "jp_bank_transfer", "mx_bank_transfer", "us_bank_transfer", ] """ The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. """ class ModifyParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer( TypedDict, ): country: str """ The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. """ class ModifyParamsPaymentMethodOptionsEps(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsFpx(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsGiropay(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsGrabpay(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsIdeal(TypedDict): setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsInteracPresent(TypedDict): pass class ModifyParamsPaymentMethodOptionsKlarna(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ preferred_locale: NotRequired[ Literal[ "cs-CZ", "da-DK", "de-AT", "de-CH", "de-DE", "el-GR", "en-AT", "en-AU", "en-BE", "en-CA", "en-CH", "en-CZ", "en-DE", "en-DK", "en-ES", "en-FI", "en-FR", "en-GB", "en-GR", "en-IE", "en-IT", "en-NL", "en-NO", "en-NZ", "en-PL", "en-PT", "en-RO", "en-SE", "en-US", "es-ES", "es-US", "fi-FI", "fr-BE", "fr-CA", "fr-CH", "fr-FR", "it-CH", "it-IT", "nb-NO", "nl-BE", "nl-NL", "pl-PL", "pt-PT", "ro-RO", "sv-FI", "sv-SE", ] ] """ Preferred language of the Klarna authorization page that the customer is redirected to """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsKonbini(TypedDict): confirmation_number: NotRequired["Literal['']|str"] """ An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores. Must not consist of only zeroes and could be rejected in case of insufficient uniqueness. We recommend to use the customer's phone number. """ expires_after_days: NotRequired["Literal['']|int"] """ The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. Defaults to 3 days. """ expires_at: NotRequired["Literal['']|int"] """ The timestamp at which the Konbini payment instructions will expire. Only one of `expires_after_days` or `expires_at` may be set. """ product_description: NotRequired["Literal['']|str"] """ A product descriptor of up to 22 characters, which will appear to customers at the convenience store. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsLink(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ persistent_token: NotRequired[str] """ [Deprecated] This is a legacy parameter that no longer has any function. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsMobilepay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsMultibanco(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsOxxo(TypedDict): expires_after_days: NotRequired[int] """ The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsP24(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ tos_shown_and_accepted: NotRequired[bool] """ Confirm that the payer has accepted the P24 terms and conditions. """ class ModifyParamsPaymentMethodOptionsPaynow(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsPaypal(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds will be captured from the customer's account. """ preferred_locale: NotRequired[ Literal[ "cs-CZ", "da-DK", "de-AT", "de-DE", "de-LU", "el-GR", "en-GB", "en-US", "es-ES", "fi-FI", "fr-BE", "fr-FR", "fr-LU", "hu-HU", "it-IT", "nl-BE", "nl-NL", "pl-PL", "pt-PT", "sk-SK", "sv-SE", ] ] """ [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. """ reference: NotRequired[str] """ A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. """ risk_correlation_id: NotRequired[str] """ The risk correlation ID for an on-session payment using a saved PayPal payment method. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsPix(TypedDict): expires_after_seconds: NotRequired[int] """ The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. """ expires_at: NotRequired[int] """ The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). Defaults to 1 day in the future. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsPromptpay(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsRevolutPay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class ModifyParamsPaymentMethodOptionsSepaDebit(TypedDict): mandate_options: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodOptionsSepaDebitMandateOptions" ] """ Additional fields for Mandate creation """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): pass class ModifyParamsPaymentMethodOptionsSofort(TypedDict): preferred_language: NotRequired[ "Literal['']|Literal['de', 'en', 'es', 'fr', 'it', 'nl', 'pl']" ] """ Language shown to the payer on redirect. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsSwish(TypedDict): reference: NotRequired["Literal['']|str"] """ The order ID displayed in the Swish app after the payment is authorized. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsTwint(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsUsBankAccount(TypedDict): financial_connections: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnections" ] """ Additional fields for Financial Connections Session creation """ mandate_options: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodOptionsUsBankAccountMandateOptions" ] """ Additional fields for Mandate creation """ networks: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodOptionsUsBankAccountNetworks" ] """ Additional fields for network related functions """ preferred_settlement_speed: NotRequired[ "Literal['']|Literal['fastest', 'standard']" ] """ Preferred transaction settlement speed """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. """ class ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): filters: NotRequired[ "PaymentIntent.ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" ] """ Provide filters for the linked accounts that the customer can select for the payment method """ permissions: NotRequired[ List[ Literal[ "balances", "ownership", "payment_method", "transactions" ] ] ] """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ List[Literal["balances", "ownership", "transactions"]] ] """ List of data features that you would like to retrieve upon account creation. """ return_url: NotRequired[str] """ For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. """ class ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( TypedDict, ): account_subcategories: NotRequired[ List[Literal["checking", "savings"]] ] """ The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. """ class ModifyParamsPaymentMethodOptionsUsBankAccountMandateOptions( TypedDict, ): collection_method: NotRequired["Literal['']|Literal['paper']"] """ The method used to collect offline mandate customer acceptance. """ class ModifyParamsPaymentMethodOptionsUsBankAccountNetworks(TypedDict): requested: NotRequired[List[Literal["ach", "us_domestic_wire"]]] """ Triggers validations to run across the selected networks """ class ModifyParamsPaymentMethodOptionsWechatPay(TypedDict): app_id: NotRequired[str] """ The app ID registered with WeChat Pay. Only required when client is ios or android. """ client: Literal["android", "ios", "web"] """ The client type that the end customer will pay from """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ModifyParamsPaymentMethodOptionsZip(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ModifyParamsShipping(TypedDict): address: "PaymentIntent.ModifyParamsShippingAddress" """ Shipping address. """ carrier: NotRequired[str] """ The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. """ name: str """ Recipient name. """ phone: NotRequired[str] """ Recipient phone (including extension). """ tracking_number: NotRequired[str] """ The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ class ModifyParamsShippingAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class ModifyParamsTransferData(TypedDict): amount: NotRequired[int] """ The amount that will be transferred automatically when a charge succeeds. """ class RetrieveParams(RequestOptions): client_secret: NotRequired[str] """ The client secret of the PaymentIntent. We require it if you use a publishable key to retrieve the source. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class SearchParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ page: NotRequired[str] """ A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. """ query: str """ The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for payment intents](https://stripe.com/docs/search#query-fields-for-payment-intents). """ class VerifyMicrodepositsParams(RequestOptions): amounts: NotRequired[List[int]] """ Two positive integers, in *cents*, equal to the values of the microdeposits sent to the bank account. """ descriptor_code: NotRequired[str] """ A six-character code starting with SM present in the microdeposit sent to the bank account. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ amount: int """ Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/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://stripe.com/docs/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). """ amount_capturable: int """ Amount that can be captured from this PaymentIntent. """ amount_details: Optional[AmountDetails] amount_received: int """ Amount that this PaymentIntent collects. """ application: Optional[ExpandableField["Application"]] """ ID of the Connect application that created the PaymentIntent. """ application_fee_amount: Optional[int] """ The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ automatic_payment_methods: Optional[AutomaticPaymentMethods] """ Settings to configure compatible payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods) """ canceled_at: Optional[int] """ Populated when `status` is `canceled`, this is the time at which the PaymentIntent was canceled. Measured in seconds since the Unix epoch. """ cancellation_reason: Optional[ Literal[ "abandoned", "automatic", "duplicate", "failed_invoice", "fraudulent", "requested_by_customer", "void_invoice", ] ] """ Reason for cancellation of this PaymentIntent, either user-provided (`duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned`) or generated by Stripe internally (`failed_invoice`, `void_invoice`, or `automatic`). """ capture_method: Literal["automatic", "automatic_async", "manual"] """ Controls when the funds will be captured from the customer's account. """ client_secret: Optional[str] """ The client secret of this PaymentIntent. Used for client-side retrieval using a publishable key. The client secret can be used to complete a payment from your frontend. It should not be stored, logged, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret. Refer to our docs to [accept a payment](https://stripe.com/docs/payments/accept-a-payment?ui=elements) and learn about how `client_secret` should be handled. """ confirmation_method: Literal["automatic", "manual"] """ Describes whether we can confirm this PaymentIntent automatically, or if it requires customer action to confirm the payment. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ 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). """ customer: Optional[ExpandableField["Customer"]] """ ID of the Customer this PaymentIntent belongs to, if one exists. Payment methods attached to other Customers cannot be used with this PaymentIntent. If present in combination with [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage), this PaymentIntent's payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. """ description: Optional[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ id: str """ Unique identifier for the object. """ invoice: Optional[ExpandableField["Invoice"]] """ ID of the invoice that created this PaymentIntent, if it exists. """ last_payment_error: Optional[LastPaymentError] """ The payment error encountered in the previous PaymentIntent confirmation. It will be cleared if the PaymentIntent is later updated for any reason. """ latest_charge: Optional[ExpandableField["Charge"]] """ The latest charge created by this PaymentIntent. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ metadata: Dict[str, str] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Learn more about [storing information in metadata](https://stripe.com/docs/payments/payment-intents/creating-payment-intents#storing-information-in-metadata). """ next_action: Optional[NextAction] """ If present, this property tells you what actions you need to take in order for your customer to fulfill a payment using the provided source. """ object: Literal["payment_intent"] """ String representing the object's type. Objects of the same type share the same value. """ on_behalf_of: Optional[ExpandableField["Account"]] """ The account (if any) for which the funds of the PaymentIntent are intended. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts) for details. """ payment_method: Optional[ExpandableField["PaymentMethod"]] """ ID of the payment method used in this PaymentIntent. """ payment_method_configuration_details: Optional[ PaymentMethodConfigurationDetails ] """ Information about the payment method configuration used for this PaymentIntent. """ payment_method_options: Optional[PaymentMethodOptions] """ Payment-method-specific configuration for this PaymentIntent. """ payment_method_types: List[str] """ The list of payment method types (e.g. card) that this PaymentIntent is allowed to use. """ processing: Optional[Processing] """ If present, this property tells you about the processing state of the payment. """ receipt_email: Optional[str] """ Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). """ review: Optional[ExpandableField["Review"]] """ ID of the review associated with this PaymentIntent, if any. """ setup_future_usage: Optional[Literal["off_session", "on_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ shipping: Optional[Shipping] """ Shipping information for this PaymentIntent. """ source: Optional[ ExpandableField[ Union["Account", "BankAccount", "CardResource", "Source"] ] ] """ This is a legacy field that will be removed in the future. It is the ID of the Source object that is associated with this PaymentIntent, if one was supplied. """ statement_descriptor: Optional[str] """ For card charges, use [statement_descriptor_suffix](https://stripe.com/docs/payments/account/statement-descriptors#dynamic). Otherwise, you can use this value as the complete description of a charge on your customers' statements. It must contain at least one letter and be 1–22 characters long. """ statement_descriptor_suffix: Optional[str] """ Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. """ status: Literal[ "canceled", "processing", "requires_action", "requires_capture", "requires_confirmation", "requires_payment_method", "succeeded", ] """ Status of this PaymentIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `requires_capture`, `canceled`, or `succeeded`. Read more about each PaymentIntent [status](https://stripe.com/docs/payments/intents#intent-statuses). """ transfer_data: Optional[TransferData] """ The data that automatically creates a Transfer after the payment finalizes. Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ transfer_group: Optional[str] """ A string that identifies the resulting payment as part of a group. Learn more about the [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers). """ @classmethod def _cls_apply_customer_balance( cls, intent: str, **params: Unpack["PaymentIntent.ApplyCustomerBalanceParams"], ) -> "PaymentIntent": """ Manually reconcile the remaining amount for a customer_balance PaymentIntent. """ return cast( "PaymentIntent", cls._static_request( "post", "/v1/payment_intents/{intent}/apply_customer_balance".format( intent=sanitize_id(intent) ), params=params, ), ) @overload @staticmethod def apply_customer_balance( intent: str, **params: Unpack["PaymentIntent.ApplyCustomerBalanceParams"], ) -> "PaymentIntent": """ Manually reconcile the remaining amount for a customer_balance PaymentIntent. """ ... @overload def apply_customer_balance( self, **params: Unpack["PaymentIntent.ApplyCustomerBalanceParams"] ) -> "PaymentIntent": """ Manually reconcile the remaining amount for a customer_balance PaymentIntent. """ ... @class_method_variant("_cls_apply_customer_balance") def apply_customer_balance( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["PaymentIntent.ApplyCustomerBalanceParams"] ) -> "PaymentIntent": """ Manually reconcile the remaining amount for a customer_balance PaymentIntent. """ return cast( "PaymentIntent", self._request( "post", "/v1/payment_intents/{intent}/apply_customer_balance".format( intent=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_apply_customer_balance_async( cls, intent: str, **params: Unpack["PaymentIntent.ApplyCustomerBalanceParams"], ) -> "PaymentIntent": """ Manually reconcile the remaining amount for a customer_balance PaymentIntent. """ return cast( "PaymentIntent", await cls._static_request_async( "post", "/v1/payment_intents/{intent}/apply_customer_balance".format( intent=sanitize_id(intent) ), params=params, ), ) @overload @staticmethod async def apply_customer_balance_async( intent: str, **params: Unpack["PaymentIntent.ApplyCustomerBalanceParams"], ) -> "PaymentIntent": """ Manually reconcile the remaining amount for a customer_balance PaymentIntent. """ ... @overload async def apply_customer_balance_async( self, **params: Unpack["PaymentIntent.ApplyCustomerBalanceParams"] ) -> "PaymentIntent": """ Manually reconcile the remaining amount for a customer_balance PaymentIntent. """ ... @class_method_variant("_cls_apply_customer_balance_async") async def apply_customer_balance_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["PaymentIntent.ApplyCustomerBalanceParams"] ) -> "PaymentIntent": """ Manually reconcile the remaining amount for a customer_balance PaymentIntent. """ return cast( "PaymentIntent", await self._request_async( "post", "/v1/payment_intents/{intent}/apply_customer_balance".format( intent=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def _cls_cancel( cls, intent: str, **params: Unpack["PaymentIntent.CancelParams"] ) -> "PaymentIntent": """ You can cancel a PaymentIntent object when it's in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_action or, [in rare cases](https://stripe.com/docs/payments/intents), processing. After it's canceled, no additional charges are made by the PaymentIntent and any operations on the PaymentIntent fail with an error. For PaymentIntents with a status of requires_capture, the remaining amount_capturable is automatically refunded. You can't cancel the PaymentIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. """ return cast( "PaymentIntent", cls._static_request( "post", "/v1/payment_intents/{intent}/cancel".format( intent=sanitize_id(intent) ), params=params, ), ) @overload @staticmethod def cancel( intent: str, **params: Unpack["PaymentIntent.CancelParams"] ) -> "PaymentIntent": """ You can cancel a PaymentIntent object when it's in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_action or, [in rare cases](https://stripe.com/docs/payments/intents), processing. After it's canceled, no additional charges are made by the PaymentIntent and any operations on the PaymentIntent fail with an error. For PaymentIntents with a status of requires_capture, the remaining amount_capturable is automatically refunded. You can't cancel the PaymentIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. """ ... @overload def cancel( self, **params: Unpack["PaymentIntent.CancelParams"] ) -> "PaymentIntent": """ You can cancel a PaymentIntent object when it's in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_action or, [in rare cases](https://stripe.com/docs/payments/intents), processing. After it's canceled, no additional charges are made by the PaymentIntent and any operations on the PaymentIntent fail with an error. For PaymentIntents with a status of requires_capture, the remaining amount_capturable is automatically refunded. You can't cancel the PaymentIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. """ ... @class_method_variant("_cls_cancel") def cancel( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["PaymentIntent.CancelParams"] ) -> "PaymentIntent": """ You can cancel a PaymentIntent object when it's in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_action or, [in rare cases](https://stripe.com/docs/payments/intents), processing. After it's canceled, no additional charges are made by the PaymentIntent and any operations on the PaymentIntent fail with an error. For PaymentIntents with a status of requires_capture, the remaining amount_capturable is automatically refunded. You can't cancel the PaymentIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. """ return cast( "PaymentIntent", self._request( "post", "/v1/payment_intents/{intent}/cancel".format( intent=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_cancel_async( cls, intent: str, **params: Unpack["PaymentIntent.CancelParams"] ) -> "PaymentIntent": """ You can cancel a PaymentIntent object when it's in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_action or, [in rare cases](https://stripe.com/docs/payments/intents), processing. After it's canceled, no additional charges are made by the PaymentIntent and any operations on the PaymentIntent fail with an error. For PaymentIntents with a status of requires_capture, the remaining amount_capturable is automatically refunded. You can't cancel the PaymentIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. """ return cast( "PaymentIntent", await cls._static_request_async( "post", "/v1/payment_intents/{intent}/cancel".format( intent=sanitize_id(intent) ), params=params, ), ) @overload @staticmethod async def cancel_async( intent: str, **params: Unpack["PaymentIntent.CancelParams"] ) -> "PaymentIntent": """ You can cancel a PaymentIntent object when it's in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_action or, [in rare cases](https://stripe.com/docs/payments/intents), processing. After it's canceled, no additional charges are made by the PaymentIntent and any operations on the PaymentIntent fail with an error. For PaymentIntents with a status of requires_capture, the remaining amount_capturable is automatically refunded. You can't cancel the PaymentIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. """ ... @overload async def cancel_async( self, **params: Unpack["PaymentIntent.CancelParams"] ) -> "PaymentIntent": """ You can cancel a PaymentIntent object when it's in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_action or, [in rare cases](https://stripe.com/docs/payments/intents), processing. After it's canceled, no additional charges are made by the PaymentIntent and any operations on the PaymentIntent fail with an error. For PaymentIntents with a status of requires_capture, the remaining amount_capturable is automatically refunded. You can't cancel the PaymentIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. """ ... @class_method_variant("_cls_cancel_async") async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["PaymentIntent.CancelParams"] ) -> "PaymentIntent": """ You can cancel a PaymentIntent object when it's in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_action or, [in rare cases](https://stripe.com/docs/payments/intents), processing. After it's canceled, no additional charges are made by the PaymentIntent and any operations on the PaymentIntent fail with an error. For PaymentIntents with a status of requires_capture, the remaining amount_capturable is automatically refunded. You can't cancel the PaymentIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. """ return cast( "PaymentIntent", await self._request_async( "post", "/v1/payment_intents/{intent}/cancel".format( intent=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def _cls_capture( cls, intent: str, **params: Unpack["PaymentIntent.CaptureParams"] ) -> "PaymentIntent": """ Capture the funds of an existing uncaptured PaymentIntent when its status is requires_capture. Uncaptured PaymentIntents are cancelled a set number of days (7 by default) after their creation. Learn more about [separate authorization and capture](https://stripe.com/docs/payments/capture-later). """ return cast( "PaymentIntent", cls._static_request( "post", "/v1/payment_intents/{intent}/capture".format( intent=sanitize_id(intent) ), params=params, ), ) @overload @staticmethod def capture( intent: str, **params: Unpack["PaymentIntent.CaptureParams"] ) -> "PaymentIntent": """ Capture the funds of an existing uncaptured PaymentIntent when its status is requires_capture. Uncaptured PaymentIntents are cancelled a set number of days (7 by default) after their creation. Learn more about [separate authorization and capture](https://stripe.com/docs/payments/capture-later). """ ... @overload def capture( self, **params: Unpack["PaymentIntent.CaptureParams"] ) -> "PaymentIntent": """ Capture the funds of an existing uncaptured PaymentIntent when its status is requires_capture. Uncaptured PaymentIntents are cancelled a set number of days (7 by default) after their creation. Learn more about [separate authorization and capture](https://stripe.com/docs/payments/capture-later). """ ... @class_method_variant("_cls_capture") def capture( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["PaymentIntent.CaptureParams"] ) -> "PaymentIntent": """ Capture the funds of an existing uncaptured PaymentIntent when its status is requires_capture. Uncaptured PaymentIntents are cancelled a set number of days (7 by default) after their creation. Learn more about [separate authorization and capture](https://stripe.com/docs/payments/capture-later). """ return cast( "PaymentIntent", self._request( "post", "/v1/payment_intents/{intent}/capture".format( intent=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_capture_async( cls, intent: str, **params: Unpack["PaymentIntent.CaptureParams"] ) -> "PaymentIntent": """ Capture the funds of an existing uncaptured PaymentIntent when its status is requires_capture. Uncaptured PaymentIntents are cancelled a set number of days (7 by default) after their creation. Learn more about [separate authorization and capture](https://stripe.com/docs/payments/capture-later). """ return cast( "PaymentIntent", await cls._static_request_async( "post", "/v1/payment_intents/{intent}/capture".format( intent=sanitize_id(intent) ), params=params, ), ) @overload @staticmethod async def capture_async( intent: str, **params: Unpack["PaymentIntent.CaptureParams"] ) -> "PaymentIntent": """ Capture the funds of an existing uncaptured PaymentIntent when its status is requires_capture. Uncaptured PaymentIntents are cancelled a set number of days (7 by default) after their creation. Learn more about [separate authorization and capture](https://stripe.com/docs/payments/capture-later). """ ... @overload async def capture_async( self, **params: Unpack["PaymentIntent.CaptureParams"] ) -> "PaymentIntent": """ Capture the funds of an existing uncaptured PaymentIntent when its status is requires_capture. Uncaptured PaymentIntents are cancelled a set number of days (7 by default) after their creation. Learn more about [separate authorization and capture](https://stripe.com/docs/payments/capture-later). """ ... @class_method_variant("_cls_capture_async") async def capture_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["PaymentIntent.CaptureParams"] ) -> "PaymentIntent": """ Capture the funds of an existing uncaptured PaymentIntent when its status is requires_capture. Uncaptured PaymentIntents are cancelled a set number of days (7 by default) after their creation. Learn more about [separate authorization and capture](https://stripe.com/docs/payments/capture-later). """ return cast( "PaymentIntent", await self._request_async( "post", "/v1/payment_intents/{intent}/capture".format( intent=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def _cls_confirm( cls, intent: str, **params: Unpack["PaymentIntent.ConfirmParams"] ) -> "PaymentIntent": """ Confirm that your customer intends to pay with current or provided payment method. Upon confirmation, the PaymentIntent will attempt to initiate a payment. If the selected payment method requires additional authentication steps, the PaymentIntent will transition to the requires_action status and suggest additional actions via next_action. If payment fails, the PaymentIntent transitions to the requires_payment_method status or the canceled status if the confirmation limit is reached. If payment succeeds, the PaymentIntent will transition to the succeeded status (or requires_capture, if capture_method is set to manual). If the confirmation_method is automatic, payment may be attempted using our [client SDKs](https://stripe.com/docs/stripe-js/reference#stripe-handle-card-payment) and the PaymentIntent's [client_secret](https://stripe.com/docs/api#payment_intent_object-client_secret). After next_actions are handled by the client, no additional confirmation is required to complete the payment. If the confirmation_method is manual, all payment attempts must be initiated using a secret key. If any actions are required for the payment, the PaymentIntent will return to the requires_confirmation state after those actions are completed. Your server needs to then explicitly re-confirm the PaymentIntent to initiate the next payment attempt. """ return cast( "PaymentIntent", cls._static_request( "post", "/v1/payment_intents/{intent}/confirm".format( intent=sanitize_id(intent) ), params=params, ), ) @overload @staticmethod def confirm( intent: str, **params: Unpack["PaymentIntent.ConfirmParams"] ) -> "PaymentIntent": """ Confirm that your customer intends to pay with current or provided payment method. Upon confirmation, the PaymentIntent will attempt to initiate a payment. If the selected payment method requires additional authentication steps, the PaymentIntent will transition to the requires_action status and suggest additional actions via next_action. If payment fails, the PaymentIntent transitions to the requires_payment_method status or the canceled status if the confirmation limit is reached. If payment succeeds, the PaymentIntent will transition to the succeeded status (or requires_capture, if capture_method is set to manual). If the confirmation_method is automatic, payment may be attempted using our [client SDKs](https://stripe.com/docs/stripe-js/reference#stripe-handle-card-payment) and the PaymentIntent's [client_secret](https://stripe.com/docs/api#payment_intent_object-client_secret). After next_actions are handled by the client, no additional confirmation is required to complete the payment. If the confirmation_method is manual, all payment attempts must be initiated using a secret key. If any actions are required for the payment, the PaymentIntent will return to the requires_confirmation state after those actions are completed. Your server needs to then explicitly re-confirm the PaymentIntent to initiate the next payment attempt. """ ... @overload def confirm( self, **params: Unpack["PaymentIntent.ConfirmParams"] ) -> "PaymentIntent": """ Confirm that your customer intends to pay with current or provided payment method. Upon confirmation, the PaymentIntent will attempt to initiate a payment. If the selected payment method requires additional authentication steps, the PaymentIntent will transition to the requires_action status and suggest additional actions via next_action. If payment fails, the PaymentIntent transitions to the requires_payment_method status or the canceled status if the confirmation limit is reached. If payment succeeds, the PaymentIntent will transition to the succeeded status (or requires_capture, if capture_method is set to manual). If the confirmation_method is automatic, payment may be attempted using our [client SDKs](https://stripe.com/docs/stripe-js/reference#stripe-handle-card-payment) and the PaymentIntent's [client_secret](https://stripe.com/docs/api#payment_intent_object-client_secret). After next_actions are handled by the client, no additional confirmation is required to complete the payment. If the confirmation_method is manual, all payment attempts must be initiated using a secret key. If any actions are required for the payment, the PaymentIntent will return to the requires_confirmation state after those actions are completed. Your server needs to then explicitly re-confirm the PaymentIntent to initiate the next payment attempt. """ ... @class_method_variant("_cls_confirm") def confirm( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["PaymentIntent.ConfirmParams"] ) -> "PaymentIntent": """ Confirm that your customer intends to pay with current or provided payment method. Upon confirmation, the PaymentIntent will attempt to initiate a payment. If the selected payment method requires additional authentication steps, the PaymentIntent will transition to the requires_action status and suggest additional actions via next_action. If payment fails, the PaymentIntent transitions to the requires_payment_method status or the canceled status if the confirmation limit is reached. If payment succeeds, the PaymentIntent will transition to the succeeded status (or requires_capture, if capture_method is set to manual). If the confirmation_method is automatic, payment may be attempted using our [client SDKs](https://stripe.com/docs/stripe-js/reference#stripe-handle-card-payment) and the PaymentIntent's [client_secret](https://stripe.com/docs/api#payment_intent_object-client_secret). After next_actions are handled by the client, no additional confirmation is required to complete the payment. If the confirmation_method is manual, all payment attempts must be initiated using a secret key. If any actions are required for the payment, the PaymentIntent will return to the requires_confirmation state after those actions are completed. Your server needs to then explicitly re-confirm the PaymentIntent to initiate the next payment attempt. """ return cast( "PaymentIntent", self._request( "post", "/v1/payment_intents/{intent}/confirm".format( intent=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_confirm_async( cls, intent: str, **params: Unpack["PaymentIntent.ConfirmParams"] ) -> "PaymentIntent": """ Confirm that your customer intends to pay with current or provided payment method. Upon confirmation, the PaymentIntent will attempt to initiate a payment. If the selected payment method requires additional authentication steps, the PaymentIntent will transition to the requires_action status and suggest additional actions via next_action. If payment fails, the PaymentIntent transitions to the requires_payment_method status or the canceled status if the confirmation limit is reached. If payment succeeds, the PaymentIntent will transition to the succeeded status (or requires_capture, if capture_method is set to manual). If the confirmation_method is automatic, payment may be attempted using our [client SDKs](https://stripe.com/docs/stripe-js/reference#stripe-handle-card-payment) and the PaymentIntent's [client_secret](https://stripe.com/docs/api#payment_intent_object-client_secret). After next_actions are handled by the client, no additional confirmation is required to complete the payment. If the confirmation_method is manual, all payment attempts must be initiated using a secret key. If any actions are required for the payment, the PaymentIntent will return to the requires_confirmation state after those actions are completed. Your server needs to then explicitly re-confirm the PaymentIntent to initiate the next payment attempt. """ return cast( "PaymentIntent", await cls._static_request_async( "post", "/v1/payment_intents/{intent}/confirm".format( intent=sanitize_id(intent) ), params=params, ), ) @overload @staticmethod async def confirm_async( intent: str, **params: Unpack["PaymentIntent.ConfirmParams"] ) -> "PaymentIntent": """ Confirm that your customer intends to pay with current or provided payment method. Upon confirmation, the PaymentIntent will attempt to initiate a payment. If the selected payment method requires additional authentication steps, the PaymentIntent will transition to the requires_action status and suggest additional actions via next_action. If payment fails, the PaymentIntent transitions to the requires_payment_method status or the canceled status if the confirmation limit is reached. If payment succeeds, the PaymentIntent will transition to the succeeded status (or requires_capture, if capture_method is set to manual). If the confirmation_method is automatic, payment may be attempted using our [client SDKs](https://stripe.com/docs/stripe-js/reference#stripe-handle-card-payment) and the PaymentIntent's [client_secret](https://stripe.com/docs/api#payment_intent_object-client_secret). After next_actions are handled by the client, no additional confirmation is required to complete the payment. If the confirmation_method is manual, all payment attempts must be initiated using a secret key. If any actions are required for the payment, the PaymentIntent will return to the requires_confirmation state after those actions are completed. Your server needs to then explicitly re-confirm the PaymentIntent to initiate the next payment attempt. """ ... @overload async def confirm_async( self, **params: Unpack["PaymentIntent.ConfirmParams"] ) -> "PaymentIntent": """ Confirm that your customer intends to pay with current or provided payment method. Upon confirmation, the PaymentIntent will attempt to initiate a payment. If the selected payment method requires additional authentication steps, the PaymentIntent will transition to the requires_action status and suggest additional actions via next_action. If payment fails, the PaymentIntent transitions to the requires_payment_method status or the canceled status if the confirmation limit is reached. If payment succeeds, the PaymentIntent will transition to the succeeded status (or requires_capture, if capture_method is set to manual). If the confirmation_method is automatic, payment may be attempted using our [client SDKs](https://stripe.com/docs/stripe-js/reference#stripe-handle-card-payment) and the PaymentIntent's [client_secret](https://stripe.com/docs/api#payment_intent_object-client_secret). After next_actions are handled by the client, no additional confirmation is required to complete the payment. If the confirmation_method is manual, all payment attempts must be initiated using a secret key. If any actions are required for the payment, the PaymentIntent will return to the requires_confirmation state after those actions are completed. Your server needs to then explicitly re-confirm the PaymentIntent to initiate the next payment attempt. """ ... @class_method_variant("_cls_confirm_async") async def confirm_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["PaymentIntent.ConfirmParams"] ) -> "PaymentIntent": """ Confirm that your customer intends to pay with current or provided payment method. Upon confirmation, the PaymentIntent will attempt to initiate a payment. If the selected payment method requires additional authentication steps, the PaymentIntent will transition to the requires_action status and suggest additional actions via next_action. If payment fails, the PaymentIntent transitions to the requires_payment_method status or the canceled status if the confirmation limit is reached. If payment succeeds, the PaymentIntent will transition to the succeeded status (or requires_capture, if capture_method is set to manual). If the confirmation_method is automatic, payment may be attempted using our [client SDKs](https://stripe.com/docs/stripe-js/reference#stripe-handle-card-payment) and the PaymentIntent's [client_secret](https://stripe.com/docs/api#payment_intent_object-client_secret). After next_actions are handled by the client, no additional confirmation is required to complete the payment. If the confirmation_method is manual, all payment attempts must be initiated using a secret key. If any actions are required for the payment, the PaymentIntent will return to the requires_confirmation state after those actions are completed. Your server needs to then explicitly re-confirm the PaymentIntent to initiate the next payment attempt. """ return cast( "PaymentIntent", await self._request_async( "post", "/v1/payment_intents/{intent}/confirm".format( intent=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def create( cls, **params: Unpack["PaymentIntent.CreateParams"] ) -> "PaymentIntent": """ Creates a PaymentIntent object. After the PaymentIntent is created, attach a payment method and [confirm](https://stripe.com/docs/api/payment_intents/confirm) to continue the payment. Learn more about the available payment flows with the Payment Intents API. When you use confirm=true during creation, it's equivalent to creating and confirming the PaymentIntent in the same call. You can use any parameters available in the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) when you supply confirm=true. """ return cast( "PaymentIntent", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["PaymentIntent.CreateParams"] ) -> "PaymentIntent": """ Creates a PaymentIntent object. After the PaymentIntent is created, attach a payment method and [confirm](https://stripe.com/docs/api/payment_intents/confirm) to continue the payment. Learn more about the available payment flows with the Payment Intents API. When you use confirm=true during creation, it's equivalent to creating and confirming the PaymentIntent in the same call. You can use any parameters available in the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) when you supply confirm=true. """ return cast( "PaymentIntent", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def _cls_increment_authorization( cls, intent: str, **params: Unpack["PaymentIntent.IncrementAuthorizationParams"], ) -> "PaymentIntent": """ Perform an incremental authorization on an eligible [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the PaymentIntent's status must be requires_capture and [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) must be true. Incremental authorizations attempt to increase the authorized amount on your customer's card to the new, higher amount provided. Similar to the initial authorization, incremental authorizations can be declined. A single PaymentIntent can call this endpoint multiple times to further increase the authorized amount. If the incremental authorization succeeds, the PaymentIntent object returns with the updated [amount](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount). If the incremental authorization fails, a [card_declined](https://stripe.com/docs/error-codes#card-declined) error returns, and no other fields on the PaymentIntent or Charge update. The PaymentIntent object remains capturable for the previously authorized amount. Each PaymentIntent can have a maximum of 10 incremental authorization attempts, including declines. After it's captured, a PaymentIntent can no longer be incremented. Learn more about [incremental authorizations](https://stripe.com/docs/terminal/features/incremental-authorizations). """ return cast( "PaymentIntent", cls._static_request( "post", "/v1/payment_intents/{intent}/increment_authorization".format( intent=sanitize_id(intent) ), params=params, ), ) @overload @staticmethod def increment_authorization( intent: str, **params: Unpack["PaymentIntent.IncrementAuthorizationParams"], ) -> "PaymentIntent": """ Perform an incremental authorization on an eligible [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the PaymentIntent's status must be requires_capture and [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) must be true. Incremental authorizations attempt to increase the authorized amount on your customer's card to the new, higher amount provided. Similar to the initial authorization, incremental authorizations can be declined. A single PaymentIntent can call this endpoint multiple times to further increase the authorized amount. If the incremental authorization succeeds, the PaymentIntent object returns with the updated [amount](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount). If the incremental authorization fails, a [card_declined](https://stripe.com/docs/error-codes#card-declined) error returns, and no other fields on the PaymentIntent or Charge update. The PaymentIntent object remains capturable for the previously authorized amount. Each PaymentIntent can have a maximum of 10 incremental authorization attempts, including declines. After it's captured, a PaymentIntent can no longer be incremented. Learn more about [incremental authorizations](https://stripe.com/docs/terminal/features/incremental-authorizations). """ ... @overload def increment_authorization( self, **params: Unpack["PaymentIntent.IncrementAuthorizationParams"] ) -> "PaymentIntent": """ Perform an incremental authorization on an eligible [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the PaymentIntent's status must be requires_capture and [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) must be true. Incremental authorizations attempt to increase the authorized amount on your customer's card to the new, higher amount provided. Similar to the initial authorization, incremental authorizations can be declined. A single PaymentIntent can call this endpoint multiple times to further increase the authorized amount. If the incremental authorization succeeds, the PaymentIntent object returns with the updated [amount](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount). If the incremental authorization fails, a [card_declined](https://stripe.com/docs/error-codes#card-declined) error returns, and no other fields on the PaymentIntent or Charge update. The PaymentIntent object remains capturable for the previously authorized amount. Each PaymentIntent can have a maximum of 10 incremental authorization attempts, including declines. After it's captured, a PaymentIntent can no longer be incremented. Learn more about [incremental authorizations](https://stripe.com/docs/terminal/features/incremental-authorizations). """ ... @class_method_variant("_cls_increment_authorization") def increment_authorization( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["PaymentIntent.IncrementAuthorizationParams"] ) -> "PaymentIntent": """ Perform an incremental authorization on an eligible [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the PaymentIntent's status must be requires_capture and [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) must be true. Incremental authorizations attempt to increase the authorized amount on your customer's card to the new, higher amount provided. Similar to the initial authorization, incremental authorizations can be declined. A single PaymentIntent can call this endpoint multiple times to further increase the authorized amount. If the incremental authorization succeeds, the PaymentIntent object returns with the updated [amount](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount). If the incremental authorization fails, a [card_declined](https://stripe.com/docs/error-codes#card-declined) error returns, and no other fields on the PaymentIntent or Charge update. The PaymentIntent object remains capturable for the previously authorized amount. Each PaymentIntent can have a maximum of 10 incremental authorization attempts, including declines. After it's captured, a PaymentIntent can no longer be incremented. Learn more about [incremental authorizations](https://stripe.com/docs/terminal/features/incremental-authorizations). """ return cast( "PaymentIntent", self._request( "post", "/v1/payment_intents/{intent}/increment_authorization".format( intent=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_increment_authorization_async( cls, intent: str, **params: Unpack["PaymentIntent.IncrementAuthorizationParams"], ) -> "PaymentIntent": """ Perform an incremental authorization on an eligible [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the PaymentIntent's status must be requires_capture and [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) must be true. Incremental authorizations attempt to increase the authorized amount on your customer's card to the new, higher amount provided. Similar to the initial authorization, incremental authorizations can be declined. A single PaymentIntent can call this endpoint multiple times to further increase the authorized amount. If the incremental authorization succeeds, the PaymentIntent object returns with the updated [amount](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount). If the incremental authorization fails, a [card_declined](https://stripe.com/docs/error-codes#card-declined) error returns, and no other fields on the PaymentIntent or Charge update. The PaymentIntent object remains capturable for the previously authorized amount. Each PaymentIntent can have a maximum of 10 incremental authorization attempts, including declines. After it's captured, a PaymentIntent can no longer be incremented. Learn more about [incremental authorizations](https://stripe.com/docs/terminal/features/incremental-authorizations). """ return cast( "PaymentIntent", await cls._static_request_async( "post", "/v1/payment_intents/{intent}/increment_authorization".format( intent=sanitize_id(intent) ), params=params, ), ) @overload @staticmethod async def increment_authorization_async( intent: str, **params: Unpack["PaymentIntent.IncrementAuthorizationParams"], ) -> "PaymentIntent": """ Perform an incremental authorization on an eligible [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the PaymentIntent's status must be requires_capture and [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) must be true. Incremental authorizations attempt to increase the authorized amount on your customer's card to the new, higher amount provided. Similar to the initial authorization, incremental authorizations can be declined. A single PaymentIntent can call this endpoint multiple times to further increase the authorized amount. If the incremental authorization succeeds, the PaymentIntent object returns with the updated [amount](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount). If the incremental authorization fails, a [card_declined](https://stripe.com/docs/error-codes#card-declined) error returns, and no other fields on the PaymentIntent or Charge update. The PaymentIntent object remains capturable for the previously authorized amount. Each PaymentIntent can have a maximum of 10 incremental authorization attempts, including declines. After it's captured, a PaymentIntent can no longer be incremented. Learn more about [incremental authorizations](https://stripe.com/docs/terminal/features/incremental-authorizations). """ ... @overload async def increment_authorization_async( self, **params: Unpack["PaymentIntent.IncrementAuthorizationParams"] ) -> "PaymentIntent": """ Perform an incremental authorization on an eligible [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the PaymentIntent's status must be requires_capture and [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) must be true. Incremental authorizations attempt to increase the authorized amount on your customer's card to the new, higher amount provided. Similar to the initial authorization, incremental authorizations can be declined. A single PaymentIntent can call this endpoint multiple times to further increase the authorized amount. If the incremental authorization succeeds, the PaymentIntent object returns with the updated [amount](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount). If the incremental authorization fails, a [card_declined](https://stripe.com/docs/error-codes#card-declined) error returns, and no other fields on the PaymentIntent or Charge update. The PaymentIntent object remains capturable for the previously authorized amount. Each PaymentIntent can have a maximum of 10 incremental authorization attempts, including declines. After it's captured, a PaymentIntent can no longer be incremented. Learn more about [incremental authorizations](https://stripe.com/docs/terminal/features/incremental-authorizations). """ ... @class_method_variant("_cls_increment_authorization_async") async def increment_authorization_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["PaymentIntent.IncrementAuthorizationParams"] ) -> "PaymentIntent": """ Perform an incremental authorization on an eligible [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the PaymentIntent's status must be requires_capture and [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) must be true. Incremental authorizations attempt to increase the authorized amount on your customer's card to the new, higher amount provided. Similar to the initial authorization, incremental authorizations can be declined. A single PaymentIntent can call this endpoint multiple times to further increase the authorized amount. If the incremental authorization succeeds, the PaymentIntent object returns with the updated [amount](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount). If the incremental authorization fails, a [card_declined](https://stripe.com/docs/error-codes#card-declined) error returns, and no other fields on the PaymentIntent or Charge update. The PaymentIntent object remains capturable for the previously authorized amount. Each PaymentIntent can have a maximum of 10 incremental authorization attempts, including declines. After it's captured, a PaymentIntent can no longer be incremented. Learn more about [incremental authorizations](https://stripe.com/docs/terminal/features/incremental-authorizations). """ return cast( "PaymentIntent", await self._request_async( "post", "/v1/payment_intents/{intent}/increment_authorization".format( intent=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def list( cls, **params: Unpack["PaymentIntent.ListParams"] ) -> ListObject["PaymentIntent"]: """ Returns a list of PaymentIntents. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["PaymentIntent.ListParams"] ) -> ListObject["PaymentIntent"]: """ Returns a list of PaymentIntents. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def modify( cls, id: str, **params: Unpack["PaymentIntent.ModifyParams"] ) -> "PaymentIntent": """ Updates properties on a PaymentIntent object without confirming. Depending on which properties you update, you might need to confirm the PaymentIntent again. For example, updating the payment_method always requires you to confirm the PaymentIntent again. If you prefer to update and confirm at the same time, we recommend updating properties through the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) instead. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "PaymentIntent", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["PaymentIntent.ModifyParams"] ) -> "PaymentIntent": """ Updates properties on a PaymentIntent object without confirming. Depending on which properties you update, you might need to confirm the PaymentIntent again. For example, updating the payment_method always requires you to confirm the PaymentIntent again. If you prefer to update and confirm at the same time, we recommend updating properties through the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) instead. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "PaymentIntent", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["PaymentIntent.RetrieveParams"] ) -> "PaymentIntent": """ Retrieves the details of a PaymentIntent that has previously been created. You can retrieve a PaymentIntent client-side using a publishable key when the client_secret is in the query string. If you retrieve a PaymentIntent with a publishable key, it only returns a subset of properties. Refer to the [payment intent](https://stripe.com/docs/api#payment_intent_object) object reference for more details. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["PaymentIntent.RetrieveParams"] ) -> "PaymentIntent": """ Retrieves the details of a PaymentIntent that has previously been created. You can retrieve a PaymentIntent client-side using a publishable key when the client_secret is in the query string. If you retrieve a PaymentIntent with a publishable key, it only returns a subset of properties. Refer to the [payment intent](https://stripe.com/docs/api#payment_intent_object) object reference for more details. """ instance = cls(id, **params) await instance.refresh_async() return instance @classmethod def _cls_verify_microdeposits( cls, intent: str, **params: Unpack["PaymentIntent.VerifyMicrodepositsParams"], ) -> "PaymentIntent": """ Verifies microdeposits on a PaymentIntent object. """ return cast( "PaymentIntent", cls._static_request( "post", "/v1/payment_intents/{intent}/verify_microdeposits".format( intent=sanitize_id(intent) ), params=params, ), ) @overload @staticmethod def verify_microdeposits( intent: str, **params: Unpack["PaymentIntent.VerifyMicrodepositsParams"], ) -> "PaymentIntent": """ Verifies microdeposits on a PaymentIntent object. """ ... @overload def verify_microdeposits( self, **params: Unpack["PaymentIntent.VerifyMicrodepositsParams"] ) -> "PaymentIntent": """ Verifies microdeposits on a PaymentIntent object. """ ... @class_method_variant("_cls_verify_microdeposits") def verify_microdeposits( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["PaymentIntent.VerifyMicrodepositsParams"] ) -> "PaymentIntent": """ Verifies microdeposits on a PaymentIntent object. """ return cast( "PaymentIntent", self._request( "post", "/v1/payment_intents/{intent}/verify_microdeposits".format( intent=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_verify_microdeposits_async( cls, intent: str, **params: Unpack["PaymentIntent.VerifyMicrodepositsParams"], ) -> "PaymentIntent": """ Verifies microdeposits on a PaymentIntent object. """ return cast( "PaymentIntent", await cls._static_request_async( "post", "/v1/payment_intents/{intent}/verify_microdeposits".format( intent=sanitize_id(intent) ), params=params, ), ) @overload @staticmethod async def verify_microdeposits_async( intent: str, **params: Unpack["PaymentIntent.VerifyMicrodepositsParams"], ) -> "PaymentIntent": """ Verifies microdeposits on a PaymentIntent object. """ ... @overload async def verify_microdeposits_async( self, **params: Unpack["PaymentIntent.VerifyMicrodepositsParams"] ) -> "PaymentIntent": """ Verifies microdeposits on a PaymentIntent object. """ ... @class_method_variant("_cls_verify_microdeposits_async") async def verify_microdeposits_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["PaymentIntent.VerifyMicrodepositsParams"] ) -> "PaymentIntent": """ Verifies microdeposits on a PaymentIntent object. """ return cast( "PaymentIntent", await self._request_async( "post", "/v1/payment_intents/{intent}/verify_microdeposits".format( intent=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def search( cls, *args, **kwargs: Unpack["PaymentIntent.SearchParams"] ) -> SearchResultObject["PaymentIntent"]: """ Search for PaymentIntents you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India. """ return cls._search( search_url="/v1/payment_intents/search", *args, **kwargs ) @classmethod async def search_async( cls, *args, **kwargs: Unpack["PaymentIntent.SearchParams"] ) -> SearchResultObject["PaymentIntent"]: """ Search for PaymentIntents you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India. """ return await cls._search_async( search_url="/v1/payment_intents/search", *args, **kwargs ) @classmethod def search_auto_paging_iter( cls, *args, **kwargs: Unpack["PaymentIntent.SearchParams"] ) -> Iterator["PaymentIntent"]: return cls.search(*args, **kwargs).auto_paging_iter() @classmethod async def search_auto_paging_iter_async( cls, *args, **kwargs: Unpack["PaymentIntent.SearchParams"] ) -> AsyncIterator["PaymentIntent"]: return (await cls.search_async(*args, **kwargs)).auto_paging_iter() _inner_class_types = { "amount_details": AmountDetails, "automatic_payment_methods": AutomaticPaymentMethods, "last_payment_error": LastPaymentError, "next_action": NextAction, "payment_method_configuration_details": PaymentMethodConfigurationDetails, "payment_method_options": PaymentMethodOptions, "processing": Processing, "shipping": Shipping, "transfer_data": TransferData, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_payment_intent_service.py0000644000175100001770000136040214637354563021327 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._payment_intent import PaymentIntent from stripe._request_options import RequestOptions from stripe._search_result_object import SearchResultObject from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class PaymentIntentService(StripeService): class ApplyCustomerBalanceParams(TypedDict): amount: NotRequired[int] """ Amount that you intend to apply to this PaymentIntent from the customer's cash balance. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (for example, 100 cents to charge 1 USD or 100 to charge 100 JPY, a zero-decimal currency). The maximum amount is the amount of the PaymentIntent. When you omit the amount, it defaults to the remaining amount requested on the PaymentIntent. """ currency: NotRequired[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). """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CancelParams(TypedDict): cancellation_reason: NotRequired[ Literal[ "abandoned", "duplicate", "fraudulent", "requested_by_customer" ] ] """ Reason for canceling this PaymentIntent. Possible values are: `duplicate`, `fraudulent`, `requested_by_customer`, or `abandoned` """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CaptureParams(TypedDict): amount_to_capture: NotRequired[int] """ The amount to capture from the PaymentIntent, which must be less than or equal to the original amount. Any additional amount is automatically refunded. Defaults to the full `amount_capturable` if it's not provided. """ application_fee_amount: NotRequired[int] """ The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ final_capture: NotRequired[bool] """ Defaults to `true`. When capturing a PaymentIntent, setting `final_capture` to `false` notifies Stripe to not release the remaining uncaptured funds to make sure that they're captured in future requests. You can only use this setting when [multicapture](https://stripe.com/docs/payments/multicapture) is available for PaymentIntents. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ statement_descriptor: NotRequired[str] """ For card charges, use [statement_descriptor_suffix](https://stripe.com/docs/payments/account/statement-descriptors#dynamic). Otherwise, you can use this value as the complete description of a charge on your customers' statements. It must contain at least one letter and be 1–22 characters long. """ statement_descriptor_suffix: NotRequired[str] """ Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. The concatenated descriptor must be 1-22 characters long. """ transfer_data: NotRequired[ "PaymentIntentService.CaptureParamsTransferData" ] """ The parameters that you can use to automatically create a transfer after the payment is captured. Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ class CaptureParamsTransferData(TypedDict): amount: NotRequired[int] """ The amount that will be transferred automatically when a charge succeeds. """ class ConfirmParams(TypedDict): capture_method: NotRequired[ Literal["automatic", "automatic_async", "manual"] ] """ Controls when the funds will be captured from the customer's account. """ confirmation_token: NotRequired[str] """ ID of the ConfirmationToken used to confirm this PaymentIntent. If the provided ConfirmationToken contains properties that are also being provided in this request, such as `payment_method`, then the values in this request will take precedence. """ error_on_requires_action: NotRequired[bool] """ Set to `true` to fail the payment attempt if the PaymentIntent transitions into `requires_action`. This parameter is intended for simpler integrations that do not handle customer actions, like [saving cards without authentication](https://stripe.com/docs/payments/save-card-without-authentication). """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ mandate: NotRequired[str] """ ID of the mandate that's used for this payment. """ mandate_data: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsMandateData" ] off_session: NotRequired["bool|Literal['one_off', 'recurring']"] """ Set to `true` to indicate that the customer isn't in your checkout flow during this payment attempt and can't authenticate. Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards). """ payment_method: NotRequired[str] """ ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods/transitioning#compatibility) object) to attach to this PaymentIntent. """ payment_method_data: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodData" ] """ If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method) property on the PaymentIntent. """ payment_method_options: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodOptions" ] """ Payment method-specific configuration for this PaymentIntent. """ payment_method_types: NotRequired[List[str]] """ The list of payment method types (for example, a card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). """ radar_options: NotRequired[ "PaymentIntentService.ConfirmParamsRadarOptions" ] """ Options to configure Radar. Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session). """ receipt_email: NotRequired["Literal['']|str"] """ Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). """ return_url: NotRequired[str] """ The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. This parameter is only used for cards and other redirect-based payment methods. """ setup_future_usage: NotRequired[ "Literal['']|Literal['off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ shipping: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsShipping" ] """ Shipping information for this PaymentIntent. """ use_stripe_sdk: NotRequired[bool] """ Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. """ class ConfirmParamsMandateData(TypedDict): customer_acceptance: NotRequired[ "PaymentIntentService.ConfirmParamsMandateDataCustomerAcceptance" ] """ This hash contains details about the customer acceptance of the Mandate. """ class ConfirmParamsMandateDataCustomerAcceptance(TypedDict): accepted_at: NotRequired[int] """ The time at which the customer accepted the Mandate. """ offline: NotRequired[ "PaymentIntentService.ConfirmParamsMandateDataCustomerAcceptanceOffline" ] """ If this is a Mandate accepted offline, this hash contains details about the offline acceptance. """ online: NotRequired[ "PaymentIntentService.ConfirmParamsMandateDataCustomerAcceptanceOnline" ] """ If this is a Mandate accepted online, this hash contains details about the online acceptance. """ type: Literal["offline", "online"] """ The type of customer acceptance information included with the Mandate. One of `online` or `offline`. """ class ConfirmParamsMandateDataCustomerAcceptanceOffline(TypedDict): pass class ConfirmParamsMandateDataCustomerAcceptanceOnline(TypedDict): ip_address: NotRequired[str] """ The IP address from which the Mandate was accepted by the customer. """ user_agent: NotRequired[str] """ The user agent of the browser from which the Mandate was accepted by the customer. """ class ConfirmParamsPaymentMethodData(TypedDict): acss_debit: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataAcssDebit" ] """ If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. """ affirm: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataAffirm" ] """ If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. """ afterpay_clearpay: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataAfterpayClearpay" ] """ If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. """ alipay: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataAlipay" ] """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ allow_redisplay: NotRequired[ Literal["always", "limited", "unspecified"] ] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ amazon_pay: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataAmazonPay" ] """ If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. """ au_becs_debit: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataAuBecsDebit" ] """ If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. """ bacs_debit: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataBacsDebit" ] """ If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. """ bancontact: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataBancontact" ] """ If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. """ billing_details: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataBillingDetails" ] """ Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. """ blik: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataBlik" ] """ If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. """ boleto: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataBoleto" ] """ If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. """ cashapp: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataCashapp" ] """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ customer_balance: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataCustomerBalance" ] """ If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. """ eps: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataEps" ] """ If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. """ fpx: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataFpx" ] """ If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. """ giropay: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataGiropay" ] """ If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. """ grabpay: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataGrabpay" ] """ If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ ideal: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataIdeal" ] """ If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. """ interac_present: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataInteracPresent" ] """ If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. """ klarna: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataKlarna" ] """ If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. """ konbini: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataKonbini" ] """ If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. """ link: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataLink" ] """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ mobilepay: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataMobilepay" ] """ If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. """ multibanco: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataMultibanco" ] """ If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. """ oxxo: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataOxxo" ] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. """ p24: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataP24" ] """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ paynow: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataPaynow" ] """ If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. """ paypal: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataPaypal" ] """ If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. """ pix: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataPix" ] """ If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. """ promptpay: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataPromptpay" ] """ If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. """ radar_options: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataRadarOptions" ] """ Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. """ revolut_pay: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataRevolutPay" ] """ If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. """ sepa_debit: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataSepaDebit" ] """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ sofort: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataSofort" ] """ If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. """ swish: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataSwish" ] """ If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. """ twint: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataTwint" ] """ If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. """ type: Literal[ "acss_debit", "affirm", "afterpay_clearpay", "alipay", "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", "blik", "boleto", "cashapp", "customer_balance", "eps", "fpx", "giropay", "grabpay", "ideal", "klarna", "konbini", "link", "mobilepay", "multibanco", "oxxo", "p24", "paynow", "paypal", "pix", "promptpay", "revolut_pay", "sepa_debit", "sofort", "swish", "twint", "us_bank_account", "wechat_pay", "zip", ] """ The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. """ us_bank_account: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataUsBankAccount" ] """ If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. """ wechat_pay: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataWechatPay" ] """ If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. """ zip: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataZip" ] """ If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. """ class ConfirmParamsPaymentMethodDataAcssDebit(TypedDict): account_number: str """ Customer's bank account number. """ institution_number: str """ Institution number of the customer's bank. """ transit_number: str """ Transit number of the customer's bank. """ class ConfirmParamsPaymentMethodDataAffirm(TypedDict): pass class ConfirmParamsPaymentMethodDataAfterpayClearpay(TypedDict): pass class ConfirmParamsPaymentMethodDataAlipay(TypedDict): pass class ConfirmParamsPaymentMethodDataAmazonPay(TypedDict): pass class ConfirmParamsPaymentMethodDataAuBecsDebit(TypedDict): account_number: str """ The account number for the bank account. """ bsb_number: str """ Bank-State-Branch number of the bank account. """ class ConfirmParamsPaymentMethodDataBacsDebit(TypedDict): account_number: NotRequired[str] """ Account number of the bank account that the funds will be debited from. """ sort_code: NotRequired[str] """ Sort code of the bank account. (e.g., `10-20-30`) """ class ConfirmParamsPaymentMethodDataBancontact(TypedDict): pass class ConfirmParamsPaymentMethodDataBillingDetails(TypedDict): address: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodDataBillingDetailsAddress" ] """ Billing address. """ email: NotRequired["Literal['']|str"] """ Email address. """ name: NotRequired["Literal['']|str"] """ Full name. """ phone: NotRequired["Literal['']|str"] """ Billing phone number (including extension). """ class ConfirmParamsPaymentMethodDataBillingDetailsAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class ConfirmParamsPaymentMethodDataBlik(TypedDict): pass class ConfirmParamsPaymentMethodDataBoleto(TypedDict): tax_id: str """ The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) """ class ConfirmParamsPaymentMethodDataCashapp(TypedDict): pass class ConfirmParamsPaymentMethodDataCustomerBalance(TypedDict): pass class ConfirmParamsPaymentMethodDataEps(TypedDict): bank: NotRequired[ Literal[ "arzte_und_apotheker_bank", "austrian_anadi_bank_ag", "bank_austria", "bankhaus_carl_spangler", "bankhaus_schelhammer_und_schattera_ag", "bawag_psk_ag", "bks_bank_ag", "brull_kallmus_bank_ag", "btv_vier_lander_bank", "capital_bank_grawe_gruppe_ag", "deutsche_bank_ag", "dolomitenbank", "easybank_ag", "erste_bank_und_sparkassen", "hypo_alpeadriabank_international_ag", "hypo_bank_burgenland_aktiengesellschaft", "hypo_noe_lb_fur_niederosterreich_u_wien", "hypo_oberosterreich_salzburg_steiermark", "hypo_tirol_bank_ag", "hypo_vorarlberg_bank_ag", "marchfelder_bank", "oberbank_ag", "raiffeisen_bankengruppe_osterreich", "schoellerbank_ag", "sparda_bank_wien", "volksbank_gruppe", "volkskreditbank_ag", "vr_bank_braunau", ] ] """ The customer's bank. """ class ConfirmParamsPaymentMethodDataFpx(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type for FPX transaction """ bank: Literal[ "affin_bank", "agrobank", "alliance_bank", "ambank", "bank_islam", "bank_muamalat", "bank_of_china", "bank_rakyat", "bsn", "cimb", "deutsche_bank", "hong_leong_bank", "hsbc", "kfh", "maybank2e", "maybank2u", "ocbc", "pb_enterprise", "public_bank", "rhb", "standard_chartered", "uob", ] """ The customer's bank. """ class ConfirmParamsPaymentMethodDataGiropay(TypedDict): pass class ConfirmParamsPaymentMethodDataGrabpay(TypedDict): pass class ConfirmParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ Literal[ "abn_amro", "asn_bank", "bunq", "handelsbanken", "ing", "knab", "moneyou", "n26", "nn", "rabobank", "regiobank", "revolut", "sns_bank", "triodos_bank", "van_lanschot", "yoursafe", ] ] """ The customer's bank. """ class ConfirmParamsPaymentMethodDataInteracPresent(TypedDict): pass class ConfirmParamsPaymentMethodDataKlarna(TypedDict): dob: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodDataKlarnaDob" ] """ Customer's date of birth """ class ConfirmParamsPaymentMethodDataKlarnaDob(TypedDict): day: int """ The day of birth, between 1 and 31. """ month: int """ The month of birth, between 1 and 12. """ year: int """ The four-digit year of birth. """ class ConfirmParamsPaymentMethodDataKonbini(TypedDict): pass class ConfirmParamsPaymentMethodDataLink(TypedDict): pass class ConfirmParamsPaymentMethodDataMobilepay(TypedDict): pass class ConfirmParamsPaymentMethodDataMultibanco(TypedDict): pass class ConfirmParamsPaymentMethodDataOxxo(TypedDict): pass class ConfirmParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ Literal[ "alior_bank", "bank_millennium", "bank_nowy_bfg_sa", "bank_pekao_sa", "banki_spbdzielcze", "blik", "bnp_paribas", "boz", "citi_handlowy", "credit_agricole", "envelobank", "etransfer_pocztowy24", "getin_bank", "ideabank", "ing", "inteligo", "mbank_mtransfer", "nest_przelew", "noble_pay", "pbac_z_ipko", "plus_bank", "santander_przelew24", "tmobile_usbugi_bankowe", "toyota_bank", "velobank", "volkswagen_bank", ] ] """ The customer's bank. """ class ConfirmParamsPaymentMethodDataPaynow(TypedDict): pass class ConfirmParamsPaymentMethodDataPaypal(TypedDict): pass class ConfirmParamsPaymentMethodDataPix(TypedDict): pass class ConfirmParamsPaymentMethodDataPromptpay(TypedDict): pass class ConfirmParamsPaymentMethodDataRadarOptions(TypedDict): session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ class ConfirmParamsPaymentMethodDataRevolutPay(TypedDict): pass class ConfirmParamsPaymentMethodDataSepaDebit(TypedDict): iban: str """ IBAN of the bank account. """ class ConfirmParamsPaymentMethodDataSofort(TypedDict): country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] """ Two-letter ISO code representing the country the bank account is located in. """ class ConfirmParamsPaymentMethodDataSwish(TypedDict): pass class ConfirmParamsPaymentMethodDataTwint(TypedDict): pass class ConfirmParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type: individual or company. """ account_number: NotRequired[str] """ Account number of the bank account. """ account_type: NotRequired[Literal["checking", "savings"]] """ Account type: checkings or savings. Defaults to checking if omitted. """ financial_connections_account: NotRequired[str] """ The ID of a Financial Connections Account to use as a payment method. """ routing_number: NotRequired[str] """ Routing number of the bank account. """ class ConfirmParamsPaymentMethodDataWechatPay(TypedDict): pass class ConfirmParamsPaymentMethodDataZip(TypedDict): pass class ConfirmParamsPaymentMethodOptions(TypedDict): acss_debit: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsAcssDebit" ] """ If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options. """ affirm: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsAffirm" ] """ If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options. """ afterpay_clearpay: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsAfterpayClearpay" ] """ If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options. """ alipay: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsAlipay" ] """ If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. """ amazon_pay: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsAmazonPay" ] """ If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options. """ au_becs_debit: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsAuBecsDebit" ] """ If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options. """ bacs_debit: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsBacsDebit" ] """ If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options. """ bancontact: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsBancontact" ] """ If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options. """ blik: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsBlik" ] """ If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options. """ boleto: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsBoleto" ] """ If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options. """ card: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsCard" ] """ Configuration for any card payments attempted on this PaymentIntent. """ card_present: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsCardPresent" ] """ If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. """ cashapp: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsCashapp" ] """ If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options. """ customer_balance: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsCustomerBalance" ] """ If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options. """ eps: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsEps" ] """ If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options. """ fpx: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsFpx" ] """ If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options. """ giropay: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsGiropay" ] """ If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options. """ grabpay: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsGrabpay" ] """ If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. """ ideal: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsIdeal" ] """ If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options. """ interac_present: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsInteracPresent" ] """ If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. """ klarna: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsKlarna" ] """ If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options. """ konbini: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsKonbini" ] """ If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options. """ link: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsLink" ] """ If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. """ mobilepay: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsMobilepay" ] """ If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options. """ multibanco: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsMultibanco" ] """ If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options. """ oxxo: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsOxxo" ] """ If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options. """ p24: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsP24" ] """ If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. """ paynow: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsPaynow" ] """ If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options. """ paypal: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsPaypal" ] """ If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. """ pix: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsPix" ] """ If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options. """ promptpay: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsPromptpay" ] """ If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options. """ revolut_pay: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsRevolutPay" ] """ If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options. """ sepa_debit: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsSepaDebit" ] """ If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options. """ sofort: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsSofort" ] """ If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. """ swish: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsSwish" ] """ If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options. """ twint: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsTwint" ] """ If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options. """ us_bank_account: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsUsBankAccount" ] """ If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options. """ wechat_pay: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsWechatPay" ] """ If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options. """ zip: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsZip" ] """ If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options. """ class ConfirmParamsPaymentMethodOptionsAcssDebit(TypedDict): mandate_options: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodOptionsAcssDebitMandateOptions" ] """ Additional fields for Mandate creation """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. """ class ConfirmParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): custom_mandate_url: NotRequired["Literal['']|str"] """ A URL for custom mandate text to render during confirmation step. The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. """ interval_description: NotRequired[str] """ Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. """ payment_schedule: NotRequired[ Literal["combined", "interval", "sporadic"] ] """ Payment schedule for the mandate. """ transaction_type: NotRequired[Literal["business", "personal"]] """ Transaction type of the mandate. """ class ConfirmParamsPaymentMethodOptionsAffirm(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ preferred_locale: NotRequired[str] """ Preferred language of the Affirm authorization page that the customer is redirected to. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ reference: NotRequired[str] """ An internal identifier or reference that this payment corresponds to. You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes. This field differs from the statement descriptor and item name. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsAlipay(TypedDict): setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsAmazonPay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class ConfirmParamsPaymentMethodOptionsAuBecsDebit(TypedDict): setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsBacsDebit(TypedDict): setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsBancontact(TypedDict): preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] """ Preferred language of the Bancontact authorization page that the customer is redirected to. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsBlik(TypedDict): code: NotRequired[str] """ The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. """ setup_future_usage: NotRequired["Literal['']|Literal['none']"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsBoleto(TypedDict): expires_after_days: NotRequired[int] """ The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsCard(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ cvc_token: NotRequired[str] """ A single-use `cvc_update` Token that represents a card CVC value. When provided, the CVC value will be verified during the card payment attempt. This parameter can only be provided during confirmation. """ installments: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodOptionsCardInstallments" ] """ Installment configuration for payments attempted on this PaymentIntent (Mexico Only). For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). """ mandate_options: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodOptionsCardMandateOptions" ] """ Configuration options for setting up an eMandate for cards issued in India. """ moto: NotRequired[bool] """ When specified, this parameter indicates that a transaction will be marked as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This parameter can only be provided during confirmation. """ network: NotRequired[ Literal[ "amex", "cartes_bancaires", "diners", "discover", "eftpos_au", "interac", "jcb", "mastercard", "unionpay", "unknown", "visa", ] ] """ Selected network to process this PaymentIntent on. Depends on the available networks of the card attached to the PaymentIntent. Can be only set confirm-time. """ request_extended_authorization: NotRequired[ Literal["if_available", "never"] ] """ Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent. """ request_incremental_authorization: NotRequired[ Literal["if_available", "never"] ] """ Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. """ request_multicapture: NotRequired[Literal["if_available", "never"]] """ Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent. """ request_overcapture: NotRequired[Literal["if_available", "never"]] """ Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. """ request_three_d_secure: NotRequired[ Literal["any", "automatic", "challenge"] ] """ 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://stripe.com/docs/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://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ require_cvc_recollection: NotRequired[bool] """ When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. using the cvc_token parameter). """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ statement_descriptor_suffix_kana: NotRequired["Literal['']|str"] """ Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. """ statement_descriptor_suffix_kanji: NotRequired["Literal['']|str"] """ 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. """ three_d_secure: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodOptionsCardThreeDSecure" ] """ If 3D Secure authentication was performed with a third-party provider, the authentication details to use for this payment. """ class ConfirmParamsPaymentMethodOptionsCardInstallments(TypedDict): enabled: NotRequired[bool] """ Setting to true enables installments for this PaymentIntent. This will cause the response to contain a list of available installment plans. Setting to false will prevent any selected plan from applying to a charge. """ plan: NotRequired[ "Literal['']|PaymentIntentService.ConfirmParamsPaymentMethodOptionsCardInstallmentsPlan" ] """ The selected installment plan to use for this payment attempt. This parameter can only be provided during confirmation. """ class ConfirmParamsPaymentMethodOptionsCardInstallmentsPlan(TypedDict): count: int """ For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. """ interval: Literal["month"] """ For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. One of `month`. """ type: Literal["fixed_count"] """ Type of installment plan, one of `fixed_count`. """ class ConfirmParamsPaymentMethodOptionsCardMandateOptions(TypedDict): amount: int """ Amount to be charged for future payments. """ amount_type: Literal["fixed", "maximum"] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ description: NotRequired[str] """ A description of the mandate or subscription that is meant to be displayed to the customer. """ end_date: NotRequired[int] """ End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. """ interval: Literal["day", "month", "sporadic", "week", "year"] """ Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. """ interval_count: NotRequired[int] """ The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. """ reference: str """ Unique identifier for the mandate or subscription. """ start_date: int """ Start date of the mandate or subscription. Start date should not be lesser than yesterday. """ supported_types: NotRequired[List[Literal["india"]]] """ Specifies the type of mandates supported. Possible values are `india`. """ class ConfirmParamsPaymentMethodOptionsCardPresent(TypedDict): request_extended_authorization: NotRequired[bool] """ Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity) """ request_incremental_authorization_support: NotRequired[bool] """ Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. """ routing: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodOptionsCardPresentRouting" ] """ Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes. """ class ConfirmParamsPaymentMethodOptionsCardPresentRouting(TypedDict): requested_priority: NotRequired[Literal["domestic", "international"]] """ Routing requested priority """ class ConfirmParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): ares_trans_status: NotRequired[ Literal["A", "C", "I", "N", "R", "U", "Y"] ] """ The `transStatus` returned from the card Issuer's ACS in the ARes. """ cryptogram: str """ The cryptogram, also known as the "authentication value" (AAV, CAVV or AEVV). This value is 20 bytes, base64-encoded into a 28-character string. (Most 3D Secure providers will return the base64-encoded version, which is what you should specify here.) """ electronic_commerce_indicator: NotRequired[ Literal["01", "02", "05", "06", "07"] ] """ The Electronic Commerce Indicator (ECI) is returned by your 3D Secure provider and indicates what degree of authentication was performed. """ exemption_indicator: NotRequired[Literal["low_risk", "none"]] """ The exemption requested via 3DS and accepted by the issuer at authentication time. """ network_options: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions" ] """ Network specific 3DS fields. Network specific arguments require an explicit card brand choice. The parameter `payment_method_options.card.network`` must be populated accordingly """ requestor_challenge_indicator: NotRequired[str] """ The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. """ transaction_id: str """ For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server Transaction ID (dsTransID). """ version: Literal["1.0.2", "2.1.0", "2.2.0"] """ The version of 3D Secure that was performed. """ class ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions( TypedDict, ): cartes_bancaires: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires" ] """ Cartes Bancaires-specific 3DS fields. """ class ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires( TypedDict, ): cb_avalgo: Literal["0", "1", "2", "3", "4", "A"] """ The cryptogram calculation algorithm used by the card Issuer's ACS to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. messageExtension: CB-AVALGO """ cb_exemption: NotRequired[str] """ The exemption indicator returned from Cartes Bancaires in the ARes. message extension: CB-EXEMPTION; string (4 characters) This is a 3 byte bitmap (low significant byte first and most significant bit first) that has been Base64 encoded """ cb_score: NotRequired[int] """ The risk score returned from Cartes Bancaires in the ARes. message extension: CB-SCORE; numeric value 0-99 """ class ConfirmParamsPaymentMethodOptionsCashapp(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsCustomerBalance(TypedDict): bank_transfer: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodOptionsCustomerBalanceBankTransfer" ] """ Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. """ funding_type: NotRequired[Literal["bank_transfer"]] """ The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsCustomerBalanceBankTransfer( TypedDict, ): eu_bank_transfer: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer" ] """ Configuration for the eu_bank_transfer funding type. """ requested_address_types: NotRequired[ List[ Literal[ "aba", "iban", "sepa", "sort_code", "spei", "swift", "zengin", ] ] ] """ List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. """ type: Literal[ "eu_bank_transfer", "gb_bank_transfer", "jp_bank_transfer", "mx_bank_transfer", "us_bank_transfer", ] """ The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. """ class ConfirmParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer( TypedDict, ): country: str """ The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. """ class ConfirmParamsPaymentMethodOptionsEps(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsFpx(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsGiropay(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsGrabpay(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsIdeal(TypedDict): setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsInteracPresent(TypedDict): pass class ConfirmParamsPaymentMethodOptionsKlarna(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ preferred_locale: NotRequired[ Literal[ "cs-CZ", "da-DK", "de-AT", "de-CH", "de-DE", "el-GR", "en-AT", "en-AU", "en-BE", "en-CA", "en-CH", "en-CZ", "en-DE", "en-DK", "en-ES", "en-FI", "en-FR", "en-GB", "en-GR", "en-IE", "en-IT", "en-NL", "en-NO", "en-NZ", "en-PL", "en-PT", "en-RO", "en-SE", "en-US", "es-ES", "es-US", "fi-FI", "fr-BE", "fr-CA", "fr-CH", "fr-FR", "it-CH", "it-IT", "nb-NO", "nl-BE", "nl-NL", "pl-PL", "pt-PT", "ro-RO", "sv-FI", "sv-SE", ] ] """ Preferred language of the Klarna authorization page that the customer is redirected to """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsKonbini(TypedDict): confirmation_number: NotRequired["Literal['']|str"] """ An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores. Must not consist of only zeroes and could be rejected in case of insufficient uniqueness. We recommend to use the customer's phone number. """ expires_after_days: NotRequired["Literal['']|int"] """ The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. Defaults to 3 days. """ expires_at: NotRequired["Literal['']|int"] """ The timestamp at which the Konbini payment instructions will expire. Only one of `expires_after_days` or `expires_at` may be set. """ product_description: NotRequired["Literal['']|str"] """ A product descriptor of up to 22 characters, which will appear to customers at the convenience store. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsLink(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ persistent_token: NotRequired[str] """ [Deprecated] This is a legacy parameter that no longer has any function. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsMobilepay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsMultibanco(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsOxxo(TypedDict): expires_after_days: NotRequired[int] """ The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsP24(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ tos_shown_and_accepted: NotRequired[bool] """ Confirm that the payer has accepted the P24 terms and conditions. """ class ConfirmParamsPaymentMethodOptionsPaynow(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsPaypal(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds will be captured from the customer's account. """ preferred_locale: NotRequired[ Literal[ "cs-CZ", "da-DK", "de-AT", "de-DE", "de-LU", "el-GR", "en-GB", "en-US", "es-ES", "fi-FI", "fr-BE", "fr-FR", "fr-LU", "hu-HU", "it-IT", "nl-BE", "nl-NL", "pl-PL", "pt-PT", "sk-SK", "sv-SE", ] ] """ [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. """ reference: NotRequired[str] """ A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. """ risk_correlation_id: NotRequired[str] """ The risk correlation ID for an on-session payment using a saved PayPal payment method. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsPix(TypedDict): expires_after_seconds: NotRequired[int] """ The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. """ expires_at: NotRequired[int] """ The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). Defaults to 1 day in the future. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsPromptpay(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsRevolutPay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class ConfirmParamsPaymentMethodOptionsSepaDebit(TypedDict): mandate_options: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodOptionsSepaDebitMandateOptions" ] """ Additional fields for Mandate creation """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): pass class ConfirmParamsPaymentMethodOptionsSofort(TypedDict): preferred_language: NotRequired[ "Literal['']|Literal['de', 'en', 'es', 'fr', 'it', 'nl', 'pl']" ] """ Language shown to the payer on redirect. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsSwish(TypedDict): reference: NotRequired["Literal['']|str"] """ The order ID displayed in the Swish app after the payment is authorized. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsTwint(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsUsBankAccount(TypedDict): financial_connections: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections" ] """ Additional fields for Financial Connections Session creation """ mandate_options: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodOptionsUsBankAccountMandateOptions" ] """ Additional fields for Mandate creation """ networks: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodOptionsUsBankAccountNetworks" ] """ Additional fields for network related functions """ preferred_settlement_speed: NotRequired[ "Literal['']|Literal['fastest', 'standard']" ] """ Preferred transaction settlement speed """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. """ class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): filters: NotRequired[ "PaymentIntentService.ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" ] """ Provide filters for the linked accounts that the customer can select for the payment method """ permissions: NotRequired[ List[ Literal[ "balances", "ownership", "payment_method", "transactions" ] ] ] """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ List[Literal["balances", "ownership", "transactions"]] ] """ List of data features that you would like to retrieve upon account creation. """ return_url: NotRequired[str] """ For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. """ class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( TypedDict, ): account_subcategories: NotRequired[ List[Literal["checking", "savings"]] ] """ The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. """ class ConfirmParamsPaymentMethodOptionsUsBankAccountMandateOptions( TypedDict, ): collection_method: NotRequired["Literal['']|Literal['paper']"] """ The method used to collect offline mandate customer acceptance. """ class ConfirmParamsPaymentMethodOptionsUsBankAccountNetworks(TypedDict): requested: NotRequired[List[Literal["ach", "us_domestic_wire"]]] """ Triggers validations to run across the selected networks """ class ConfirmParamsPaymentMethodOptionsWechatPay(TypedDict): app_id: NotRequired[str] """ The app ID registered with WeChat Pay. Only required when client is ios or android. """ client: Literal["android", "ios", "web"] """ The client type that the end customer will pay from """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsPaymentMethodOptionsZip(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class ConfirmParamsRadarOptions(TypedDict): session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ class ConfirmParamsShipping(TypedDict): address: "PaymentIntentService.ConfirmParamsShippingAddress" """ Shipping address. """ carrier: NotRequired[str] """ The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. """ name: str """ Recipient name. """ phone: NotRequired[str] """ Recipient phone (including extension). """ tracking_number: NotRequired[str] """ The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ class ConfirmParamsShippingAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParams(TypedDict): amount: int """ Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/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://stripe.com/docs/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). """ application_fee_amount: NotRequired[int] """ The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ automatic_payment_methods: NotRequired[ "PaymentIntentService.CreateParamsAutomaticPaymentMethods" ] """ When you enable this parameter, this PaymentIntent accepts payment methods that you enable in the Dashboard and that are compatible with this PaymentIntent's other parameters. """ capture_method: NotRequired[ Literal["automatic", "automatic_async", "manual"] ] """ Controls when the funds will be captured from the customer's account. """ confirm: NotRequired[bool] """ Set to `true` to attempt to [confirm this PaymentIntent](https://stripe.com/docs/api/payment_intents/confirm) immediately. This parameter defaults to `false`. When creating and confirming a PaymentIntent at the same time, you can also provide the parameters available in the [Confirm API](https://stripe.com/docs/api/payment_intents/confirm). """ confirmation_method: NotRequired[Literal["automatic", "manual"]] """ Describes whether we can confirm this PaymentIntent automatically, or if it requires customer action to confirm the payment. """ confirmation_token: NotRequired[str] """ ID of the ConfirmationToken used to confirm this PaymentIntent. If the provided ConfirmationToken contains properties that are also being provided in this request, such as `payment_method`, then the values in this request will take precedence. """ 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). """ customer: NotRequired[str] """ ID of the Customer this PaymentIntent belongs to, if one exists. Payment methods attached to other Customers cannot be used with this PaymentIntent. If present in combination with [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage), this PaymentIntent's payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. """ description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ error_on_requires_action: NotRequired[bool] """ Set to `true` to fail the payment attempt if the PaymentIntent transitions into `requires_action`. Use this parameter for simpler integrations that don't handle customer actions, such as [saving cards without authentication](https://stripe.com/docs/payments/save-card-without-authentication). This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ mandate: NotRequired[str] """ ID of the mandate that's used for this payment. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). """ mandate_data: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsMandateData" ] """ This hash contains details about the Mandate to create. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ off_session: NotRequired["bool|Literal['one_off', 'recurring']"] """ Set to `true` to indicate that the customer isn't in your checkout flow during this payment attempt and can't authenticate. Use this parameter in scenarios where you collect card details and [charge them later](https://stripe.com/docs/payments/cards/charging-saved-cards). This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). """ on_behalf_of: NotRequired[str] """ The Stripe account ID that these funds are intended for. Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ payment_method: NotRequired[str] """ ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/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. """ payment_method_configuration: NotRequired[str] """ The ID of the payment method configuration to use with this PaymentIntent. """ payment_method_data: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodData" ] """ If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method) property on the PaymentIntent. """ payment_method_options: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodOptions" ] """ Payment method-specific configuration for this PaymentIntent. """ payment_method_types: NotRequired[List[str]] """ The list of payment method types (for example, a card) that this PaymentIntent can use. If you don't provide this, it defaults to ["card"]. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). """ radar_options: NotRequired[ "PaymentIntentService.CreateParamsRadarOptions" ] """ Options to configure Radar. Learn more about [Radar Sessions](https://stripe.com/docs/radar/radar-session). """ receipt_email: NotRequired[str] """ Email address to send the receipt to. If you specify `receipt_email` for a payment in live mode, you send a receipt regardless of your [email settings](https://dashboard.stripe.com/account/emails). """ return_url: NotRequired[str] """ The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-confirm). """ setup_future_usage: NotRequired[Literal["off_session", "on_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ shipping: NotRequired["PaymentIntentService.CreateParamsShipping"] """ Shipping information for this PaymentIntent. """ statement_descriptor: NotRequired[str] """ For card charges, use [statement_descriptor_suffix](https://stripe.com/docs/payments/account/statement-descriptors#dynamic). Otherwise, you can use this value as the complete description of a charge on your customers' statements. It must contain at least one letter and be 1–22 characters long. """ statement_descriptor_suffix: NotRequired[str] """ Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. The concatenated descriptor must contain 1-22 characters. """ transfer_data: NotRequired[ "PaymentIntentService.CreateParamsTransferData" ] """ The parameters that you can use to automatically create a Transfer. Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ transfer_group: NotRequired[str] """ A string that identifies the resulting payment as part of a group. Learn more about the [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers). """ use_stripe_sdk: NotRequired[bool] """ Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. """ class CreateParamsAutomaticPaymentMethods(TypedDict): allow_redirects: NotRequired[Literal["always", "never"]] """ Controls whether this PaymentIntent will accept redirect-based payment methods. Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. To [confirm](https://stripe.com/docs/api/payment_intents/confirm) this PaymentIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the payment. """ enabled: bool """ Whether this feature is enabled. """ class CreateParamsMandateData(TypedDict): customer_acceptance: ( "PaymentIntentService.CreateParamsMandateDataCustomerAcceptance" ) """ This hash contains details about the customer acceptance of the Mandate. """ class CreateParamsMandateDataCustomerAcceptance(TypedDict): accepted_at: NotRequired[int] """ The time at which the customer accepted the Mandate. """ offline: NotRequired[ "PaymentIntentService.CreateParamsMandateDataCustomerAcceptanceOffline" ] """ If this is a Mandate accepted offline, this hash contains details about the offline acceptance. """ online: NotRequired[ "PaymentIntentService.CreateParamsMandateDataCustomerAcceptanceOnline" ] """ If this is a Mandate accepted online, this hash contains details about the online acceptance. """ type: Literal["offline", "online"] """ The type of customer acceptance information included with the Mandate. One of `online` or `offline`. """ class CreateParamsMandateDataCustomerAcceptanceOffline(TypedDict): pass class CreateParamsMandateDataCustomerAcceptanceOnline(TypedDict): ip_address: str """ The IP address from which the Mandate was accepted by the customer. """ user_agent: str """ The user agent of the browser from which the Mandate was accepted by the customer. """ class CreateParamsPaymentMethodData(TypedDict): acss_debit: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataAcssDebit" ] """ If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. """ affirm: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataAffirm" ] """ If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. """ afterpay_clearpay: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataAfterpayClearpay" ] """ If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. """ alipay: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataAlipay" ] """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ allow_redisplay: NotRequired[ Literal["always", "limited", "unspecified"] ] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ amazon_pay: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataAmazonPay" ] """ If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. """ au_becs_debit: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataAuBecsDebit" ] """ If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. """ bacs_debit: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataBacsDebit" ] """ If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. """ bancontact: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataBancontact" ] """ If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. """ billing_details: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataBillingDetails" ] """ Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. """ blik: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataBlik" ] """ If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. """ boleto: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataBoleto" ] """ If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. """ cashapp: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataCashapp" ] """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ customer_balance: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataCustomerBalance" ] """ If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. """ eps: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataEps" ] """ If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. """ fpx: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataFpx" ] """ If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. """ giropay: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataGiropay" ] """ If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. """ grabpay: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataGrabpay" ] """ If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ ideal: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataIdeal" ] """ If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. """ interac_present: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataInteracPresent" ] """ If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. """ klarna: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataKlarna" ] """ If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. """ konbini: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataKonbini" ] """ If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. """ link: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataLink" ] """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ mobilepay: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataMobilepay" ] """ If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. """ multibanco: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataMultibanco" ] """ If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. """ oxxo: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataOxxo" ] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. """ p24: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataP24" ] """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ paynow: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataPaynow" ] """ If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. """ paypal: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataPaypal" ] """ If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. """ pix: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataPix" ] """ If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. """ promptpay: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataPromptpay" ] """ If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. """ radar_options: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataRadarOptions" ] """ Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. """ revolut_pay: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataRevolutPay" ] """ If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. """ sepa_debit: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataSepaDebit" ] """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ sofort: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataSofort" ] """ If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. """ swish: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataSwish" ] """ If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. """ twint: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataTwint" ] """ If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. """ type: Literal[ "acss_debit", "affirm", "afterpay_clearpay", "alipay", "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", "blik", "boleto", "cashapp", "customer_balance", "eps", "fpx", "giropay", "grabpay", "ideal", "klarna", "konbini", "link", "mobilepay", "multibanco", "oxxo", "p24", "paynow", "paypal", "pix", "promptpay", "revolut_pay", "sepa_debit", "sofort", "swish", "twint", "us_bank_account", "wechat_pay", "zip", ] """ The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. """ us_bank_account: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataUsBankAccount" ] """ If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. """ wechat_pay: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataWechatPay" ] """ If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. """ zip: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataZip" ] """ If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. """ class CreateParamsPaymentMethodDataAcssDebit(TypedDict): account_number: str """ Customer's bank account number. """ institution_number: str """ Institution number of the customer's bank. """ transit_number: str """ Transit number of the customer's bank. """ class CreateParamsPaymentMethodDataAffirm(TypedDict): pass class CreateParamsPaymentMethodDataAfterpayClearpay(TypedDict): pass class CreateParamsPaymentMethodDataAlipay(TypedDict): pass class CreateParamsPaymentMethodDataAmazonPay(TypedDict): pass class CreateParamsPaymentMethodDataAuBecsDebit(TypedDict): account_number: str """ The account number for the bank account. """ bsb_number: str """ Bank-State-Branch number of the bank account. """ class CreateParamsPaymentMethodDataBacsDebit(TypedDict): account_number: NotRequired[str] """ Account number of the bank account that the funds will be debited from. """ sort_code: NotRequired[str] """ Sort code of the bank account. (e.g., `10-20-30`) """ class CreateParamsPaymentMethodDataBancontact(TypedDict): pass class CreateParamsPaymentMethodDataBillingDetails(TypedDict): address: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodDataBillingDetailsAddress" ] """ Billing address. """ email: NotRequired["Literal['']|str"] """ Email address. """ name: NotRequired["Literal['']|str"] """ Full name. """ phone: NotRequired["Literal['']|str"] """ Billing phone number (including extension). """ class CreateParamsPaymentMethodDataBillingDetailsAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsPaymentMethodDataBlik(TypedDict): pass class CreateParamsPaymentMethodDataBoleto(TypedDict): tax_id: str """ The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) """ class CreateParamsPaymentMethodDataCashapp(TypedDict): pass class CreateParamsPaymentMethodDataCustomerBalance(TypedDict): pass class CreateParamsPaymentMethodDataEps(TypedDict): bank: NotRequired[ Literal[ "arzte_und_apotheker_bank", "austrian_anadi_bank_ag", "bank_austria", "bankhaus_carl_spangler", "bankhaus_schelhammer_und_schattera_ag", "bawag_psk_ag", "bks_bank_ag", "brull_kallmus_bank_ag", "btv_vier_lander_bank", "capital_bank_grawe_gruppe_ag", "deutsche_bank_ag", "dolomitenbank", "easybank_ag", "erste_bank_und_sparkassen", "hypo_alpeadriabank_international_ag", "hypo_bank_burgenland_aktiengesellschaft", "hypo_noe_lb_fur_niederosterreich_u_wien", "hypo_oberosterreich_salzburg_steiermark", "hypo_tirol_bank_ag", "hypo_vorarlberg_bank_ag", "marchfelder_bank", "oberbank_ag", "raiffeisen_bankengruppe_osterreich", "schoellerbank_ag", "sparda_bank_wien", "volksbank_gruppe", "volkskreditbank_ag", "vr_bank_braunau", ] ] """ The customer's bank. """ class CreateParamsPaymentMethodDataFpx(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type for FPX transaction """ bank: Literal[ "affin_bank", "agrobank", "alliance_bank", "ambank", "bank_islam", "bank_muamalat", "bank_of_china", "bank_rakyat", "bsn", "cimb", "deutsche_bank", "hong_leong_bank", "hsbc", "kfh", "maybank2e", "maybank2u", "ocbc", "pb_enterprise", "public_bank", "rhb", "standard_chartered", "uob", ] """ The customer's bank. """ class CreateParamsPaymentMethodDataGiropay(TypedDict): pass class CreateParamsPaymentMethodDataGrabpay(TypedDict): pass class CreateParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ Literal[ "abn_amro", "asn_bank", "bunq", "handelsbanken", "ing", "knab", "moneyou", "n26", "nn", "rabobank", "regiobank", "revolut", "sns_bank", "triodos_bank", "van_lanschot", "yoursafe", ] ] """ The customer's bank. """ class CreateParamsPaymentMethodDataInteracPresent(TypedDict): pass class CreateParamsPaymentMethodDataKlarna(TypedDict): dob: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodDataKlarnaDob" ] """ Customer's date of birth """ class CreateParamsPaymentMethodDataKlarnaDob(TypedDict): day: int """ The day of birth, between 1 and 31. """ month: int """ The month of birth, between 1 and 12. """ year: int """ The four-digit year of birth. """ class CreateParamsPaymentMethodDataKonbini(TypedDict): pass class CreateParamsPaymentMethodDataLink(TypedDict): pass class CreateParamsPaymentMethodDataMobilepay(TypedDict): pass class CreateParamsPaymentMethodDataMultibanco(TypedDict): pass class CreateParamsPaymentMethodDataOxxo(TypedDict): pass class CreateParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ Literal[ "alior_bank", "bank_millennium", "bank_nowy_bfg_sa", "bank_pekao_sa", "banki_spbdzielcze", "blik", "bnp_paribas", "boz", "citi_handlowy", "credit_agricole", "envelobank", "etransfer_pocztowy24", "getin_bank", "ideabank", "ing", "inteligo", "mbank_mtransfer", "nest_przelew", "noble_pay", "pbac_z_ipko", "plus_bank", "santander_przelew24", "tmobile_usbugi_bankowe", "toyota_bank", "velobank", "volkswagen_bank", ] ] """ The customer's bank. """ class CreateParamsPaymentMethodDataPaynow(TypedDict): pass class CreateParamsPaymentMethodDataPaypal(TypedDict): pass class CreateParamsPaymentMethodDataPix(TypedDict): pass class CreateParamsPaymentMethodDataPromptpay(TypedDict): pass class CreateParamsPaymentMethodDataRadarOptions(TypedDict): session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ class CreateParamsPaymentMethodDataRevolutPay(TypedDict): pass class CreateParamsPaymentMethodDataSepaDebit(TypedDict): iban: str """ IBAN of the bank account. """ class CreateParamsPaymentMethodDataSofort(TypedDict): country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] """ Two-letter ISO code representing the country the bank account is located in. """ class CreateParamsPaymentMethodDataSwish(TypedDict): pass class CreateParamsPaymentMethodDataTwint(TypedDict): pass class CreateParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type: individual or company. """ account_number: NotRequired[str] """ Account number of the bank account. """ account_type: NotRequired[Literal["checking", "savings"]] """ Account type: checkings or savings. Defaults to checking if omitted. """ financial_connections_account: NotRequired[str] """ The ID of a Financial Connections Account to use as a payment method. """ routing_number: NotRequired[str] """ Routing number of the bank account. """ class CreateParamsPaymentMethodDataWechatPay(TypedDict): pass class CreateParamsPaymentMethodDataZip(TypedDict): pass class CreateParamsPaymentMethodOptions(TypedDict): acss_debit: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsAcssDebit" ] """ If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options. """ affirm: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsAffirm" ] """ If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options. """ afterpay_clearpay: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsAfterpayClearpay" ] """ If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options. """ alipay: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsAlipay" ] """ If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. """ amazon_pay: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsAmazonPay" ] """ If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options. """ au_becs_debit: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsAuBecsDebit" ] """ If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options. """ bacs_debit: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsBacsDebit" ] """ If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options. """ bancontact: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsBancontact" ] """ If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options. """ blik: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsBlik" ] """ If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options. """ boleto: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsBoleto" ] """ If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options. """ card: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsCard" ] """ Configuration for any card payments attempted on this PaymentIntent. """ card_present: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsCardPresent" ] """ If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. """ cashapp: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsCashapp" ] """ If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options. """ customer_balance: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsCustomerBalance" ] """ If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options. """ eps: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsEps" ] """ If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options. """ fpx: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsFpx" ] """ If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options. """ giropay: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsGiropay" ] """ If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options. """ grabpay: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsGrabpay" ] """ If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. """ ideal: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsIdeal" ] """ If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options. """ interac_present: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsInteracPresent" ] """ If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. """ klarna: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsKlarna" ] """ If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options. """ konbini: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsKonbini" ] """ If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options. """ link: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsLink" ] """ If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. """ mobilepay: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsMobilepay" ] """ If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options. """ multibanco: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsMultibanco" ] """ If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options. """ oxxo: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsOxxo" ] """ If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options. """ p24: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsP24" ] """ If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. """ paynow: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsPaynow" ] """ If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options. """ paypal: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsPaypal" ] """ If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. """ pix: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsPix" ] """ If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options. """ promptpay: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsPromptpay" ] """ If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options. """ revolut_pay: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsRevolutPay" ] """ If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options. """ sepa_debit: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsSepaDebit" ] """ If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options. """ sofort: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsSofort" ] """ If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. """ swish: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsSwish" ] """ If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options. """ twint: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsTwint" ] """ If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options. """ us_bank_account: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsUsBankAccount" ] """ If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options. """ wechat_pay: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsWechatPay" ] """ If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options. """ zip: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsZip" ] """ If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options. """ class CreateParamsPaymentMethodOptionsAcssDebit(TypedDict): mandate_options: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodOptionsAcssDebitMandateOptions" ] """ Additional fields for Mandate creation """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. """ class CreateParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): custom_mandate_url: NotRequired["Literal['']|str"] """ A URL for custom mandate text to render during confirmation step. The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. """ interval_description: NotRequired[str] """ Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. """ payment_schedule: NotRequired[ Literal["combined", "interval", "sporadic"] ] """ Payment schedule for the mandate. """ transaction_type: NotRequired[Literal["business", "personal"]] """ Transaction type of the mandate. """ class CreateParamsPaymentMethodOptionsAffirm(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ preferred_locale: NotRequired[str] """ Preferred language of the Affirm authorization page that the customer is redirected to. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ reference: NotRequired[str] """ An internal identifier or reference that this payment corresponds to. You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes. This field differs from the statement descriptor and item name. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsAlipay(TypedDict): setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsAmazonPay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsBancontact(TypedDict): preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] """ Preferred language of the Bancontact authorization page that the customer is redirected to. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsBlik(TypedDict): code: NotRequired[str] """ The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. """ setup_future_usage: NotRequired["Literal['']|Literal['none']"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsBoleto(TypedDict): expires_after_days: NotRequired[int] """ The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsCard(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ cvc_token: NotRequired[str] """ A single-use `cvc_update` Token that represents a card CVC value. When provided, the CVC value will be verified during the card payment attempt. This parameter can only be provided during confirmation. """ installments: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodOptionsCardInstallments" ] """ Installment configuration for payments attempted on this PaymentIntent (Mexico Only). For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). """ mandate_options: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodOptionsCardMandateOptions" ] """ Configuration options for setting up an eMandate for cards issued in India. """ moto: NotRequired[bool] """ When specified, this parameter indicates that a transaction will be marked as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This parameter can only be provided during confirmation. """ network: NotRequired[ Literal[ "amex", "cartes_bancaires", "diners", "discover", "eftpos_au", "interac", "jcb", "mastercard", "unionpay", "unknown", "visa", ] ] """ Selected network to process this PaymentIntent on. Depends on the available networks of the card attached to the PaymentIntent. Can be only set confirm-time. """ request_extended_authorization: NotRequired[ Literal["if_available", "never"] ] """ Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent. """ request_incremental_authorization: NotRequired[ Literal["if_available", "never"] ] """ Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. """ request_multicapture: NotRequired[Literal["if_available", "never"]] """ Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent. """ request_overcapture: NotRequired[Literal["if_available", "never"]] """ Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. """ request_three_d_secure: NotRequired[ Literal["any", "automatic", "challenge"] ] """ 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://stripe.com/docs/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://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ require_cvc_recollection: NotRequired[bool] """ When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. using the cvc_token parameter). """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ statement_descriptor_suffix_kana: NotRequired["Literal['']|str"] """ Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. """ statement_descriptor_suffix_kanji: NotRequired["Literal['']|str"] """ 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. """ three_d_secure: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodOptionsCardThreeDSecure" ] """ If 3D Secure authentication was performed with a third-party provider, the authentication details to use for this payment. """ class CreateParamsPaymentMethodOptionsCardInstallments(TypedDict): enabled: NotRequired[bool] """ Setting to true enables installments for this PaymentIntent. This will cause the response to contain a list of available installment plans. Setting to false will prevent any selected plan from applying to a charge. """ plan: NotRequired[ "Literal['']|PaymentIntentService.CreateParamsPaymentMethodOptionsCardInstallmentsPlan" ] """ The selected installment plan to use for this payment attempt. This parameter can only be provided during confirmation. """ class CreateParamsPaymentMethodOptionsCardInstallmentsPlan(TypedDict): count: int """ For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. """ interval: Literal["month"] """ For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. One of `month`. """ type: Literal["fixed_count"] """ Type of installment plan, one of `fixed_count`. """ class CreateParamsPaymentMethodOptionsCardMandateOptions(TypedDict): amount: int """ Amount to be charged for future payments. """ amount_type: Literal["fixed", "maximum"] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ description: NotRequired[str] """ A description of the mandate or subscription that is meant to be displayed to the customer. """ end_date: NotRequired[int] """ End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. """ interval: Literal["day", "month", "sporadic", "week", "year"] """ Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. """ interval_count: NotRequired[int] """ The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. """ reference: str """ Unique identifier for the mandate or subscription. """ start_date: int """ Start date of the mandate or subscription. Start date should not be lesser than yesterday. """ supported_types: NotRequired[List[Literal["india"]]] """ Specifies the type of mandates supported. Possible values are `india`. """ class CreateParamsPaymentMethodOptionsCardPresent(TypedDict): request_extended_authorization: NotRequired[bool] """ Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity) """ request_incremental_authorization_support: NotRequired[bool] """ Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. """ routing: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodOptionsCardPresentRouting" ] """ Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes. """ class CreateParamsPaymentMethodOptionsCardPresentRouting(TypedDict): requested_priority: NotRequired[Literal["domestic", "international"]] """ Routing requested priority """ class CreateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): ares_trans_status: NotRequired[ Literal["A", "C", "I", "N", "R", "U", "Y"] ] """ The `transStatus` returned from the card Issuer's ACS in the ARes. """ cryptogram: str """ The cryptogram, also known as the "authentication value" (AAV, CAVV or AEVV). This value is 20 bytes, base64-encoded into a 28-character string. (Most 3D Secure providers will return the base64-encoded version, which is what you should specify here.) """ electronic_commerce_indicator: NotRequired[ Literal["01", "02", "05", "06", "07"] ] """ The Electronic Commerce Indicator (ECI) is returned by your 3D Secure provider and indicates what degree of authentication was performed. """ exemption_indicator: NotRequired[Literal["low_risk", "none"]] """ The exemption requested via 3DS and accepted by the issuer at authentication time. """ network_options: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions" ] """ Network specific 3DS fields. Network specific arguments require an explicit card brand choice. The parameter `payment_method_options.card.network`` must be populated accordingly """ requestor_challenge_indicator: NotRequired[str] """ The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. """ transaction_id: str """ For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server Transaction ID (dsTransID). """ version: Literal["1.0.2", "2.1.0", "2.2.0"] """ The version of 3D Secure that was performed. """ class CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions( TypedDict, ): cartes_bancaires: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires" ] """ Cartes Bancaires-specific 3DS fields. """ class CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires( TypedDict, ): cb_avalgo: Literal["0", "1", "2", "3", "4", "A"] """ The cryptogram calculation algorithm used by the card Issuer's ACS to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. messageExtension: CB-AVALGO """ cb_exemption: NotRequired[str] """ The exemption indicator returned from Cartes Bancaires in the ARes. message extension: CB-EXEMPTION; string (4 characters) This is a 3 byte bitmap (low significant byte first and most significant bit first) that has been Base64 encoded """ cb_score: NotRequired[int] """ The risk score returned from Cartes Bancaires in the ARes. message extension: CB-SCORE; numeric value 0-99 """ class CreateParamsPaymentMethodOptionsCashapp(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsCustomerBalance(TypedDict): bank_transfer: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodOptionsCustomerBalanceBankTransfer" ] """ Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. """ funding_type: NotRequired[Literal["bank_transfer"]] """ The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsCustomerBalanceBankTransfer( TypedDict, ): eu_bank_transfer: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer" ] """ Configuration for the eu_bank_transfer funding type. """ requested_address_types: NotRequired[ List[ Literal[ "aba", "iban", "sepa", "sort_code", "spei", "swift", "zengin", ] ] ] """ List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. """ type: Literal[ "eu_bank_transfer", "gb_bank_transfer", "jp_bank_transfer", "mx_bank_transfer", "us_bank_transfer", ] """ The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. """ class CreateParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer( TypedDict, ): country: str """ The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. """ class CreateParamsPaymentMethodOptionsEps(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsFpx(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsGiropay(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsGrabpay(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsIdeal(TypedDict): setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsInteracPresent(TypedDict): pass class CreateParamsPaymentMethodOptionsKlarna(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ preferred_locale: NotRequired[ Literal[ "cs-CZ", "da-DK", "de-AT", "de-CH", "de-DE", "el-GR", "en-AT", "en-AU", "en-BE", "en-CA", "en-CH", "en-CZ", "en-DE", "en-DK", "en-ES", "en-FI", "en-FR", "en-GB", "en-GR", "en-IE", "en-IT", "en-NL", "en-NO", "en-NZ", "en-PL", "en-PT", "en-RO", "en-SE", "en-US", "es-ES", "es-US", "fi-FI", "fr-BE", "fr-CA", "fr-CH", "fr-FR", "it-CH", "it-IT", "nb-NO", "nl-BE", "nl-NL", "pl-PL", "pt-PT", "ro-RO", "sv-FI", "sv-SE", ] ] """ Preferred language of the Klarna authorization page that the customer is redirected to """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsKonbini(TypedDict): confirmation_number: NotRequired["Literal['']|str"] """ An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores. Must not consist of only zeroes and could be rejected in case of insufficient uniqueness. We recommend to use the customer's phone number. """ expires_after_days: NotRequired["Literal['']|int"] """ The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. Defaults to 3 days. """ expires_at: NotRequired["Literal['']|int"] """ The timestamp at which the Konbini payment instructions will expire. Only one of `expires_after_days` or `expires_at` may be set. """ product_description: NotRequired["Literal['']|str"] """ A product descriptor of up to 22 characters, which will appear to customers at the convenience store. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsLink(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ persistent_token: NotRequired[str] """ [Deprecated] This is a legacy parameter that no longer has any function. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsMobilepay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsMultibanco(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsOxxo(TypedDict): expires_after_days: NotRequired[int] """ The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsP24(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ tos_shown_and_accepted: NotRequired[bool] """ Confirm that the payer has accepted the P24 terms and conditions. """ class CreateParamsPaymentMethodOptionsPaynow(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsPaypal(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds will be captured from the customer's account. """ preferred_locale: NotRequired[ Literal[ "cs-CZ", "da-DK", "de-AT", "de-DE", "de-LU", "el-GR", "en-GB", "en-US", "es-ES", "fi-FI", "fr-BE", "fr-FR", "fr-LU", "hu-HU", "it-IT", "nl-BE", "nl-NL", "pl-PL", "pt-PT", "sk-SK", "sv-SE", ] ] """ [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. """ reference: NotRequired[str] """ A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. """ risk_correlation_id: NotRequired[str] """ The risk correlation ID for an on-session payment using a saved PayPal payment method. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsPix(TypedDict): expires_after_seconds: NotRequired[int] """ The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. """ expires_at: NotRequired[int] """ The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). Defaults to 1 day in the future. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsPromptpay(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsRevolutPay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): mandate_options: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodOptionsSepaDebitMandateOptions" ] """ Additional fields for Mandate creation """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): pass class CreateParamsPaymentMethodOptionsSofort(TypedDict): preferred_language: NotRequired[ "Literal['']|Literal['de', 'en', 'es', 'fr', 'it', 'nl', 'pl']" ] """ Language shown to the payer on redirect. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsSwish(TypedDict): reference: NotRequired["Literal['']|str"] """ The order ID displayed in the Swish app after the payment is authorized. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsTwint(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): financial_connections: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections" ] """ Additional fields for Financial Connections Session creation """ mandate_options: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodOptionsUsBankAccountMandateOptions" ] """ Additional fields for Mandate creation """ networks: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodOptionsUsBankAccountNetworks" ] """ Additional fields for network related functions """ preferred_settlement_speed: NotRequired[ "Literal['']|Literal['fastest', 'standard']" ] """ Preferred transaction settlement speed """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. """ class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): filters: NotRequired[ "PaymentIntentService.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" ] """ Provide filters for the linked accounts that the customer can select for the payment method """ permissions: NotRequired[ List[ Literal[ "balances", "ownership", "payment_method", "transactions" ] ] ] """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ List[Literal["balances", "ownership", "transactions"]] ] """ List of data features that you would like to retrieve upon account creation. """ return_url: NotRequired[str] """ For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. """ class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( TypedDict, ): account_subcategories: NotRequired[ List[Literal["checking", "savings"]] ] """ The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. """ class CreateParamsPaymentMethodOptionsUsBankAccountMandateOptions( TypedDict, ): collection_method: NotRequired["Literal['']|Literal['paper']"] """ The method used to collect offline mandate customer acceptance. """ class CreateParamsPaymentMethodOptionsUsBankAccountNetworks(TypedDict): requested: NotRequired[List[Literal["ach", "us_domestic_wire"]]] """ Triggers validations to run across the selected networks """ class CreateParamsPaymentMethodOptionsWechatPay(TypedDict): app_id: NotRequired[str] """ The app ID registered with WeChat Pay. Only required when client is ios or android. """ client: Literal["android", "ios", "web"] """ The client type that the end customer will pay from """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsZip(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsRadarOptions(TypedDict): session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ class CreateParamsShipping(TypedDict): address: "PaymentIntentService.CreateParamsShippingAddress" """ Shipping address. """ carrier: NotRequired[str] """ The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. """ name: str """ Recipient name. """ phone: NotRequired[str] """ Recipient phone (including extension). """ tracking_number: NotRequired[str] """ The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ class CreateParamsShippingAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsTransferData(TypedDict): amount: NotRequired[int] """ The amount that will be transferred automatically when a charge succeeds. The amount is capped at the total transaction amount and if no amount is set, the full amount is transferred. If you intend to collect a fee and you need a more robust reporting experience, using [application_fee_amount](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-application_fee_amount) might be a better fit for your integration. """ destination: str """ If specified, successful charges will be attributed to the destination account for tax reporting, and the funds from charges will be transferred to the destination account. The ID of the resulting transfer will be returned on the successful charge's `transfer` field. """ class IncrementAuthorizationParams(TypedDict): amount: int """ The updated total amount that you intend to collect from the cardholder. This amount must be greater than the currently authorized amount. """ application_fee_amount: NotRequired[int] """ The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ statement_descriptor: NotRequired[str] """ For card charges, use [statement_descriptor_suffix](https://stripe.com/docs/payments/account/statement-descriptors#dynamic). Otherwise, you can use this value as the complete description of a charge on your customers' statements. It must contain at least one letter and be 1–22 characters long. """ transfer_data: NotRequired[ "PaymentIntentService.IncrementAuthorizationParamsTransferData" ] """ The parameters used to automatically create a transfer after the payment is captured. Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ class IncrementAuthorizationParamsTransferData(TypedDict): amount: NotRequired[int] """ The amount that will be transferred automatically when a charge succeeds. """ class ListParams(TypedDict): created: NotRequired["PaymentIntentService.ListParamsCreated|int"] """ A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp or a dictionary with a number of different query options. """ customer: NotRequired[str] """ Only return PaymentIntents for the customer that this customer ID specifies. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): client_secret: NotRequired[str] """ The client secret of the PaymentIntent. We require it if you use a publishable key to retrieve the source. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class SearchParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ page: NotRequired[str] """ A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. """ query: str """ The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for payment intents](https://stripe.com/docs/search#query-fields-for-payment-intents). """ class UpdateParams(TypedDict): amount: NotRequired[int] """ Amount intended to be collected by this PaymentIntent. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/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://stripe.com/docs/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). """ application_fee_amount: NotRequired["Literal['']|int"] """ The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ capture_method: NotRequired[ Literal["automatic", "automatic_async", "manual"] ] """ Controls when the funds will be captured from the customer's account. """ currency: NotRequired[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). """ customer: NotRequired[str] """ ID of the Customer this PaymentIntent belongs to, if one exists. Payment methods attached to other Customers cannot be used with this PaymentIntent. If present in combination with [setup_future_usage](https://stripe.com/docs/api#payment_intent_object-setup_future_usage), this PaymentIntent's payment method will be attached to the Customer after the PaymentIntent has been confirmed and any required actions from the user are complete. """ description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ payment_method: NotRequired[str] """ ID of the payment method (a PaymentMethod, Card, or [compatible Source](https://stripe.com/docs/payments/payment-methods/transitioning#compatibility) object) to attach to this PaymentIntent. """ payment_method_configuration: NotRequired[str] """ The ID of the payment method configuration to use with this PaymentIntent. """ payment_method_data: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodData" ] """ If provided, this hash will be used to create a PaymentMethod. The new PaymentMethod will appear in the [payment_method](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-payment_method) property on the PaymentIntent. """ payment_method_options: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodOptions" ] """ Payment-method-specific configuration for this PaymentIntent. """ payment_method_types: NotRequired[List[str]] """ The list of payment method types (for example, card) that this PaymentIntent can use. Use `automatic_payment_methods` to manage payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). """ receipt_email: NotRequired["Literal['']|str"] """ Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). """ setup_future_usage: NotRequired[ "Literal['']|Literal['off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ shipping: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsShipping" ] """ Shipping information for this PaymentIntent. """ statement_descriptor: NotRequired[str] """ For card charges, use [statement_descriptor_suffix](https://stripe.com/docs/payments/account/statement-descriptors#dynamic). Otherwise, you can use this value as the complete description of a charge on your customers' statements. It must contain at least one letter and be 1–22 characters long. """ statement_descriptor_suffix: NotRequired[str] """ Provides information about a card payment that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. """ transfer_data: NotRequired[ "PaymentIntentService.UpdateParamsTransferData" ] """ Use this parameter to automatically create a Transfer when the payment succeeds. Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ transfer_group: NotRequired[str] """ A string that identifies the resulting payment as part of a group. You can only provide `transfer_group` if it hasn't been set. Learn more about the [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ class UpdateParamsPaymentMethodData(TypedDict): acss_debit: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataAcssDebit" ] """ If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. """ affirm: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataAffirm" ] """ If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. """ afterpay_clearpay: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataAfterpayClearpay" ] """ If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. """ alipay: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataAlipay" ] """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ allow_redisplay: NotRequired[ Literal["always", "limited", "unspecified"] ] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ amazon_pay: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataAmazonPay" ] """ If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. """ au_becs_debit: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataAuBecsDebit" ] """ If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. """ bacs_debit: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataBacsDebit" ] """ If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. """ bancontact: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataBancontact" ] """ If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. """ billing_details: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataBillingDetails" ] """ Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. """ blik: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataBlik" ] """ If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. """ boleto: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataBoleto" ] """ If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. """ cashapp: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataCashapp" ] """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ customer_balance: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataCustomerBalance" ] """ If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. """ eps: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataEps" ] """ If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. """ fpx: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataFpx" ] """ If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. """ giropay: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataGiropay" ] """ If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. """ grabpay: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataGrabpay" ] """ If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ ideal: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataIdeal" ] """ If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. """ interac_present: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataInteracPresent" ] """ If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. """ klarna: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataKlarna" ] """ If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. """ konbini: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataKonbini" ] """ If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. """ link: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataLink" ] """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ mobilepay: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataMobilepay" ] """ If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. """ multibanco: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataMultibanco" ] """ If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. """ oxxo: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataOxxo" ] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. """ p24: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataP24" ] """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ paynow: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataPaynow" ] """ If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. """ paypal: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataPaypal" ] """ If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. """ pix: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataPix" ] """ If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. """ promptpay: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataPromptpay" ] """ If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. """ radar_options: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataRadarOptions" ] """ Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. """ revolut_pay: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataRevolutPay" ] """ If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. """ sepa_debit: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataSepaDebit" ] """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ sofort: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataSofort" ] """ If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. """ swish: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataSwish" ] """ If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. """ twint: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataTwint" ] """ If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. """ type: Literal[ "acss_debit", "affirm", "afterpay_clearpay", "alipay", "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", "blik", "boleto", "cashapp", "customer_balance", "eps", "fpx", "giropay", "grabpay", "ideal", "klarna", "konbini", "link", "mobilepay", "multibanco", "oxxo", "p24", "paynow", "paypal", "pix", "promptpay", "revolut_pay", "sepa_debit", "sofort", "swish", "twint", "us_bank_account", "wechat_pay", "zip", ] """ The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. """ us_bank_account: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataUsBankAccount" ] """ If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. """ wechat_pay: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataWechatPay" ] """ If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. """ zip: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataZip" ] """ If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. """ class UpdateParamsPaymentMethodDataAcssDebit(TypedDict): account_number: str """ Customer's bank account number. """ institution_number: str """ Institution number of the customer's bank. """ transit_number: str """ Transit number of the customer's bank. """ class UpdateParamsPaymentMethodDataAffirm(TypedDict): pass class UpdateParamsPaymentMethodDataAfterpayClearpay(TypedDict): pass class UpdateParamsPaymentMethodDataAlipay(TypedDict): pass class UpdateParamsPaymentMethodDataAmazonPay(TypedDict): pass class UpdateParamsPaymentMethodDataAuBecsDebit(TypedDict): account_number: str """ The account number for the bank account. """ bsb_number: str """ Bank-State-Branch number of the bank account. """ class UpdateParamsPaymentMethodDataBacsDebit(TypedDict): account_number: NotRequired[str] """ Account number of the bank account that the funds will be debited from. """ sort_code: NotRequired[str] """ Sort code of the bank account. (e.g., `10-20-30`) """ class UpdateParamsPaymentMethodDataBancontact(TypedDict): pass class UpdateParamsPaymentMethodDataBillingDetails(TypedDict): address: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodDataBillingDetailsAddress" ] """ Billing address. """ email: NotRequired["Literal['']|str"] """ Email address. """ name: NotRequired["Literal['']|str"] """ Full name. """ phone: NotRequired["Literal['']|str"] """ Billing phone number (including extension). """ class UpdateParamsPaymentMethodDataBillingDetailsAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class UpdateParamsPaymentMethodDataBlik(TypedDict): pass class UpdateParamsPaymentMethodDataBoleto(TypedDict): tax_id: str """ The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) """ class UpdateParamsPaymentMethodDataCashapp(TypedDict): pass class UpdateParamsPaymentMethodDataCustomerBalance(TypedDict): pass class UpdateParamsPaymentMethodDataEps(TypedDict): bank: NotRequired[ Literal[ "arzte_und_apotheker_bank", "austrian_anadi_bank_ag", "bank_austria", "bankhaus_carl_spangler", "bankhaus_schelhammer_und_schattera_ag", "bawag_psk_ag", "bks_bank_ag", "brull_kallmus_bank_ag", "btv_vier_lander_bank", "capital_bank_grawe_gruppe_ag", "deutsche_bank_ag", "dolomitenbank", "easybank_ag", "erste_bank_und_sparkassen", "hypo_alpeadriabank_international_ag", "hypo_bank_burgenland_aktiengesellschaft", "hypo_noe_lb_fur_niederosterreich_u_wien", "hypo_oberosterreich_salzburg_steiermark", "hypo_tirol_bank_ag", "hypo_vorarlberg_bank_ag", "marchfelder_bank", "oberbank_ag", "raiffeisen_bankengruppe_osterreich", "schoellerbank_ag", "sparda_bank_wien", "volksbank_gruppe", "volkskreditbank_ag", "vr_bank_braunau", ] ] """ The customer's bank. """ class UpdateParamsPaymentMethodDataFpx(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type for FPX transaction """ bank: Literal[ "affin_bank", "agrobank", "alliance_bank", "ambank", "bank_islam", "bank_muamalat", "bank_of_china", "bank_rakyat", "bsn", "cimb", "deutsche_bank", "hong_leong_bank", "hsbc", "kfh", "maybank2e", "maybank2u", "ocbc", "pb_enterprise", "public_bank", "rhb", "standard_chartered", "uob", ] """ The customer's bank. """ class UpdateParamsPaymentMethodDataGiropay(TypedDict): pass class UpdateParamsPaymentMethodDataGrabpay(TypedDict): pass class UpdateParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ Literal[ "abn_amro", "asn_bank", "bunq", "handelsbanken", "ing", "knab", "moneyou", "n26", "nn", "rabobank", "regiobank", "revolut", "sns_bank", "triodos_bank", "van_lanschot", "yoursafe", ] ] """ The customer's bank. """ class UpdateParamsPaymentMethodDataInteracPresent(TypedDict): pass class UpdateParamsPaymentMethodDataKlarna(TypedDict): dob: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodDataKlarnaDob" ] """ Customer's date of birth """ class UpdateParamsPaymentMethodDataKlarnaDob(TypedDict): day: int """ The day of birth, between 1 and 31. """ month: int """ The month of birth, between 1 and 12. """ year: int """ The four-digit year of birth. """ class UpdateParamsPaymentMethodDataKonbini(TypedDict): pass class UpdateParamsPaymentMethodDataLink(TypedDict): pass class UpdateParamsPaymentMethodDataMobilepay(TypedDict): pass class UpdateParamsPaymentMethodDataMultibanco(TypedDict): pass class UpdateParamsPaymentMethodDataOxxo(TypedDict): pass class UpdateParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ Literal[ "alior_bank", "bank_millennium", "bank_nowy_bfg_sa", "bank_pekao_sa", "banki_spbdzielcze", "blik", "bnp_paribas", "boz", "citi_handlowy", "credit_agricole", "envelobank", "etransfer_pocztowy24", "getin_bank", "ideabank", "ing", "inteligo", "mbank_mtransfer", "nest_przelew", "noble_pay", "pbac_z_ipko", "plus_bank", "santander_przelew24", "tmobile_usbugi_bankowe", "toyota_bank", "velobank", "volkswagen_bank", ] ] """ The customer's bank. """ class UpdateParamsPaymentMethodDataPaynow(TypedDict): pass class UpdateParamsPaymentMethodDataPaypal(TypedDict): pass class UpdateParamsPaymentMethodDataPix(TypedDict): pass class UpdateParamsPaymentMethodDataPromptpay(TypedDict): pass class UpdateParamsPaymentMethodDataRadarOptions(TypedDict): session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ class UpdateParamsPaymentMethodDataRevolutPay(TypedDict): pass class UpdateParamsPaymentMethodDataSepaDebit(TypedDict): iban: str """ IBAN of the bank account. """ class UpdateParamsPaymentMethodDataSofort(TypedDict): country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] """ Two-letter ISO code representing the country the bank account is located in. """ class UpdateParamsPaymentMethodDataSwish(TypedDict): pass class UpdateParamsPaymentMethodDataTwint(TypedDict): pass class UpdateParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type: individual or company. """ account_number: NotRequired[str] """ Account number of the bank account. """ account_type: NotRequired[Literal["checking", "savings"]] """ Account type: checkings or savings. Defaults to checking if omitted. """ financial_connections_account: NotRequired[str] """ The ID of a Financial Connections Account to use as a payment method. """ routing_number: NotRequired[str] """ Routing number of the bank account. """ class UpdateParamsPaymentMethodDataWechatPay(TypedDict): pass class UpdateParamsPaymentMethodDataZip(TypedDict): pass class UpdateParamsPaymentMethodOptions(TypedDict): acss_debit: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsAcssDebit" ] """ If this is a `acss_debit` PaymentMethod, this sub-hash contains details about the ACSS Debit payment method options. """ affirm: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsAffirm" ] """ If this is an `affirm` PaymentMethod, this sub-hash contains details about the Affirm payment method options. """ afterpay_clearpay: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsAfterpayClearpay" ] """ If this is a `afterpay_clearpay` PaymentMethod, this sub-hash contains details about the Afterpay Clearpay payment method options. """ alipay: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsAlipay" ] """ If this is a `alipay` PaymentMethod, this sub-hash contains details about the Alipay payment method options. """ amazon_pay: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsAmazonPay" ] """ If this is a `amazon_pay` PaymentMethod, this sub-hash contains details about the Amazon Pay payment method options. """ au_becs_debit: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsAuBecsDebit" ] """ If this is a `au_becs_debit` PaymentMethod, this sub-hash contains details about the AU BECS Direct Debit payment method options. """ bacs_debit: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsBacsDebit" ] """ If this is a `bacs_debit` PaymentMethod, this sub-hash contains details about the BACS Debit payment method options. """ bancontact: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsBancontact" ] """ If this is a `bancontact` PaymentMethod, this sub-hash contains details about the Bancontact payment method options. """ blik: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsBlik" ] """ If this is a `blik` PaymentMethod, this sub-hash contains details about the BLIK payment method options. """ boleto: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsBoleto" ] """ If this is a `boleto` PaymentMethod, this sub-hash contains details about the Boleto payment method options. """ card: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsCard" ] """ Configuration for any card payments attempted on this PaymentIntent. """ card_present: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsCardPresent" ] """ If this is a `card_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. """ cashapp: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsCashapp" ] """ If this is a `cashapp` PaymentMethod, this sub-hash contains details about the Cash App Pay payment method options. """ customer_balance: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsCustomerBalance" ] """ If this is a `customer balance` PaymentMethod, this sub-hash contains details about the customer balance payment method options. """ eps: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsEps" ] """ If this is a `eps` PaymentMethod, this sub-hash contains details about the EPS payment method options. """ fpx: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsFpx" ] """ If this is a `fpx` PaymentMethod, this sub-hash contains details about the FPX payment method options. """ giropay: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsGiropay" ] """ If this is a `giropay` PaymentMethod, this sub-hash contains details about the Giropay payment method options. """ grabpay: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsGrabpay" ] """ If this is a `grabpay` PaymentMethod, this sub-hash contains details about the Grabpay payment method options. """ ideal: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsIdeal" ] """ If this is a `ideal` PaymentMethod, this sub-hash contains details about the Ideal payment method options. """ interac_present: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsInteracPresent" ] """ If this is a `interac_present` PaymentMethod, this sub-hash contains details about the Card Present payment method options. """ klarna: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsKlarna" ] """ If this is a `klarna` PaymentMethod, this sub-hash contains details about the Klarna payment method options. """ konbini: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsKonbini" ] """ If this is a `konbini` PaymentMethod, this sub-hash contains details about the Konbini payment method options. """ link: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsLink" ] """ If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. """ mobilepay: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsMobilepay" ] """ If this is a `MobilePay` PaymentMethod, this sub-hash contains details about the MobilePay payment method options. """ multibanco: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsMultibanco" ] """ If this is a `multibanco` PaymentMethod, this sub-hash contains details about the Multibanco payment method options. """ oxxo: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsOxxo" ] """ If this is a `oxxo` PaymentMethod, this sub-hash contains details about the OXXO payment method options. """ p24: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsP24" ] """ If this is a `p24` PaymentMethod, this sub-hash contains details about the Przelewy24 payment method options. """ paynow: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsPaynow" ] """ If this is a `paynow` PaymentMethod, this sub-hash contains details about the PayNow payment method options. """ paypal: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsPaypal" ] """ If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. """ pix: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsPix" ] """ If this is a `pix` PaymentMethod, this sub-hash contains details about the Pix payment method options. """ promptpay: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsPromptpay" ] """ If this is a `promptpay` PaymentMethod, this sub-hash contains details about the PromptPay payment method options. """ revolut_pay: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsRevolutPay" ] """ If this is a `revolut_pay` PaymentMethod, this sub-hash contains details about the Revolut Pay payment method options. """ sepa_debit: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsSepaDebit" ] """ If this is a `sepa_debit` PaymentIntent, this sub-hash contains details about the SEPA Debit payment method options. """ sofort: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsSofort" ] """ If this is a `sofort` PaymentMethod, this sub-hash contains details about the SOFORT payment method options. """ swish: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsSwish" ] """ If this is a `Swish` PaymentMethod, this sub-hash contains details about the Swish payment method options. """ twint: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsTwint" ] """ If this is a `twint` PaymentMethod, this sub-hash contains details about the TWINT payment method options. """ us_bank_account: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsUsBankAccount" ] """ If this is a `us_bank_account` PaymentMethod, this sub-hash contains details about the US bank account payment method options. """ wechat_pay: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsWechatPay" ] """ If this is a `wechat_pay` PaymentMethod, this sub-hash contains details about the WeChat Pay payment method options. """ zip: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsZip" ] """ If this is a `zip` PaymentMethod, this sub-hash contains details about the Zip payment method options. """ class UpdateParamsPaymentMethodOptionsAcssDebit(TypedDict): mandate_options: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodOptionsAcssDebitMandateOptions" ] """ Additional fields for Mandate creation """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. """ class UpdateParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): custom_mandate_url: NotRequired["Literal['']|str"] """ A URL for custom mandate text to render during confirmation step. The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. """ interval_description: NotRequired[str] """ Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. """ payment_schedule: NotRequired[ Literal["combined", "interval", "sporadic"] ] """ Payment schedule for the mandate. """ transaction_type: NotRequired[Literal["business", "personal"]] """ Transaction type of the mandate. """ class UpdateParamsPaymentMethodOptionsAffirm(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ preferred_locale: NotRequired[str] """ Preferred language of the Affirm authorization page that the customer is redirected to. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ reference: NotRequired[str] """ An internal identifier or reference that this payment corresponds to. You must limit the identifier to 128 characters, and it can only contain letters, numbers, underscores, backslashes, and dashes. This field differs from the statement descriptor and item name. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsAlipay(TypedDict): setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsAmazonPay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class UpdateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsBacsDebit(TypedDict): setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsBancontact(TypedDict): preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] """ Preferred language of the Bancontact authorization page that the customer is redirected to. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsBlik(TypedDict): code: NotRequired[str] """ The 6-digit BLIK code that a customer has generated using their banking application. Can only be set on confirmation. """ setup_future_usage: NotRequired["Literal['']|Literal['none']"] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsBoleto(TypedDict): expires_after_days: NotRequired[int] """ The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsCard(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ cvc_token: NotRequired[str] """ A single-use `cvc_update` Token that represents a card CVC value. When provided, the CVC value will be verified during the card payment attempt. This parameter can only be provided during confirmation. """ installments: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodOptionsCardInstallments" ] """ Installment configuration for payments attempted on this PaymentIntent (Mexico Only). For more information, see the [installments integration guide](https://stripe.com/docs/payments/installments). """ mandate_options: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodOptionsCardMandateOptions" ] """ Configuration options for setting up an eMandate for cards issued in India. """ moto: NotRequired[bool] """ When specified, this parameter indicates that a transaction will be marked as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This parameter can only be provided during confirmation. """ network: NotRequired[ Literal[ "amex", "cartes_bancaires", "diners", "discover", "eftpos_au", "interac", "jcb", "mastercard", "unionpay", "unknown", "visa", ] ] """ Selected network to process this PaymentIntent on. Depends on the available networks of the card attached to the PaymentIntent. Can be only set confirm-time. """ request_extended_authorization: NotRequired[ Literal["if_available", "never"] ] """ Request ability to [capture beyond the standard authorization validity window](https://stripe.com/docs/payments/extended-authorization) for this PaymentIntent. """ request_incremental_authorization: NotRequired[ Literal["if_available", "never"] ] """ Request ability to [increment the authorization](https://stripe.com/docs/payments/incremental-authorization) for this PaymentIntent. """ request_multicapture: NotRequired[Literal["if_available", "never"]] """ Request ability to make [multiple captures](https://stripe.com/docs/payments/multicapture) for this PaymentIntent. """ request_overcapture: NotRequired[Literal["if_available", "never"]] """ Request ability to [overcapture](https://stripe.com/docs/payments/overcapture) for this PaymentIntent. """ request_three_d_secure: NotRequired[ Literal["any", "automatic", "challenge"] ] """ 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://stripe.com/docs/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://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ require_cvc_recollection: NotRequired[bool] """ When enabled, using a card that is attached to a customer will require the CVC to be provided again (i.e. using the cvc_token parameter). """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ statement_descriptor_suffix_kana: NotRequired["Literal['']|str"] """ Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. """ statement_descriptor_suffix_kanji: NotRequired["Literal['']|str"] """ 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. """ three_d_secure: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodOptionsCardThreeDSecure" ] """ If 3D Secure authentication was performed with a third-party provider, the authentication details to use for this payment. """ class UpdateParamsPaymentMethodOptionsCardInstallments(TypedDict): enabled: NotRequired[bool] """ Setting to true enables installments for this PaymentIntent. This will cause the response to contain a list of available installment plans. Setting to false will prevent any selected plan from applying to a charge. """ plan: NotRequired[ "Literal['']|PaymentIntentService.UpdateParamsPaymentMethodOptionsCardInstallmentsPlan" ] """ The selected installment plan to use for this payment attempt. This parameter can only be provided during confirmation. """ class UpdateParamsPaymentMethodOptionsCardInstallmentsPlan(TypedDict): count: int """ For `fixed_count` installment plans, this is the number of installment payments your customer will make to their credit card. """ interval: Literal["month"] """ For `fixed_count` installment plans, this is the interval between installment payments your customer will make to their credit card. One of `month`. """ type: Literal["fixed_count"] """ Type of installment plan, one of `fixed_count`. """ class UpdateParamsPaymentMethodOptionsCardMandateOptions(TypedDict): amount: int """ Amount to be charged for future payments. """ amount_type: Literal["fixed", "maximum"] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ description: NotRequired[str] """ A description of the mandate or subscription that is meant to be displayed to the customer. """ end_date: NotRequired[int] """ End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. """ interval: Literal["day", "month", "sporadic", "week", "year"] """ Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. """ interval_count: NotRequired[int] """ The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. """ reference: str """ Unique identifier for the mandate or subscription. """ start_date: int """ Start date of the mandate or subscription. Start date should not be lesser than yesterday. """ supported_types: NotRequired[List[Literal["india"]]] """ Specifies the type of mandates supported. Possible values are `india`. """ class UpdateParamsPaymentMethodOptionsCardPresent(TypedDict): request_extended_authorization: NotRequired[bool] """ Request ability to capture this payment beyond the standard [authorization validity window](https://stripe.com/docs/terminal/features/extended-authorizations#authorization-validity) """ request_incremental_authorization_support: NotRequired[bool] """ Request ability to [increment](https://stripe.com/docs/terminal/features/incremental-authorizations) this PaymentIntent if the combination of MCC and card brand is eligible. Check [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) in the [Confirm](https://stripe.com/docs/api/payment_intents/confirm) response to verify support. """ routing: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodOptionsCardPresentRouting" ] """ Network routing priority on co-branded EMV cards supporting domestic debit and international card schemes. """ class UpdateParamsPaymentMethodOptionsCardPresentRouting(TypedDict): requested_priority: NotRequired[Literal["domestic", "international"]] """ Routing requested priority """ class UpdateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): ares_trans_status: NotRequired[ Literal["A", "C", "I", "N", "R", "U", "Y"] ] """ The `transStatus` returned from the card Issuer's ACS in the ARes. """ cryptogram: str """ The cryptogram, also known as the "authentication value" (AAV, CAVV or AEVV). This value is 20 bytes, base64-encoded into a 28-character string. (Most 3D Secure providers will return the base64-encoded version, which is what you should specify here.) """ electronic_commerce_indicator: NotRequired[ Literal["01", "02", "05", "06", "07"] ] """ The Electronic Commerce Indicator (ECI) is returned by your 3D Secure provider and indicates what degree of authentication was performed. """ exemption_indicator: NotRequired[Literal["low_risk", "none"]] """ The exemption requested via 3DS and accepted by the issuer at authentication time. """ network_options: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions" ] """ Network specific 3DS fields. Network specific arguments require an explicit card brand choice. The parameter `payment_method_options.card.network`` must be populated accordingly """ requestor_challenge_indicator: NotRequired[str] """ The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. """ transaction_id: str """ For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server Transaction ID (dsTransID). """ version: Literal["1.0.2", "2.1.0", "2.2.0"] """ The version of 3D Secure that was performed. """ class UpdateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions( TypedDict, ): cartes_bancaires: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires" ] """ Cartes Bancaires-specific 3DS fields. """ class UpdateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires( TypedDict, ): cb_avalgo: Literal["0", "1", "2", "3", "4", "A"] """ The cryptogram calculation algorithm used by the card Issuer's ACS to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. messageExtension: CB-AVALGO """ cb_exemption: NotRequired[str] """ The exemption indicator returned from Cartes Bancaires in the ARes. message extension: CB-EXEMPTION; string (4 characters) This is a 3 byte bitmap (low significant byte first and most significant bit first) that has been Base64 encoded """ cb_score: NotRequired[int] """ The risk score returned from Cartes Bancaires in the ARes. message extension: CB-SCORE; numeric value 0-99 """ class UpdateParamsPaymentMethodOptionsCashapp(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsCustomerBalance(TypedDict): bank_transfer: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodOptionsCustomerBalanceBankTransfer" ] """ Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. """ funding_type: NotRequired[Literal["bank_transfer"]] """ The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsCustomerBalanceBankTransfer( TypedDict, ): eu_bank_transfer: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer" ] """ Configuration for the eu_bank_transfer funding type. """ requested_address_types: NotRequired[ List[ Literal[ "aba", "iban", "sepa", "sort_code", "spei", "swift", "zengin", ] ] ] """ List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. """ type: Literal[ "eu_bank_transfer", "gb_bank_transfer", "jp_bank_transfer", "mx_bank_transfer", "us_bank_transfer", ] """ The list of bank transfer types that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. """ class UpdateParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer( TypedDict, ): country: str """ The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. """ class UpdateParamsPaymentMethodOptionsEps(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsFpx(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsGiropay(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsGrabpay(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsIdeal(TypedDict): setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsInteracPresent(TypedDict): pass class UpdateParamsPaymentMethodOptionsKlarna(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ preferred_locale: NotRequired[ Literal[ "cs-CZ", "da-DK", "de-AT", "de-CH", "de-DE", "el-GR", "en-AT", "en-AU", "en-BE", "en-CA", "en-CH", "en-CZ", "en-DE", "en-DK", "en-ES", "en-FI", "en-FR", "en-GB", "en-GR", "en-IE", "en-IT", "en-NL", "en-NO", "en-NZ", "en-PL", "en-PT", "en-RO", "en-SE", "en-US", "es-ES", "es-US", "fi-FI", "fr-BE", "fr-CA", "fr-CH", "fr-FR", "it-CH", "it-IT", "nb-NO", "nl-BE", "nl-NL", "pl-PL", "pt-PT", "ro-RO", "sv-FI", "sv-SE", ] ] """ Preferred language of the Klarna authorization page that the customer is redirected to """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsKonbini(TypedDict): confirmation_number: NotRequired["Literal['']|str"] """ An optional 10 to 11 digit numeric-only string determining the confirmation code at applicable convenience stores. Must not consist of only zeroes and could be rejected in case of insufficient uniqueness. We recommend to use the customer's phone number. """ expires_after_days: NotRequired["Literal['']|int"] """ The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. Defaults to 3 days. """ expires_at: NotRequired["Literal['']|int"] """ The timestamp at which the Konbini payment instructions will expire. Only one of `expires_after_days` or `expires_at` may be set. """ product_description: NotRequired["Literal['']|str"] """ A product descriptor of up to 22 characters, which will appear to customers at the convenience store. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsLink(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ persistent_token: NotRequired[str] """ [Deprecated] This is a legacy parameter that no longer has any function. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsMobilepay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsMultibanco(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsOxxo(TypedDict): expires_after_days: NotRequired[int] """ The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsP24(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ tos_shown_and_accepted: NotRequired[bool] """ Confirm that the payer has accepted the P24 terms and conditions. """ class UpdateParamsPaymentMethodOptionsPaynow(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsPaypal(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds will be captured from the customer's account. """ preferred_locale: NotRequired[ Literal[ "cs-CZ", "da-DK", "de-AT", "de-DE", "de-LU", "el-GR", "en-GB", "en-US", "es-ES", "fi-FI", "fr-BE", "fr-FR", "fr-LU", "hu-HU", "it-IT", "nl-BE", "nl-NL", "pl-PL", "pt-PT", "sk-SK", "sv-SE", ] ] """ [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. """ reference: NotRequired[str] """ A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. """ risk_correlation_id: NotRequired[str] """ The risk correlation ID for an on-session payment using a saved PayPal payment method. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsPix(TypedDict): expires_after_seconds: NotRequired[int] """ The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. """ expires_at: NotRequired[int] """ The timestamp at which the Pix expires (between 10 and 1209600 seconds in the future). Defaults to 1 day in the future. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsPromptpay(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsRevolutPay(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds are captured from the customer's account. If provided, this parameter overrides the behavior of the top-level [capture_method](https://stripe.com/api/payment_intents/update#update_payment_intent-capture_method) for this payment method type when finalizing the payment with this payment method type. If `capture_method` is already set on the PaymentIntent, providing an empty value for this parameter unsets the stored value for this payment method type. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class UpdateParamsPaymentMethodOptionsSepaDebit(TypedDict): mandate_options: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodOptionsSepaDebitMandateOptions" ] """ Additional fields for Mandate creation """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): pass class UpdateParamsPaymentMethodOptionsSofort(TypedDict): preferred_language: NotRequired[ "Literal['']|Literal['de', 'en', 'es', 'fr', 'it', 'nl', 'pl']" ] """ Language shown to the payer on redirect. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsSwish(TypedDict): reference: NotRequired["Literal['']|str"] """ The order ID displayed in the Swish app after the payment is authorized. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsTwint(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsUsBankAccount(TypedDict): financial_connections: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnections" ] """ Additional fields for Financial Connections Session creation """ mandate_options: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodOptionsUsBankAccountMandateOptions" ] """ Additional fields for Mandate creation """ networks: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodOptionsUsBankAccountNetworks" ] """ Additional fields for network related functions """ preferred_settlement_speed: NotRequired[ "Literal['']|Literal['fastest', 'standard']" ] """ Preferred transaction settlement speed """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session', 'on_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. """ class UpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): filters: NotRequired[ "PaymentIntentService.UpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" ] """ Provide filters for the linked accounts that the customer can select for the payment method """ permissions: NotRequired[ List[ Literal[ "balances", "ownership", "payment_method", "transactions" ] ] ] """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ List[Literal["balances", "ownership", "transactions"]] ] """ List of data features that you would like to retrieve upon account creation. """ return_url: NotRequired[str] """ For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. """ class UpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( TypedDict, ): account_subcategories: NotRequired[ List[Literal["checking", "savings"]] ] """ The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. """ class UpdateParamsPaymentMethodOptionsUsBankAccountMandateOptions( TypedDict, ): collection_method: NotRequired["Literal['']|Literal['paper']"] """ The method used to collect offline mandate customer acceptance. """ class UpdateParamsPaymentMethodOptionsUsBankAccountNetworks(TypedDict): requested: NotRequired[List[Literal["ach", "us_domestic_wire"]]] """ Triggers validations to run across the selected networks """ class UpdateParamsPaymentMethodOptionsWechatPay(TypedDict): app_id: NotRequired[str] """ The app ID registered with WeChat Pay. Only required when client is ios or android. """ client: Literal["android", "ios", "web"] """ The client type that the end customer will pay from """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class UpdateParamsPaymentMethodOptionsZip(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class UpdateParamsShipping(TypedDict): address: "PaymentIntentService.UpdateParamsShippingAddress" """ Shipping address. """ carrier: NotRequired[str] """ The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. """ name: str """ Recipient name. """ phone: NotRequired[str] """ Recipient phone (including extension). """ tracking_number: NotRequired[str] """ The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ class UpdateParamsShippingAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class UpdateParamsTransferData(TypedDict): amount: NotRequired[int] """ The amount that will be transferred automatically when a charge succeeds. """ class VerifyMicrodepositsParams(TypedDict): amounts: NotRequired[List[int]] """ Two positive integers, in *cents*, equal to the values of the microdeposits sent to the bank account. """ descriptor_code: NotRequired[str] """ A six-character code starting with SM present in the microdeposit sent to the bank account. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def list( self, params: "PaymentIntentService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[PaymentIntent]: """ Returns a list of PaymentIntents. """ return cast( ListObject[PaymentIntent], self._request( "get", "/v1/payment_intents", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "PaymentIntentService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[PaymentIntent]: """ Returns a list of PaymentIntents. """ return cast( ListObject[PaymentIntent], await self._request_async( "get", "/v1/payment_intents", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "PaymentIntentService.CreateParams", options: RequestOptions = {}, ) -> PaymentIntent: """ Creates a PaymentIntent object. After the PaymentIntent is created, attach a payment method and [confirm](https://stripe.com/docs/api/payment_intents/confirm) to continue the payment. Learn more about the available payment flows with the Payment Intents API. When you use confirm=true during creation, it's equivalent to creating and confirming the PaymentIntent in the same call. You can use any parameters available in the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) when you supply confirm=true. """ return cast( PaymentIntent, self._request( "post", "/v1/payment_intents", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "PaymentIntentService.CreateParams", options: RequestOptions = {}, ) -> PaymentIntent: """ Creates a PaymentIntent object. After the PaymentIntent is created, attach a payment method and [confirm](https://stripe.com/docs/api/payment_intents/confirm) to continue the payment. Learn more about the available payment flows with the Payment Intents API. When you use confirm=true during creation, it's equivalent to creating and confirming the PaymentIntent in the same call. You can use any parameters available in the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) when you supply confirm=true. """ return cast( PaymentIntent, await self._request_async( "post", "/v1/payment_intents", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, intent: str, params: "PaymentIntentService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> PaymentIntent: """ Retrieves the details of a PaymentIntent that has previously been created. You can retrieve a PaymentIntent client-side using a publishable key when the client_secret is in the query string. If you retrieve a PaymentIntent with a publishable key, it only returns a subset of properties. Refer to the [payment intent](https://stripe.com/docs/api#payment_intent_object) object reference for more details. """ return cast( PaymentIntent, self._request( "get", "/v1/payment_intents/{intent}".format( intent=sanitize_id(intent), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, intent: str, params: "PaymentIntentService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> PaymentIntent: """ Retrieves the details of a PaymentIntent that has previously been created. You can retrieve a PaymentIntent client-side using a publishable key when the client_secret is in the query string. If you retrieve a PaymentIntent with a publishable key, it only returns a subset of properties. Refer to the [payment intent](https://stripe.com/docs/api#payment_intent_object) object reference for more details. """ return cast( PaymentIntent, await self._request_async( "get", "/v1/payment_intents/{intent}".format( intent=sanitize_id(intent), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, intent: str, params: "PaymentIntentService.UpdateParams" = {}, options: RequestOptions = {}, ) -> PaymentIntent: """ Updates properties on a PaymentIntent object without confirming. Depending on which properties you update, you might need to confirm the PaymentIntent again. For example, updating the payment_method always requires you to confirm the PaymentIntent again. If you prefer to update and confirm at the same time, we recommend updating properties through the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) instead. """ return cast( PaymentIntent, self._request( "post", "/v1/payment_intents/{intent}".format( intent=sanitize_id(intent), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, intent: str, params: "PaymentIntentService.UpdateParams" = {}, options: RequestOptions = {}, ) -> PaymentIntent: """ Updates properties on a PaymentIntent object without confirming. Depending on which properties you update, you might need to confirm the PaymentIntent again. For example, updating the payment_method always requires you to confirm the PaymentIntent again. If you prefer to update and confirm at the same time, we recommend updating properties through the [confirm API](https://stripe.com/docs/api/payment_intents/confirm) instead. """ return cast( PaymentIntent, await self._request_async( "post", "/v1/payment_intents/{intent}".format( intent=sanitize_id(intent), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def search( self, params: "PaymentIntentService.SearchParams", options: RequestOptions = {}, ) -> SearchResultObject[PaymentIntent]: """ Search for PaymentIntents you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India. """ return cast( SearchResultObject[PaymentIntent], self._request( "get", "/v1/payment_intents/search", api_mode="V1", base_address="api", params=params, options=options, ), ) async def search_async( self, params: "PaymentIntentService.SearchParams", options: RequestOptions = {}, ) -> SearchResultObject[PaymentIntent]: """ Search for PaymentIntents you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India. """ return cast( SearchResultObject[PaymentIntent], await self._request_async( "get", "/v1/payment_intents/search", api_mode="V1", base_address="api", params=params, options=options, ), ) def apply_customer_balance( self, intent: str, params: "PaymentIntentService.ApplyCustomerBalanceParams" = {}, options: RequestOptions = {}, ) -> PaymentIntent: """ Manually reconcile the remaining amount for a customer_balance PaymentIntent. """ return cast( PaymentIntent, self._request( "post", "/v1/payment_intents/{intent}/apply_customer_balance".format( intent=sanitize_id(intent), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def apply_customer_balance_async( self, intent: str, params: "PaymentIntentService.ApplyCustomerBalanceParams" = {}, options: RequestOptions = {}, ) -> PaymentIntent: """ Manually reconcile the remaining amount for a customer_balance PaymentIntent. """ return cast( PaymentIntent, await self._request_async( "post", "/v1/payment_intents/{intent}/apply_customer_balance".format( intent=sanitize_id(intent), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def cancel( self, intent: str, params: "PaymentIntentService.CancelParams" = {}, options: RequestOptions = {}, ) -> PaymentIntent: """ You can cancel a PaymentIntent object when it's in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_action or, [in rare cases](https://stripe.com/docs/payments/intents), processing. After it's canceled, no additional charges are made by the PaymentIntent and any operations on the PaymentIntent fail with an error. For PaymentIntents with a status of requires_capture, the remaining amount_capturable is automatically refunded. You can't cancel the PaymentIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. """ return cast( PaymentIntent, self._request( "post", "/v1/payment_intents/{intent}/cancel".format( intent=sanitize_id(intent), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def cancel_async( self, intent: str, params: "PaymentIntentService.CancelParams" = {}, options: RequestOptions = {}, ) -> PaymentIntent: """ You can cancel a PaymentIntent object when it's in one of these statuses: requires_payment_method, requires_capture, requires_confirmation, requires_action or, [in rare cases](https://stripe.com/docs/payments/intents), processing. After it's canceled, no additional charges are made by the PaymentIntent and any operations on the PaymentIntent fail with an error. For PaymentIntents with a status of requires_capture, the remaining amount_capturable is automatically refunded. You can't cancel the PaymentIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. """ return cast( PaymentIntent, await self._request_async( "post", "/v1/payment_intents/{intent}/cancel".format( intent=sanitize_id(intent), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def capture( self, intent: str, params: "PaymentIntentService.CaptureParams" = {}, options: RequestOptions = {}, ) -> PaymentIntent: """ Capture the funds of an existing uncaptured PaymentIntent when its status is requires_capture. Uncaptured PaymentIntents are cancelled a set number of days (7 by default) after their creation. Learn more about [separate authorization and capture](https://stripe.com/docs/payments/capture-later). """ return cast( PaymentIntent, self._request( "post", "/v1/payment_intents/{intent}/capture".format( intent=sanitize_id(intent), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def capture_async( self, intent: str, params: "PaymentIntentService.CaptureParams" = {}, options: RequestOptions = {}, ) -> PaymentIntent: """ Capture the funds of an existing uncaptured PaymentIntent when its status is requires_capture. Uncaptured PaymentIntents are cancelled a set number of days (7 by default) after their creation. Learn more about [separate authorization and capture](https://stripe.com/docs/payments/capture-later). """ return cast( PaymentIntent, await self._request_async( "post", "/v1/payment_intents/{intent}/capture".format( intent=sanitize_id(intent), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def confirm( self, intent: str, params: "PaymentIntentService.ConfirmParams" = {}, options: RequestOptions = {}, ) -> PaymentIntent: """ Confirm that your customer intends to pay with current or provided payment method. Upon confirmation, the PaymentIntent will attempt to initiate a payment. If the selected payment method requires additional authentication steps, the PaymentIntent will transition to the requires_action status and suggest additional actions via next_action. If payment fails, the PaymentIntent transitions to the requires_payment_method status or the canceled status if the confirmation limit is reached. If payment succeeds, the PaymentIntent will transition to the succeeded status (or requires_capture, if capture_method is set to manual). If the confirmation_method is automatic, payment may be attempted using our [client SDKs](https://stripe.com/docs/stripe-js/reference#stripe-handle-card-payment) and the PaymentIntent's [client_secret](https://stripe.com/docs/api#payment_intent_object-client_secret). After next_actions are handled by the client, no additional confirmation is required to complete the payment. If the confirmation_method is manual, all payment attempts must be initiated using a secret key. If any actions are required for the payment, the PaymentIntent will return to the requires_confirmation state after those actions are completed. Your server needs to then explicitly re-confirm the PaymentIntent to initiate the next payment attempt. """ return cast( PaymentIntent, self._request( "post", "/v1/payment_intents/{intent}/confirm".format( intent=sanitize_id(intent), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def confirm_async( self, intent: str, params: "PaymentIntentService.ConfirmParams" = {}, options: RequestOptions = {}, ) -> PaymentIntent: """ Confirm that your customer intends to pay with current or provided payment method. Upon confirmation, the PaymentIntent will attempt to initiate a payment. If the selected payment method requires additional authentication steps, the PaymentIntent will transition to the requires_action status and suggest additional actions via next_action. If payment fails, the PaymentIntent transitions to the requires_payment_method status or the canceled status if the confirmation limit is reached. If payment succeeds, the PaymentIntent will transition to the succeeded status (or requires_capture, if capture_method is set to manual). If the confirmation_method is automatic, payment may be attempted using our [client SDKs](https://stripe.com/docs/stripe-js/reference#stripe-handle-card-payment) and the PaymentIntent's [client_secret](https://stripe.com/docs/api#payment_intent_object-client_secret). After next_actions are handled by the client, no additional confirmation is required to complete the payment. If the confirmation_method is manual, all payment attempts must be initiated using a secret key. If any actions are required for the payment, the PaymentIntent will return to the requires_confirmation state after those actions are completed. Your server needs to then explicitly re-confirm the PaymentIntent to initiate the next payment attempt. """ return cast( PaymentIntent, await self._request_async( "post", "/v1/payment_intents/{intent}/confirm".format( intent=sanitize_id(intent), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def increment_authorization( self, intent: str, params: "PaymentIntentService.IncrementAuthorizationParams", options: RequestOptions = {}, ) -> PaymentIntent: """ Perform an incremental authorization on an eligible [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the PaymentIntent's status must be requires_capture and [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) must be true. Incremental authorizations attempt to increase the authorized amount on your customer's card to the new, higher amount provided. Similar to the initial authorization, incremental authorizations can be declined. A single PaymentIntent can call this endpoint multiple times to further increase the authorized amount. If the incremental authorization succeeds, the PaymentIntent object returns with the updated [amount](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount). If the incremental authorization fails, a [card_declined](https://stripe.com/docs/error-codes#card-declined) error returns, and no other fields on the PaymentIntent or Charge update. The PaymentIntent object remains capturable for the previously authorized amount. Each PaymentIntent can have a maximum of 10 incremental authorization attempts, including declines. After it's captured, a PaymentIntent can no longer be incremented. Learn more about [incremental authorizations](https://stripe.com/docs/terminal/features/incremental-authorizations). """ return cast( PaymentIntent, self._request( "post", "/v1/payment_intents/{intent}/increment_authorization".format( intent=sanitize_id(intent), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def increment_authorization_async( self, intent: str, params: "PaymentIntentService.IncrementAuthorizationParams", options: RequestOptions = {}, ) -> PaymentIntent: """ Perform an incremental authorization on an eligible [PaymentIntent](https://stripe.com/docs/api/payment_intents/object). To be eligible, the PaymentIntent's status must be requires_capture and [incremental_authorization_supported](https://stripe.com/docs/api/charges/object#charge_object-payment_method_details-card_present-incremental_authorization_supported) must be true. Incremental authorizations attempt to increase the authorized amount on your customer's card to the new, higher amount provided. Similar to the initial authorization, incremental authorizations can be declined. A single PaymentIntent can call this endpoint multiple times to further increase the authorized amount. If the incremental authorization succeeds, the PaymentIntent object returns with the updated [amount](https://stripe.com/docs/api/payment_intents/object#payment_intent_object-amount). If the incremental authorization fails, a [card_declined](https://stripe.com/docs/error-codes#card-declined) error returns, and no other fields on the PaymentIntent or Charge update. The PaymentIntent object remains capturable for the previously authorized amount. Each PaymentIntent can have a maximum of 10 incremental authorization attempts, including declines. After it's captured, a PaymentIntent can no longer be incremented. Learn more about [incremental authorizations](https://stripe.com/docs/terminal/features/incremental-authorizations). """ return cast( PaymentIntent, await self._request_async( "post", "/v1/payment_intents/{intent}/increment_authorization".format( intent=sanitize_id(intent), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def verify_microdeposits( self, intent: str, params: "PaymentIntentService.VerifyMicrodepositsParams" = {}, options: RequestOptions = {}, ) -> PaymentIntent: """ Verifies microdeposits on a PaymentIntent object. """ return cast( PaymentIntent, self._request( "post", "/v1/payment_intents/{intent}/verify_microdeposits".format( intent=sanitize_id(intent), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def verify_microdeposits_async( self, intent: str, params: "PaymentIntentService.VerifyMicrodepositsParams" = {}, options: RequestOptions = {}, ) -> PaymentIntent: """ Verifies microdeposits on a PaymentIntent object. """ return cast( PaymentIntent, await self._request_async( "post", "/v1/payment_intents/{intent}/verify_microdeposits".format( intent=sanitize_id(intent), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_payment_link.py0000644000175100001770000027762214637354563017255 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._account import Account from stripe._application import Application from stripe._line_item import LineItem from stripe._shipping_rate import ShippingRate from stripe._tax_id import TaxId class PaymentLink( CreateableAPIResource["PaymentLink"], ListableAPIResource["PaymentLink"], UpdateableAPIResource["PaymentLink"], ): """ A payment link is a shareable URL that will take your customers to a hosted payment page. A payment link can be shared and used multiple times. When a customer opens a payment link it will open a new [checkout session](https://stripe.com/docs/api/checkout/sessions) to render the payment page. You can use [checkout session events](https://stripe.com/docs/api/events/types#event_types-checkout.session.completed) to track payments through payment links. Related guide: [Payment Links API](https://stripe.com/docs/payment-links) """ OBJECT_NAME: ClassVar[Literal["payment_link"]] = "payment_link" class AfterCompletion(StripeObject): class HostedConfirmation(StripeObject): custom_message: Optional[str] """ The custom message that is displayed to the customer after the purchase is complete. """ class Redirect(StripeObject): url: str """ The URL the customer will be redirected to after the purchase is complete. """ hosted_confirmation: Optional[HostedConfirmation] redirect: Optional[Redirect] type: Literal["hosted_confirmation", "redirect"] """ The specified behavior after the purchase is complete. """ _inner_class_types = { "hosted_confirmation": HostedConfirmation, "redirect": Redirect, } class AutomaticTax(StripeObject): class Liability(StripeObject): account: Optional[ExpandableField["Account"]] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced. """ enabled: bool """ If `true`, tax will be calculated automatically using the customer's location. """ liability: Optional[Liability] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ _inner_class_types = {"liability": Liability} class ConsentCollection(StripeObject): class PaymentMethodReuseAgreement(StripeObject): position: Literal["auto", "hidden"] """ Determines the position and visibility of the payment method reuse agreement in the UI. When set to `auto`, Stripe's defaults will be used. When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI. """ payment_method_reuse_agreement: Optional[PaymentMethodReuseAgreement] """ Settings related to the payment method reuse text shown in the Checkout UI. """ promotions: Optional[Literal["auto", "none"]] """ If set to `auto`, enables the collection of customer consent for promotional communications. """ terms_of_service: Optional[Literal["none", "required"]] """ If set to `required`, it requires cutomers to accept the terms of service before being able to pay. If set to `none`, customers won't be shown a checkbox to accept the terms of service. """ _inner_class_types = { "payment_method_reuse_agreement": PaymentMethodReuseAgreement, } class CustomField(StripeObject): class Dropdown(StripeObject): class Option(StripeObject): label: str """ The label for the option, displayed to the customer. Up to 100 characters. """ value: str """ The value for this option, not displayed to the customer, used by your integration to reconcile the option selected by the customer. Must be unique to this option, alphanumeric, and up to 100 characters. """ options: List[Option] """ The options available for the customer to select. Up to 200 options allowed. """ _inner_class_types = {"options": Option} class Label(StripeObject): custom: Optional[str] """ Custom text for the label, displayed to the customer. Up to 50 characters. """ type: Literal["custom"] """ The type of the label. """ class Numeric(StripeObject): maximum_length: Optional[int] """ The maximum character length constraint for the customer's input. """ minimum_length: Optional[int] """ The minimum character length requirement for the customer's input. """ class Text(StripeObject): maximum_length: Optional[int] """ The maximum character length constraint for the customer's input. """ minimum_length: Optional[int] """ The minimum character length requirement for the customer's input. """ dropdown: Optional[Dropdown] key: str """ String of your choice that your integration can use to reconcile this field. Must be unique to this field, alphanumeric, and up to 200 characters. """ label: Label numeric: Optional[Numeric] optional: bool """ Whether the customer is required to complete the field before completing the Checkout Session. Defaults to `false`. """ text: Optional[Text] type: Literal["dropdown", "numeric", "text"] """ The type of the field. """ _inner_class_types = { "dropdown": Dropdown, "label": Label, "numeric": Numeric, "text": Text, } class CustomText(StripeObject): class AfterSubmit(StripeObject): message: str """ Text may be up to 1200 characters in length. """ class ShippingAddress(StripeObject): message: str """ Text may be up to 1200 characters in length. """ class Submit(StripeObject): message: str """ Text may be up to 1200 characters in length. """ class TermsOfServiceAcceptance(StripeObject): message: str """ Text may be up to 1200 characters in length. """ after_submit: Optional[AfterSubmit] """ Custom text that should be displayed after the payment confirmation button. """ shipping_address: Optional[ShippingAddress] """ Custom text that should be displayed alongside shipping address collection. """ submit: Optional[Submit] """ Custom text that should be displayed alongside the payment confirmation button. """ terms_of_service_acceptance: Optional[TermsOfServiceAcceptance] """ Custom text that should be displayed in place of the default terms of service agreement text. """ _inner_class_types = { "after_submit": AfterSubmit, "shipping_address": ShippingAddress, "submit": Submit, "terms_of_service_acceptance": TermsOfServiceAcceptance, } class InvoiceCreation(StripeObject): class InvoiceData(StripeObject): class CustomField(StripeObject): name: str """ The name of the custom field. """ value: str """ The value of the custom field. """ class Issuer(StripeObject): account: Optional[ExpandableField["Account"]] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced. """ class RenderingOptions(StripeObject): amount_tax_display: Optional[str] """ How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. """ account_tax_ids: Optional[List[ExpandableField["TaxId"]]] """ The account tax IDs associated with the invoice. """ custom_fields: Optional[List[CustomField]] """ A list of up to 4 custom fields to be displayed on the invoice. """ description: Optional[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ footer: Optional[str] """ Footer to be displayed on the invoice. """ issuer: Optional[Issuer] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ metadata: Optional[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ rendering_options: Optional[RenderingOptions] """ Options for invoice PDF rendering. """ _inner_class_types = { "custom_fields": CustomField, "issuer": Issuer, "rendering_options": RenderingOptions, } enabled: bool """ Enable creating an invoice on successful payment. """ invoice_data: Optional[InvoiceData] """ Configuration for the invoice. Default invoice values will be used if unspecified. """ _inner_class_types = {"invoice_data": InvoiceData} class PaymentIntentData(StripeObject): capture_method: Optional[ Literal["automatic", "automatic_async", "manual"] ] """ Indicates when the funds will be captured from the customer's account. """ description: Optional[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ metadata: Dict[str, str] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on [Payment Intents](https://stripe.com/docs/api/payment_intents) generated from this payment link. """ setup_future_usage: Optional[Literal["off_session", "on_session"]] """ Indicates that you intend to make future payments with the payment method collected during checkout. """ statement_descriptor: Optional[str] """ Extra information about the payment. This will appear on your customer's statement when this payment succeeds in creating a charge. """ statement_descriptor_suffix: Optional[str] """ Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. """ transfer_group: Optional[str] """ A string that identifies the resulting payment as part of a group. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. """ class PhoneNumberCollection(StripeObject): enabled: bool """ If `true`, a phone number will be collected during checkout. """ class Restrictions(StripeObject): class CompletedSessions(StripeObject): count: int """ The current number of checkout sessions that have been completed on the payment link which count towards the `completed_sessions` restriction to be met. """ limit: int """ The maximum number of checkout sessions that can be completed for the `completed_sessions` restriction to be met. """ completed_sessions: CompletedSessions _inner_class_types = {"completed_sessions": CompletedSessions} class ShippingAddressCollection(StripeObject): allowed_countries: List[ Literal[ "AC", "AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CV", "CW", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MK", "ML", "MM", "MN", "MO", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SZ", "TA", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VN", "VU", "WF", "WS", "XK", "YE", "YT", "ZA", "ZM", "ZW", "ZZ", ] ] """ An array of two-letter ISO country codes representing which countries Checkout should provide as options for shipping locations. Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. """ class ShippingOption(StripeObject): shipping_amount: int """ A non-negative integer in cents representing how much to charge. """ shipping_rate: ExpandableField["ShippingRate"] """ The ID of the Shipping Rate to use for this shipping option. """ class SubscriptionData(StripeObject): class InvoiceSettings(StripeObject): class Issuer(StripeObject): account: Optional[ExpandableField["Account"]] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced. """ issuer: Issuer _inner_class_types = {"issuer": Issuer} class TrialSettings(StripeObject): class EndBehavior(StripeObject): missing_payment_method: Literal[ "cancel", "create_invoice", "pause" ] """ Indicates how the subscription should change when the trial ends if the user did not provide a payment method. """ end_behavior: EndBehavior """ Defines how a subscription behaves when a free trial ends. """ _inner_class_types = {"end_behavior": EndBehavior} description: Optional[str] """ The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ invoice_settings: InvoiceSettings metadata: Dict[str, str] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on [Subscriptions](https://stripe.com/docs/api/subscriptions) generated from this payment link. """ trial_period_days: Optional[int] """ Integer representing the number of trial period days before the customer is charged for the first time. """ trial_settings: Optional[TrialSettings] """ Settings related to subscription trials. """ _inner_class_types = { "invoice_settings": InvoiceSettings, "trial_settings": TrialSettings, } class TaxIdCollection(StripeObject): enabled: bool """ Indicates whether tax ID collection is enabled for the session. """ class TransferData(StripeObject): amount: Optional[int] """ The amount in cents (or local equivalent) that will be transferred to the destination account. By default, the entire amount is transferred to the destination. """ destination: ExpandableField["Account"] """ The connected account receiving the transfer. """ class CreateParams(RequestOptions): after_completion: NotRequired[ "PaymentLink.CreateParamsAfterCompletion" ] """ Behavior after the purchase is complete. """ allow_promotion_codes: NotRequired[bool] """ Enables user redeemable promotion codes. """ application_fee_amount: NotRequired[int] """ The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. Can only be applied when there are no line items with recurring prices. """ application_fee_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. There must be at least 1 line item with a recurring price to use this field. """ automatic_tax: NotRequired["PaymentLink.CreateParamsAutomaticTax"] """ Configuration for automatic tax collection. """ billing_address_collection: NotRequired[Literal["auto", "required"]] """ Configuration for collecting the customer's billing address. Defaults to `auto`. """ consent_collection: NotRequired[ "PaymentLink.CreateParamsConsentCollection" ] """ Configure fields to gather active consent from customers. """ currency: NotRequired[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) and supported by each line item's price. """ custom_fields: NotRequired[List["PaymentLink.CreateParamsCustomField"]] """ Collect additional information from your customer using custom fields. Up to 3 fields are supported. """ custom_text: NotRequired["PaymentLink.CreateParamsCustomText"] """ Display additional text for your customers using custom text. """ customer_creation: NotRequired[Literal["always", "if_required"]] """ Configures whether [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link create a [Customer](https://stripe.com/docs/api/customers). """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ inactive_message: NotRequired[str] """ The custom message to be displayed to a customer when a payment link is no longer active. """ invoice_creation: NotRequired[ "PaymentLink.CreateParamsInvoiceCreation" ] """ Generate a post-purchase Invoice for one-time payments. """ line_items: List["PaymentLink.CreateParamsLineItem"] """ The line items representing what is being sold. Each line item represents an item being sold. Up to 20 line items are supported. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. Metadata associated with this Payment Link will automatically be copied to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link. """ on_behalf_of: NotRequired[str] """ The account on behalf of which to charge. """ payment_intent_data: NotRequired[ "PaymentLink.CreateParamsPaymentIntentData" ] """ A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode. """ payment_method_collection: NotRequired[ Literal["always", "if_required"] ] """ Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount. Can only be set in `subscription` mode. Defaults to `always`. If you'd like information on how to collect a payment method outside of Checkout, read the guide on [configuring subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials). """ payment_method_types: NotRequired[ List[ Literal[ "affirm", "afterpay_clearpay", "alipay", "au_becs_debit", "bacs_debit", "bancontact", "blik", "boleto", "card", "cashapp", "eps", "fpx", "giropay", "grabpay", "ideal", "klarna", "konbini", "link", "mobilepay", "multibanco", "oxxo", "p24", "paynow", "paypal", "pix", "promptpay", "sepa_debit", "sofort", "swish", "twint", "us_bank_account", "wechat_pay", "zip", ] ] ] """ The list of payment method types that customers can use. If no value is passed, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods) (20+ payment methods [supported](https://stripe.com/docs/payments/payment-methods/integration-options#payment-method-product-support)). """ phone_number_collection: NotRequired[ "PaymentLink.CreateParamsPhoneNumberCollection" ] """ Controls phone number collection settings during checkout. We recommend that you review your privacy policy and check with your legal contacts. """ restrictions: NotRequired["PaymentLink.CreateParamsRestrictions"] """ Settings that restrict the usage of a payment link. """ shipping_address_collection: NotRequired[ "PaymentLink.CreateParamsShippingAddressCollection" ] """ Configuration for collecting the customer's shipping address. """ shipping_options: NotRequired[ List["PaymentLink.CreateParamsShippingOption"] ] """ The shipping rate options to apply to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link. """ submit_type: NotRequired[Literal["auto", "book", "donate", "pay"]] """ Describes the type of transaction being performed in order to customize relevant text on the page, such as the submit button. Changing this value will also affect the hostname in the [url](https://stripe.com/docs/api/payment_links/payment_links/object#url) property (example: `donate.stripe.com`). """ subscription_data: NotRequired[ "PaymentLink.CreateParamsSubscriptionData" ] """ When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use `subscription_data`. """ tax_id_collection: NotRequired[ "PaymentLink.CreateParamsTaxIdCollection" ] """ Controls tax ID collection during checkout. """ transfer_data: NotRequired["PaymentLink.CreateParamsTransferData"] """ The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to. """ class CreateParamsAfterCompletion(TypedDict): hosted_confirmation: NotRequired[ "PaymentLink.CreateParamsAfterCompletionHostedConfirmation" ] """ Configuration when `type=hosted_confirmation`. """ redirect: NotRequired[ "PaymentLink.CreateParamsAfterCompletionRedirect" ] """ Configuration when `type=redirect`. """ type: Literal["hosted_confirmation", "redirect"] """ The specified behavior after the purchase is complete. Either `redirect` or `hosted_confirmation`. """ class CreateParamsAfterCompletionHostedConfirmation(TypedDict): custom_message: NotRequired[str] """ A custom message to display to the customer after the purchase is complete. """ class CreateParamsAfterCompletionRedirect(TypedDict): url: str """ The URL the customer will be redirected to after the purchase is complete. You can embed `{CHECKOUT_SESSION_ID}` into the URL to have the `id` of the completed [checkout session](https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-id) included. """ class CreateParamsAutomaticTax(TypedDict): enabled: bool """ If `true`, tax will be calculated automatically using the customer's location. """ liability: NotRequired["PaymentLink.CreateParamsAutomaticTaxLiability"] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ class CreateParamsAutomaticTaxLiability(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class CreateParamsConsentCollection(TypedDict): payment_method_reuse_agreement: NotRequired[ "PaymentLink.CreateParamsConsentCollectionPaymentMethodReuseAgreement" ] """ Determines the display of payment method reuse agreement text in the UI. If set to `hidden`, it will hide legal text related to the reuse of a payment method. """ promotions: NotRequired[Literal["auto", "none"]] """ If set to `auto`, enables the collection of customer consent for promotional communications. The Checkout Session will determine whether to display an option to opt into promotional communication from the merchant depending on the customer's locale. Only available to US merchants. """ terms_of_service: NotRequired[Literal["none", "required"]] """ If set to `required`, it requires customers to check a terms of service checkbox before being able to pay. There must be a valid terms of service URL set in your [Dashboard settings](https://dashboard.stripe.com/settings/public). """ class CreateParamsConsentCollectionPaymentMethodReuseAgreement(TypedDict): position: Literal["auto", "hidden"] """ Determines the position and visibility of the payment method reuse agreement in the UI. When set to `auto`, Stripe's defaults will be used. When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI. """ class CreateParamsCustomField(TypedDict): dropdown: NotRequired["PaymentLink.CreateParamsCustomFieldDropdown"] """ Configuration for `type=dropdown` fields. """ key: str """ String of your choice that your integration can use to reconcile this field. Must be unique to this field, alphanumeric, and up to 200 characters. """ label: "PaymentLink.CreateParamsCustomFieldLabel" """ The label for the field, displayed to the customer. """ numeric: NotRequired["PaymentLink.CreateParamsCustomFieldNumeric"] """ Configuration for `type=numeric` fields. """ optional: NotRequired[bool] """ Whether the customer is required to complete the field before completing the Checkout Session. Defaults to `false`. """ text: NotRequired["PaymentLink.CreateParamsCustomFieldText"] """ Configuration for `type=text` fields. """ type: Literal["dropdown", "numeric", "text"] """ The type of the field. """ class CreateParamsCustomFieldDropdown(TypedDict): options: List["PaymentLink.CreateParamsCustomFieldDropdownOption"] """ The options available for the customer to select. Up to 200 options allowed. """ class CreateParamsCustomFieldDropdownOption(TypedDict): label: str """ The label for the option, displayed to the customer. Up to 100 characters. """ value: str """ The value for this option, not displayed to the customer, used by your integration to reconcile the option selected by the customer. Must be unique to this option, alphanumeric, and up to 100 characters. """ class CreateParamsCustomFieldLabel(TypedDict): custom: str """ Custom text for the label, displayed to the customer. Up to 50 characters. """ type: Literal["custom"] """ The type of the label. """ class CreateParamsCustomFieldNumeric(TypedDict): maximum_length: NotRequired[int] """ The maximum character length constraint for the customer's input. """ minimum_length: NotRequired[int] """ The minimum character length requirement for the customer's input. """ class CreateParamsCustomFieldText(TypedDict): maximum_length: NotRequired[int] """ The maximum character length constraint for the customer's input. """ minimum_length: NotRequired[int] """ The minimum character length requirement for the customer's input. """ class CreateParamsCustomText(TypedDict): after_submit: NotRequired[ "Literal['']|PaymentLink.CreateParamsCustomTextAfterSubmit" ] """ Custom text that should be displayed after the payment confirmation button. """ shipping_address: NotRequired[ "Literal['']|PaymentLink.CreateParamsCustomTextShippingAddress" ] """ Custom text that should be displayed alongside shipping address collection. """ submit: NotRequired[ "Literal['']|PaymentLink.CreateParamsCustomTextSubmit" ] """ Custom text that should be displayed alongside the payment confirmation button. """ terms_of_service_acceptance: NotRequired[ "Literal['']|PaymentLink.CreateParamsCustomTextTermsOfServiceAcceptance" ] """ Custom text that should be displayed in place of the default terms of service agreement text. """ class CreateParamsCustomTextAfterSubmit(TypedDict): message: str """ Text may be up to 1200 characters in length. """ class CreateParamsCustomTextShippingAddress(TypedDict): message: str """ Text may be up to 1200 characters in length. """ class CreateParamsCustomTextSubmit(TypedDict): message: str """ Text may be up to 1200 characters in length. """ class CreateParamsCustomTextTermsOfServiceAcceptance(TypedDict): message: str """ Text may be up to 1200 characters in length. """ class CreateParamsInvoiceCreation(TypedDict): enabled: bool """ Whether the feature is enabled """ invoice_data: NotRequired[ "PaymentLink.CreateParamsInvoiceCreationInvoiceData" ] """ Invoice PDF configuration. """ class CreateParamsInvoiceCreationInvoiceData(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ The account tax IDs associated with the invoice. """ custom_fields: NotRequired[ "Literal['']|List[PaymentLink.CreateParamsInvoiceCreationInvoiceDataCustomField]" ] """ Default custom fields to be displayed on invoices for this customer. """ description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ footer: NotRequired[str] """ Default footer to be displayed on invoices for this customer. """ issuer: NotRequired[ "PaymentLink.CreateParamsInvoiceCreationInvoiceDataIssuer" ] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ rendering_options: NotRequired[ "Literal['']|PaymentLink.CreateParamsInvoiceCreationInvoiceDataRenderingOptions" ] """ Default options for invoice PDF rendering for this customer. """ class CreateParamsInvoiceCreationInvoiceDataCustomField(TypedDict): name: str """ The name of the custom field. This may be up to 40 characters. """ value: str """ The value of the custom field. This may be up to 140 characters. """ class CreateParamsInvoiceCreationInvoiceDataIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class CreateParamsInvoiceCreationInvoiceDataRenderingOptions(TypedDict): amount_tax_display: NotRequired[ "Literal['']|Literal['exclude_tax', 'include_inclusive_tax']" ] """ How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. """ class CreateParamsLineItem(TypedDict): adjustable_quantity: NotRequired[ "PaymentLink.CreateParamsLineItemAdjustableQuantity" ] """ When set, provides configuration for this item's quantity to be adjusted by the customer during checkout. """ price: str """ The ID of the [Price](https://stripe.com/docs/api/prices) or [Plan](https://stripe.com/docs/api/plans) object. """ quantity: int """ The quantity of the line item being purchased. """ class CreateParamsLineItemAdjustableQuantity(TypedDict): enabled: bool """ Set to true if the quantity can be adjusted to any non-negative Integer. """ maximum: NotRequired[int] """ The maximum quantity the customer can purchase. By default this value is 99. You can specify a value up to 999. """ minimum: NotRequired[int] """ The minimum quantity the customer can purchase. By default this value is 0. If there is only one item in the cart then that item's quantity cannot go down to 0. """ class CreateParamsPaymentIntentData(TypedDict): capture_method: NotRequired[ Literal["automatic", "automatic_async", "manual"] ] """ Controls when the funds will be captured from the customer's account. """ description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on [Payment Intents](https://stripe.com/docs/api/payment_intents) generated from this payment link. Unlike object-level metadata, this field is declarative. Updates will clear prior values. """ setup_future_usage: NotRequired[Literal["off_session", "on_session"]] """ Indicates that you intend to [make future payments](https://stripe.com/docs/payments/payment-intents#future-usage) with the payment method collected by this Checkout Session. When setting this to `on_session`, Checkout will show a notice to the customer that their payment details will be saved. When setting this to `off_session`, Checkout will show a notice to the customer that their payment details will be saved and used for future payments. If a Customer has been provided or Checkout creates a new Customer,Checkout will attach the payment method to the Customer. If Checkout does not create a Customer, the payment method is not attached to a Customer. To reuse the payment method, you can retrieve it from the Checkout Session's PaymentIntent. When processing card payments, Checkout also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as SCA. """ statement_descriptor: NotRequired[str] """ Extra information about the payment. This will appear on your customer's statement when this payment succeeds in creating a charge. """ statement_descriptor_suffix: NotRequired[str] """ Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. """ transfer_group: NotRequired[str] """ A string that identifies the resulting payment as part of a group. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. """ class CreateParamsPhoneNumberCollection(TypedDict): enabled: bool """ Set to `true` to enable phone number collection. """ class CreateParamsRestrictions(TypedDict): completed_sessions: ( "PaymentLink.CreateParamsRestrictionsCompletedSessions" ) """ Configuration for the `completed_sessions` restriction type. """ class CreateParamsRestrictionsCompletedSessions(TypedDict): limit: int """ The maximum number of checkout sessions that can be completed for the `completed_sessions` restriction to be met. """ class CreateParamsShippingAddressCollection(TypedDict): allowed_countries: List[ Literal[ "AC", "AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CV", "CW", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MK", "ML", "MM", "MN", "MO", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SZ", "TA", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VN", "VU", "WF", "WS", "XK", "YE", "YT", "ZA", "ZM", "ZW", "ZZ", ] ] """ An array of two-letter ISO country codes representing which countries Checkout should provide as options for shipping locations. Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. """ class CreateParamsShippingOption(TypedDict): shipping_rate: NotRequired[str] """ The ID of the Shipping Rate to use for this shipping option. """ class CreateParamsSubscriptionData(TypedDict): description: NotRequired[str] """ The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ invoice_settings: NotRequired[ "PaymentLink.CreateParamsSubscriptionDataInvoiceSettings" ] """ All invoices will be billed using the specified settings. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on [Subscriptions](https://stripe.com/docs/api/subscriptions) generated from this payment link. Unlike object-level metadata, this field is declarative. Updates will clear prior values. """ trial_period_days: NotRequired[int] """ Integer representing the number of trial period days before the customer is charged for the first time. Has to be at least 1. """ trial_settings: NotRequired[ "PaymentLink.CreateParamsSubscriptionDataTrialSettings" ] """ Settings related to subscription trials. """ class CreateParamsSubscriptionDataInvoiceSettings(TypedDict): issuer: NotRequired[ "PaymentLink.CreateParamsSubscriptionDataInvoiceSettingsIssuer" ] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ class CreateParamsSubscriptionDataInvoiceSettingsIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class CreateParamsSubscriptionDataTrialSettings(TypedDict): end_behavior: ( "PaymentLink.CreateParamsSubscriptionDataTrialSettingsEndBehavior" ) """ Defines how the subscription should behave when the user's free trial ends. """ class CreateParamsSubscriptionDataTrialSettingsEndBehavior(TypedDict): missing_payment_method: Literal["cancel", "create_invoice", "pause"] """ Indicates how the subscription should change when the trial ends if the user did not provide a payment method. """ class CreateParamsTaxIdCollection(TypedDict): enabled: bool """ Enable tax ID collection during checkout. Defaults to `false`. """ class CreateParamsTransferData(TypedDict): amount: NotRequired[int] """ The amount that will be transferred automatically when a charge succeeds. """ destination: str """ If specified, successful charges will be attributed to the destination account for tax reporting, and the funds from charges will be transferred to the destination account. The ID of the resulting transfer will be returned on the successful charge's `transfer` field. """ class ListLineItemsParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParams(RequestOptions): active: NotRequired[bool] """ Only return payment links that are active or inactive (e.g., pass `false` to list all inactive payment links). """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ModifyParams(RequestOptions): active: NotRequired[bool] """ Whether the payment link's `url` is active. If `false`, customers visiting the URL will be shown a page saying that the link has been deactivated. """ after_completion: NotRequired[ "PaymentLink.ModifyParamsAfterCompletion" ] """ Behavior after the purchase is complete. """ allow_promotion_codes: NotRequired[bool] """ Enables user redeemable promotion codes. """ automatic_tax: NotRequired["PaymentLink.ModifyParamsAutomaticTax"] """ Configuration for automatic tax collection. """ billing_address_collection: NotRequired[Literal["auto", "required"]] """ Configuration for collecting the customer's billing address. Defaults to `auto`. """ custom_fields: NotRequired[ "Literal['']|List[PaymentLink.ModifyParamsCustomField]" ] """ Collect additional information from your customer using custom fields. Up to 3 fields are supported. """ custom_text: NotRequired["PaymentLink.ModifyParamsCustomText"] """ Display additional text for your customers using custom text. """ customer_creation: NotRequired[Literal["always", "if_required"]] """ Configures whether [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link create a [Customer](https://stripe.com/docs/api/customers). """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ inactive_message: NotRequired["Literal['']|str"] """ The custom message to be displayed to a customer when a payment link is no longer active. """ invoice_creation: NotRequired[ "PaymentLink.ModifyParamsInvoiceCreation" ] """ Generate a post-purchase Invoice for one-time payments. """ line_items: NotRequired[List["PaymentLink.ModifyParamsLineItem"]] """ The line items representing what is being sold. Each line item represents an item being sold. Up to 20 line items are supported. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. Metadata associated with this Payment Link will automatically be copied to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link. """ payment_intent_data: NotRequired[ "PaymentLink.ModifyParamsPaymentIntentData" ] """ A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode. """ payment_method_collection: NotRequired[ Literal["always", "if_required"] ] """ Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount. Can only be set in `subscription` mode. Defaults to `always`. If you'd like information on how to collect a payment method outside of Checkout, read the guide on [configuring subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials). """ payment_method_types: NotRequired[ "Literal['']|List[Literal['affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mobilepay', 'multibanco', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'sepa_debit', 'sofort', 'swish', 'twint', 'us_bank_account', 'wechat_pay', 'zip']]" ] """ The list of payment method types that customers can use. Pass an empty string to enable dynamic payment methods that use your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). """ restrictions: NotRequired[ "Literal['']|PaymentLink.ModifyParamsRestrictions" ] """ Settings that restrict the usage of a payment link. """ shipping_address_collection: NotRequired[ "Literal['']|PaymentLink.ModifyParamsShippingAddressCollection" ] """ Configuration for collecting the customer's shipping address. """ subscription_data: NotRequired[ "PaymentLink.ModifyParamsSubscriptionData" ] """ When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use `subscription_data`. """ tax_id_collection: NotRequired[ "PaymentLink.ModifyParamsTaxIdCollection" ] """ Controls tax ID collection during checkout. """ class ModifyParamsAfterCompletion(TypedDict): hosted_confirmation: NotRequired[ "PaymentLink.ModifyParamsAfterCompletionHostedConfirmation" ] """ Configuration when `type=hosted_confirmation`. """ redirect: NotRequired[ "PaymentLink.ModifyParamsAfterCompletionRedirect" ] """ Configuration when `type=redirect`. """ type: Literal["hosted_confirmation", "redirect"] """ The specified behavior after the purchase is complete. Either `redirect` or `hosted_confirmation`. """ class ModifyParamsAfterCompletionHostedConfirmation(TypedDict): custom_message: NotRequired[str] """ A custom message to display to the customer after the purchase is complete. """ class ModifyParamsAfterCompletionRedirect(TypedDict): url: str """ The URL the customer will be redirected to after the purchase is complete. You can embed `{CHECKOUT_SESSION_ID}` into the URL to have the `id` of the completed [checkout session](https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-id) included. """ class ModifyParamsAutomaticTax(TypedDict): enabled: bool """ If `true`, tax will be calculated automatically using the customer's location. """ liability: NotRequired["PaymentLink.ModifyParamsAutomaticTaxLiability"] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ class ModifyParamsAutomaticTaxLiability(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class ModifyParamsCustomField(TypedDict): dropdown: NotRequired["PaymentLink.ModifyParamsCustomFieldDropdown"] """ Configuration for `type=dropdown` fields. """ key: str """ String of your choice that your integration can use to reconcile this field. Must be unique to this field, alphanumeric, and up to 200 characters. """ label: "PaymentLink.ModifyParamsCustomFieldLabel" """ The label for the field, displayed to the customer. """ numeric: NotRequired["PaymentLink.ModifyParamsCustomFieldNumeric"] """ Configuration for `type=numeric` fields. """ optional: NotRequired[bool] """ Whether the customer is required to complete the field before completing the Checkout Session. Defaults to `false`. """ text: NotRequired["PaymentLink.ModifyParamsCustomFieldText"] """ Configuration for `type=text` fields. """ type: Literal["dropdown", "numeric", "text"] """ The type of the field. """ class ModifyParamsCustomFieldDropdown(TypedDict): options: List["PaymentLink.ModifyParamsCustomFieldDropdownOption"] """ The options available for the customer to select. Up to 200 options allowed. """ class ModifyParamsCustomFieldDropdownOption(TypedDict): label: str """ The label for the option, displayed to the customer. Up to 100 characters. """ value: str """ The value for this option, not displayed to the customer, used by your integration to reconcile the option selected by the customer. Must be unique to this option, alphanumeric, and up to 100 characters. """ class ModifyParamsCustomFieldLabel(TypedDict): custom: str """ Custom text for the label, displayed to the customer. Up to 50 characters. """ type: Literal["custom"] """ The type of the label. """ class ModifyParamsCustomFieldNumeric(TypedDict): maximum_length: NotRequired[int] """ The maximum character length constraint for the customer's input. """ minimum_length: NotRequired[int] """ The minimum character length requirement for the customer's input. """ class ModifyParamsCustomFieldText(TypedDict): maximum_length: NotRequired[int] """ The maximum character length constraint for the customer's input. """ minimum_length: NotRequired[int] """ The minimum character length requirement for the customer's input. """ class ModifyParamsCustomText(TypedDict): after_submit: NotRequired[ "Literal['']|PaymentLink.ModifyParamsCustomTextAfterSubmit" ] """ Custom text that should be displayed after the payment confirmation button. """ shipping_address: NotRequired[ "Literal['']|PaymentLink.ModifyParamsCustomTextShippingAddress" ] """ Custom text that should be displayed alongside shipping address collection. """ submit: NotRequired[ "Literal['']|PaymentLink.ModifyParamsCustomTextSubmit" ] """ Custom text that should be displayed alongside the payment confirmation button. """ terms_of_service_acceptance: NotRequired[ "Literal['']|PaymentLink.ModifyParamsCustomTextTermsOfServiceAcceptance" ] """ Custom text that should be displayed in place of the default terms of service agreement text. """ class ModifyParamsCustomTextAfterSubmit(TypedDict): message: str """ Text may be up to 1200 characters in length. """ class ModifyParamsCustomTextShippingAddress(TypedDict): message: str """ Text may be up to 1200 characters in length. """ class ModifyParamsCustomTextSubmit(TypedDict): message: str """ Text may be up to 1200 characters in length. """ class ModifyParamsCustomTextTermsOfServiceAcceptance(TypedDict): message: str """ Text may be up to 1200 characters in length. """ class ModifyParamsInvoiceCreation(TypedDict): enabled: bool """ Whether the feature is enabled """ invoice_data: NotRequired[ "PaymentLink.ModifyParamsInvoiceCreationInvoiceData" ] """ Invoice PDF configuration. """ class ModifyParamsInvoiceCreationInvoiceData(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ The account tax IDs associated with the invoice. """ custom_fields: NotRequired[ "Literal['']|List[PaymentLink.ModifyParamsInvoiceCreationInvoiceDataCustomField]" ] """ Default custom fields to be displayed on invoices for this customer. """ description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ footer: NotRequired[str] """ Default footer to be displayed on invoices for this customer. """ issuer: NotRequired[ "PaymentLink.ModifyParamsInvoiceCreationInvoiceDataIssuer" ] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ rendering_options: NotRequired[ "Literal['']|PaymentLink.ModifyParamsInvoiceCreationInvoiceDataRenderingOptions" ] """ Default options for invoice PDF rendering for this customer. """ class ModifyParamsInvoiceCreationInvoiceDataCustomField(TypedDict): name: str """ The name of the custom field. This may be up to 40 characters. """ value: str """ The value of the custom field. This may be up to 140 characters. """ class ModifyParamsInvoiceCreationInvoiceDataIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class ModifyParamsInvoiceCreationInvoiceDataRenderingOptions(TypedDict): amount_tax_display: NotRequired[ "Literal['']|Literal['exclude_tax', 'include_inclusive_tax']" ] """ How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. """ class ModifyParamsLineItem(TypedDict): adjustable_quantity: NotRequired[ "PaymentLink.ModifyParamsLineItemAdjustableQuantity" ] """ When set, provides configuration for this item's quantity to be adjusted by the customer during checkout. """ id: str """ The ID of an existing line item on the payment link. """ quantity: NotRequired[int] """ The quantity of the line item being purchased. """ class ModifyParamsLineItemAdjustableQuantity(TypedDict): enabled: bool """ Set to true if the quantity can be adjusted to any non-negative Integer. """ maximum: NotRequired[int] """ The maximum quantity the customer can purchase. By default this value is 99. You can specify a value up to 999. """ minimum: NotRequired[int] """ The minimum quantity the customer can purchase. By default this value is 0. If there is only one item in the cart then that item's quantity cannot go down to 0. """ class ModifyParamsPaymentIntentData(TypedDict): description: NotRequired["Literal['']|str"] """ An arbitrary string attached to the object. Often useful for displaying to users. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on [Payment Intents](https://stripe.com/docs/api/payment_intents) generated from this payment link. Unlike object-level metadata, this field is declarative. Updates will clear prior values. """ statement_descriptor: NotRequired["Literal['']|str"] """ Extra information about the payment. This will appear on your customer's statement when this payment succeeds in creating a charge. """ statement_descriptor_suffix: NotRequired["Literal['']|str"] """ Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. """ transfer_group: NotRequired["Literal['']|str"] """ A string that identifies the resulting payment as part of a group. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. """ class ModifyParamsRestrictions(TypedDict): completed_sessions: ( "PaymentLink.ModifyParamsRestrictionsCompletedSessions" ) """ Configuration for the `completed_sessions` restriction type. """ class ModifyParamsRestrictionsCompletedSessions(TypedDict): limit: int """ The maximum number of checkout sessions that can be completed for the `completed_sessions` restriction to be met. """ class ModifyParamsShippingAddressCollection(TypedDict): allowed_countries: List[ Literal[ "AC", "AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CV", "CW", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MK", "ML", "MM", "MN", "MO", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SZ", "TA", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VN", "VU", "WF", "WS", "XK", "YE", "YT", "ZA", "ZM", "ZW", "ZZ", ] ] """ An array of two-letter ISO country codes representing which countries Checkout should provide as options for shipping locations. Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. """ class ModifyParamsSubscriptionData(TypedDict): invoice_settings: NotRequired[ "PaymentLink.ModifyParamsSubscriptionDataInvoiceSettings" ] """ All invoices will be billed using the specified settings. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on [Subscriptions](https://stripe.com/docs/api/subscriptions) generated from this payment link. Unlike object-level metadata, this field is declarative. Updates will clear prior values. """ trial_settings: NotRequired[ "Literal['']|PaymentLink.ModifyParamsSubscriptionDataTrialSettings" ] """ Settings related to subscription trials. """ class ModifyParamsSubscriptionDataInvoiceSettings(TypedDict): issuer: NotRequired[ "PaymentLink.ModifyParamsSubscriptionDataInvoiceSettingsIssuer" ] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ class ModifyParamsSubscriptionDataInvoiceSettingsIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class ModifyParamsSubscriptionDataTrialSettings(TypedDict): end_behavior: ( "PaymentLink.ModifyParamsSubscriptionDataTrialSettingsEndBehavior" ) """ Defines how the subscription should behave when the user's free trial ends. """ class ModifyParamsSubscriptionDataTrialSettingsEndBehavior(TypedDict): missing_payment_method: Literal["cancel", "create_invoice", "pause"] """ Indicates how the subscription should change when the trial ends if the user did not provide a payment method. """ class ModifyParamsTaxIdCollection(TypedDict): enabled: bool """ Enable tax ID collection during checkout. Defaults to `false`. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ active: bool """ Whether the payment link's `url` is active. If `false`, customers visiting the URL will be shown a page saying that the link has been deactivated. """ after_completion: AfterCompletion allow_promotion_codes: bool """ Whether user redeemable promotion codes are enabled. """ application: Optional[ExpandableField["Application"]] """ The ID of the Connect application that created the Payment Link. """ application_fee_amount: Optional[int] """ The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. """ application_fee_percent: Optional[float] """ This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. """ automatic_tax: AutomaticTax billing_address_collection: Literal["auto", "required"] """ Configuration for collecting the customer's billing address. Defaults to `auto`. """ consent_collection: Optional[ConsentCollection] """ When set, provides configuration to gather active consent from customers. """ 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). """ custom_fields: List[CustomField] """ Collect additional information from your customer using custom fields. Up to 3 fields are supported. """ custom_text: CustomText customer_creation: Literal["always", "if_required"] """ Configuration for Customer creation during checkout. """ id: str """ Unique identifier for the object. """ inactive_message: Optional[str] """ The custom message to be displayed to a customer when a payment link is no longer active. """ invoice_creation: Optional[InvoiceCreation] """ Configuration for creating invoice for payment mode payment links. """ line_items: Optional[ListObject["LineItem"]] """ The line items representing what is being sold. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ metadata: Dict[str, str] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ object: Literal["payment_link"] """ String representing the object's type. Objects of the same type share the same value. """ on_behalf_of: Optional[ExpandableField["Account"]] """ The account on behalf of which to charge. See the [Connect documentation](https://support.stripe.com/questions/sending-invoices-on-behalf-of-connected-accounts) for details. """ payment_intent_data: Optional[PaymentIntentData] """ Indicates the parameters to be passed to PaymentIntent creation during checkout. """ payment_method_collection: Literal["always", "if_required"] """ Configuration for collecting a payment method during checkout. Defaults to `always`. """ payment_method_types: Optional[ List[ Literal[ "affirm", "afterpay_clearpay", "alipay", "au_becs_debit", "bacs_debit", "bancontact", "blik", "boleto", "card", "cashapp", "eps", "fpx", "giropay", "grabpay", "ideal", "klarna", "konbini", "link", "mobilepay", "multibanco", "oxxo", "p24", "paynow", "paypal", "pix", "promptpay", "sepa_debit", "sofort", "swish", "twint", "us_bank_account", "wechat_pay", "zip", ] ] ] """ The list of payment method types that customers can use. When `null`, Stripe will dynamically show relevant payment methods you've enabled in your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). """ phone_number_collection: PhoneNumberCollection restrictions: Optional[Restrictions] """ Settings that restrict the usage of a payment link. """ shipping_address_collection: Optional[ShippingAddressCollection] """ Configuration for collecting the customer's shipping address. """ shipping_options: List[ShippingOption] """ The shipping rate options applied to the session. """ submit_type: Literal["auto", "book", "donate", "pay"] """ Indicates the type of transaction being performed which customizes relevant text on the page, such as the submit button. """ subscription_data: Optional[SubscriptionData] """ When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use `subscription_data`. """ tax_id_collection: TaxIdCollection transfer_data: Optional[TransferData] """ The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to. """ url: str """ The public URL that can be shared with customers. """ @classmethod def create( cls, **params: Unpack["PaymentLink.CreateParams"] ) -> "PaymentLink": """ Creates a payment link. """ return cast( "PaymentLink", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["PaymentLink.CreateParams"] ) -> "PaymentLink": """ Creates a payment link. """ return cast( "PaymentLink", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def list( cls, **params: Unpack["PaymentLink.ListParams"] ) -> ListObject["PaymentLink"]: """ Returns a list of your payment links. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["PaymentLink.ListParams"] ) -> ListObject["PaymentLink"]: """ Returns a list of your payment links. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def _cls_list_line_items( cls, payment_link: str, **params: Unpack["PaymentLink.ListLineItemsParams"], ) -> ListObject["LineItem"]: """ When retrieving a payment link, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ return cast( ListObject["LineItem"], cls._static_request( "get", "/v1/payment_links/{payment_link}/line_items".format( payment_link=sanitize_id(payment_link) ), params=params, ), ) @overload @staticmethod def list_line_items( payment_link: str, **params: Unpack["PaymentLink.ListLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a payment link, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ ... @overload def list_line_items( self, **params: Unpack["PaymentLink.ListLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a payment link, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ ... @class_method_variant("_cls_list_line_items") def list_line_items( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["PaymentLink.ListLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a payment link, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ return cast( ListObject["LineItem"], self._request( "get", "/v1/payment_links/{payment_link}/line_items".format( payment_link=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_list_line_items_async( cls, payment_link: str, **params: Unpack["PaymentLink.ListLineItemsParams"], ) -> ListObject["LineItem"]: """ When retrieving a payment link, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ return cast( ListObject["LineItem"], await cls._static_request_async( "get", "/v1/payment_links/{payment_link}/line_items".format( payment_link=sanitize_id(payment_link) ), params=params, ), ) @overload @staticmethod async def list_line_items_async( payment_link: str, **params: Unpack["PaymentLink.ListLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a payment link, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ ... @overload async def list_line_items_async( self, **params: Unpack["PaymentLink.ListLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a payment link, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ ... @class_method_variant("_cls_list_line_items_async") async def list_line_items_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["PaymentLink.ListLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a payment link, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ return cast( ListObject["LineItem"], await self._request_async( "get", "/v1/payment_links/{payment_link}/line_items".format( payment_link=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def modify( cls, id: str, **params: Unpack["PaymentLink.ModifyParams"] ) -> "PaymentLink": """ Updates a payment link. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "PaymentLink", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["PaymentLink.ModifyParams"] ) -> "PaymentLink": """ Updates a payment link. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "PaymentLink", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["PaymentLink.RetrieveParams"] ) -> "PaymentLink": """ Retrieve a payment link. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["PaymentLink.RetrieveParams"] ) -> "PaymentLink": """ Retrieve a payment link. """ instance = cls(id, **params) await instance.refresh_async() return instance _inner_class_types = { "after_completion": AfterCompletion, "automatic_tax": AutomaticTax, "consent_collection": ConsentCollection, "custom_fields": CustomField, "custom_text": CustomText, "invoice_creation": InvoiceCreation, "payment_intent_data": PaymentIntentData, "phone_number_collection": PhoneNumberCollection, "restrictions": Restrictions, "shipping_address_collection": ShippingAddressCollection, "shipping_options": ShippingOption, "subscription_data": SubscriptionData, "tax_id_collection": TaxIdCollection, "transfer_data": TransferData, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_payment_link_line_item_service.py0000644000175100001770000000615114637354563023005 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._line_item import LineItem from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict class PaymentLinkLineItemService(StripeService): class ListParams(TypedDict): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ def list( self, payment_link: str, params: "PaymentLinkLineItemService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[LineItem]: """ When retrieving a payment link, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ return cast( ListObject[LineItem], self._request( "get", "/v1/payment_links/{payment_link}/line_items".format( payment_link=sanitize_id(payment_link), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, payment_link: str, params: "PaymentLinkLineItemService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[LineItem]: """ When retrieving a payment link, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ return cast( ListObject[LineItem], await self._request_async( "get", "/v1/payment_links/{payment_link}/line_items".format( payment_link=sanitize_id(payment_link), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_payment_link_service.py0000644000175100001770000020145014637354563020757 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._payment_link import PaymentLink from stripe._payment_link_line_item_service import PaymentLinkLineItemService from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class PaymentLinkService(StripeService): def __init__(self, requestor): super().__init__(requestor) self.line_items = PaymentLinkLineItemService(self._requestor) class CreateParams(TypedDict): after_completion: NotRequired[ "PaymentLinkService.CreateParamsAfterCompletion" ] """ Behavior after the purchase is complete. """ allow_promotion_codes: NotRequired[bool] """ Enables user redeemable promotion codes. """ application_fee_amount: NotRequired[int] """ The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. Can only be applied when there are no line items with recurring prices. """ application_fee_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. There must be at least 1 line item with a recurring price to use this field. """ automatic_tax: NotRequired[ "PaymentLinkService.CreateParamsAutomaticTax" ] """ Configuration for automatic tax collection. """ billing_address_collection: NotRequired[Literal["auto", "required"]] """ Configuration for collecting the customer's billing address. Defaults to `auto`. """ consent_collection: NotRequired[ "PaymentLinkService.CreateParamsConsentCollection" ] """ Configure fields to gather active consent from customers. """ currency: NotRequired[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) and supported by each line item's price. """ custom_fields: NotRequired[ List["PaymentLinkService.CreateParamsCustomField"] ] """ Collect additional information from your customer using custom fields. Up to 3 fields are supported. """ custom_text: NotRequired["PaymentLinkService.CreateParamsCustomText"] """ Display additional text for your customers using custom text. """ customer_creation: NotRequired[Literal["always", "if_required"]] """ Configures whether [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link create a [Customer](https://stripe.com/docs/api/customers). """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ inactive_message: NotRequired[str] """ The custom message to be displayed to a customer when a payment link is no longer active. """ invoice_creation: NotRequired[ "PaymentLinkService.CreateParamsInvoiceCreation" ] """ Generate a post-purchase Invoice for one-time payments. """ line_items: List["PaymentLinkService.CreateParamsLineItem"] """ The line items representing what is being sold. Each line item represents an item being sold. Up to 20 line items are supported. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. Metadata associated with this Payment Link will automatically be copied to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link. """ on_behalf_of: NotRequired[str] """ The account on behalf of which to charge. """ payment_intent_data: NotRequired[ "PaymentLinkService.CreateParamsPaymentIntentData" ] """ A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode. """ payment_method_collection: NotRequired[ Literal["always", "if_required"] ] """ Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount. Can only be set in `subscription` mode. Defaults to `always`. If you'd like information on how to collect a payment method outside of Checkout, read the guide on [configuring subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials). """ payment_method_types: NotRequired[ List[ Literal[ "affirm", "afterpay_clearpay", "alipay", "au_becs_debit", "bacs_debit", "bancontact", "blik", "boleto", "card", "cashapp", "eps", "fpx", "giropay", "grabpay", "ideal", "klarna", "konbini", "link", "mobilepay", "multibanco", "oxxo", "p24", "paynow", "paypal", "pix", "promptpay", "sepa_debit", "sofort", "swish", "twint", "us_bank_account", "wechat_pay", "zip", ] ] ] """ The list of payment method types that customers can use. If no value is passed, Stripe will dynamically show relevant payment methods from your [payment method settings](https://dashboard.stripe.com/settings/payment_methods) (20+ payment methods [supported](https://stripe.com/docs/payments/payment-methods/integration-options#payment-method-product-support)). """ phone_number_collection: NotRequired[ "PaymentLinkService.CreateParamsPhoneNumberCollection" ] """ Controls phone number collection settings during checkout. We recommend that you review your privacy policy and check with your legal contacts. """ restrictions: NotRequired[ "PaymentLinkService.CreateParamsRestrictions" ] """ Settings that restrict the usage of a payment link. """ shipping_address_collection: NotRequired[ "PaymentLinkService.CreateParamsShippingAddressCollection" ] """ Configuration for collecting the customer's shipping address. """ shipping_options: NotRequired[ List["PaymentLinkService.CreateParamsShippingOption"] ] """ The shipping rate options to apply to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link. """ submit_type: NotRequired[Literal["auto", "book", "donate", "pay"]] """ Describes the type of transaction being performed in order to customize relevant text on the page, such as the submit button. Changing this value will also affect the hostname in the [url](https://stripe.com/docs/api/payment_links/payment_links/object#url) property (example: `donate.stripe.com`). """ subscription_data: NotRequired[ "PaymentLinkService.CreateParamsSubscriptionData" ] """ When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use `subscription_data`. """ tax_id_collection: NotRequired[ "PaymentLinkService.CreateParamsTaxIdCollection" ] """ Controls tax ID collection during checkout. """ transfer_data: NotRequired[ "PaymentLinkService.CreateParamsTransferData" ] """ The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to. """ class CreateParamsAfterCompletion(TypedDict): hosted_confirmation: NotRequired[ "PaymentLinkService.CreateParamsAfterCompletionHostedConfirmation" ] """ Configuration when `type=hosted_confirmation`. """ redirect: NotRequired[ "PaymentLinkService.CreateParamsAfterCompletionRedirect" ] """ Configuration when `type=redirect`. """ type: Literal["hosted_confirmation", "redirect"] """ The specified behavior after the purchase is complete. Either `redirect` or `hosted_confirmation`. """ class CreateParamsAfterCompletionHostedConfirmation(TypedDict): custom_message: NotRequired[str] """ A custom message to display to the customer after the purchase is complete. """ class CreateParamsAfterCompletionRedirect(TypedDict): url: str """ The URL the customer will be redirected to after the purchase is complete. You can embed `{CHECKOUT_SESSION_ID}` into the URL to have the `id` of the completed [checkout session](https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-id) included. """ class CreateParamsAutomaticTax(TypedDict): enabled: bool """ If `true`, tax will be calculated automatically using the customer's location. """ liability: NotRequired[ "PaymentLinkService.CreateParamsAutomaticTaxLiability" ] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ class CreateParamsAutomaticTaxLiability(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class CreateParamsConsentCollection(TypedDict): payment_method_reuse_agreement: NotRequired[ "PaymentLinkService.CreateParamsConsentCollectionPaymentMethodReuseAgreement" ] """ Determines the display of payment method reuse agreement text in the UI. If set to `hidden`, it will hide legal text related to the reuse of a payment method. """ promotions: NotRequired[Literal["auto", "none"]] """ If set to `auto`, enables the collection of customer consent for promotional communications. The Checkout Session will determine whether to display an option to opt into promotional communication from the merchant depending on the customer's locale. Only available to US merchants. """ terms_of_service: NotRequired[Literal["none", "required"]] """ If set to `required`, it requires customers to check a terms of service checkbox before being able to pay. There must be a valid terms of service URL set in your [Dashboard settings](https://dashboard.stripe.com/settings/public). """ class CreateParamsConsentCollectionPaymentMethodReuseAgreement(TypedDict): position: Literal["auto", "hidden"] """ Determines the position and visibility of the payment method reuse agreement in the UI. When set to `auto`, Stripe's defaults will be used. When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI. """ class CreateParamsCustomField(TypedDict): dropdown: NotRequired[ "PaymentLinkService.CreateParamsCustomFieldDropdown" ] """ Configuration for `type=dropdown` fields. """ key: str """ String of your choice that your integration can use to reconcile this field. Must be unique to this field, alphanumeric, and up to 200 characters. """ label: "PaymentLinkService.CreateParamsCustomFieldLabel" """ The label for the field, displayed to the customer. """ numeric: NotRequired[ "PaymentLinkService.CreateParamsCustomFieldNumeric" ] """ Configuration for `type=numeric` fields. """ optional: NotRequired[bool] """ Whether the customer is required to complete the field before completing the Checkout Session. Defaults to `false`. """ text: NotRequired["PaymentLinkService.CreateParamsCustomFieldText"] """ Configuration for `type=text` fields. """ type: Literal["dropdown", "numeric", "text"] """ The type of the field. """ class CreateParamsCustomFieldDropdown(TypedDict): options: List[ "PaymentLinkService.CreateParamsCustomFieldDropdownOption" ] """ The options available for the customer to select. Up to 200 options allowed. """ class CreateParamsCustomFieldDropdownOption(TypedDict): label: str """ The label for the option, displayed to the customer. Up to 100 characters. """ value: str """ The value for this option, not displayed to the customer, used by your integration to reconcile the option selected by the customer. Must be unique to this option, alphanumeric, and up to 100 characters. """ class CreateParamsCustomFieldLabel(TypedDict): custom: str """ Custom text for the label, displayed to the customer. Up to 50 characters. """ type: Literal["custom"] """ The type of the label. """ class CreateParamsCustomFieldNumeric(TypedDict): maximum_length: NotRequired[int] """ The maximum character length constraint for the customer's input. """ minimum_length: NotRequired[int] """ The minimum character length requirement for the customer's input. """ class CreateParamsCustomFieldText(TypedDict): maximum_length: NotRequired[int] """ The maximum character length constraint for the customer's input. """ minimum_length: NotRequired[int] """ The minimum character length requirement for the customer's input. """ class CreateParamsCustomText(TypedDict): after_submit: NotRequired[ "Literal['']|PaymentLinkService.CreateParamsCustomTextAfterSubmit" ] """ Custom text that should be displayed after the payment confirmation button. """ shipping_address: NotRequired[ "Literal['']|PaymentLinkService.CreateParamsCustomTextShippingAddress" ] """ Custom text that should be displayed alongside shipping address collection. """ submit: NotRequired[ "Literal['']|PaymentLinkService.CreateParamsCustomTextSubmit" ] """ Custom text that should be displayed alongside the payment confirmation button. """ terms_of_service_acceptance: NotRequired[ "Literal['']|PaymentLinkService.CreateParamsCustomTextTermsOfServiceAcceptance" ] """ Custom text that should be displayed in place of the default terms of service agreement text. """ class CreateParamsCustomTextAfterSubmit(TypedDict): message: str """ Text may be up to 1200 characters in length. """ class CreateParamsCustomTextShippingAddress(TypedDict): message: str """ Text may be up to 1200 characters in length. """ class CreateParamsCustomTextSubmit(TypedDict): message: str """ Text may be up to 1200 characters in length. """ class CreateParamsCustomTextTermsOfServiceAcceptance(TypedDict): message: str """ Text may be up to 1200 characters in length. """ class CreateParamsInvoiceCreation(TypedDict): enabled: bool """ Whether the feature is enabled """ invoice_data: NotRequired[ "PaymentLinkService.CreateParamsInvoiceCreationInvoiceData" ] """ Invoice PDF configuration. """ class CreateParamsInvoiceCreationInvoiceData(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ The account tax IDs associated with the invoice. """ custom_fields: NotRequired[ "Literal['']|List[PaymentLinkService.CreateParamsInvoiceCreationInvoiceDataCustomField]" ] """ Default custom fields to be displayed on invoices for this customer. """ description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ footer: NotRequired[str] """ Default footer to be displayed on invoices for this customer. """ issuer: NotRequired[ "PaymentLinkService.CreateParamsInvoiceCreationInvoiceDataIssuer" ] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ rendering_options: NotRequired[ "Literal['']|PaymentLinkService.CreateParamsInvoiceCreationInvoiceDataRenderingOptions" ] """ Default options for invoice PDF rendering for this customer. """ class CreateParamsInvoiceCreationInvoiceDataCustomField(TypedDict): name: str """ The name of the custom field. This may be up to 40 characters. """ value: str """ The value of the custom field. This may be up to 140 characters. """ class CreateParamsInvoiceCreationInvoiceDataIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class CreateParamsInvoiceCreationInvoiceDataRenderingOptions(TypedDict): amount_tax_display: NotRequired[ "Literal['']|Literal['exclude_tax', 'include_inclusive_tax']" ] """ How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. """ class CreateParamsLineItem(TypedDict): adjustable_quantity: NotRequired[ "PaymentLinkService.CreateParamsLineItemAdjustableQuantity" ] """ When set, provides configuration for this item's quantity to be adjusted by the customer during checkout. """ price: str """ The ID of the [Price](https://stripe.com/docs/api/prices) or [Plan](https://stripe.com/docs/api/plans) object. """ quantity: int """ The quantity of the line item being purchased. """ class CreateParamsLineItemAdjustableQuantity(TypedDict): enabled: bool """ Set to true if the quantity can be adjusted to any non-negative Integer. """ maximum: NotRequired[int] """ The maximum quantity the customer can purchase. By default this value is 99. You can specify a value up to 999. """ minimum: NotRequired[int] """ The minimum quantity the customer can purchase. By default this value is 0. If there is only one item in the cart then that item's quantity cannot go down to 0. """ class CreateParamsPaymentIntentData(TypedDict): capture_method: NotRequired[ Literal["automatic", "automatic_async", "manual"] ] """ Controls when the funds will be captured from the customer's account. """ description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on [Payment Intents](https://stripe.com/docs/api/payment_intents) generated from this payment link. Unlike object-level metadata, this field is declarative. Updates will clear prior values. """ setup_future_usage: NotRequired[Literal["off_session", "on_session"]] """ Indicates that you intend to [make future payments](https://stripe.com/docs/payments/payment-intents#future-usage) with the payment method collected by this Checkout Session. When setting this to `on_session`, Checkout will show a notice to the customer that their payment details will be saved. When setting this to `off_session`, Checkout will show a notice to the customer that their payment details will be saved and used for future payments. If a Customer has been provided or Checkout creates a new Customer,Checkout will attach the payment method to the Customer. If Checkout does not create a Customer, the payment method is not attached to a Customer. To reuse the payment method, you can retrieve it from the Checkout Session's PaymentIntent. When processing card payments, Checkout also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as SCA. """ statement_descriptor: NotRequired[str] """ Extra information about the payment. This will appear on your customer's statement when this payment succeeds in creating a charge. """ statement_descriptor_suffix: NotRequired[str] """ Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. """ transfer_group: NotRequired[str] """ A string that identifies the resulting payment as part of a group. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. """ class CreateParamsPhoneNumberCollection(TypedDict): enabled: bool """ Set to `true` to enable phone number collection. """ class CreateParamsRestrictions(TypedDict): completed_sessions: ( "PaymentLinkService.CreateParamsRestrictionsCompletedSessions" ) """ Configuration for the `completed_sessions` restriction type. """ class CreateParamsRestrictionsCompletedSessions(TypedDict): limit: int """ The maximum number of checkout sessions that can be completed for the `completed_sessions` restriction to be met. """ class CreateParamsShippingAddressCollection(TypedDict): allowed_countries: List[ Literal[ "AC", "AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CV", "CW", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MK", "ML", "MM", "MN", "MO", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SZ", "TA", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VN", "VU", "WF", "WS", "XK", "YE", "YT", "ZA", "ZM", "ZW", "ZZ", ] ] """ An array of two-letter ISO country codes representing which countries Checkout should provide as options for shipping locations. Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. """ class CreateParamsShippingOption(TypedDict): shipping_rate: NotRequired[str] """ The ID of the Shipping Rate to use for this shipping option. """ class CreateParamsSubscriptionData(TypedDict): description: NotRequired[str] """ The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ invoice_settings: NotRequired[ "PaymentLinkService.CreateParamsSubscriptionDataInvoiceSettings" ] """ All invoices will be billed using the specified settings. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on [Subscriptions](https://stripe.com/docs/api/subscriptions) generated from this payment link. Unlike object-level metadata, this field is declarative. Updates will clear prior values. """ trial_period_days: NotRequired[int] """ Integer representing the number of trial period days before the customer is charged for the first time. Has to be at least 1. """ trial_settings: NotRequired[ "PaymentLinkService.CreateParamsSubscriptionDataTrialSettings" ] """ Settings related to subscription trials. """ class CreateParamsSubscriptionDataInvoiceSettings(TypedDict): issuer: NotRequired[ "PaymentLinkService.CreateParamsSubscriptionDataInvoiceSettingsIssuer" ] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ class CreateParamsSubscriptionDataInvoiceSettingsIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class CreateParamsSubscriptionDataTrialSettings(TypedDict): end_behavior: "PaymentLinkService.CreateParamsSubscriptionDataTrialSettingsEndBehavior" """ Defines how the subscription should behave when the user's free trial ends. """ class CreateParamsSubscriptionDataTrialSettingsEndBehavior(TypedDict): missing_payment_method: Literal["cancel", "create_invoice", "pause"] """ Indicates how the subscription should change when the trial ends if the user did not provide a payment method. """ class CreateParamsTaxIdCollection(TypedDict): enabled: bool """ Enable tax ID collection during checkout. Defaults to `false`. """ class CreateParamsTransferData(TypedDict): amount: NotRequired[int] """ The amount that will be transferred automatically when a charge succeeds. """ destination: str """ If specified, successful charges will be attributed to the destination account for tax reporting, and the funds from charges will be transferred to the destination account. The ID of the resulting transfer will be returned on the successful charge's `transfer` field. """ class ListParams(TypedDict): active: NotRequired[bool] """ Only return payment links that are active or inactive (e.g., pass `false` to list all inactive payment links). """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): active: NotRequired[bool] """ Whether the payment link's `url` is active. If `false`, customers visiting the URL will be shown a page saying that the link has been deactivated. """ after_completion: NotRequired[ "PaymentLinkService.UpdateParamsAfterCompletion" ] """ Behavior after the purchase is complete. """ allow_promotion_codes: NotRequired[bool] """ Enables user redeemable promotion codes. """ automatic_tax: NotRequired[ "PaymentLinkService.UpdateParamsAutomaticTax" ] """ Configuration for automatic tax collection. """ billing_address_collection: NotRequired[Literal["auto", "required"]] """ Configuration for collecting the customer's billing address. Defaults to `auto`. """ custom_fields: NotRequired[ "Literal['']|List[PaymentLinkService.UpdateParamsCustomField]" ] """ Collect additional information from your customer using custom fields. Up to 3 fields are supported. """ custom_text: NotRequired["PaymentLinkService.UpdateParamsCustomText"] """ Display additional text for your customers using custom text. """ customer_creation: NotRequired[Literal["always", "if_required"]] """ Configures whether [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link create a [Customer](https://stripe.com/docs/api/customers). """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ inactive_message: NotRequired["Literal['']|str"] """ The custom message to be displayed to a customer when a payment link is no longer active. """ invoice_creation: NotRequired[ "PaymentLinkService.UpdateParamsInvoiceCreation" ] """ Generate a post-purchase Invoice for one-time payments. """ line_items: NotRequired[ List["PaymentLinkService.UpdateParamsLineItem"] ] """ The line items representing what is being sold. Each line item represents an item being sold. Up to 20 line items are supported. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. Metadata associated with this Payment Link will automatically be copied to [checkout sessions](https://stripe.com/docs/api/checkout/sessions) created by this payment link. """ payment_intent_data: NotRequired[ "PaymentLinkService.UpdateParamsPaymentIntentData" ] """ A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode. """ payment_method_collection: NotRequired[ Literal["always", "if_required"] ] """ Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0.This may occur if the Checkout Session includes a free trial or a discount. Can only be set in `subscription` mode. Defaults to `always`. If you'd like information on how to collect a payment method outside of Checkout, read the guide on [configuring subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials). """ payment_method_types: NotRequired[ "Literal['']|List[Literal['affirm', 'afterpay_clearpay', 'alipay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'blik', 'boleto', 'card', 'cashapp', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'klarna', 'konbini', 'link', 'mobilepay', 'multibanco', 'oxxo', 'p24', 'paynow', 'paypal', 'pix', 'promptpay', 'sepa_debit', 'sofort', 'swish', 'twint', 'us_bank_account', 'wechat_pay', 'zip']]" ] """ The list of payment method types that customers can use. Pass an empty string to enable dynamic payment methods that use your [payment method settings](https://dashboard.stripe.com/settings/payment_methods). """ restrictions: NotRequired[ "Literal['']|PaymentLinkService.UpdateParamsRestrictions" ] """ Settings that restrict the usage of a payment link. """ shipping_address_collection: NotRequired[ "Literal['']|PaymentLinkService.UpdateParamsShippingAddressCollection" ] """ Configuration for collecting the customer's shipping address. """ subscription_data: NotRequired[ "PaymentLinkService.UpdateParamsSubscriptionData" ] """ When creating a subscription, the specified configuration data will be used. There must be at least one line item with a recurring price to use `subscription_data`. """ tax_id_collection: NotRequired[ "PaymentLinkService.UpdateParamsTaxIdCollection" ] """ Controls tax ID collection during checkout. """ class UpdateParamsAfterCompletion(TypedDict): hosted_confirmation: NotRequired[ "PaymentLinkService.UpdateParamsAfterCompletionHostedConfirmation" ] """ Configuration when `type=hosted_confirmation`. """ redirect: NotRequired[ "PaymentLinkService.UpdateParamsAfterCompletionRedirect" ] """ Configuration when `type=redirect`. """ type: Literal["hosted_confirmation", "redirect"] """ The specified behavior after the purchase is complete. Either `redirect` or `hosted_confirmation`. """ class UpdateParamsAfterCompletionHostedConfirmation(TypedDict): custom_message: NotRequired[str] """ A custom message to display to the customer after the purchase is complete. """ class UpdateParamsAfterCompletionRedirect(TypedDict): url: str """ The URL the customer will be redirected to after the purchase is complete. You can embed `{CHECKOUT_SESSION_ID}` into the URL to have the `id` of the completed [checkout session](https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-id) included. """ class UpdateParamsAutomaticTax(TypedDict): enabled: bool """ If `true`, tax will be calculated automatically using the customer's location. """ liability: NotRequired[ "PaymentLinkService.UpdateParamsAutomaticTaxLiability" ] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ class UpdateParamsAutomaticTaxLiability(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class UpdateParamsCustomField(TypedDict): dropdown: NotRequired[ "PaymentLinkService.UpdateParamsCustomFieldDropdown" ] """ Configuration for `type=dropdown` fields. """ key: str """ String of your choice that your integration can use to reconcile this field. Must be unique to this field, alphanumeric, and up to 200 characters. """ label: "PaymentLinkService.UpdateParamsCustomFieldLabel" """ The label for the field, displayed to the customer. """ numeric: NotRequired[ "PaymentLinkService.UpdateParamsCustomFieldNumeric" ] """ Configuration for `type=numeric` fields. """ optional: NotRequired[bool] """ Whether the customer is required to complete the field before completing the Checkout Session. Defaults to `false`. """ text: NotRequired["PaymentLinkService.UpdateParamsCustomFieldText"] """ Configuration for `type=text` fields. """ type: Literal["dropdown", "numeric", "text"] """ The type of the field. """ class UpdateParamsCustomFieldDropdown(TypedDict): options: List[ "PaymentLinkService.UpdateParamsCustomFieldDropdownOption" ] """ The options available for the customer to select. Up to 200 options allowed. """ class UpdateParamsCustomFieldDropdownOption(TypedDict): label: str """ The label for the option, displayed to the customer. Up to 100 characters. """ value: str """ The value for this option, not displayed to the customer, used by your integration to reconcile the option selected by the customer. Must be unique to this option, alphanumeric, and up to 100 characters. """ class UpdateParamsCustomFieldLabel(TypedDict): custom: str """ Custom text for the label, displayed to the customer. Up to 50 characters. """ type: Literal["custom"] """ The type of the label. """ class UpdateParamsCustomFieldNumeric(TypedDict): maximum_length: NotRequired[int] """ The maximum character length constraint for the customer's input. """ minimum_length: NotRequired[int] """ The minimum character length requirement for the customer's input. """ class UpdateParamsCustomFieldText(TypedDict): maximum_length: NotRequired[int] """ The maximum character length constraint for the customer's input. """ minimum_length: NotRequired[int] """ The minimum character length requirement for the customer's input. """ class UpdateParamsCustomText(TypedDict): after_submit: NotRequired[ "Literal['']|PaymentLinkService.UpdateParamsCustomTextAfterSubmit" ] """ Custom text that should be displayed after the payment confirmation button. """ shipping_address: NotRequired[ "Literal['']|PaymentLinkService.UpdateParamsCustomTextShippingAddress" ] """ Custom text that should be displayed alongside shipping address collection. """ submit: NotRequired[ "Literal['']|PaymentLinkService.UpdateParamsCustomTextSubmit" ] """ Custom text that should be displayed alongside the payment confirmation button. """ terms_of_service_acceptance: NotRequired[ "Literal['']|PaymentLinkService.UpdateParamsCustomTextTermsOfServiceAcceptance" ] """ Custom text that should be displayed in place of the default terms of service agreement text. """ class UpdateParamsCustomTextAfterSubmit(TypedDict): message: str """ Text may be up to 1200 characters in length. """ class UpdateParamsCustomTextShippingAddress(TypedDict): message: str """ Text may be up to 1200 characters in length. """ class UpdateParamsCustomTextSubmit(TypedDict): message: str """ Text may be up to 1200 characters in length. """ class UpdateParamsCustomTextTermsOfServiceAcceptance(TypedDict): message: str """ Text may be up to 1200 characters in length. """ class UpdateParamsInvoiceCreation(TypedDict): enabled: bool """ Whether the feature is enabled """ invoice_data: NotRequired[ "PaymentLinkService.UpdateParamsInvoiceCreationInvoiceData" ] """ Invoice PDF configuration. """ class UpdateParamsInvoiceCreationInvoiceData(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ The account tax IDs associated with the invoice. """ custom_fields: NotRequired[ "Literal['']|List[PaymentLinkService.UpdateParamsInvoiceCreationInvoiceDataCustomField]" ] """ Default custom fields to be displayed on invoices for this customer. """ description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ footer: NotRequired[str] """ Default footer to be displayed on invoices for this customer. """ issuer: NotRequired[ "PaymentLinkService.UpdateParamsInvoiceCreationInvoiceDataIssuer" ] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ rendering_options: NotRequired[ "Literal['']|PaymentLinkService.UpdateParamsInvoiceCreationInvoiceDataRenderingOptions" ] """ Default options for invoice PDF rendering for this customer. """ class UpdateParamsInvoiceCreationInvoiceDataCustomField(TypedDict): name: str """ The name of the custom field. This may be up to 40 characters. """ value: str """ The value of the custom field. This may be up to 140 characters. """ class UpdateParamsInvoiceCreationInvoiceDataIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class UpdateParamsInvoiceCreationInvoiceDataRenderingOptions(TypedDict): amount_tax_display: NotRequired[ "Literal['']|Literal['exclude_tax', 'include_inclusive_tax']" ] """ How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. """ class UpdateParamsLineItem(TypedDict): adjustable_quantity: NotRequired[ "PaymentLinkService.UpdateParamsLineItemAdjustableQuantity" ] """ When set, provides configuration for this item's quantity to be adjusted by the customer during checkout. """ id: str """ The ID of an existing line item on the payment link. """ quantity: NotRequired[int] """ The quantity of the line item being purchased. """ class UpdateParamsLineItemAdjustableQuantity(TypedDict): enabled: bool """ Set to true if the quantity can be adjusted to any non-negative Integer. """ maximum: NotRequired[int] """ The maximum quantity the customer can purchase. By default this value is 99. You can specify a value up to 999. """ minimum: NotRequired[int] """ The minimum quantity the customer can purchase. By default this value is 0. If there is only one item in the cart then that item's quantity cannot go down to 0. """ class UpdateParamsPaymentIntentData(TypedDict): description: NotRequired["Literal['']|str"] """ An arbitrary string attached to the object. Often useful for displaying to users. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on [Payment Intents](https://stripe.com/docs/api/payment_intents) generated from this payment link. Unlike object-level metadata, this field is declarative. Updates will clear prior values. """ statement_descriptor: NotRequired["Literal['']|str"] """ Extra information about the payment. This will appear on your customer's statement when this payment succeeds in creating a charge. """ statement_descriptor_suffix: NotRequired["Literal['']|str"] """ Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. """ transfer_group: NotRequired["Literal['']|str"] """ A string that identifies the resulting payment as part of a group. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. """ class UpdateParamsRestrictions(TypedDict): completed_sessions: ( "PaymentLinkService.UpdateParamsRestrictionsCompletedSessions" ) """ Configuration for the `completed_sessions` restriction type. """ class UpdateParamsRestrictionsCompletedSessions(TypedDict): limit: int """ The maximum number of checkout sessions that can be completed for the `completed_sessions` restriction to be met. """ class UpdateParamsShippingAddressCollection(TypedDict): allowed_countries: List[ Literal[ "AC", "AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CV", "CW", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MK", "ML", "MM", "MN", "MO", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SZ", "TA", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VN", "VU", "WF", "WS", "XK", "YE", "YT", "ZA", "ZM", "ZW", "ZZ", ] ] """ An array of two-letter ISO country codes representing which countries Checkout should provide as options for shipping locations. Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. """ class UpdateParamsSubscriptionData(TypedDict): invoice_settings: NotRequired[ "PaymentLinkService.UpdateParamsSubscriptionDataInvoiceSettings" ] """ All invoices will be billed using the specified settings. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will declaratively set metadata on [Subscriptions](https://stripe.com/docs/api/subscriptions) generated from this payment link. Unlike object-level metadata, this field is declarative. Updates will clear prior values. """ trial_settings: NotRequired[ "Literal['']|PaymentLinkService.UpdateParamsSubscriptionDataTrialSettings" ] """ Settings related to subscription trials. """ class UpdateParamsSubscriptionDataInvoiceSettings(TypedDict): issuer: NotRequired[ "PaymentLinkService.UpdateParamsSubscriptionDataInvoiceSettingsIssuer" ] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ class UpdateParamsSubscriptionDataInvoiceSettingsIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class UpdateParamsSubscriptionDataTrialSettings(TypedDict): end_behavior: "PaymentLinkService.UpdateParamsSubscriptionDataTrialSettingsEndBehavior" """ Defines how the subscription should behave when the user's free trial ends. """ class UpdateParamsSubscriptionDataTrialSettingsEndBehavior(TypedDict): missing_payment_method: Literal["cancel", "create_invoice", "pause"] """ Indicates how the subscription should change when the trial ends if the user did not provide a payment method. """ class UpdateParamsTaxIdCollection(TypedDict): enabled: bool """ Enable tax ID collection during checkout. Defaults to `false`. """ def list( self, params: "PaymentLinkService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[PaymentLink]: """ Returns a list of your payment links. """ return cast( ListObject[PaymentLink], self._request( "get", "/v1/payment_links", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "PaymentLinkService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[PaymentLink]: """ Returns a list of your payment links. """ return cast( ListObject[PaymentLink], await self._request_async( "get", "/v1/payment_links", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "PaymentLinkService.CreateParams", options: RequestOptions = {}, ) -> PaymentLink: """ Creates a payment link. """ return cast( PaymentLink, self._request( "post", "/v1/payment_links", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "PaymentLinkService.CreateParams", options: RequestOptions = {}, ) -> PaymentLink: """ Creates a payment link. """ return cast( PaymentLink, await self._request_async( "post", "/v1/payment_links", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, payment_link: str, params: "PaymentLinkService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> PaymentLink: """ Retrieve a payment link. """ return cast( PaymentLink, self._request( "get", "/v1/payment_links/{payment_link}".format( payment_link=sanitize_id(payment_link), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, payment_link: str, params: "PaymentLinkService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> PaymentLink: """ Retrieve a payment link. """ return cast( PaymentLink, await self._request_async( "get", "/v1/payment_links/{payment_link}".format( payment_link=sanitize_id(payment_link), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, payment_link: str, params: "PaymentLinkService.UpdateParams" = {}, options: RequestOptions = {}, ) -> PaymentLink: """ Updates a payment link. """ return cast( PaymentLink, self._request( "post", "/v1/payment_links/{payment_link}".format( payment_link=sanitize_id(payment_link), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, payment_link: str, params: "PaymentLinkService.UpdateParams" = {}, options: RequestOptions = {}, ) -> PaymentLink: """ Updates a payment link. """ return cast( PaymentLink, await self._request_async( "post", "/v1/payment_links/{payment_link}".format( payment_link=sanitize_id(payment_link), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_payment_method.py0000644000175100001770000031134214637354563017564 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._charge import Charge from stripe._customer import Customer from stripe._setup_attempt import SetupAttempt class PaymentMethod( CreateableAPIResource["PaymentMethod"], ListableAPIResource["PaymentMethod"], UpdateableAPIResource["PaymentMethod"], ): """ PaymentMethod objects represent your customer's payment instruments. You can use them with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or save them to Customer objects to store instrument details for future payments. Related guides: [Payment Methods](https://stripe.com/docs/payments/payment-methods) and [More Payment Scenarios](https://stripe.com/docs/payments/more-payment-scenarios). """ OBJECT_NAME: ClassVar[Literal["payment_method"]] = "payment_method" class AcssDebit(StripeObject): bank_name: Optional[str] """ Name of the bank associated with the bank account. """ fingerprint: Optional[str] """ Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. """ institution_number: Optional[str] """ Institution number of the bank account. """ last4: Optional[str] """ Last four digits of the bank account number. """ transit_number: Optional[str] """ Transit number of the bank account. """ class Affirm(StripeObject): pass class AfterpayClearpay(StripeObject): pass class Alipay(StripeObject): pass class AmazonPay(StripeObject): pass class AuBecsDebit(StripeObject): bsb_number: Optional[str] """ Six-digit number identifying bank and branch associated with this bank account. """ fingerprint: Optional[str] """ Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. """ last4: Optional[str] """ Last four digits of the bank account number. """ class BacsDebit(StripeObject): fingerprint: Optional[str] """ Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. """ last4: Optional[str] """ Last four digits of the bank account number. """ sort_code: Optional[str] """ Sort code of the bank account. (e.g., `10-20-30`) """ class Bancontact(StripeObject): pass 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 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State, county, province, or region. """ address: Optional[Address] """ Billing address. """ email: Optional[str] """ Email address. """ name: Optional[str] """ Full name. """ phone: Optional[str] """ Billing phone number (including extension). """ _inner_class_types = {"address": Address} class Blik(StripeObject): pass class Boleto(StripeObject): tax_id: str """ Uniquely identifies the customer tax id (CNPJ or CPF) """ class Card(StripeObject): class Checks(StripeObject): address_line1_check: Optional[str] """ If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. """ address_postal_code_check: Optional[str] """ If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. """ cvc_check: Optional[str] """ If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. """ class GeneratedFrom(StripeObject): class PaymentMethodDetails(StripeObject): class CardPresent(StripeObject): class Offline(StripeObject): stored_at: Optional[int] """ Time at which the payment was collected while offline """ class Receipt(StripeObject): account_type: Optional[ Literal["checking", "credit", "prepaid", "unknown"] ] """ The type of account being debited or credited """ application_cryptogram: Optional[str] """ EMV tag 9F26, cryptogram generated by the integrated circuit chip. """ application_preferred_name: Optional[str] """ Mnenomic of the Application Identifier. """ authorization_code: Optional[str] """ Identifier for this transaction. """ authorization_response_code: Optional[str] """ EMV tag 8A. A code returned by the card issuer. """ cardholder_verification_method: Optional[str] """ Describes the method used by the cardholder to verify ownership of the card. One of the following: `approval`, `failure`, `none`, `offline_pin`, `offline_pin_and_signature`, `online_pin`, or `signature`. """ dedicated_file_name: Optional[str] """ EMV tag 84. Similar to the application identifier stored on the integrated circuit chip. """ terminal_verification_results: Optional[str] """ The outcome of a series of EMV functions performed by the card reader. """ transaction_status_information: Optional[str] """ An indication of various EMV functions performed during the transaction. """ amount_authorized: Optional[int] """ The authorized amount """ brand: Optional[str] """ Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ capture_before: Optional[int] """ When using manual capture, a future timestamp after which the charge will be automatically refunded if uncaptured. """ cardholder_name: Optional[str] """ The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. """ country: Optional[str] """ Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. """ description: Optional[str] """ A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) """ emv_auth_data: Optional[str] """ Authorization response cryptogram. """ exp_month: int """ Two-digit number representing the card's expiration month. """ exp_year: int """ Four-digit number representing the card's expiration year. """ fingerprint: Optional[str] """ Uniquely identifies this particular card number. You can use this attribute to check whether two customers who've signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* """ funding: Optional[str] """ Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. """ generated_card: Optional[str] """ ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. Only present if it was possible to generate a card PaymentMethod. """ iin: Optional[str] """ Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) """ incremental_authorization_supported: bool """ Whether this [PaymentIntent](https://stripe.com/docs/api/payment_intents) is eligible for incremental authorizations. Request support using [request_incremental_authorization_support](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-payment_method_options-card_present-request_incremental_authorization_support). """ issuer: Optional[str] """ The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) """ last4: Optional[str] """ The last four digits of the card. """ network: Optional[str] """ Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ offline: Optional[Offline] """ Details about payments collected offline. """ overcapture_supported: bool """ Defines whether the authorized amount can be over-captured or not """ preferred_locales: Optional[List[str]] """ EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. """ read_method: Optional[ Literal[ "contact_emv", "contactless_emv", "contactless_magstripe_mode", "magnetic_stripe_fallback", "magnetic_stripe_track2", ] ] """ How card details were read in this transaction. """ receipt: Optional[Receipt] """ A collection of fields required to be displayed on receipts. Only required for EMV transactions. """ _inner_class_types = { "offline": Offline, "receipt": Receipt, } card_present: Optional[CardPresent] type: str """ The type of payment method transaction-specific details from the transaction that generated this `card` payment method. Always `card_present`. """ _inner_class_types = {"card_present": CardPresent} charge: Optional[str] """ The charge that created this object. """ payment_method_details: Optional[PaymentMethodDetails] """ Transaction-specific details of the payment method used in the payment. """ setup_attempt: Optional[ExpandableField["SetupAttempt"]] """ The ID of the SetupAttempt that generated this PaymentMethod, if any. """ _inner_class_types = { "payment_method_details": PaymentMethodDetails, } class Networks(StripeObject): available: List[str] """ All available networks for the card. """ preferred: Optional[str] """ The preferred network for co-branded cards. Can be `cartes_bancaires`, `mastercard`, `visa` or `invalid_preference` if requested network is not valid for the card. """ class ThreeDSecureUsage(StripeObject): supported: bool """ Whether 3D Secure is supported on this card. """ class Wallet(StripeObject): class AmexExpressCheckout(StripeObject): pass class ApplePay(StripeObject): pass class GooglePay(StripeObject): pass class Link(StripeObject): pass class Masterpass(StripeObject): class BillingAddress(StripeObject): city: Optional[str] """ City, district, suburb, town, or village. """ country: Optional[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: Optional[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State, county, province, or region. """ class ShippingAddress(StripeObject): city: Optional[str] """ City, district, suburb, town, or village. """ country: Optional[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: Optional[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State, county, province, or region. """ billing_address: Optional[BillingAddress] """ Owner's verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ email: Optional[str] """ Owner's verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ name: Optional[str] """ Owner's verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ shipping_address: Optional[ShippingAddress] """ Owner's verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ _inner_class_types = { "billing_address": BillingAddress, "shipping_address": ShippingAddress, } class SamsungPay(StripeObject): pass class VisaCheckout(StripeObject): class BillingAddress(StripeObject): city: Optional[str] """ City, district, suburb, town, or village. """ country: Optional[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: Optional[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State, county, province, or region. """ class ShippingAddress(StripeObject): city: Optional[str] """ City, district, suburb, town, or village. """ country: Optional[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: Optional[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State, county, province, or region. """ billing_address: Optional[BillingAddress] """ Owner's verified billing address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ email: Optional[str] """ Owner's verified email. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ name: Optional[str] """ Owner's verified full name. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ shipping_address: Optional[ShippingAddress] """ Owner's verified shipping address. Values are verified or provided by the wallet directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ _inner_class_types = { "billing_address": BillingAddress, "shipping_address": ShippingAddress, } amex_express_checkout: Optional[AmexExpressCheckout] apple_pay: Optional[ApplePay] dynamic_last4: Optional[str] """ (For tokenized numbers only.) The last four digits of the device account number. """ google_pay: Optional[GooglePay] link: Optional[Link] masterpass: Optional[Masterpass] samsung_pay: Optional[SamsungPay] type: Literal[ "amex_express_checkout", "apple_pay", "google_pay", "link", "masterpass", "samsung_pay", "visa_checkout", ] """ The type of the card wallet, one of `amex_express_checkout`, `apple_pay`, `google_pay`, `masterpass`, `samsung_pay`, `visa_checkout`, or `link`. An additional hash is included on the Wallet subhash with a name matching this value. It contains additional information specific to the card wallet type. """ visa_checkout: Optional[VisaCheckout] _inner_class_types = { "amex_express_checkout": AmexExpressCheckout, "apple_pay": ApplePay, "google_pay": GooglePay, "link": Link, "masterpass": Masterpass, "samsung_pay": SamsungPay, "visa_checkout": VisaCheckout, } brand: str """ Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ checks: Optional[Checks] """ Checks on Card address and CVC if provided. """ country: Optional[str] """ Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. """ description: Optional[str] """ A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) """ display_brand: Optional[str] """ The brand to use when displaying the card, this accounts for customer's brand choice on dual-branded cards. Can be `american_express`, `cartes_bancaires`, `diners_club`, `discover`, `eftpos_australia`, `interac`, `jcb`, `mastercard`, `union_pay`, `visa`, or `other` and may contain more values in the future. """ exp_month: int """ Two-digit number representing the card's expiration month. """ exp_year: int """ Four-digit number representing the card's expiration year. """ fingerprint: Optional[str] """ Uniquely identifies this particular card number. You can use this attribute to check whether two customers who've signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* """ funding: str """ Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. """ generated_from: Optional[GeneratedFrom] """ Details of the original PaymentMethod that created this object. """ iin: Optional[str] """ Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) """ issuer: Optional[str] """ The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) """ last4: str """ The last four digits of the card. """ networks: Optional[Networks] """ Contains information about card networks that can be used to process the payment. """ three_d_secure_usage: Optional[ThreeDSecureUsage] """ Contains details on how this Card may be used for 3D Secure authentication. """ wallet: Optional[Wallet] """ If this Card is part of a card wallet, this contains the details of the card wallet. """ _inner_class_types = { "checks": Checks, "generated_from": GeneratedFrom, "networks": Networks, "three_d_secure_usage": ThreeDSecureUsage, "wallet": Wallet, } class CardPresent(StripeObject): class Networks(StripeObject): available: List[str] """ All available networks for the card. """ preferred: Optional[str] """ The preferred network for the card. """ brand: Optional[str] """ Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ cardholder_name: Optional[str] """ The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. """ country: Optional[str] """ Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. """ description: Optional[str] """ A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) """ exp_month: int """ Two-digit number representing the card's expiration month. """ exp_year: int """ Four-digit number representing the card's expiration year. """ fingerprint: Optional[str] """ Uniquely identifies this particular card number. You can use this attribute to check whether two customers who've signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* """ funding: Optional[str] """ Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. """ iin: Optional[str] """ Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) """ issuer: Optional[str] """ The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) """ last4: Optional[str] """ The last four digits of the card. """ networks: Optional[Networks] """ Contains information about card networks that can be used to process the payment. """ preferred_locales: Optional[List[str]] """ EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. """ read_method: Optional[ Literal[ "contact_emv", "contactless_emv", "contactless_magstripe_mode", "magnetic_stripe_fallback", "magnetic_stripe_track2", ] ] """ How card details were read in this transaction. """ _inner_class_types = {"networks": Networks} class Cashapp(StripeObject): buyer_id: Optional[str] """ A unique and immutable identifier assigned by Cash App to every buyer. """ cashtag: Optional[str] """ A public identifier for buyers using Cash App. """ class CustomerBalance(StripeObject): pass class Eps(StripeObject): bank: Optional[ Literal[ "arzte_und_apotheker_bank", "austrian_anadi_bank_ag", "bank_austria", "bankhaus_carl_spangler", "bankhaus_schelhammer_und_schattera_ag", "bawag_psk_ag", "bks_bank_ag", "brull_kallmus_bank_ag", "btv_vier_lander_bank", "capital_bank_grawe_gruppe_ag", "deutsche_bank_ag", "dolomitenbank", "easybank_ag", "erste_bank_und_sparkassen", "hypo_alpeadriabank_international_ag", "hypo_bank_burgenland_aktiengesellschaft", "hypo_noe_lb_fur_niederosterreich_u_wien", "hypo_oberosterreich_salzburg_steiermark", "hypo_tirol_bank_ag", "hypo_vorarlberg_bank_ag", "marchfelder_bank", "oberbank_ag", "raiffeisen_bankengruppe_osterreich", "schoellerbank_ag", "sparda_bank_wien", "volksbank_gruppe", "volkskreditbank_ag", "vr_bank_braunau", ] ] """ The customer's bank. Should be one of `arzte_und_apotheker_bank`, `austrian_anadi_bank_ag`, `bank_austria`, `bankhaus_carl_spangler`, `bankhaus_schelhammer_und_schattera_ag`, `bawag_psk_ag`, `bks_bank_ag`, `brull_kallmus_bank_ag`, `btv_vier_lander_bank`, `capital_bank_grawe_gruppe_ag`, `deutsche_bank_ag`, `dolomitenbank`, `easybank_ag`, `erste_bank_und_sparkassen`, `hypo_alpeadriabank_international_ag`, `hypo_noe_lb_fur_niederosterreich_u_wien`, `hypo_oberosterreich_salzburg_steiermark`, `hypo_tirol_bank_ag`, `hypo_vorarlberg_bank_ag`, `hypo_bank_burgenland_aktiengesellschaft`, `marchfelder_bank`, `oberbank_ag`, `raiffeisen_bankengruppe_osterreich`, `schoellerbank_ag`, `sparda_bank_wien`, `volksbank_gruppe`, `volkskreditbank_ag`, or `vr_bank_braunau`. """ class Fpx(StripeObject): account_holder_type: Optional[Literal["company", "individual"]] """ Account holder type, if provided. Can be one of `individual` or `company`. """ bank: Literal[ "affin_bank", "agrobank", "alliance_bank", "ambank", "bank_islam", "bank_muamalat", "bank_of_china", "bank_rakyat", "bsn", "cimb", "deutsche_bank", "hong_leong_bank", "hsbc", "kfh", "maybank2e", "maybank2u", "ocbc", "pb_enterprise", "public_bank", "rhb", "standard_chartered", "uob", ] """ The customer's bank, if provided. Can be one of `affin_bank`, `agrobank`, `alliance_bank`, `ambank`, `bank_islam`, `bank_muamalat`, `bank_rakyat`, `bsn`, `cimb`, `hong_leong_bank`, `hsbc`, `kfh`, `maybank2u`, `ocbc`, `public_bank`, `rhb`, `standard_chartered`, `uob`, `deutsche_bank`, `maybank2e`, `pb_enterprise`, or `bank_of_china`. """ class Giropay(StripeObject): pass class Grabpay(StripeObject): pass class Ideal(StripeObject): bank: Optional[ Literal[ "abn_amro", "asn_bank", "bunq", "handelsbanken", "ing", "knab", "moneyou", "n26", "nn", "rabobank", "regiobank", "revolut", "sns_bank", "triodos_bank", "van_lanschot", "yoursafe", ] ] """ The customer's bank, if provided. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. """ bic: Optional[ Literal[ "ABNANL2A", "ASNBNL21", "BITSNL2A", "BUNQNL2A", "FVLBNL22", "HANDNL2A", "INGBNL2A", "KNABNL2H", "MOYONL21", "NNBANL2G", "NTSBDEB1", "RABONL2U", "RBRBNL21", "REVOIE23", "REVOLT21", "SNSBNL2A", "TRIONL2U", ] ] """ The Bank Identifier Code of the customer's bank, if the bank was provided. """ class InteracPresent(StripeObject): class Networks(StripeObject): available: List[str] """ All available networks for the card. """ preferred: Optional[str] """ The preferred network for the card. """ brand: Optional[str] """ Card brand. Can be `interac`, `mastercard` or `visa`. """ cardholder_name: Optional[str] """ The cardholder name as read from the card, in [ISO 7813](https://en.wikipedia.org/wiki/ISO/IEC_7813) format. May include alphanumeric characters, special characters and first/last name separator (`/`). In some cases, the cardholder name may not be available depending on how the issuer has configured the card. Cardholder name is typically not available on swipe or contactless payments, such as those made with Apple Pay and Google Pay. """ country: Optional[str] """ Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. """ description: Optional[str] """ A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) """ exp_month: int """ Two-digit number representing the card's expiration month. """ exp_year: int """ Four-digit number representing the card's expiration year. """ fingerprint: Optional[str] """ Uniquely identifies this particular card number. You can use this attribute to check whether two customers who've signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* """ funding: Optional[str] """ Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. """ iin: Optional[str] """ Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) """ issuer: Optional[str] """ The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) """ last4: Optional[str] """ The last four digits of the card. """ networks: Optional[Networks] """ Contains information about card networks that can be used to process the payment. """ preferred_locales: Optional[List[str]] """ EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. """ read_method: Optional[ Literal[ "contact_emv", "contactless_emv", "contactless_magstripe_mode", "magnetic_stripe_fallback", "magnetic_stripe_track2", ] ] """ How card details were read in this transaction. """ _inner_class_types = {"networks": Networks} class Klarna(StripeObject): class Dob(StripeObject): day: Optional[int] """ The day of birth, between 1 and 31. """ month: Optional[int] """ The month of birth, between 1 and 12. """ year: Optional[int] """ The four-digit year of birth. """ dob: Optional[Dob] """ The customer's date of birth, if provided. """ _inner_class_types = {"dob": Dob} class Konbini(StripeObject): pass class Link(StripeObject): email: Optional[str] """ Account owner's email address. """ persistent_token: Optional[str] """ [Deprecated] This is a legacy parameter that no longer has any function. """ class Mobilepay(StripeObject): pass class Multibanco(StripeObject): pass class Oxxo(StripeObject): pass class P24(StripeObject): bank: Optional[ Literal[ "alior_bank", "bank_millennium", "bank_nowy_bfg_sa", "bank_pekao_sa", "banki_spbdzielcze", "blik", "bnp_paribas", "boz", "citi_handlowy", "credit_agricole", "envelobank", "etransfer_pocztowy24", "getin_bank", "ideabank", "ing", "inteligo", "mbank_mtransfer", "nest_przelew", "noble_pay", "pbac_z_ipko", "plus_bank", "santander_przelew24", "tmobile_usbugi_bankowe", "toyota_bank", "velobank", "volkswagen_bank", ] ] """ The customer's bank, if provided. """ class Paynow(StripeObject): pass class Paypal(StripeObject): payer_email: Optional[str] """ Owner's email. Values are provided by PayPal directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ payer_id: Optional[str] """ PayPal account PayerID. This identifier uniquely identifies the PayPal customer. """ class Pix(StripeObject): pass class Promptpay(StripeObject): pass class RadarOptions(StripeObject): session: Optional[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ class RevolutPay(StripeObject): pass class SepaDebit(StripeObject): class GeneratedFrom(StripeObject): charge: Optional[ExpandableField["Charge"]] """ The ID of the Charge that generated this PaymentMethod, if any. """ setup_attempt: Optional[ExpandableField["SetupAttempt"]] """ The ID of the SetupAttempt that generated this PaymentMethod, if any. """ bank_code: Optional[str] """ Bank code of bank associated with the bank account. """ branch_code: Optional[str] """ Branch code of bank associated with the bank account. """ country: Optional[str] """ Two-letter ISO code representing the country the bank account is located in. """ fingerprint: Optional[str] """ Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. """ generated_from: Optional[GeneratedFrom] """ Information about the object that generated this PaymentMethod. """ last4: Optional[str] """ Last four characters of the IBAN. """ _inner_class_types = {"generated_from": GeneratedFrom} class Sofort(StripeObject): country: Optional[str] """ Two-letter ISO code representing the country the bank account is located in. """ class Swish(StripeObject): pass class Twint(StripeObject): pass class UsBankAccount(StripeObject): class Networks(StripeObject): preferred: Optional[str] """ The preferred network. """ supported: List[Literal["ach", "us_domestic_wire"]] """ All supported networks. """ class StatusDetails(StripeObject): class Blocked(StripeObject): network_code: Optional[ Literal[ "R02", "R03", "R04", "R05", "R07", "R08", "R10", "R11", "R16", "R20", "R29", "R31", ] ] """ The ACH network code that resulted in this block. """ reason: Optional[ Literal[ "bank_account_closed", "bank_account_frozen", "bank_account_invalid_details", "bank_account_restricted", "bank_account_unusable", "debit_not_authorized", ] ] """ The reason why this PaymentMethod's fingerprint has been blocked """ blocked: Optional[Blocked] _inner_class_types = {"blocked": Blocked} account_holder_type: Optional[Literal["company", "individual"]] """ Account holder type: individual or company. """ account_type: Optional[Literal["checking", "savings"]] """ Account type: checkings or savings. Defaults to checking if omitted. """ bank_name: Optional[str] """ The name of the bank. """ financial_connections_account: Optional[str] """ The ID of the Financial Connections Account used to create the payment method. """ fingerprint: Optional[str] """ Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. """ last4: Optional[str] """ Last four digits of the bank account number. """ networks: Optional[Networks] """ Contains information about US bank account networks that can be used. """ routing_number: Optional[str] """ Routing number of the bank account. """ status_details: Optional[StatusDetails] """ Contains information about the future reusability of this PaymentMethod. """ _inner_class_types = { "networks": Networks, "status_details": StatusDetails, } class WechatPay(StripeObject): pass class Zip(StripeObject): pass class AttachParams(RequestOptions): customer: str """ The ID of the customer to which to attach the PaymentMethod. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CreateParams(RequestOptions): acss_debit: NotRequired["PaymentMethod.CreateParamsAcssDebit"] """ If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. """ affirm: NotRequired["PaymentMethod.CreateParamsAffirm"] """ If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. """ afterpay_clearpay: NotRequired[ "PaymentMethod.CreateParamsAfterpayClearpay" ] """ If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. """ alipay: NotRequired["PaymentMethod.CreateParamsAlipay"] """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ allow_redisplay: NotRequired[ Literal["always", "limited", "unspecified"] ] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ amazon_pay: NotRequired["PaymentMethod.CreateParamsAmazonPay"] """ If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. """ au_becs_debit: NotRequired["PaymentMethod.CreateParamsAuBecsDebit"] """ If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. """ bacs_debit: NotRequired["PaymentMethod.CreateParamsBacsDebit"] """ If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. """ bancontact: NotRequired["PaymentMethod.CreateParamsBancontact"] """ If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. """ billing_details: NotRequired[ "PaymentMethod.CreateParamsBillingDetails" ] """ Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. """ blik: NotRequired["PaymentMethod.CreateParamsBlik"] """ If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. """ boleto: NotRequired["PaymentMethod.CreateParamsBoleto"] """ If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. """ card: NotRequired["PaymentMethod.CreateParamsCard"] """ If this is a `card` PaymentMethod, this hash contains the user's card details. For backwards compatibility, you can alternatively provide a Stripe token (e.g., for Apple Pay, Amex Express Checkout, or legacy Checkout) into the card hash with format `card: {token: "tok_visa"}`. When providing a card number, you must meet the requirements for [PCI compliance](https://stripe.com/docs/security#validating-pci-compliance). We strongly recommend using Stripe.js instead of interacting with this API directly. """ cashapp: NotRequired["PaymentMethod.CreateParamsCashapp"] """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ customer: NotRequired[str] """ The `Customer` to whom the original PaymentMethod is attached. """ customer_balance: NotRequired[ "PaymentMethod.CreateParamsCustomerBalance" ] """ If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. """ eps: NotRequired["PaymentMethod.CreateParamsEps"] """ If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ fpx: NotRequired["PaymentMethod.CreateParamsFpx"] """ If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. """ giropay: NotRequired["PaymentMethod.CreateParamsGiropay"] """ If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. """ grabpay: NotRequired["PaymentMethod.CreateParamsGrabpay"] """ If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ ideal: NotRequired["PaymentMethod.CreateParamsIdeal"] """ If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. """ interac_present: NotRequired[ "PaymentMethod.CreateParamsInteracPresent" ] """ If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. """ klarna: NotRequired["PaymentMethod.CreateParamsKlarna"] """ If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. """ konbini: NotRequired["PaymentMethod.CreateParamsKonbini"] """ If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. """ link: NotRequired["PaymentMethod.CreateParamsLink"] """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ mobilepay: NotRequired["PaymentMethod.CreateParamsMobilepay"] """ If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. """ multibanco: NotRequired["PaymentMethod.CreateParamsMultibanco"] """ If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. """ oxxo: NotRequired["PaymentMethod.CreateParamsOxxo"] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. """ p24: NotRequired["PaymentMethod.CreateParamsP24"] """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ payment_method: NotRequired[str] """ The PaymentMethod to share. """ paynow: NotRequired["PaymentMethod.CreateParamsPaynow"] """ If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. """ paypal: NotRequired["PaymentMethod.CreateParamsPaypal"] """ If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. """ pix: NotRequired["PaymentMethod.CreateParamsPix"] """ If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. """ promptpay: NotRequired["PaymentMethod.CreateParamsPromptpay"] """ If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. """ radar_options: NotRequired["PaymentMethod.CreateParamsRadarOptions"] """ Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. """ revolut_pay: NotRequired["PaymentMethod.CreateParamsRevolutPay"] """ If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. """ sepa_debit: NotRequired["PaymentMethod.CreateParamsSepaDebit"] """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ sofort: NotRequired["PaymentMethod.CreateParamsSofort"] """ If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. """ swish: NotRequired["PaymentMethod.CreateParamsSwish"] """ If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. """ twint: NotRequired["PaymentMethod.CreateParamsTwint"] """ If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. """ type: NotRequired[ Literal[ "acss_debit", "affirm", "afterpay_clearpay", "alipay", "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", "blik", "boleto", "card", "cashapp", "customer_balance", "eps", "fpx", "giropay", "grabpay", "ideal", "klarna", "konbini", "link", "mobilepay", "multibanco", "oxxo", "p24", "paynow", "paypal", "pix", "promptpay", "revolut_pay", "sepa_debit", "sofort", "swish", "twint", "us_bank_account", "wechat_pay", "zip", ] ] """ The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. """ us_bank_account: NotRequired["PaymentMethod.CreateParamsUsBankAccount"] """ If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. """ wechat_pay: NotRequired["PaymentMethod.CreateParamsWechatPay"] """ If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. """ zip: NotRequired["PaymentMethod.CreateParamsZip"] """ If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. """ class CreateParamsAcssDebit(TypedDict): account_number: str """ Customer's bank account number. """ institution_number: str """ Institution number of the customer's bank. """ transit_number: str """ Transit number of the customer's bank. """ class CreateParamsAffirm(TypedDict): pass class CreateParamsAfterpayClearpay(TypedDict): pass class CreateParamsAlipay(TypedDict): pass class CreateParamsAmazonPay(TypedDict): pass class CreateParamsAuBecsDebit(TypedDict): account_number: str """ The account number for the bank account. """ bsb_number: str """ Bank-State-Branch number of the bank account. """ class CreateParamsBacsDebit(TypedDict): account_number: NotRequired[str] """ Account number of the bank account that the funds will be debited from. """ sort_code: NotRequired[str] """ Sort code of the bank account. (e.g., `10-20-30`) """ class CreateParamsBancontact(TypedDict): pass class CreateParamsBillingDetails(TypedDict): address: NotRequired[ "Literal['']|PaymentMethod.CreateParamsBillingDetailsAddress" ] """ Billing address. """ email: NotRequired["Literal['']|str"] """ Email address. """ name: NotRequired["Literal['']|str"] """ Full name. """ phone: NotRequired["Literal['']|str"] """ Billing phone number (including extension). """ class CreateParamsBillingDetailsAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsBlik(TypedDict): pass class CreateParamsBoleto(TypedDict): tax_id: str """ The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) """ class CreateParamsCard(TypedDict): cvc: NotRequired[str] """ The card's CVC. It is highly recommended to always include this value. """ exp_month: NotRequired[int] """ Two-digit number representing the card's expiration month. """ exp_year: NotRequired[int] """ Four-digit number representing the card's expiration year. """ networks: NotRequired["PaymentMethod.CreateParamsCardNetworks"] """ Contains information about card networks used to process the payment. """ number: NotRequired[str] """ The card number, as a string without any separators. """ token: NotRequired[str] """ For backwards compatibility, you can alternatively provide a Stripe token (e.g., for Apple Pay, Amex Express Checkout, or legacy Checkout) into the card hash with format card: {token: "tok_visa"}. """ class CreateParamsCardNetworks(TypedDict): preferred: NotRequired[ Literal["cartes_bancaires", "mastercard", "visa"] ] """ The customer's preferred card network for co-branded cards. Supports `cartes_bancaires`, `mastercard`, or `visa`. Selection of a network that does not apply to the card will be stored as `invalid_preference` on the card. """ class CreateParamsCashapp(TypedDict): pass class CreateParamsCustomerBalance(TypedDict): pass class CreateParamsEps(TypedDict): bank: NotRequired[ Literal[ "arzte_und_apotheker_bank", "austrian_anadi_bank_ag", "bank_austria", "bankhaus_carl_spangler", "bankhaus_schelhammer_und_schattera_ag", "bawag_psk_ag", "bks_bank_ag", "brull_kallmus_bank_ag", "btv_vier_lander_bank", "capital_bank_grawe_gruppe_ag", "deutsche_bank_ag", "dolomitenbank", "easybank_ag", "erste_bank_und_sparkassen", "hypo_alpeadriabank_international_ag", "hypo_bank_burgenland_aktiengesellschaft", "hypo_noe_lb_fur_niederosterreich_u_wien", "hypo_oberosterreich_salzburg_steiermark", "hypo_tirol_bank_ag", "hypo_vorarlberg_bank_ag", "marchfelder_bank", "oberbank_ag", "raiffeisen_bankengruppe_osterreich", "schoellerbank_ag", "sparda_bank_wien", "volksbank_gruppe", "volkskreditbank_ag", "vr_bank_braunau", ] ] """ The customer's bank. """ class CreateParamsFpx(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type for FPX transaction """ bank: Literal[ "affin_bank", "agrobank", "alliance_bank", "ambank", "bank_islam", "bank_muamalat", "bank_of_china", "bank_rakyat", "bsn", "cimb", "deutsche_bank", "hong_leong_bank", "hsbc", "kfh", "maybank2e", "maybank2u", "ocbc", "pb_enterprise", "public_bank", "rhb", "standard_chartered", "uob", ] """ The customer's bank. """ class CreateParamsGiropay(TypedDict): pass class CreateParamsGrabpay(TypedDict): pass class CreateParamsIdeal(TypedDict): bank: NotRequired[ Literal[ "abn_amro", "asn_bank", "bunq", "handelsbanken", "ing", "knab", "moneyou", "n26", "nn", "rabobank", "regiobank", "revolut", "sns_bank", "triodos_bank", "van_lanschot", "yoursafe", ] ] """ The customer's bank. """ class CreateParamsInteracPresent(TypedDict): pass class CreateParamsKlarna(TypedDict): dob: NotRequired["PaymentMethod.CreateParamsKlarnaDob"] """ Customer's date of birth """ class CreateParamsKlarnaDob(TypedDict): day: int """ The day of birth, between 1 and 31. """ month: int """ The month of birth, between 1 and 12. """ year: int """ The four-digit year of birth. """ class CreateParamsKonbini(TypedDict): pass class CreateParamsLink(TypedDict): pass class CreateParamsMobilepay(TypedDict): pass class CreateParamsMultibanco(TypedDict): pass class CreateParamsOxxo(TypedDict): pass class CreateParamsP24(TypedDict): bank: NotRequired[ Literal[ "alior_bank", "bank_millennium", "bank_nowy_bfg_sa", "bank_pekao_sa", "banki_spbdzielcze", "blik", "bnp_paribas", "boz", "citi_handlowy", "credit_agricole", "envelobank", "etransfer_pocztowy24", "getin_bank", "ideabank", "ing", "inteligo", "mbank_mtransfer", "nest_przelew", "noble_pay", "pbac_z_ipko", "plus_bank", "santander_przelew24", "tmobile_usbugi_bankowe", "toyota_bank", "velobank", "volkswagen_bank", ] ] """ The customer's bank. """ class CreateParamsPaynow(TypedDict): pass class CreateParamsPaypal(TypedDict): pass class CreateParamsPix(TypedDict): pass class CreateParamsPromptpay(TypedDict): pass class CreateParamsRadarOptions(TypedDict): session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ class CreateParamsRevolutPay(TypedDict): pass class CreateParamsSepaDebit(TypedDict): iban: str """ IBAN of the bank account. """ class CreateParamsSofort(TypedDict): country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] """ Two-letter ISO code representing the country the bank account is located in. """ class CreateParamsSwish(TypedDict): pass class CreateParamsTwint(TypedDict): pass class CreateParamsUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type: individual or company. """ account_number: NotRequired[str] """ Account number of the bank account. """ account_type: NotRequired[Literal["checking", "savings"]] """ Account type: checkings or savings. Defaults to checking if omitted. """ financial_connections_account: NotRequired[str] """ The ID of a Financial Connections Account to use as a payment method. """ routing_number: NotRequired[str] """ Routing number of the bank account. """ class CreateParamsWechatPay(TypedDict): pass class CreateParamsZip(TypedDict): pass class DetachParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ListParams(RequestOptions): customer: NotRequired[str] """ The ID of the customer whose PaymentMethods will be retrieved. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ type: NotRequired[ Literal[ "acss_debit", "affirm", "afterpay_clearpay", "alipay", "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", "blik", "boleto", "card", "cashapp", "customer_balance", "eps", "fpx", "giropay", "grabpay", "ideal", "klarna", "konbini", "link", "mobilepay", "multibanco", "oxxo", "p24", "paynow", "paypal", "pix", "promptpay", "revolut_pay", "sepa_debit", "sofort", "swish", "twint", "us_bank_account", "wechat_pay", "zip", ] ] """ An optional filter on the list, based on the object `type` field. Without the filter, the list includes all current and future payment method types. If your integration expects only one type of payment method in the response, make sure to provide a type value in the request. """ class ModifyParams(RequestOptions): allow_redisplay: NotRequired[ Literal["always", "limited", "unspecified"] ] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ billing_details: NotRequired[ "PaymentMethod.ModifyParamsBillingDetails" ] """ Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. """ card: NotRequired["PaymentMethod.ModifyParamsCard"] """ If this is a `card` PaymentMethod, this hash contains the user's card details. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ link: NotRequired["PaymentMethod.ModifyParamsLink"] """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ us_bank_account: NotRequired["PaymentMethod.ModifyParamsUsBankAccount"] """ If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. """ class ModifyParamsBillingDetails(TypedDict): address: NotRequired[ "Literal['']|PaymentMethod.ModifyParamsBillingDetailsAddress" ] """ Billing address. """ email: NotRequired["Literal['']|str"] """ Email address. """ name: NotRequired["Literal['']|str"] """ Full name. """ phone: NotRequired["Literal['']|str"] """ Billing phone number (including extension). """ class ModifyParamsBillingDetailsAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class ModifyParamsCard(TypedDict): exp_month: NotRequired[int] """ Two-digit number representing the card's expiration month. """ exp_year: NotRequired[int] """ Four-digit number representing the card's expiration year. """ networks: NotRequired["PaymentMethod.ModifyParamsCardNetworks"] """ Contains information about card networks used to process the payment. """ class ModifyParamsCardNetworks(TypedDict): preferred: NotRequired[ "Literal['']|Literal['cartes_bancaires', 'mastercard', 'visa']" ] """ The customer's preferred card network for co-branded cards. Supports `cartes_bancaires`, `mastercard`, or `visa`. Selection of a network that does not apply to the card will be stored as `invalid_preference` on the card. """ class ModifyParamsLink(TypedDict): pass class ModifyParamsUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ Bank account holder type. """ account_type: NotRequired[Literal["checking", "savings"]] """ Bank account type. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ acss_debit: Optional[AcssDebit] affirm: Optional[Affirm] afterpay_clearpay: Optional[AfterpayClearpay] alipay: Optional[Alipay] allow_redisplay: Optional[Literal["always", "limited", "unspecified"]] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to “unspecified”. """ amazon_pay: Optional[AmazonPay] au_becs_debit: Optional[AuBecsDebit] bacs_debit: Optional[BacsDebit] bancontact: Optional[Bancontact] billing_details: BillingDetails blik: Optional[Blik] boleto: Optional[Boleto] card: Optional[Card] card_present: Optional[CardPresent] cashapp: Optional[Cashapp] created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ customer: Optional[ExpandableField["Customer"]] """ The ID of the Customer to which this PaymentMethod is saved. This will not be set when the PaymentMethod has not been saved to a Customer. """ customer_balance: Optional[CustomerBalance] eps: Optional[Eps] fpx: Optional[Fpx] giropay: Optional[Giropay] grabpay: Optional[Grabpay] id: str """ Unique identifier for the object. """ ideal: Optional[Ideal] interac_present: Optional[InteracPresent] klarna: Optional[Klarna] konbini: Optional[Konbini] link: Optional[Link] livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ metadata: Optional[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ mobilepay: Optional[Mobilepay] multibanco: Optional[Multibanco] object: Literal["payment_method"] """ String representing the object's type. Objects of the same type share the same value. """ oxxo: Optional[Oxxo] p24: Optional[P24] paynow: Optional[Paynow] paypal: Optional[Paypal] pix: Optional[Pix] promptpay: Optional[Promptpay] radar_options: Optional[RadarOptions] """ Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. """ revolut_pay: Optional[RevolutPay] sepa_debit: Optional[SepaDebit] sofort: Optional[Sofort] swish: Optional[Swish] twint: Optional[Twint] type: Literal[ "acss_debit", "affirm", "afterpay_clearpay", "alipay", "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", "blik", "boleto", "card", "card_present", "cashapp", "customer_balance", "eps", "fpx", "giropay", "grabpay", "ideal", "interac_present", "klarna", "konbini", "link", "mobilepay", "multibanco", "oxxo", "p24", "paynow", "paypal", "pix", "promptpay", "revolut_pay", "sepa_debit", "sofort", "swish", "twint", "us_bank_account", "wechat_pay", "zip", ] """ The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. """ us_bank_account: Optional[UsBankAccount] wechat_pay: Optional[WechatPay] zip: Optional[Zip] @classmethod def _cls_attach( cls, payment_method: str, **params: Unpack["PaymentMethod.AttachParams"], ) -> "PaymentMethod": """ Attaches a PaymentMethod object to a Customer. To attach a new PaymentMethod to a customer for future payments, we recommend you use a [SetupIntent](https://stripe.com/docs/api/setup_intents) or a PaymentIntent with [setup_future_usage](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage). These approaches will perform any necessary steps to set up the PaymentMethod for future payments. Using the /v1/payment_methods/:id/attach endpoint without first using a SetupIntent or PaymentIntent with setup_future_usage does not optimize the PaymentMethod for future use, which makes later declines and payment friction more likely. See [Optimizing cards for future payments](https://stripe.com/docs/payments/payment-intents#future-usage) for more information about setting up future payments. To use this PaymentMethod as the default for invoice or subscription payments, set [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method), on the Customer to the PaymentMethod's ID. """ return cast( "PaymentMethod", cls._static_request( "post", "/v1/payment_methods/{payment_method}/attach".format( payment_method=sanitize_id(payment_method) ), params=params, ), ) @overload @staticmethod def attach( payment_method: str, **params: Unpack["PaymentMethod.AttachParams"] ) -> "PaymentMethod": """ Attaches a PaymentMethod object to a Customer. To attach a new PaymentMethod to a customer for future payments, we recommend you use a [SetupIntent](https://stripe.com/docs/api/setup_intents) or a PaymentIntent with [setup_future_usage](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage). These approaches will perform any necessary steps to set up the PaymentMethod for future payments. Using the /v1/payment_methods/:id/attach endpoint without first using a SetupIntent or PaymentIntent with setup_future_usage does not optimize the PaymentMethod for future use, which makes later declines and payment friction more likely. See [Optimizing cards for future payments](https://stripe.com/docs/payments/payment-intents#future-usage) for more information about setting up future payments. To use this PaymentMethod as the default for invoice or subscription payments, set [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method), on the Customer to the PaymentMethod's ID. """ ... @overload def attach( self, **params: Unpack["PaymentMethod.AttachParams"] ) -> "PaymentMethod": """ Attaches a PaymentMethod object to a Customer. To attach a new PaymentMethod to a customer for future payments, we recommend you use a [SetupIntent](https://stripe.com/docs/api/setup_intents) or a PaymentIntent with [setup_future_usage](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage). These approaches will perform any necessary steps to set up the PaymentMethod for future payments. Using the /v1/payment_methods/:id/attach endpoint without first using a SetupIntent or PaymentIntent with setup_future_usage does not optimize the PaymentMethod for future use, which makes later declines and payment friction more likely. See [Optimizing cards for future payments](https://stripe.com/docs/payments/payment-intents#future-usage) for more information about setting up future payments. To use this PaymentMethod as the default for invoice or subscription payments, set [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method), on the Customer to the PaymentMethod's ID. """ ... @class_method_variant("_cls_attach") def attach( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["PaymentMethod.AttachParams"] ) -> "PaymentMethod": """ Attaches a PaymentMethod object to a Customer. To attach a new PaymentMethod to a customer for future payments, we recommend you use a [SetupIntent](https://stripe.com/docs/api/setup_intents) or a PaymentIntent with [setup_future_usage](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage). These approaches will perform any necessary steps to set up the PaymentMethod for future payments. Using the /v1/payment_methods/:id/attach endpoint without first using a SetupIntent or PaymentIntent with setup_future_usage does not optimize the PaymentMethod for future use, which makes later declines and payment friction more likely. See [Optimizing cards for future payments](https://stripe.com/docs/payments/payment-intents#future-usage) for more information about setting up future payments. To use this PaymentMethod as the default for invoice or subscription payments, set [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method), on the Customer to the PaymentMethod's ID. """ return cast( "PaymentMethod", self._request( "post", "/v1/payment_methods/{payment_method}/attach".format( payment_method=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_attach_async( cls, payment_method: str, **params: Unpack["PaymentMethod.AttachParams"], ) -> "PaymentMethod": """ Attaches a PaymentMethod object to a Customer. To attach a new PaymentMethod to a customer for future payments, we recommend you use a [SetupIntent](https://stripe.com/docs/api/setup_intents) or a PaymentIntent with [setup_future_usage](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage). These approaches will perform any necessary steps to set up the PaymentMethod for future payments. Using the /v1/payment_methods/:id/attach endpoint without first using a SetupIntent or PaymentIntent with setup_future_usage does not optimize the PaymentMethod for future use, which makes later declines and payment friction more likely. See [Optimizing cards for future payments](https://stripe.com/docs/payments/payment-intents#future-usage) for more information about setting up future payments. To use this PaymentMethod as the default for invoice or subscription payments, set [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method), on the Customer to the PaymentMethod's ID. """ return cast( "PaymentMethod", await cls._static_request_async( "post", "/v1/payment_methods/{payment_method}/attach".format( payment_method=sanitize_id(payment_method) ), params=params, ), ) @overload @staticmethod async def attach_async( payment_method: str, **params: Unpack["PaymentMethod.AttachParams"] ) -> "PaymentMethod": """ Attaches a PaymentMethod object to a Customer. To attach a new PaymentMethod to a customer for future payments, we recommend you use a [SetupIntent](https://stripe.com/docs/api/setup_intents) or a PaymentIntent with [setup_future_usage](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage). These approaches will perform any necessary steps to set up the PaymentMethod for future payments. Using the /v1/payment_methods/:id/attach endpoint without first using a SetupIntent or PaymentIntent with setup_future_usage does not optimize the PaymentMethod for future use, which makes later declines and payment friction more likely. See [Optimizing cards for future payments](https://stripe.com/docs/payments/payment-intents#future-usage) for more information about setting up future payments. To use this PaymentMethod as the default for invoice or subscription payments, set [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method), on the Customer to the PaymentMethod's ID. """ ... @overload async def attach_async( self, **params: Unpack["PaymentMethod.AttachParams"] ) -> "PaymentMethod": """ Attaches a PaymentMethod object to a Customer. To attach a new PaymentMethod to a customer for future payments, we recommend you use a [SetupIntent](https://stripe.com/docs/api/setup_intents) or a PaymentIntent with [setup_future_usage](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage). These approaches will perform any necessary steps to set up the PaymentMethod for future payments. Using the /v1/payment_methods/:id/attach endpoint without first using a SetupIntent or PaymentIntent with setup_future_usage does not optimize the PaymentMethod for future use, which makes later declines and payment friction more likely. See [Optimizing cards for future payments](https://stripe.com/docs/payments/payment-intents#future-usage) for more information about setting up future payments. To use this PaymentMethod as the default for invoice or subscription payments, set [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method), on the Customer to the PaymentMethod's ID. """ ... @class_method_variant("_cls_attach_async") async def attach_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["PaymentMethod.AttachParams"] ) -> "PaymentMethod": """ Attaches a PaymentMethod object to a Customer. To attach a new PaymentMethod to a customer for future payments, we recommend you use a [SetupIntent](https://stripe.com/docs/api/setup_intents) or a PaymentIntent with [setup_future_usage](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage). These approaches will perform any necessary steps to set up the PaymentMethod for future payments. Using the /v1/payment_methods/:id/attach endpoint without first using a SetupIntent or PaymentIntent with setup_future_usage does not optimize the PaymentMethod for future use, which makes later declines and payment friction more likely. See [Optimizing cards for future payments](https://stripe.com/docs/payments/payment-intents#future-usage) for more information about setting up future payments. To use this PaymentMethod as the default for invoice or subscription payments, set [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method), on the Customer to the PaymentMethod's ID. """ return cast( "PaymentMethod", await self._request_async( "post", "/v1/payment_methods/{payment_method}/attach".format( payment_method=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def create( cls, **params: Unpack["PaymentMethod.CreateParams"] ) -> "PaymentMethod": """ Creates a PaymentMethod object. Read the [Stripe.js reference](https://stripe.com/docs/stripe-js/reference#stripe-create-payment-method) to learn how to create PaymentMethods via Stripe.js. Instead of creating a PaymentMethod directly, we recommend using the [PaymentIntents API to accept a payment immediately or the SetupIntent](https://stripe.com/docs/payments/accept-a-payment) API to collect payment method details ahead of a future payment. """ return cast( "PaymentMethod", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["PaymentMethod.CreateParams"] ) -> "PaymentMethod": """ Creates a PaymentMethod object. Read the [Stripe.js reference](https://stripe.com/docs/stripe-js/reference#stripe-create-payment-method) to learn how to create PaymentMethods via Stripe.js. Instead of creating a PaymentMethod directly, we recommend using the [PaymentIntents API to accept a payment immediately or the SetupIntent](https://stripe.com/docs/payments/accept-a-payment) API to collect payment method details ahead of a future payment. """ return cast( "PaymentMethod", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def _cls_detach( cls, payment_method: str, **params: Unpack["PaymentMethod.DetachParams"], ) -> "PaymentMethod": """ Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer. """ return cast( "PaymentMethod", cls._static_request( "post", "/v1/payment_methods/{payment_method}/detach".format( payment_method=sanitize_id(payment_method) ), params=params, ), ) @overload @staticmethod def detach( payment_method: str, **params: Unpack["PaymentMethod.DetachParams"] ) -> "PaymentMethod": """ Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer. """ ... @overload def detach( self, **params: Unpack["PaymentMethod.DetachParams"] ) -> "PaymentMethod": """ Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer. """ ... @class_method_variant("_cls_detach") def detach( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["PaymentMethod.DetachParams"] ) -> "PaymentMethod": """ Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer. """ return cast( "PaymentMethod", self._request( "post", "/v1/payment_methods/{payment_method}/detach".format( payment_method=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_detach_async( cls, payment_method: str, **params: Unpack["PaymentMethod.DetachParams"], ) -> "PaymentMethod": """ Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer. """ return cast( "PaymentMethod", await cls._static_request_async( "post", "/v1/payment_methods/{payment_method}/detach".format( payment_method=sanitize_id(payment_method) ), params=params, ), ) @overload @staticmethod async def detach_async( payment_method: str, **params: Unpack["PaymentMethod.DetachParams"] ) -> "PaymentMethod": """ Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer. """ ... @overload async def detach_async( self, **params: Unpack["PaymentMethod.DetachParams"] ) -> "PaymentMethod": """ Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer. """ ... @class_method_variant("_cls_detach_async") async def detach_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["PaymentMethod.DetachParams"] ) -> "PaymentMethod": """ Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer. """ return cast( "PaymentMethod", await self._request_async( "post", "/v1/payment_methods/{payment_method}/detach".format( payment_method=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def list( cls, **params: Unpack["PaymentMethod.ListParams"] ) -> ListObject["PaymentMethod"]: """ Returns a list of PaymentMethods for Treasury flows. If you want to list the PaymentMethods attached to a Customer for payments, you should use the [List a Customer's PaymentMethods](https://stripe.com/docs/api/payment_methods/customer_list) API instead. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["PaymentMethod.ListParams"] ) -> ListObject["PaymentMethod"]: """ Returns a list of PaymentMethods for Treasury flows. If you want to list the PaymentMethods attached to a Customer for payments, you should use the [List a Customer's PaymentMethods](https://stripe.com/docs/api/payment_methods/customer_list) API instead. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def modify( cls, id: str, **params: Unpack["PaymentMethod.ModifyParams"] ) -> "PaymentMethod": """ Updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "PaymentMethod", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["PaymentMethod.ModifyParams"] ) -> "PaymentMethod": """ Updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "PaymentMethod", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["PaymentMethod.RetrieveParams"] ) -> "PaymentMethod": """ Retrieves a PaymentMethod object attached to the StripeAccount. To retrieve a payment method attached to a Customer, you should use [Retrieve a Customer's PaymentMethods](https://stripe.com/docs/api/payment_methods/customer) """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["PaymentMethod.RetrieveParams"] ) -> "PaymentMethod": """ Retrieves a PaymentMethod object attached to the StripeAccount. To retrieve a payment method attached to a Customer, you should use [Retrieve a Customer's PaymentMethods](https://stripe.com/docs/api/payment_methods/customer) """ instance = cls(id, **params) await instance.refresh_async() return instance _inner_class_types = { "acss_debit": AcssDebit, "affirm": Affirm, "afterpay_clearpay": AfterpayClearpay, "alipay": Alipay, "amazon_pay": AmazonPay, "au_becs_debit": AuBecsDebit, "bacs_debit": BacsDebit, "bancontact": Bancontact, "billing_details": BillingDetails, "blik": Blik, "boleto": Boleto, "card": Card, "card_present": CardPresent, "cashapp": Cashapp, "customer_balance": CustomerBalance, "eps": Eps, "fpx": Fpx, "giropay": Giropay, "grabpay": Grabpay, "ideal": Ideal, "interac_present": InteracPresent, "klarna": Klarna, "konbini": Konbini, "link": Link, "mobilepay": Mobilepay, "multibanco": Multibanco, "oxxo": Oxxo, "p24": P24, "paynow": Paynow, "paypal": Paypal, "pix": Pix, "promptpay": Promptpay, "radar_options": RadarOptions, "revolut_pay": RevolutPay, "sepa_debit": SepaDebit, "sofort": Sofort, "swish": Swish, "twint": Twint, "us_bank_account": UsBankAccount, "wechat_pay": WechatPay, "zip": Zip, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_payment_method_configuration.py0000644000175100001770000034672114637354563022524 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import sanitize_id from typing import ClassVar, List, Optional, cast from typing_extensions import Literal, NotRequired, TypedDict, Unpack class PaymentMethodConfiguration( CreateableAPIResource["PaymentMethodConfiguration"], ListableAPIResource["PaymentMethodConfiguration"], UpdateableAPIResource["PaymentMethodConfiguration"], ): """ PaymentMethodConfigurations control which payment methods are displayed to your customers when you don't explicitly specify payment method types. You can have multiple configurations with different sets of payment methods for different scenarios. There are two types of PaymentMethodConfigurations. Which is used depends on the [charge type](https://stripe.com/docs/connect/charges): **Direct** configurations apply to payments created on your account, including Connect destination charges, Connect separate charges and transfers, and payments not involving Connect. **Child** configurations apply to payments created on your connected accounts using direct charges, and charges with the on_behalf_of parameter. Child configurations have a `parent` that sets default values and controls which settings connected accounts may override. You can specify a parent ID at payment time, and Stripe will automatically resolve the connected account's associated child configuration. Parent configurations are [managed in the dashboard](https://dashboard.stripe.com/settings/payment_methods/connected_accounts) and are not available in this API. Related guides: - [Payment Method Configurations API](https://stripe.com/docs/connect/payment-method-configurations) - [Multiple configurations on dynamic payment methods](https://stripe.com/docs/payments/multiple-payment-method-configs) - [Multiple configurations for your Connect accounts](https://stripe.com/docs/connect/multiple-payment-method-configurations) """ OBJECT_NAME: ClassVar[Literal["payment_method_configuration"]] = ( "payment_method_configuration" ) class AcssDebit(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] """ For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. """ preference: Literal["none", "off", "on"] """ The account's display preference. """ value: Literal["off", "on"] """ The effective display preference value. """ available: bool """ Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. """ display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} class Affirm(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] """ For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. """ preference: Literal["none", "off", "on"] """ The account's display preference. """ value: Literal["off", "on"] """ The effective display preference value. """ available: bool """ Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. """ display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} class AfterpayClearpay(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] """ For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. """ preference: Literal["none", "off", "on"] """ The account's display preference. """ value: Literal["off", "on"] """ The effective display preference value. """ available: bool """ Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. """ display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} class Alipay(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] """ For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. """ preference: Literal["none", "off", "on"] """ The account's display preference. """ value: Literal["off", "on"] """ The effective display preference value. """ available: bool """ Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. """ display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} class AmazonPay(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] """ For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. """ preference: Literal["none", "off", "on"] """ The account's display preference. """ value: Literal["off", "on"] """ The effective display preference value. """ available: bool """ Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. """ display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} class ApplePay(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] """ For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. """ preference: Literal["none", "off", "on"] """ The account's display preference. """ value: Literal["off", "on"] """ The effective display preference value. """ available: bool """ Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. """ display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} class AuBecsDebit(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] """ For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. """ preference: Literal["none", "off", "on"] """ The account's display preference. """ value: Literal["off", "on"] """ The effective display preference value. """ available: bool """ Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. """ display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} class BacsDebit(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] """ For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. """ preference: Literal["none", "off", "on"] """ The account's display preference. """ value: Literal["off", "on"] """ The effective display preference value. """ available: bool """ Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. """ display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} class Bancontact(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] """ For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. """ preference: Literal["none", "off", "on"] """ The account's display preference. """ value: Literal["off", "on"] """ The effective display preference value. """ available: bool """ Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. """ display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} class Blik(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] """ For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. """ preference: Literal["none", "off", "on"] """ The account's display preference. """ value: Literal["off", "on"] """ The effective display preference value. """ available: bool """ Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. """ display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} class Boleto(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] """ For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. """ preference: Literal["none", "off", "on"] """ The account's display preference. """ value: Literal["off", "on"] """ The effective display preference value. """ available: bool """ Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. """ display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} class Card(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] """ For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. """ preference: Literal["none", "off", "on"] """ The account's display preference. """ value: Literal["off", "on"] """ The effective display preference value. """ available: bool """ Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. """ display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} class CartesBancaires(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] """ For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. """ preference: Literal["none", "off", "on"] """ The account's display preference. """ value: Literal["off", "on"] """ The effective display preference value. """ available: bool """ Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. """ display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} class Cashapp(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] """ For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. """ preference: Literal["none", "off", "on"] """ The account's display preference. """ value: Literal["off", "on"] """ The effective display preference value. """ available: bool """ Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. """ display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} class CustomerBalance(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] """ For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. """ preference: Literal["none", "off", "on"] """ The account's display preference. """ value: Literal["off", "on"] """ The effective display preference value. """ available: bool """ Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. """ display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} class Eps(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] """ For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. """ preference: Literal["none", "off", "on"] """ The account's display preference. """ value: Literal["off", "on"] """ The effective display preference value. """ available: bool """ Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. """ display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} class Fpx(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] """ For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. """ preference: Literal["none", "off", "on"] """ The account's display preference. """ value: Literal["off", "on"] """ The effective display preference value. """ available: bool """ Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. """ display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} class Giropay(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] """ For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. """ preference: Literal["none", "off", "on"] """ The account's display preference. """ value: Literal["off", "on"] """ The effective display preference value. """ available: bool """ Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. """ display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} class GooglePay(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] """ For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. """ preference: Literal["none", "off", "on"] """ The account's display preference. """ value: Literal["off", "on"] """ The effective display preference value. """ available: bool """ Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. """ display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} class Grabpay(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] """ For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. """ preference: Literal["none", "off", "on"] """ The account's display preference. """ value: Literal["off", "on"] """ The effective display preference value. """ available: bool """ Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. """ display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} class Ideal(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] """ For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. """ preference: Literal["none", "off", "on"] """ The account's display preference. """ value: Literal["off", "on"] """ The effective display preference value. """ available: bool """ Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. """ display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} class Jcb(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] """ For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. """ preference: Literal["none", "off", "on"] """ The account's display preference. """ value: Literal["off", "on"] """ The effective display preference value. """ available: bool """ Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. """ display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} class Klarna(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] """ For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. """ preference: Literal["none", "off", "on"] """ The account's display preference. """ value: Literal["off", "on"] """ The effective display preference value. """ available: bool """ Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. """ display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} class Konbini(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] """ For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. """ preference: Literal["none", "off", "on"] """ The account's display preference. """ value: Literal["off", "on"] """ The effective display preference value. """ available: bool """ Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. """ display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} class Link(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] """ For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. """ preference: Literal["none", "off", "on"] """ The account's display preference. """ value: Literal["off", "on"] """ The effective display preference value. """ available: bool """ Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. """ display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} class Mobilepay(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] """ For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. """ preference: Literal["none", "off", "on"] """ The account's display preference. """ value: Literal["off", "on"] """ The effective display preference value. """ available: bool """ Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. """ display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} class Multibanco(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] """ For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. """ preference: Literal["none", "off", "on"] """ The account's display preference. """ value: Literal["off", "on"] """ The effective display preference value. """ available: bool """ Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. """ display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} class Oxxo(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] """ For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. """ preference: Literal["none", "off", "on"] """ The account's display preference. """ value: Literal["off", "on"] """ The effective display preference value. """ available: bool """ Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. """ display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} class P24(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] """ For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. """ preference: Literal["none", "off", "on"] """ The account's display preference. """ value: Literal["off", "on"] """ The effective display preference value. """ available: bool """ Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. """ display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} class Paynow(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] """ For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. """ preference: Literal["none", "off", "on"] """ The account's display preference. """ value: Literal["off", "on"] """ The effective display preference value. """ available: bool """ Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. """ display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} class Paypal(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] """ For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. """ preference: Literal["none", "off", "on"] """ The account's display preference. """ value: Literal["off", "on"] """ The effective display preference value. """ available: bool """ Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. """ display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} class Promptpay(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] """ For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. """ preference: Literal["none", "off", "on"] """ The account's display preference. """ value: Literal["off", "on"] """ The effective display preference value. """ available: bool """ Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. """ display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} class RevolutPay(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] """ For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. """ preference: Literal["none", "off", "on"] """ The account's display preference. """ value: Literal["off", "on"] """ The effective display preference value. """ available: bool """ Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. """ display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} class SepaDebit(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] """ For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. """ preference: Literal["none", "off", "on"] """ The account's display preference. """ value: Literal["off", "on"] """ The effective display preference value. """ available: bool """ Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. """ display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} class Sofort(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] """ For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. """ preference: Literal["none", "off", "on"] """ The account's display preference. """ value: Literal["off", "on"] """ The effective display preference value. """ available: bool """ Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. """ display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} class Swish(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] """ For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. """ preference: Literal["none", "off", "on"] """ The account's display preference. """ value: Literal["off", "on"] """ The effective display preference value. """ available: bool """ Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. """ display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} class UsBankAccount(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] """ For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. """ preference: Literal["none", "off", "on"] """ The account's display preference. """ value: Literal["off", "on"] """ The effective display preference value. """ available: bool """ Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. """ display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} class WechatPay(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] """ For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. """ preference: Literal["none", "off", "on"] """ The account's display preference. """ value: Literal["off", "on"] """ The effective display preference value. """ available: bool """ Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. """ display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} class Zip(StripeObject): class DisplayPreference(StripeObject): overridable: Optional[bool] """ For child configs, whether or not the account's preference will be observed. If `false`, the parent configuration's default is used. """ preference: Literal["none", "off", "on"] """ The account's display preference. """ value: Literal["off", "on"] """ The effective display preference value. """ available: bool """ Whether this payment method may be offered at checkout. True if `display_preference` is `on` and the payment method's capability is active. """ display_preference: DisplayPreference _inner_class_types = {"display_preference": DisplayPreference} class CreateParams(RequestOptions): acss_debit: NotRequired[ "PaymentMethodConfiguration.CreateParamsAcssDebit" ] """ Canadian pre-authorized debit payments, check this [page](https://stripe.com/docs/payments/acss-debit) for more details like country availability. """ affirm: NotRequired["PaymentMethodConfiguration.CreateParamsAffirm"] """ [Affirm](https://www.affirm.com/) gives your customers a way to split purchases over a series of payments. Depending on the purchase, they can pay with four interest-free payments (Split Pay) or pay over a longer term (Installments), which might include interest. Check this [page](https://stripe.com/docs/payments/affirm) for more details like country availability. """ afterpay_clearpay: NotRequired[ "PaymentMethodConfiguration.CreateParamsAfterpayClearpay" ] """ Afterpay gives your customers a way to pay for purchases in installments, check this [page](https://stripe.com/docs/payments/afterpay-clearpay) for more details like country availability. Afterpay is particularly popular among businesses selling fashion, beauty, and sports products. """ alipay: NotRequired["PaymentMethodConfiguration.CreateParamsAlipay"] """ Alipay is a digital wallet in China that has more than a billion active users worldwide. Alipay users can pay on the web or on a mobile device using login credentials or their Alipay app. Alipay has a low dispute rate and reduces fraud by authenticating payments using the customer's login credentials. Check this [page](https://stripe.com/docs/payments/alipay) for more details. """ amazon_pay: NotRequired[ "PaymentMethodConfiguration.CreateParamsAmazonPay" ] """ Amazon Pay is a wallet payment method that lets your customers check out the same way as on Amazon. """ apple_pay: NotRequired[ "PaymentMethodConfiguration.CreateParamsApplePay" ] """ Stripe users can accept [Apple Pay](https://stripe.com/payments/apple-pay) in iOS applications in iOS 9 and later, and on the web in Safari starting with iOS 10 or macOS Sierra. There are no additional fees to process Apple Pay payments, and the [pricing](https://stripe.com/pricing) is the same as other card transactions. Check this [page](https://stripe.com/docs/apple-pay) for more details. """ apple_pay_later: NotRequired[ "PaymentMethodConfiguration.CreateParamsApplePayLater" ] """ Apple Pay Later, a payment method for customers to buy now and pay later, gives your customers a way to split purchases into four installments across six weeks. """ au_becs_debit: NotRequired[ "PaymentMethodConfiguration.CreateParamsAuBecsDebit" ] """ Stripe users in Australia can accept Bulk Electronic Clearing System (BECS) direct debit payments from customers with an Australian bank account. Check this [page](https://stripe.com/docs/payments/au-becs-debit) for more details. """ bacs_debit: NotRequired[ "PaymentMethodConfiguration.CreateParamsBacsDebit" ] """ Stripe users in the UK can accept Bacs Direct Debit payments from customers with a UK bank account, check this [page](https://stripe.com/docs/payments/payment-methods/bacs-debit) for more details. """ bancontact: NotRequired[ "PaymentMethodConfiguration.CreateParamsBancontact" ] """ Bancontact is the most popular online payment method in Belgium, with over 15 million cards in circulation. [Customers](https://stripe.com/docs/api/customers) use a Bancontact card or mobile app linked to a Belgian bank account to make online payments that are secure, guaranteed, and confirmed immediately. Check this [page](https://stripe.com/docs/payments/bancontact) for more details. """ blik: NotRequired["PaymentMethodConfiguration.CreateParamsBlik"] """ BLIK is a [single use](https://stripe.com/docs/payments/payment-methods#usage) payment method that requires customers to authenticate their payments. When customers want to pay online using BLIK, they request a six-digit code from their banking application and enter it into the payment collection form. Check this [page](https://stripe.com/docs/payments/blik) for more details. """ boleto: NotRequired["PaymentMethodConfiguration.CreateParamsBoleto"] """ Boleto is an official (regulated by the Central Bank of Brazil) payment method in Brazil. Check this [page](https://stripe.com/docs/payments/boleto) for more details. """ card: NotRequired["PaymentMethodConfiguration.CreateParamsCard"] """ Cards are a popular way for consumers and businesses to pay online or in person. Stripe supports global and local card networks. """ cartes_bancaires: NotRequired[ "PaymentMethodConfiguration.CreateParamsCartesBancaires" ] """ Cartes Bancaires is France's local card network. More than 95% of these cards are co-branded with either Visa or Mastercard, meaning you can process these cards over either Cartes Bancaires or the Visa or Mastercard networks. Check this [page](https://stripe.com/docs/payments/cartes-bancaires) for more details. """ cashapp: NotRequired["PaymentMethodConfiguration.CreateParamsCashapp"] """ Cash App is a popular consumer app in the US that allows customers to bank, invest, send, and receive money using their digital wallet. Check this [page](https://stripe.com/docs/payments/cash-app-pay) for more details. """ customer_balance: NotRequired[ "PaymentMethodConfiguration.CreateParamsCustomerBalance" ] """ Uses a customer's [cash balance](https://stripe.com/docs/payments/customer-balance) for the payment. The cash balance can be funded via a bank transfer. Check this [page](https://stripe.com/docs/payments/bank-transfers) for more details. """ eps: NotRequired["PaymentMethodConfiguration.CreateParamsEps"] """ EPS is an Austria-based payment method that allows customers to complete transactions online using their bank credentials. EPS is supported by all Austrian banks and is accepted by over 80% of Austrian online retailers. Check this [page](https://stripe.com/docs/payments/eps) for more details. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ fpx: NotRequired["PaymentMethodConfiguration.CreateParamsFpx"] """ Financial Process Exchange (FPX) is a Malaysia-based payment method that allows customers to complete transactions online using their bank credentials. Bank Negara Malaysia (BNM), the Central Bank of Malaysia, and eleven other major Malaysian financial institutions are members of the PayNet Group, which owns and operates FPX. It is one of the most popular online payment methods in Malaysia, with nearly 90 million transactions in 2018 according to BNM. Check this [page](https://stripe.com/docs/payments/fpx) for more details. """ giropay: NotRequired["PaymentMethodConfiguration.CreateParamsGiropay"] """ giropay is a German payment method based on online banking, introduced in 2006. It allows customers to complete transactions online using their online banking environment, with funds debited from their bank account. Depending on their bank, customers confirm payments on giropay using a second factor of authentication or a PIN. giropay accounts for 10% of online checkouts in Germany. Check this [page](https://stripe.com/docs/payments/giropay) for more details. """ google_pay: NotRequired[ "PaymentMethodConfiguration.CreateParamsGooglePay" ] """ Google Pay allows customers to make payments in your app or website using any credit or debit card saved to their Google Account, including those from Google Play, YouTube, Chrome, or an Android device. Use the Google Pay API to request any credit or debit card stored in your customer's Google account. Check this [page](https://stripe.com/docs/google-pay) for more details. """ grabpay: NotRequired["PaymentMethodConfiguration.CreateParamsGrabpay"] """ GrabPay is a payment method developed by [Grab](https://www.grab.com/sg/consumer/finance/pay/). GrabPay is a digital wallet - customers maintain a balance in their wallets that they pay out with. Check this [page](https://stripe.com/docs/payments/grabpay) for more details. """ ideal: NotRequired["PaymentMethodConfiguration.CreateParamsIdeal"] """ iDEAL is a Netherlands-based payment method that allows customers to complete transactions online using their bank credentials. All major Dutch banks are members of Currence, the scheme that operates iDEAL, making it the most popular online payment method in the Netherlands with a share of online transactions close to 55%. Check this [page](https://stripe.com/docs/payments/ideal) for more details. """ jcb: NotRequired["PaymentMethodConfiguration.CreateParamsJcb"] """ JCB is a credit card company based in Japan. JCB is currently available in Japan to businesses approved by JCB, and available to all businesses in Australia, Canada, Hong Kong, Japan, New Zealand, Singapore, Switzerland, United Kingdom, United States, and all countries in the European Economic Area except Iceland. Check this [page](https://support.stripe.com/questions/accepting-japan-credit-bureau-%28jcb%29-payments) for more details. """ klarna: NotRequired["PaymentMethodConfiguration.CreateParamsKlarna"] """ Klarna gives customers a range of [payment options](https://stripe.com/docs/payments/klarna#payment-options) during checkout. Available payment options vary depending on the customer's billing address and the transaction amount. These payment options make it convenient for customers to purchase items in all price ranges. Check this [page](https://stripe.com/docs/payments/klarna) for more details. """ konbini: NotRequired["PaymentMethodConfiguration.CreateParamsKonbini"] """ Konbini allows customers in Japan to pay for bills and online purchases at convenience stores with cash. Check this [page](https://stripe.com/docs/payments/konbini) for more details. """ link: NotRequired["PaymentMethodConfiguration.CreateParamsLink"] """ [Link](https://stripe.com/docs/payments/link) is a payment method network. With Link, users save their payment details once, then reuse that information to pay with one click for any business on the network. """ mobilepay: NotRequired[ "PaymentMethodConfiguration.CreateParamsMobilepay" ] """ MobilePay is a [single-use](https://stripe.com/docs/payments/payment-methods#usage) card wallet payment method used in Denmark and Finland. It allows customers to [authenticate and approve](https://stripe.com/docs/payments/payment-methods#customer-actions) payments using the MobilePay app. Check this [page](https://stripe.com/docs/payments/mobilepay) for more details. """ multibanco: NotRequired[ "PaymentMethodConfiguration.CreateParamsMultibanco" ] """ Stripe users in Europe and the United States can accept Multibanco payments from customers in Portugal using [Sources](https://stripe.com/docs/sources)—a single integration path for creating payments using any supported method. """ name: NotRequired[str] """ Configuration name. """ oxxo: NotRequired["PaymentMethodConfiguration.CreateParamsOxxo"] """ OXXO is a Mexican chain of convenience stores with thousands of locations across Latin America and represents nearly 20% of online transactions in Mexico. OXXO allows customers to pay bills and online purchases in-store with cash. Check this [page](https://stripe.com/docs/payments/oxxo) for more details. """ p24: NotRequired["PaymentMethodConfiguration.CreateParamsP24"] """ Przelewy24 is a Poland-based payment method aggregator that allows customers to complete transactions online using bank transfers and other methods. Bank transfers account for 30% of online payments in Poland and Przelewy24 provides a way for customers to pay with over 165 banks. Check this [page](https://stripe.com/docs/payments/p24) for more details. """ parent: NotRequired[str] """ Configuration's parent configuration. Specify to create a child configuration. """ paynow: NotRequired["PaymentMethodConfiguration.CreateParamsPaynow"] """ PayNow is a Singapore-based payment method that allows customers to make a payment using their preferred app from participating banks and participating non-bank financial institutions. Check this [page](https://stripe.com/docs/payments/paynow) for more details. """ paypal: NotRequired["PaymentMethodConfiguration.CreateParamsPaypal"] """ PayPal, a digital wallet popular with customers in Europe, allows your customers worldwide to pay using their PayPal account. Check this [page](https://stripe.com/docs/payments/paypal) for more details. """ promptpay: NotRequired[ "PaymentMethodConfiguration.CreateParamsPromptpay" ] """ PromptPay is a Thailand-based payment method that allows customers to make a payment using their preferred app from participating banks. Check this [page](https://stripe.com/docs/payments/promptpay) for more details. """ revolut_pay: NotRequired[ "PaymentMethodConfiguration.CreateParamsRevolutPay" ] """ Revolut Pay, developed by Revolut, a global finance app, is a digital wallet payment method. Revolut Pay uses the customer's stored balance or cards to fund the payment, and offers the option for non-Revolut customers to save their details after their first purchase. """ sepa_debit: NotRequired[ "PaymentMethodConfiguration.CreateParamsSepaDebit" ] """ The [Single Euro Payments Area (SEPA)](https://en.wikipedia.org/wiki/Single_Euro_Payments_Area) is an initiative of the European Union to simplify payments within and across member countries. SEPA established and enforced banking standards to allow for the direct debiting of every EUR-denominated bank account within the SEPA region, check this [page](https://stripe.com/docs/payments/sepa-debit) for more details. """ sofort: NotRequired["PaymentMethodConfiguration.CreateParamsSofort"] """ Stripe users in Europe and the United States can use the [Payment Intents API](https://stripe.com/docs/payments/payment-intents)—a single integration path for creating payments using any supported method—to accept [Sofort](https://www.sofort.com/) payments from customers. Check this [page](https://stripe.com/docs/payments/sofort) for more details. """ swish: NotRequired["PaymentMethodConfiguration.CreateParamsSwish"] """ Swish is a [real-time](https://stripe.com/docs/payments/real-time) payment method popular in Sweden. It allows customers to [authenticate and approve](https://stripe.com/docs/payments/payment-methods#customer-actions) payments using the Swish mobile app and the Swedish BankID mobile app. Check this [page](https://stripe.com/docs/payments/swish) for more details. """ us_bank_account: NotRequired[ "PaymentMethodConfiguration.CreateParamsUsBankAccount" ] """ Stripe users in the United States can accept ACH direct debit payments from customers with a US bank account using the Automated Clearing House (ACH) payments system operated by Nacha. Check this [page](https://stripe.com/docs/payments/ach-debit) for more details. """ wechat_pay: NotRequired[ "PaymentMethodConfiguration.CreateParamsWechatPay" ] """ WeChat, owned by Tencent, is China's leading mobile app with over 1 billion monthly active users. Chinese consumers can use WeChat Pay to pay for goods and services inside of businesses' apps and websites. WeChat Pay users buy most frequently in gaming, e-commerce, travel, online education, and food/nutrition. Check this [page](https://stripe.com/docs/payments/wechat-pay) for more details. """ zip: NotRequired["PaymentMethodConfiguration.CreateParamsZip"] """ Zip gives your customers a way to split purchases over a series of payments. Check this [page](https://stripe.com/docs/payments/zip) for more details like country availability. """ class CreateParamsAcssDebit(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsAcssDebitDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsAcssDebitDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsAffirm(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsAffirmDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsAffirmDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsAfterpayClearpay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsAfterpayClearpayDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsAfterpayClearpayDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsAlipay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsAlipayDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsAlipayDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsAmazonPay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsAmazonPayDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsAmazonPayDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsApplePay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsApplePayDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsApplePayDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsApplePayLater(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsApplePayLaterDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsApplePayLaterDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsAuBecsDebit(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsAuBecsDebitDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsAuBecsDebitDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsBacsDebit(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsBacsDebitDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsBacsDebitDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsBancontact(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsBancontactDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsBancontactDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsBlik(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsBlikDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsBlikDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsBoleto(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsBoletoDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsBoletoDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsCard(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsCardDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsCardDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsCartesBancaires(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsCartesBancairesDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsCartesBancairesDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsCashapp(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsCashappDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsCashappDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsCustomerBalance(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsCustomerBalanceDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsCustomerBalanceDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsEps(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsEpsDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsEpsDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsFpx(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsFpxDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsFpxDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsGiropay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsGiropayDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsGiropayDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsGooglePay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsGooglePayDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsGooglePayDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsGrabpay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsGrabpayDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsGrabpayDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsIdeal(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsIdealDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsIdealDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsJcb(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsJcbDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsJcbDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsKlarna(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsKlarnaDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsKlarnaDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsKonbini(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsKonbiniDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsKonbiniDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsLink(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsLinkDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsLinkDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsMobilepay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsMobilepayDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsMobilepayDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsMultibanco(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsMultibancoDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsMultibancoDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsOxxo(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsOxxoDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsOxxoDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsP24(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsP24DisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsP24DisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsPaynow(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsPaynowDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsPaynowDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsPaypal(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsPaypalDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsPaypalDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsPromptpay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsPromptpayDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsPromptpayDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsRevolutPay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsRevolutPayDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsRevolutPayDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsSepaDebit(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsSepaDebitDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsSepaDebitDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsSofort(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsSofortDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsSofortDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsSwish(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsSwishDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsSwishDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsUsBankAccount(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsUsBankAccountDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsUsBankAccountDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsWechatPay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsWechatPayDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsWechatPayDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsZip(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.CreateParamsZipDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsZipDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class ListParams(RequestOptions): application: NotRequired["Literal['']|str"] """ The Connect application to filter by. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ModifyParams(RequestOptions): acss_debit: NotRequired[ "PaymentMethodConfiguration.ModifyParamsAcssDebit" ] """ Canadian pre-authorized debit payments, check this [page](https://stripe.com/docs/payments/acss-debit) for more details like country availability. """ active: NotRequired[bool] """ Whether the configuration can be used for new payments. """ affirm: NotRequired["PaymentMethodConfiguration.ModifyParamsAffirm"] """ [Affirm](https://www.affirm.com/) gives your customers a way to split purchases over a series of payments. Depending on the purchase, they can pay with four interest-free payments (Split Pay) or pay over a longer term (Installments), which might include interest. Check this [page](https://stripe.com/docs/payments/affirm) for more details like country availability. """ afterpay_clearpay: NotRequired[ "PaymentMethodConfiguration.ModifyParamsAfterpayClearpay" ] """ Afterpay gives your customers a way to pay for purchases in installments, check this [page](https://stripe.com/docs/payments/afterpay-clearpay) for more details like country availability. Afterpay is particularly popular among businesses selling fashion, beauty, and sports products. """ alipay: NotRequired["PaymentMethodConfiguration.ModifyParamsAlipay"] """ Alipay is a digital wallet in China that has more than a billion active users worldwide. Alipay users can pay on the web or on a mobile device using login credentials or their Alipay app. Alipay has a low dispute rate and reduces fraud by authenticating payments using the customer's login credentials. Check this [page](https://stripe.com/docs/payments/alipay) for more details. """ amazon_pay: NotRequired[ "PaymentMethodConfiguration.ModifyParamsAmazonPay" ] """ Amazon Pay is a wallet payment method that lets your customers check out the same way as on Amazon. """ apple_pay: NotRequired[ "PaymentMethodConfiguration.ModifyParamsApplePay" ] """ Stripe users can accept [Apple Pay](https://stripe.com/payments/apple-pay) in iOS applications in iOS 9 and later, and on the web in Safari starting with iOS 10 or macOS Sierra. There are no additional fees to process Apple Pay payments, and the [pricing](https://stripe.com/pricing) is the same as other card transactions. Check this [page](https://stripe.com/docs/apple-pay) for more details. """ apple_pay_later: NotRequired[ "PaymentMethodConfiguration.ModifyParamsApplePayLater" ] """ Apple Pay Later, a payment method for customers to buy now and pay later, gives your customers a way to split purchases into four installments across six weeks. """ au_becs_debit: NotRequired[ "PaymentMethodConfiguration.ModifyParamsAuBecsDebit" ] """ Stripe users in Australia can accept Bulk Electronic Clearing System (BECS) direct debit payments from customers with an Australian bank account. Check this [page](https://stripe.com/docs/payments/au-becs-debit) for more details. """ bacs_debit: NotRequired[ "PaymentMethodConfiguration.ModifyParamsBacsDebit" ] """ Stripe users in the UK can accept Bacs Direct Debit payments from customers with a UK bank account, check this [page](https://stripe.com/docs/payments/payment-methods/bacs-debit) for more details. """ bancontact: NotRequired[ "PaymentMethodConfiguration.ModifyParamsBancontact" ] """ Bancontact is the most popular online payment method in Belgium, with over 15 million cards in circulation. [Customers](https://stripe.com/docs/api/customers) use a Bancontact card or mobile app linked to a Belgian bank account to make online payments that are secure, guaranteed, and confirmed immediately. Check this [page](https://stripe.com/docs/payments/bancontact) for more details. """ blik: NotRequired["PaymentMethodConfiguration.ModifyParamsBlik"] """ BLIK is a [single use](https://stripe.com/docs/payments/payment-methods#usage) payment method that requires customers to authenticate their payments. When customers want to pay online using BLIK, they request a six-digit code from their banking application and enter it into the payment collection form. Check this [page](https://stripe.com/docs/payments/blik) for more details. """ boleto: NotRequired["PaymentMethodConfiguration.ModifyParamsBoleto"] """ Boleto is an official (regulated by the Central Bank of Brazil) payment method in Brazil. Check this [page](https://stripe.com/docs/payments/boleto) for more details. """ card: NotRequired["PaymentMethodConfiguration.ModifyParamsCard"] """ Cards are a popular way for consumers and businesses to pay online or in person. Stripe supports global and local card networks. """ cartes_bancaires: NotRequired[ "PaymentMethodConfiguration.ModifyParamsCartesBancaires" ] """ Cartes Bancaires is France's local card network. More than 95% of these cards are co-branded with either Visa or Mastercard, meaning you can process these cards over either Cartes Bancaires or the Visa or Mastercard networks. Check this [page](https://stripe.com/docs/payments/cartes-bancaires) for more details. """ cashapp: NotRequired["PaymentMethodConfiguration.ModifyParamsCashapp"] """ Cash App is a popular consumer app in the US that allows customers to bank, invest, send, and receive money using their digital wallet. Check this [page](https://stripe.com/docs/payments/cash-app-pay) for more details. """ customer_balance: NotRequired[ "PaymentMethodConfiguration.ModifyParamsCustomerBalance" ] """ Uses a customer's [cash balance](https://stripe.com/docs/payments/customer-balance) for the payment. The cash balance can be funded via a bank transfer. Check this [page](https://stripe.com/docs/payments/bank-transfers) for more details. """ eps: NotRequired["PaymentMethodConfiguration.ModifyParamsEps"] """ EPS is an Austria-based payment method that allows customers to complete transactions online using their bank credentials. EPS is supported by all Austrian banks and is accepted by over 80% of Austrian online retailers. Check this [page](https://stripe.com/docs/payments/eps) for more details. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ fpx: NotRequired["PaymentMethodConfiguration.ModifyParamsFpx"] """ Financial Process Exchange (FPX) is a Malaysia-based payment method that allows customers to complete transactions online using their bank credentials. Bank Negara Malaysia (BNM), the Central Bank of Malaysia, and eleven other major Malaysian financial institutions are members of the PayNet Group, which owns and operates FPX. It is one of the most popular online payment methods in Malaysia, with nearly 90 million transactions in 2018 according to BNM. Check this [page](https://stripe.com/docs/payments/fpx) for more details. """ giropay: NotRequired["PaymentMethodConfiguration.ModifyParamsGiropay"] """ giropay is a German payment method based on online banking, introduced in 2006. It allows customers to complete transactions online using their online banking environment, with funds debited from their bank account. Depending on their bank, customers confirm payments on giropay using a second factor of authentication or a PIN. giropay accounts for 10% of online checkouts in Germany. Check this [page](https://stripe.com/docs/payments/giropay) for more details. """ google_pay: NotRequired[ "PaymentMethodConfiguration.ModifyParamsGooglePay" ] """ Google Pay allows customers to make payments in your app or website using any credit or debit card saved to their Google Account, including those from Google Play, YouTube, Chrome, or an Android device. Use the Google Pay API to request any credit or debit card stored in your customer's Google account. Check this [page](https://stripe.com/docs/google-pay) for more details. """ grabpay: NotRequired["PaymentMethodConfiguration.ModifyParamsGrabpay"] """ GrabPay is a payment method developed by [Grab](https://www.grab.com/sg/consumer/finance/pay/). GrabPay is a digital wallet - customers maintain a balance in their wallets that they pay out with. Check this [page](https://stripe.com/docs/payments/grabpay) for more details. """ ideal: NotRequired["PaymentMethodConfiguration.ModifyParamsIdeal"] """ iDEAL is a Netherlands-based payment method that allows customers to complete transactions online using their bank credentials. All major Dutch banks are members of Currence, the scheme that operates iDEAL, making it the most popular online payment method in the Netherlands with a share of online transactions close to 55%. Check this [page](https://stripe.com/docs/payments/ideal) for more details. """ jcb: NotRequired["PaymentMethodConfiguration.ModifyParamsJcb"] """ JCB is a credit card company based in Japan. JCB is currently available in Japan to businesses approved by JCB, and available to all businesses in Australia, Canada, Hong Kong, Japan, New Zealand, Singapore, Switzerland, United Kingdom, United States, and all countries in the European Economic Area except Iceland. Check this [page](https://support.stripe.com/questions/accepting-japan-credit-bureau-%28jcb%29-payments) for more details. """ klarna: NotRequired["PaymentMethodConfiguration.ModifyParamsKlarna"] """ Klarna gives customers a range of [payment options](https://stripe.com/docs/payments/klarna#payment-options) during checkout. Available payment options vary depending on the customer's billing address and the transaction amount. These payment options make it convenient for customers to purchase items in all price ranges. Check this [page](https://stripe.com/docs/payments/klarna) for more details. """ konbini: NotRequired["PaymentMethodConfiguration.ModifyParamsKonbini"] """ Konbini allows customers in Japan to pay for bills and online purchases at convenience stores with cash. Check this [page](https://stripe.com/docs/payments/konbini) for more details. """ link: NotRequired["PaymentMethodConfiguration.ModifyParamsLink"] """ [Link](https://stripe.com/docs/payments/link) is a payment method network. With Link, users save their payment details once, then reuse that information to pay with one click for any business on the network. """ mobilepay: NotRequired[ "PaymentMethodConfiguration.ModifyParamsMobilepay" ] """ MobilePay is a [single-use](https://stripe.com/docs/payments/payment-methods#usage) card wallet payment method used in Denmark and Finland. It allows customers to [authenticate and approve](https://stripe.com/docs/payments/payment-methods#customer-actions) payments using the MobilePay app. Check this [page](https://stripe.com/docs/payments/mobilepay) for more details. """ multibanco: NotRequired[ "PaymentMethodConfiguration.ModifyParamsMultibanco" ] """ Stripe users in Europe and the United States can accept Multibanco payments from customers in Portugal using [Sources](https://stripe.com/docs/sources)—a single integration path for creating payments using any supported method. """ name: NotRequired[str] """ Configuration name. """ oxxo: NotRequired["PaymentMethodConfiguration.ModifyParamsOxxo"] """ OXXO is a Mexican chain of convenience stores with thousands of locations across Latin America and represents nearly 20% of online transactions in Mexico. OXXO allows customers to pay bills and online purchases in-store with cash. Check this [page](https://stripe.com/docs/payments/oxxo) for more details. """ p24: NotRequired["PaymentMethodConfiguration.ModifyParamsP24"] """ Przelewy24 is a Poland-based payment method aggregator that allows customers to complete transactions online using bank transfers and other methods. Bank transfers account for 30% of online payments in Poland and Przelewy24 provides a way for customers to pay with over 165 banks. Check this [page](https://stripe.com/docs/payments/p24) for more details. """ paynow: NotRequired["PaymentMethodConfiguration.ModifyParamsPaynow"] """ PayNow is a Singapore-based payment method that allows customers to make a payment using their preferred app from participating banks and participating non-bank financial institutions. Check this [page](https://stripe.com/docs/payments/paynow) for more details. """ paypal: NotRequired["PaymentMethodConfiguration.ModifyParamsPaypal"] """ PayPal, a digital wallet popular with customers in Europe, allows your customers worldwide to pay using their PayPal account. Check this [page](https://stripe.com/docs/payments/paypal) for more details. """ promptpay: NotRequired[ "PaymentMethodConfiguration.ModifyParamsPromptpay" ] """ PromptPay is a Thailand-based payment method that allows customers to make a payment using their preferred app from participating banks. Check this [page](https://stripe.com/docs/payments/promptpay) for more details. """ revolut_pay: NotRequired[ "PaymentMethodConfiguration.ModifyParamsRevolutPay" ] """ Revolut Pay, developed by Revolut, a global finance app, is a digital wallet payment method. Revolut Pay uses the customer's stored balance or cards to fund the payment, and offers the option for non-Revolut customers to save their details after their first purchase. """ sepa_debit: NotRequired[ "PaymentMethodConfiguration.ModifyParamsSepaDebit" ] """ The [Single Euro Payments Area (SEPA)](https://en.wikipedia.org/wiki/Single_Euro_Payments_Area) is an initiative of the European Union to simplify payments within and across member countries. SEPA established and enforced banking standards to allow for the direct debiting of every EUR-denominated bank account within the SEPA region, check this [page](https://stripe.com/docs/payments/sepa-debit) for more details. """ sofort: NotRequired["PaymentMethodConfiguration.ModifyParamsSofort"] """ Stripe users in Europe and the United States can use the [Payment Intents API](https://stripe.com/docs/payments/payment-intents)—a single integration path for creating payments using any supported method—to accept [Sofort](https://www.sofort.com/) payments from customers. Check this [page](https://stripe.com/docs/payments/sofort) for more details. """ swish: NotRequired["PaymentMethodConfiguration.ModifyParamsSwish"] """ Swish is a [real-time](https://stripe.com/docs/payments/real-time) payment method popular in Sweden. It allows customers to [authenticate and approve](https://stripe.com/docs/payments/payment-methods#customer-actions) payments using the Swish mobile app and the Swedish BankID mobile app. Check this [page](https://stripe.com/docs/payments/swish) for more details. """ us_bank_account: NotRequired[ "PaymentMethodConfiguration.ModifyParamsUsBankAccount" ] """ Stripe users in the United States can accept ACH direct debit payments from customers with a US bank account using the Automated Clearing House (ACH) payments system operated by Nacha. Check this [page](https://stripe.com/docs/payments/ach-debit) for more details. """ wechat_pay: NotRequired[ "PaymentMethodConfiguration.ModifyParamsWechatPay" ] """ WeChat, owned by Tencent, is China's leading mobile app with over 1 billion monthly active users. Chinese consumers can use WeChat Pay to pay for goods and services inside of businesses' apps and websites. WeChat Pay users buy most frequently in gaming, e-commerce, travel, online education, and food/nutrition. Check this [page](https://stripe.com/docs/payments/wechat-pay) for more details. """ zip: NotRequired["PaymentMethodConfiguration.ModifyParamsZip"] """ Zip gives your customers a way to split purchases over a series of payments. Check this [page](https://stripe.com/docs/payments/zip) for more details like country availability. """ class ModifyParamsAcssDebit(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsAcssDebitDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class ModifyParamsAcssDebitDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class ModifyParamsAffirm(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsAffirmDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class ModifyParamsAffirmDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class ModifyParamsAfterpayClearpay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsAfterpayClearpayDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class ModifyParamsAfterpayClearpayDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class ModifyParamsAlipay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsAlipayDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class ModifyParamsAlipayDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class ModifyParamsAmazonPay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsAmazonPayDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class ModifyParamsAmazonPayDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class ModifyParamsApplePay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsApplePayDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class ModifyParamsApplePayDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class ModifyParamsApplePayLater(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsApplePayLaterDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class ModifyParamsApplePayLaterDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class ModifyParamsAuBecsDebit(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsAuBecsDebitDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class ModifyParamsAuBecsDebitDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class ModifyParamsBacsDebit(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsBacsDebitDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class ModifyParamsBacsDebitDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class ModifyParamsBancontact(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsBancontactDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class ModifyParamsBancontactDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class ModifyParamsBlik(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsBlikDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class ModifyParamsBlikDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class ModifyParamsBoleto(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsBoletoDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class ModifyParamsBoletoDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class ModifyParamsCard(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsCardDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class ModifyParamsCardDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class ModifyParamsCartesBancaires(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsCartesBancairesDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class ModifyParamsCartesBancairesDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class ModifyParamsCashapp(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsCashappDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class ModifyParamsCashappDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class ModifyParamsCustomerBalance(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsCustomerBalanceDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class ModifyParamsCustomerBalanceDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class ModifyParamsEps(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsEpsDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class ModifyParamsEpsDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class ModifyParamsFpx(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsFpxDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class ModifyParamsFpxDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class ModifyParamsGiropay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsGiropayDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class ModifyParamsGiropayDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class ModifyParamsGooglePay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsGooglePayDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class ModifyParamsGooglePayDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class ModifyParamsGrabpay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsGrabpayDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class ModifyParamsGrabpayDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class ModifyParamsIdeal(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsIdealDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class ModifyParamsIdealDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class ModifyParamsJcb(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsJcbDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class ModifyParamsJcbDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class ModifyParamsKlarna(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsKlarnaDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class ModifyParamsKlarnaDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class ModifyParamsKonbini(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsKonbiniDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class ModifyParamsKonbiniDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class ModifyParamsLink(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsLinkDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class ModifyParamsLinkDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class ModifyParamsMobilepay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsMobilepayDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class ModifyParamsMobilepayDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class ModifyParamsMultibanco(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsMultibancoDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class ModifyParamsMultibancoDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class ModifyParamsOxxo(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsOxxoDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class ModifyParamsOxxoDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class ModifyParamsP24(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsP24DisplayPreference" ] """ Whether or not the payment method should be displayed. """ class ModifyParamsP24DisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class ModifyParamsPaynow(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsPaynowDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class ModifyParamsPaynowDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class ModifyParamsPaypal(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsPaypalDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class ModifyParamsPaypalDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class ModifyParamsPromptpay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsPromptpayDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class ModifyParamsPromptpayDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class ModifyParamsRevolutPay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsRevolutPayDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class ModifyParamsRevolutPayDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class ModifyParamsSepaDebit(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsSepaDebitDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class ModifyParamsSepaDebitDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class ModifyParamsSofort(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsSofortDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class ModifyParamsSofortDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class ModifyParamsSwish(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsSwishDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class ModifyParamsSwishDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class ModifyParamsUsBankAccount(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsUsBankAccountDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class ModifyParamsUsBankAccountDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class ModifyParamsWechatPay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsWechatPayDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class ModifyParamsWechatPayDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class ModifyParamsZip(TypedDict): display_preference: NotRequired[ "PaymentMethodConfiguration.ModifyParamsZipDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class ModifyParamsZipDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ acss_debit: Optional[AcssDebit] active: bool """ Whether the configuration can be used for new payments. """ affirm: Optional[Affirm] afterpay_clearpay: Optional[AfterpayClearpay] alipay: Optional[Alipay] amazon_pay: Optional[AmazonPay] apple_pay: Optional[ApplePay] application: Optional[str] """ For child configs, the Connect application associated with the configuration. """ au_becs_debit: Optional[AuBecsDebit] bacs_debit: Optional[BacsDebit] bancontact: Optional[Bancontact] blik: Optional[Blik] boleto: Optional[Boleto] card: Optional[Card] cartes_bancaires: Optional[CartesBancaires] cashapp: Optional[Cashapp] customer_balance: Optional[CustomerBalance] eps: Optional[Eps] fpx: Optional[Fpx] giropay: Optional[Giropay] google_pay: Optional[GooglePay] grabpay: Optional[Grabpay] id: str """ Unique identifier for the object. """ ideal: Optional[Ideal] is_default: bool """ The default configuration is used whenever a payment method configuration is not specified. """ jcb: Optional[Jcb] klarna: Optional[Klarna] konbini: Optional[Konbini] link: Optional[Link] livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ mobilepay: Optional[Mobilepay] multibanco: Optional[Multibanco] name: str """ The configuration's name. """ object: Literal["payment_method_configuration"] """ String representing the object's type. Objects of the same type share the same value. """ oxxo: Optional[Oxxo] p24: Optional[P24] parent: Optional[str] """ For child configs, the configuration's parent configuration. """ paynow: Optional[Paynow] paypal: Optional[Paypal] promptpay: Optional[Promptpay] revolut_pay: Optional[RevolutPay] sepa_debit: Optional[SepaDebit] sofort: Optional[Sofort] swish: Optional[Swish] us_bank_account: Optional[UsBankAccount] wechat_pay: Optional[WechatPay] zip: Optional[Zip] @classmethod def create( cls, **params: Unpack["PaymentMethodConfiguration.CreateParams"] ) -> "PaymentMethodConfiguration": """ Creates a payment method configuration """ return cast( "PaymentMethodConfiguration", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["PaymentMethodConfiguration.CreateParams"] ) -> "PaymentMethodConfiguration": """ Creates a payment method configuration """ return cast( "PaymentMethodConfiguration", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def list( cls, **params: Unpack["PaymentMethodConfiguration.ListParams"] ) -> ListObject["PaymentMethodConfiguration"]: """ List payment method configurations """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["PaymentMethodConfiguration.ListParams"] ) -> ListObject["PaymentMethodConfiguration"]: """ List payment method configurations """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def modify( cls, id: str, **params: Unpack["PaymentMethodConfiguration.ModifyParams"], ) -> "PaymentMethodConfiguration": """ Update payment method configuration """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "PaymentMethodConfiguration", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["PaymentMethodConfiguration.ModifyParams"], ) -> "PaymentMethodConfiguration": """ Update payment method configuration """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "PaymentMethodConfiguration", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["PaymentMethodConfiguration.RetrieveParams"], ) -> "PaymentMethodConfiguration": """ Retrieve payment method configuration """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["PaymentMethodConfiguration.RetrieveParams"], ) -> "PaymentMethodConfiguration": """ Retrieve payment method configuration """ instance = cls(id, **params) await instance.refresh_async() return instance _inner_class_types = { "acss_debit": AcssDebit, "affirm": Affirm, "afterpay_clearpay": AfterpayClearpay, "alipay": Alipay, "amazon_pay": AmazonPay, "apple_pay": ApplePay, "au_becs_debit": AuBecsDebit, "bacs_debit": BacsDebit, "bancontact": Bancontact, "blik": Blik, "boleto": Boleto, "card": Card, "cartes_bancaires": CartesBancaires, "cashapp": Cashapp, "customer_balance": CustomerBalance, "eps": Eps, "fpx": Fpx, "giropay": Giropay, "google_pay": GooglePay, "grabpay": Grabpay, "ideal": Ideal, "jcb": Jcb, "klarna": Klarna, "konbini": Konbini, "link": Link, "mobilepay": Mobilepay, "multibanco": Multibanco, "oxxo": Oxxo, "p24": P24, "paynow": Paynow, "paypal": Paypal, "promptpay": Promptpay, "revolut_pay": RevolutPay, "sepa_debit": SepaDebit, "sofort": Sofort, "swish": Swish, "us_bank_account": UsBankAccount, "wechat_pay": WechatPay, "zip": Zip, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_payment_method_configuration_service.py0000644000175100001770000024051014637354563024231 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._payment_method_configuration import PaymentMethodConfiguration from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict class PaymentMethodConfigurationService(StripeService): class CreateParams(TypedDict): acss_debit: NotRequired[ "PaymentMethodConfigurationService.CreateParamsAcssDebit" ] """ Canadian pre-authorized debit payments, check this [page](https://stripe.com/docs/payments/acss-debit) for more details like country availability. """ affirm: NotRequired[ "PaymentMethodConfigurationService.CreateParamsAffirm" ] """ [Affirm](https://www.affirm.com/) gives your customers a way to split purchases over a series of payments. Depending on the purchase, they can pay with four interest-free payments (Split Pay) or pay over a longer term (Installments), which might include interest. Check this [page](https://stripe.com/docs/payments/affirm) for more details like country availability. """ afterpay_clearpay: NotRequired[ "PaymentMethodConfigurationService.CreateParamsAfterpayClearpay" ] """ Afterpay gives your customers a way to pay for purchases in installments, check this [page](https://stripe.com/docs/payments/afterpay-clearpay) for more details like country availability. Afterpay is particularly popular among businesses selling fashion, beauty, and sports products. """ alipay: NotRequired[ "PaymentMethodConfigurationService.CreateParamsAlipay" ] """ Alipay is a digital wallet in China that has more than a billion active users worldwide. Alipay users can pay on the web or on a mobile device using login credentials or their Alipay app. Alipay has a low dispute rate and reduces fraud by authenticating payments using the customer's login credentials. Check this [page](https://stripe.com/docs/payments/alipay) for more details. """ amazon_pay: NotRequired[ "PaymentMethodConfigurationService.CreateParamsAmazonPay" ] """ Amazon Pay is a wallet payment method that lets your customers check out the same way as on Amazon. """ apple_pay: NotRequired[ "PaymentMethodConfigurationService.CreateParamsApplePay" ] """ Stripe users can accept [Apple Pay](https://stripe.com/payments/apple-pay) in iOS applications in iOS 9 and later, and on the web in Safari starting with iOS 10 or macOS Sierra. There are no additional fees to process Apple Pay payments, and the [pricing](https://stripe.com/pricing) is the same as other card transactions. Check this [page](https://stripe.com/docs/apple-pay) for more details. """ apple_pay_later: NotRequired[ "PaymentMethodConfigurationService.CreateParamsApplePayLater" ] """ Apple Pay Later, a payment method for customers to buy now and pay later, gives your customers a way to split purchases into four installments across six weeks. """ au_becs_debit: NotRequired[ "PaymentMethodConfigurationService.CreateParamsAuBecsDebit" ] """ Stripe users in Australia can accept Bulk Electronic Clearing System (BECS) direct debit payments from customers with an Australian bank account. Check this [page](https://stripe.com/docs/payments/au-becs-debit) for more details. """ bacs_debit: NotRequired[ "PaymentMethodConfigurationService.CreateParamsBacsDebit" ] """ Stripe users in the UK can accept Bacs Direct Debit payments from customers with a UK bank account, check this [page](https://stripe.com/docs/payments/payment-methods/bacs-debit) for more details. """ bancontact: NotRequired[ "PaymentMethodConfigurationService.CreateParamsBancontact" ] """ Bancontact is the most popular online payment method in Belgium, with over 15 million cards in circulation. [Customers](https://stripe.com/docs/api/customers) use a Bancontact card or mobile app linked to a Belgian bank account to make online payments that are secure, guaranteed, and confirmed immediately. Check this [page](https://stripe.com/docs/payments/bancontact) for more details. """ blik: NotRequired["PaymentMethodConfigurationService.CreateParamsBlik"] """ BLIK is a [single use](https://stripe.com/docs/payments/payment-methods#usage) payment method that requires customers to authenticate their payments. When customers want to pay online using BLIK, they request a six-digit code from their banking application and enter it into the payment collection form. Check this [page](https://stripe.com/docs/payments/blik) for more details. """ boleto: NotRequired[ "PaymentMethodConfigurationService.CreateParamsBoleto" ] """ Boleto is an official (regulated by the Central Bank of Brazil) payment method in Brazil. Check this [page](https://stripe.com/docs/payments/boleto) for more details. """ card: NotRequired["PaymentMethodConfigurationService.CreateParamsCard"] """ Cards are a popular way for consumers and businesses to pay online or in person. Stripe supports global and local card networks. """ cartes_bancaires: NotRequired[ "PaymentMethodConfigurationService.CreateParamsCartesBancaires" ] """ Cartes Bancaires is France's local card network. More than 95% of these cards are co-branded with either Visa or Mastercard, meaning you can process these cards over either Cartes Bancaires or the Visa or Mastercard networks. Check this [page](https://stripe.com/docs/payments/cartes-bancaires) for more details. """ cashapp: NotRequired[ "PaymentMethodConfigurationService.CreateParamsCashapp" ] """ Cash App is a popular consumer app in the US that allows customers to bank, invest, send, and receive money using their digital wallet. Check this [page](https://stripe.com/docs/payments/cash-app-pay) for more details. """ customer_balance: NotRequired[ "PaymentMethodConfigurationService.CreateParamsCustomerBalance" ] """ Uses a customer's [cash balance](https://stripe.com/docs/payments/customer-balance) for the payment. The cash balance can be funded via a bank transfer. Check this [page](https://stripe.com/docs/payments/bank-transfers) for more details. """ eps: NotRequired["PaymentMethodConfigurationService.CreateParamsEps"] """ EPS is an Austria-based payment method that allows customers to complete transactions online using their bank credentials. EPS is supported by all Austrian banks and is accepted by over 80% of Austrian online retailers. Check this [page](https://stripe.com/docs/payments/eps) for more details. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ fpx: NotRequired["PaymentMethodConfigurationService.CreateParamsFpx"] """ Financial Process Exchange (FPX) is a Malaysia-based payment method that allows customers to complete transactions online using their bank credentials. Bank Negara Malaysia (BNM), the Central Bank of Malaysia, and eleven other major Malaysian financial institutions are members of the PayNet Group, which owns and operates FPX. It is one of the most popular online payment methods in Malaysia, with nearly 90 million transactions in 2018 according to BNM. Check this [page](https://stripe.com/docs/payments/fpx) for more details. """ giropay: NotRequired[ "PaymentMethodConfigurationService.CreateParamsGiropay" ] """ giropay is a German payment method based on online banking, introduced in 2006. It allows customers to complete transactions online using their online banking environment, with funds debited from their bank account. Depending on their bank, customers confirm payments on giropay using a second factor of authentication or a PIN. giropay accounts for 10% of online checkouts in Germany. Check this [page](https://stripe.com/docs/payments/giropay) for more details. """ google_pay: NotRequired[ "PaymentMethodConfigurationService.CreateParamsGooglePay" ] """ Google Pay allows customers to make payments in your app or website using any credit or debit card saved to their Google Account, including those from Google Play, YouTube, Chrome, or an Android device. Use the Google Pay API to request any credit or debit card stored in your customer's Google account. Check this [page](https://stripe.com/docs/google-pay) for more details. """ grabpay: NotRequired[ "PaymentMethodConfigurationService.CreateParamsGrabpay" ] """ GrabPay is a payment method developed by [Grab](https://www.grab.com/sg/consumer/finance/pay/). GrabPay is a digital wallet - customers maintain a balance in their wallets that they pay out with. Check this [page](https://stripe.com/docs/payments/grabpay) for more details. """ ideal: NotRequired[ "PaymentMethodConfigurationService.CreateParamsIdeal" ] """ iDEAL is a Netherlands-based payment method that allows customers to complete transactions online using their bank credentials. All major Dutch banks are members of Currence, the scheme that operates iDEAL, making it the most popular online payment method in the Netherlands with a share of online transactions close to 55%. Check this [page](https://stripe.com/docs/payments/ideal) for more details. """ jcb: NotRequired["PaymentMethodConfigurationService.CreateParamsJcb"] """ JCB is a credit card company based in Japan. JCB is currently available in Japan to businesses approved by JCB, and available to all businesses in Australia, Canada, Hong Kong, Japan, New Zealand, Singapore, Switzerland, United Kingdom, United States, and all countries in the European Economic Area except Iceland. Check this [page](https://support.stripe.com/questions/accepting-japan-credit-bureau-%28jcb%29-payments) for more details. """ klarna: NotRequired[ "PaymentMethodConfigurationService.CreateParamsKlarna" ] """ Klarna gives customers a range of [payment options](https://stripe.com/docs/payments/klarna#payment-options) during checkout. Available payment options vary depending on the customer's billing address and the transaction amount. These payment options make it convenient for customers to purchase items in all price ranges. Check this [page](https://stripe.com/docs/payments/klarna) for more details. """ konbini: NotRequired[ "PaymentMethodConfigurationService.CreateParamsKonbini" ] """ Konbini allows customers in Japan to pay for bills and online purchases at convenience stores with cash. Check this [page](https://stripe.com/docs/payments/konbini) for more details. """ link: NotRequired["PaymentMethodConfigurationService.CreateParamsLink"] """ [Link](https://stripe.com/docs/payments/link) is a payment method network. With Link, users save their payment details once, then reuse that information to pay with one click for any business on the network. """ mobilepay: NotRequired[ "PaymentMethodConfigurationService.CreateParamsMobilepay" ] """ MobilePay is a [single-use](https://stripe.com/docs/payments/payment-methods#usage) card wallet payment method used in Denmark and Finland. It allows customers to [authenticate and approve](https://stripe.com/docs/payments/payment-methods#customer-actions) payments using the MobilePay app. Check this [page](https://stripe.com/docs/payments/mobilepay) for more details. """ multibanco: NotRequired[ "PaymentMethodConfigurationService.CreateParamsMultibanco" ] """ Stripe users in Europe and the United States can accept Multibanco payments from customers in Portugal using [Sources](https://stripe.com/docs/sources)—a single integration path for creating payments using any supported method. """ name: NotRequired[str] """ Configuration name. """ oxxo: NotRequired["PaymentMethodConfigurationService.CreateParamsOxxo"] """ OXXO is a Mexican chain of convenience stores with thousands of locations across Latin America and represents nearly 20% of online transactions in Mexico. OXXO allows customers to pay bills and online purchases in-store with cash. Check this [page](https://stripe.com/docs/payments/oxxo) for more details. """ p24: NotRequired["PaymentMethodConfigurationService.CreateParamsP24"] """ Przelewy24 is a Poland-based payment method aggregator that allows customers to complete transactions online using bank transfers and other methods. Bank transfers account for 30% of online payments in Poland and Przelewy24 provides a way for customers to pay with over 165 banks. Check this [page](https://stripe.com/docs/payments/p24) for more details. """ parent: NotRequired[str] """ Configuration's parent configuration. Specify to create a child configuration. """ paynow: NotRequired[ "PaymentMethodConfigurationService.CreateParamsPaynow" ] """ PayNow is a Singapore-based payment method that allows customers to make a payment using their preferred app from participating banks and participating non-bank financial institutions. Check this [page](https://stripe.com/docs/payments/paynow) for more details. """ paypal: NotRequired[ "PaymentMethodConfigurationService.CreateParamsPaypal" ] """ PayPal, a digital wallet popular with customers in Europe, allows your customers worldwide to pay using their PayPal account. Check this [page](https://stripe.com/docs/payments/paypal) for more details. """ promptpay: NotRequired[ "PaymentMethodConfigurationService.CreateParamsPromptpay" ] """ PromptPay is a Thailand-based payment method that allows customers to make a payment using their preferred app from participating banks. Check this [page](https://stripe.com/docs/payments/promptpay) for more details. """ revolut_pay: NotRequired[ "PaymentMethodConfigurationService.CreateParamsRevolutPay" ] """ Revolut Pay, developed by Revolut, a global finance app, is a digital wallet payment method. Revolut Pay uses the customer's stored balance or cards to fund the payment, and offers the option for non-Revolut customers to save their details after their first purchase. """ sepa_debit: NotRequired[ "PaymentMethodConfigurationService.CreateParamsSepaDebit" ] """ The [Single Euro Payments Area (SEPA)](https://en.wikipedia.org/wiki/Single_Euro_Payments_Area) is an initiative of the European Union to simplify payments within and across member countries. SEPA established and enforced banking standards to allow for the direct debiting of every EUR-denominated bank account within the SEPA region, check this [page](https://stripe.com/docs/payments/sepa-debit) for more details. """ sofort: NotRequired[ "PaymentMethodConfigurationService.CreateParamsSofort" ] """ Stripe users in Europe and the United States can use the [Payment Intents API](https://stripe.com/docs/payments/payment-intents)—a single integration path for creating payments using any supported method—to accept [Sofort](https://www.sofort.com/) payments from customers. Check this [page](https://stripe.com/docs/payments/sofort) for more details. """ swish: NotRequired[ "PaymentMethodConfigurationService.CreateParamsSwish" ] """ Swish is a [real-time](https://stripe.com/docs/payments/real-time) payment method popular in Sweden. It allows customers to [authenticate and approve](https://stripe.com/docs/payments/payment-methods#customer-actions) payments using the Swish mobile app and the Swedish BankID mobile app. Check this [page](https://stripe.com/docs/payments/swish) for more details. """ us_bank_account: NotRequired[ "PaymentMethodConfigurationService.CreateParamsUsBankAccount" ] """ Stripe users in the United States can accept ACH direct debit payments from customers with a US bank account using the Automated Clearing House (ACH) payments system operated by Nacha. Check this [page](https://stripe.com/docs/payments/ach-debit) for more details. """ wechat_pay: NotRequired[ "PaymentMethodConfigurationService.CreateParamsWechatPay" ] """ WeChat, owned by Tencent, is China's leading mobile app with over 1 billion monthly active users. Chinese consumers can use WeChat Pay to pay for goods and services inside of businesses' apps and websites. WeChat Pay users buy most frequently in gaming, e-commerce, travel, online education, and food/nutrition. Check this [page](https://stripe.com/docs/payments/wechat-pay) for more details. """ zip: NotRequired["PaymentMethodConfigurationService.CreateParamsZip"] """ Zip gives your customers a way to split purchases over a series of payments. Check this [page](https://stripe.com/docs/payments/zip) for more details like country availability. """ class CreateParamsAcssDebit(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsAcssDebitDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsAcssDebitDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsAffirm(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsAffirmDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsAffirmDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsAfterpayClearpay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsAfterpayClearpayDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsAfterpayClearpayDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsAlipay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsAlipayDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsAlipayDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsAmazonPay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsAmazonPayDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsAmazonPayDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsApplePay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsApplePayDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsApplePayDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsApplePayLater(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsApplePayLaterDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsApplePayLaterDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsAuBecsDebit(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsAuBecsDebitDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsAuBecsDebitDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsBacsDebit(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsBacsDebitDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsBacsDebitDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsBancontact(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsBancontactDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsBancontactDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsBlik(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsBlikDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsBlikDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsBoleto(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsBoletoDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsBoletoDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsCard(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsCardDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsCardDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsCartesBancaires(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsCartesBancairesDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsCartesBancairesDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsCashapp(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsCashappDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsCashappDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsCustomerBalance(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsCustomerBalanceDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsCustomerBalanceDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsEps(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsEpsDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsEpsDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsFpx(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsFpxDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsFpxDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsGiropay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsGiropayDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsGiropayDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsGooglePay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsGooglePayDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsGooglePayDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsGrabpay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsGrabpayDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsGrabpayDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsIdeal(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsIdealDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsIdealDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsJcb(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsJcbDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsJcbDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsKlarna(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsKlarnaDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsKlarnaDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsKonbini(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsKonbiniDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsKonbiniDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsLink(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsLinkDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsLinkDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsMobilepay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsMobilepayDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsMobilepayDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsMultibanco(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsMultibancoDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsMultibancoDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsOxxo(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsOxxoDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsOxxoDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsP24(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsP24DisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsP24DisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsPaynow(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsPaynowDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsPaynowDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsPaypal(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsPaypalDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsPaypalDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsPromptpay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsPromptpayDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsPromptpayDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsRevolutPay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsRevolutPayDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsRevolutPayDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsSepaDebit(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsSepaDebitDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsSepaDebitDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsSofort(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsSofortDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsSofortDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsSwish(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsSwishDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsSwishDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsUsBankAccount(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsUsBankAccountDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsUsBankAccountDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsWechatPay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsWechatPayDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsWechatPayDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class CreateParamsZip(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.CreateParamsZipDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class CreateParamsZipDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class ListParams(TypedDict): application: NotRequired["Literal['']|str"] """ The Connect application to filter by. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): acss_debit: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsAcssDebit" ] """ Canadian pre-authorized debit payments, check this [page](https://stripe.com/docs/payments/acss-debit) for more details like country availability. """ active: NotRequired[bool] """ Whether the configuration can be used for new payments. """ affirm: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsAffirm" ] """ [Affirm](https://www.affirm.com/) gives your customers a way to split purchases over a series of payments. Depending on the purchase, they can pay with four interest-free payments (Split Pay) or pay over a longer term (Installments), which might include interest. Check this [page](https://stripe.com/docs/payments/affirm) for more details like country availability. """ afterpay_clearpay: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsAfterpayClearpay" ] """ Afterpay gives your customers a way to pay for purchases in installments, check this [page](https://stripe.com/docs/payments/afterpay-clearpay) for more details like country availability. Afterpay is particularly popular among businesses selling fashion, beauty, and sports products. """ alipay: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsAlipay" ] """ Alipay is a digital wallet in China that has more than a billion active users worldwide. Alipay users can pay on the web or on a mobile device using login credentials or their Alipay app. Alipay has a low dispute rate and reduces fraud by authenticating payments using the customer's login credentials. Check this [page](https://stripe.com/docs/payments/alipay) for more details. """ amazon_pay: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsAmazonPay" ] """ Amazon Pay is a wallet payment method that lets your customers check out the same way as on Amazon. """ apple_pay: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsApplePay" ] """ Stripe users can accept [Apple Pay](https://stripe.com/payments/apple-pay) in iOS applications in iOS 9 and later, and on the web in Safari starting with iOS 10 or macOS Sierra. There are no additional fees to process Apple Pay payments, and the [pricing](https://stripe.com/pricing) is the same as other card transactions. Check this [page](https://stripe.com/docs/apple-pay) for more details. """ apple_pay_later: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsApplePayLater" ] """ Apple Pay Later, a payment method for customers to buy now and pay later, gives your customers a way to split purchases into four installments across six weeks. """ au_becs_debit: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsAuBecsDebit" ] """ Stripe users in Australia can accept Bulk Electronic Clearing System (BECS) direct debit payments from customers with an Australian bank account. Check this [page](https://stripe.com/docs/payments/au-becs-debit) for more details. """ bacs_debit: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsBacsDebit" ] """ Stripe users in the UK can accept Bacs Direct Debit payments from customers with a UK bank account, check this [page](https://stripe.com/docs/payments/payment-methods/bacs-debit) for more details. """ bancontact: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsBancontact" ] """ Bancontact is the most popular online payment method in Belgium, with over 15 million cards in circulation. [Customers](https://stripe.com/docs/api/customers) use a Bancontact card or mobile app linked to a Belgian bank account to make online payments that are secure, guaranteed, and confirmed immediately. Check this [page](https://stripe.com/docs/payments/bancontact) for more details. """ blik: NotRequired["PaymentMethodConfigurationService.UpdateParamsBlik"] """ BLIK is a [single use](https://stripe.com/docs/payments/payment-methods#usage) payment method that requires customers to authenticate their payments. When customers want to pay online using BLIK, they request a six-digit code from their banking application and enter it into the payment collection form. Check this [page](https://stripe.com/docs/payments/blik) for more details. """ boleto: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsBoleto" ] """ Boleto is an official (regulated by the Central Bank of Brazil) payment method in Brazil. Check this [page](https://stripe.com/docs/payments/boleto) for more details. """ card: NotRequired["PaymentMethodConfigurationService.UpdateParamsCard"] """ Cards are a popular way for consumers and businesses to pay online or in person. Stripe supports global and local card networks. """ cartes_bancaires: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsCartesBancaires" ] """ Cartes Bancaires is France's local card network. More than 95% of these cards are co-branded with either Visa or Mastercard, meaning you can process these cards over either Cartes Bancaires or the Visa or Mastercard networks. Check this [page](https://stripe.com/docs/payments/cartes-bancaires) for more details. """ cashapp: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsCashapp" ] """ Cash App is a popular consumer app in the US that allows customers to bank, invest, send, and receive money using their digital wallet. Check this [page](https://stripe.com/docs/payments/cash-app-pay) for more details. """ customer_balance: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsCustomerBalance" ] """ Uses a customer's [cash balance](https://stripe.com/docs/payments/customer-balance) for the payment. The cash balance can be funded via a bank transfer. Check this [page](https://stripe.com/docs/payments/bank-transfers) for more details. """ eps: NotRequired["PaymentMethodConfigurationService.UpdateParamsEps"] """ EPS is an Austria-based payment method that allows customers to complete transactions online using their bank credentials. EPS is supported by all Austrian banks and is accepted by over 80% of Austrian online retailers. Check this [page](https://stripe.com/docs/payments/eps) for more details. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ fpx: NotRequired["PaymentMethodConfigurationService.UpdateParamsFpx"] """ Financial Process Exchange (FPX) is a Malaysia-based payment method that allows customers to complete transactions online using their bank credentials. Bank Negara Malaysia (BNM), the Central Bank of Malaysia, and eleven other major Malaysian financial institutions are members of the PayNet Group, which owns and operates FPX. It is one of the most popular online payment methods in Malaysia, with nearly 90 million transactions in 2018 according to BNM. Check this [page](https://stripe.com/docs/payments/fpx) for more details. """ giropay: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsGiropay" ] """ giropay is a German payment method based on online banking, introduced in 2006. It allows customers to complete transactions online using their online banking environment, with funds debited from their bank account. Depending on their bank, customers confirm payments on giropay using a second factor of authentication or a PIN. giropay accounts for 10% of online checkouts in Germany. Check this [page](https://stripe.com/docs/payments/giropay) for more details. """ google_pay: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsGooglePay" ] """ Google Pay allows customers to make payments in your app or website using any credit or debit card saved to their Google Account, including those from Google Play, YouTube, Chrome, or an Android device. Use the Google Pay API to request any credit or debit card stored in your customer's Google account. Check this [page](https://stripe.com/docs/google-pay) for more details. """ grabpay: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsGrabpay" ] """ GrabPay is a payment method developed by [Grab](https://www.grab.com/sg/consumer/finance/pay/). GrabPay is a digital wallet - customers maintain a balance in their wallets that they pay out with. Check this [page](https://stripe.com/docs/payments/grabpay) for more details. """ ideal: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsIdeal" ] """ iDEAL is a Netherlands-based payment method that allows customers to complete transactions online using their bank credentials. All major Dutch banks are members of Currence, the scheme that operates iDEAL, making it the most popular online payment method in the Netherlands with a share of online transactions close to 55%. Check this [page](https://stripe.com/docs/payments/ideal) for more details. """ jcb: NotRequired["PaymentMethodConfigurationService.UpdateParamsJcb"] """ JCB is a credit card company based in Japan. JCB is currently available in Japan to businesses approved by JCB, and available to all businesses in Australia, Canada, Hong Kong, Japan, New Zealand, Singapore, Switzerland, United Kingdom, United States, and all countries in the European Economic Area except Iceland. Check this [page](https://support.stripe.com/questions/accepting-japan-credit-bureau-%28jcb%29-payments) for more details. """ klarna: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsKlarna" ] """ Klarna gives customers a range of [payment options](https://stripe.com/docs/payments/klarna#payment-options) during checkout. Available payment options vary depending on the customer's billing address and the transaction amount. These payment options make it convenient for customers to purchase items in all price ranges. Check this [page](https://stripe.com/docs/payments/klarna) for more details. """ konbini: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsKonbini" ] """ Konbini allows customers in Japan to pay for bills and online purchases at convenience stores with cash. Check this [page](https://stripe.com/docs/payments/konbini) for more details. """ link: NotRequired["PaymentMethodConfigurationService.UpdateParamsLink"] """ [Link](https://stripe.com/docs/payments/link) is a payment method network. With Link, users save their payment details once, then reuse that information to pay with one click for any business on the network. """ mobilepay: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsMobilepay" ] """ MobilePay is a [single-use](https://stripe.com/docs/payments/payment-methods#usage) card wallet payment method used in Denmark and Finland. It allows customers to [authenticate and approve](https://stripe.com/docs/payments/payment-methods#customer-actions) payments using the MobilePay app. Check this [page](https://stripe.com/docs/payments/mobilepay) for more details. """ multibanco: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsMultibanco" ] """ Stripe users in Europe and the United States can accept Multibanco payments from customers in Portugal using [Sources](https://stripe.com/docs/sources)—a single integration path for creating payments using any supported method. """ name: NotRequired[str] """ Configuration name. """ oxxo: NotRequired["PaymentMethodConfigurationService.UpdateParamsOxxo"] """ OXXO is a Mexican chain of convenience stores with thousands of locations across Latin America and represents nearly 20% of online transactions in Mexico. OXXO allows customers to pay bills and online purchases in-store with cash. Check this [page](https://stripe.com/docs/payments/oxxo) for more details. """ p24: NotRequired["PaymentMethodConfigurationService.UpdateParamsP24"] """ Przelewy24 is a Poland-based payment method aggregator that allows customers to complete transactions online using bank transfers and other methods. Bank transfers account for 30% of online payments in Poland and Przelewy24 provides a way for customers to pay with over 165 banks. Check this [page](https://stripe.com/docs/payments/p24) for more details. """ paynow: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsPaynow" ] """ PayNow is a Singapore-based payment method that allows customers to make a payment using their preferred app from participating banks and participating non-bank financial institutions. Check this [page](https://stripe.com/docs/payments/paynow) for more details. """ paypal: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsPaypal" ] """ PayPal, a digital wallet popular with customers in Europe, allows your customers worldwide to pay using their PayPal account. Check this [page](https://stripe.com/docs/payments/paypal) for more details. """ promptpay: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsPromptpay" ] """ PromptPay is a Thailand-based payment method that allows customers to make a payment using their preferred app from participating banks. Check this [page](https://stripe.com/docs/payments/promptpay) for more details. """ revolut_pay: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsRevolutPay" ] """ Revolut Pay, developed by Revolut, a global finance app, is a digital wallet payment method. Revolut Pay uses the customer's stored balance or cards to fund the payment, and offers the option for non-Revolut customers to save their details after their first purchase. """ sepa_debit: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsSepaDebit" ] """ The [Single Euro Payments Area (SEPA)](https://en.wikipedia.org/wiki/Single_Euro_Payments_Area) is an initiative of the European Union to simplify payments within and across member countries. SEPA established and enforced banking standards to allow for the direct debiting of every EUR-denominated bank account within the SEPA region, check this [page](https://stripe.com/docs/payments/sepa-debit) for more details. """ sofort: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsSofort" ] """ Stripe users in Europe and the United States can use the [Payment Intents API](https://stripe.com/docs/payments/payment-intents)—a single integration path for creating payments using any supported method—to accept [Sofort](https://www.sofort.com/) payments from customers. Check this [page](https://stripe.com/docs/payments/sofort) for more details. """ swish: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsSwish" ] """ Swish is a [real-time](https://stripe.com/docs/payments/real-time) payment method popular in Sweden. It allows customers to [authenticate and approve](https://stripe.com/docs/payments/payment-methods#customer-actions) payments using the Swish mobile app and the Swedish BankID mobile app. Check this [page](https://stripe.com/docs/payments/swish) for more details. """ us_bank_account: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsUsBankAccount" ] """ Stripe users in the United States can accept ACH direct debit payments from customers with a US bank account using the Automated Clearing House (ACH) payments system operated by Nacha. Check this [page](https://stripe.com/docs/payments/ach-debit) for more details. """ wechat_pay: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsWechatPay" ] """ WeChat, owned by Tencent, is China's leading mobile app with over 1 billion monthly active users. Chinese consumers can use WeChat Pay to pay for goods and services inside of businesses' apps and websites. WeChat Pay users buy most frequently in gaming, e-commerce, travel, online education, and food/nutrition. Check this [page](https://stripe.com/docs/payments/wechat-pay) for more details. """ zip: NotRequired["PaymentMethodConfigurationService.UpdateParamsZip"] """ Zip gives your customers a way to split purchases over a series of payments. Check this [page](https://stripe.com/docs/payments/zip) for more details like country availability. """ class UpdateParamsAcssDebit(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsAcssDebitDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class UpdateParamsAcssDebitDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class UpdateParamsAffirm(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsAffirmDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class UpdateParamsAffirmDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class UpdateParamsAfterpayClearpay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsAfterpayClearpayDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class UpdateParamsAfterpayClearpayDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class UpdateParamsAlipay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsAlipayDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class UpdateParamsAlipayDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class UpdateParamsAmazonPay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsAmazonPayDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class UpdateParamsAmazonPayDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class UpdateParamsApplePay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsApplePayDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class UpdateParamsApplePayDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class UpdateParamsApplePayLater(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsApplePayLaterDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class UpdateParamsApplePayLaterDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class UpdateParamsAuBecsDebit(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsAuBecsDebitDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class UpdateParamsAuBecsDebitDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class UpdateParamsBacsDebit(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsBacsDebitDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class UpdateParamsBacsDebitDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class UpdateParamsBancontact(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsBancontactDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class UpdateParamsBancontactDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class UpdateParamsBlik(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsBlikDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class UpdateParamsBlikDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class UpdateParamsBoleto(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsBoletoDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class UpdateParamsBoletoDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class UpdateParamsCard(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsCardDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class UpdateParamsCardDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class UpdateParamsCartesBancaires(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsCartesBancairesDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class UpdateParamsCartesBancairesDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class UpdateParamsCashapp(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsCashappDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class UpdateParamsCashappDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class UpdateParamsCustomerBalance(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsCustomerBalanceDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class UpdateParamsCustomerBalanceDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class UpdateParamsEps(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsEpsDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class UpdateParamsEpsDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class UpdateParamsFpx(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsFpxDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class UpdateParamsFpxDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class UpdateParamsGiropay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsGiropayDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class UpdateParamsGiropayDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class UpdateParamsGooglePay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsGooglePayDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class UpdateParamsGooglePayDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class UpdateParamsGrabpay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsGrabpayDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class UpdateParamsGrabpayDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class UpdateParamsIdeal(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsIdealDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class UpdateParamsIdealDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class UpdateParamsJcb(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsJcbDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class UpdateParamsJcbDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class UpdateParamsKlarna(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsKlarnaDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class UpdateParamsKlarnaDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class UpdateParamsKonbini(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsKonbiniDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class UpdateParamsKonbiniDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class UpdateParamsLink(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsLinkDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class UpdateParamsLinkDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class UpdateParamsMobilepay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsMobilepayDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class UpdateParamsMobilepayDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class UpdateParamsMultibanco(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsMultibancoDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class UpdateParamsMultibancoDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class UpdateParamsOxxo(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsOxxoDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class UpdateParamsOxxoDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class UpdateParamsP24(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsP24DisplayPreference" ] """ Whether or not the payment method should be displayed. """ class UpdateParamsP24DisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class UpdateParamsPaynow(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsPaynowDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class UpdateParamsPaynowDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class UpdateParamsPaypal(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsPaypalDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class UpdateParamsPaypalDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class UpdateParamsPromptpay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsPromptpayDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class UpdateParamsPromptpayDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class UpdateParamsRevolutPay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsRevolutPayDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class UpdateParamsRevolutPayDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class UpdateParamsSepaDebit(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsSepaDebitDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class UpdateParamsSepaDebitDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class UpdateParamsSofort(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsSofortDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class UpdateParamsSofortDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class UpdateParamsSwish(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsSwishDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class UpdateParamsSwishDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class UpdateParamsUsBankAccount(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsUsBankAccountDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class UpdateParamsUsBankAccountDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class UpdateParamsWechatPay(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsWechatPayDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class UpdateParamsWechatPayDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ class UpdateParamsZip(TypedDict): display_preference: NotRequired[ "PaymentMethodConfigurationService.UpdateParamsZipDisplayPreference" ] """ Whether or not the payment method should be displayed. """ class UpdateParamsZipDisplayPreference(TypedDict): preference: NotRequired[Literal["none", "off", "on"]] """ The account's preference for whether or not to display this payment method. """ def list( self, params: "PaymentMethodConfigurationService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[PaymentMethodConfiguration]: """ List payment method configurations """ return cast( ListObject[PaymentMethodConfiguration], self._request( "get", "/v1/payment_method_configurations", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "PaymentMethodConfigurationService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[PaymentMethodConfiguration]: """ List payment method configurations """ return cast( ListObject[PaymentMethodConfiguration], await self._request_async( "get", "/v1/payment_method_configurations", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "PaymentMethodConfigurationService.CreateParams" = {}, options: RequestOptions = {}, ) -> PaymentMethodConfiguration: """ Creates a payment method configuration """ return cast( PaymentMethodConfiguration, self._request( "post", "/v1/payment_method_configurations", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "PaymentMethodConfigurationService.CreateParams" = {}, options: RequestOptions = {}, ) -> PaymentMethodConfiguration: """ Creates a payment method configuration """ return cast( PaymentMethodConfiguration, await self._request_async( "post", "/v1/payment_method_configurations", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, configuration: str, params: "PaymentMethodConfigurationService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> PaymentMethodConfiguration: """ Retrieve payment method configuration """ return cast( PaymentMethodConfiguration, self._request( "get", "/v1/payment_method_configurations/{configuration}".format( configuration=sanitize_id(configuration), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, configuration: str, params: "PaymentMethodConfigurationService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> PaymentMethodConfiguration: """ Retrieve payment method configuration """ return cast( PaymentMethodConfiguration, await self._request_async( "get", "/v1/payment_method_configurations/{configuration}".format( configuration=sanitize_id(configuration), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, configuration: str, params: "PaymentMethodConfigurationService.UpdateParams" = {}, options: RequestOptions = {}, ) -> PaymentMethodConfiguration: """ Update payment method configuration """ return cast( PaymentMethodConfiguration, self._request( "post", "/v1/payment_method_configurations/{configuration}".format( configuration=sanitize_id(configuration), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, configuration: str, params: "PaymentMethodConfigurationService.UpdateParams" = {}, options: RequestOptions = {}, ) -> PaymentMethodConfiguration: """ Update payment method configuration """ return cast( PaymentMethodConfiguration, await self._request_async( "post", "/v1/payment_method_configurations/{configuration}".format( configuration=sanitize_id(configuration), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_payment_method_domain.py0000644000175100001770000004575414637354563021126 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, List, Optional, cast, overload from typing_extensions import Literal, NotRequired, Unpack class PaymentMethodDomain( CreateableAPIResource["PaymentMethodDomain"], ListableAPIResource["PaymentMethodDomain"], UpdateableAPIResource["PaymentMethodDomain"], ): """ A payment method domain represents a web domain that you have registered with Stripe. Stripe Elements use registered payment method domains to control where certain payment methods are shown. Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration). """ OBJECT_NAME: ClassVar[Literal["payment_method_domain"]] = ( "payment_method_domain" ) class ApplePay(StripeObject): class StatusDetails(StripeObject): error_message: str """ The error message associated with the status of the payment method on the domain. """ status: Literal["active", "inactive"] """ The status of the payment method on the domain. """ status_details: Optional[StatusDetails] """ Contains additional details about the status of a payment method for a specific payment method domain. """ _inner_class_types = {"status_details": StatusDetails} class GooglePay(StripeObject): class StatusDetails(StripeObject): error_message: str """ The error message associated with the status of the payment method on the domain. """ status: Literal["active", "inactive"] """ The status of the payment method on the domain. """ status_details: Optional[StatusDetails] """ Contains additional details about the status of a payment method for a specific payment method domain. """ _inner_class_types = {"status_details": StatusDetails} class Link(StripeObject): class StatusDetails(StripeObject): error_message: str """ The error message associated with the status of the payment method on the domain. """ status: Literal["active", "inactive"] """ The status of the payment method on the domain. """ status_details: Optional[StatusDetails] """ Contains additional details about the status of a payment method for a specific payment method domain. """ _inner_class_types = {"status_details": StatusDetails} class Paypal(StripeObject): class StatusDetails(StripeObject): error_message: str """ The error message associated with the status of the payment method on the domain. """ status: Literal["active", "inactive"] """ The status of the payment method on the domain. """ status_details: Optional[StatusDetails] """ Contains additional details about the status of a payment method for a specific payment method domain. """ _inner_class_types = {"status_details": StatusDetails} class CreateParams(RequestOptions): domain_name: str """ The domain name that this payment method domain object represents. """ enabled: NotRequired[bool] """ Whether this payment method domain is enabled. If the domain is not enabled, payment methods that require a payment method domain will not appear in Elements. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ListParams(RequestOptions): domain_name: NotRequired[str] """ The domain name that this payment method domain object represents. """ enabled: NotRequired[bool] """ Whether this payment method domain is enabled. If the domain is not enabled, payment methods will not appear in Elements """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ModifyParams(RequestOptions): enabled: NotRequired[bool] """ Whether this payment method domain is enabled. If the domain is not enabled, payment methods that require a payment method domain will not appear in Elements. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ValidateParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ apple_pay: ApplePay """ Indicates the status of a specific payment method on a payment method domain. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ domain_name: str """ The domain name that this payment method domain object represents. """ enabled: bool """ Whether this payment method domain is enabled. If the domain is not enabled, payment methods that require a payment method domain will not appear in Elements. """ google_pay: GooglePay """ Indicates the status of a specific payment method on a payment method domain. """ id: str """ Unique identifier for the object. """ link: Link """ Indicates the status of a specific payment method on a payment method domain. """ 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["payment_method_domain"] """ String representing the object's type. Objects of the same type share the same value. """ paypal: Paypal """ Indicates the status of a specific payment method on a payment method domain. """ @classmethod def create( cls, **params: Unpack["PaymentMethodDomain.CreateParams"] ) -> "PaymentMethodDomain": """ Creates a payment method domain. """ return cast( "PaymentMethodDomain", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["PaymentMethodDomain.CreateParams"] ) -> "PaymentMethodDomain": """ Creates a payment method domain. """ return cast( "PaymentMethodDomain", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def list( cls, **params: Unpack["PaymentMethodDomain.ListParams"] ) -> ListObject["PaymentMethodDomain"]: """ Lists the details of existing payment method domains. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["PaymentMethodDomain.ListParams"] ) -> ListObject["PaymentMethodDomain"]: """ Lists the details of existing payment method domains. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def modify( cls, id: str, **params: Unpack["PaymentMethodDomain.ModifyParams"] ) -> "PaymentMethodDomain": """ Updates an existing payment method domain. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "PaymentMethodDomain", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["PaymentMethodDomain.ModifyParams"] ) -> "PaymentMethodDomain": """ Updates an existing payment method domain. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "PaymentMethodDomain", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["PaymentMethodDomain.RetrieveParams"] ) -> "PaymentMethodDomain": """ Retrieves the details of an existing payment method domain. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["PaymentMethodDomain.RetrieveParams"] ) -> "PaymentMethodDomain": """ Retrieves the details of an existing payment method domain. """ instance = cls(id, **params) await instance.refresh_async() return instance @classmethod def _cls_validate( cls, payment_method_domain: str, **params: Unpack["PaymentMethodDomain.ValidateParams"], ) -> "PaymentMethodDomain": """ Some payment methods such as Apple Pay require additional steps to verify a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. The payment method doesn't appear in Elements for this domain until it is active. To activate a payment method on an existing payment method domain, complete the required validation steps specific to the payment method, and then validate the payment method domain with this endpoint. Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration). """ return cast( "PaymentMethodDomain", cls._static_request( "post", "/v1/payment_method_domains/{payment_method_domain}/validate".format( payment_method_domain=sanitize_id(payment_method_domain) ), params=params, ), ) @overload @staticmethod def validate( payment_method_domain: str, **params: Unpack["PaymentMethodDomain.ValidateParams"], ) -> "PaymentMethodDomain": """ Some payment methods such as Apple Pay require additional steps to verify a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. The payment method doesn't appear in Elements for this domain until it is active. To activate a payment method on an existing payment method domain, complete the required validation steps specific to the payment method, and then validate the payment method domain with this endpoint. Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration). """ ... @overload def validate( self, **params: Unpack["PaymentMethodDomain.ValidateParams"] ) -> "PaymentMethodDomain": """ Some payment methods such as Apple Pay require additional steps to verify a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. The payment method doesn't appear in Elements for this domain until it is active. To activate a payment method on an existing payment method domain, complete the required validation steps specific to the payment method, and then validate the payment method domain with this endpoint. Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration). """ ... @class_method_variant("_cls_validate") def validate( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["PaymentMethodDomain.ValidateParams"] ) -> "PaymentMethodDomain": """ Some payment methods such as Apple Pay require additional steps to verify a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. The payment method doesn't appear in Elements for this domain until it is active. To activate a payment method on an existing payment method domain, complete the required validation steps specific to the payment method, and then validate the payment method domain with this endpoint. Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration). """ return cast( "PaymentMethodDomain", self._request( "post", "/v1/payment_method_domains/{payment_method_domain}/validate".format( payment_method_domain=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_validate_async( cls, payment_method_domain: str, **params: Unpack["PaymentMethodDomain.ValidateParams"], ) -> "PaymentMethodDomain": """ Some payment methods such as Apple Pay require additional steps to verify a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. The payment method doesn't appear in Elements for this domain until it is active. To activate a payment method on an existing payment method domain, complete the required validation steps specific to the payment method, and then validate the payment method domain with this endpoint. Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration). """ return cast( "PaymentMethodDomain", await cls._static_request_async( "post", "/v1/payment_method_domains/{payment_method_domain}/validate".format( payment_method_domain=sanitize_id(payment_method_domain) ), params=params, ), ) @overload @staticmethod async def validate_async( payment_method_domain: str, **params: Unpack["PaymentMethodDomain.ValidateParams"], ) -> "PaymentMethodDomain": """ Some payment methods such as Apple Pay require additional steps to verify a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. The payment method doesn't appear in Elements for this domain until it is active. To activate a payment method on an existing payment method domain, complete the required validation steps specific to the payment method, and then validate the payment method domain with this endpoint. Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration). """ ... @overload async def validate_async( self, **params: Unpack["PaymentMethodDomain.ValidateParams"] ) -> "PaymentMethodDomain": """ Some payment methods such as Apple Pay require additional steps to verify a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. The payment method doesn't appear in Elements for this domain until it is active. To activate a payment method on an existing payment method domain, complete the required validation steps specific to the payment method, and then validate the payment method domain with this endpoint. Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration). """ ... @class_method_variant("_cls_validate_async") async def validate_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["PaymentMethodDomain.ValidateParams"] ) -> "PaymentMethodDomain": """ Some payment methods such as Apple Pay require additional steps to verify a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. The payment method doesn't appear in Elements for this domain until it is active. To activate a payment method on an existing payment method domain, complete the required validation steps specific to the payment method, and then validate the payment method domain with this endpoint. Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration). """ return cast( "PaymentMethodDomain", await self._request_async( "post", "/v1/payment_method_domains/{payment_method_domain}/validate".format( payment_method_domain=sanitize_id(self.get("id")) ), params=params, ), ) _inner_class_types = { "apple_pay": ApplePay, "google_pay": GooglePay, "link": Link, "paypal": Paypal, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_payment_method_domain_service.py0000644000175100001770000002520514637354563022633 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._payment_method_domain import PaymentMethodDomain from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict class PaymentMethodDomainService(StripeService): class CreateParams(TypedDict): domain_name: str """ The domain name that this payment method domain object represents. """ enabled: NotRequired[bool] """ Whether this payment method domain is enabled. If the domain is not enabled, payment methods that require a payment method domain will not appear in Elements. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ListParams(TypedDict): domain_name: NotRequired[str] """ The domain name that this payment method domain object represents. """ enabled: NotRequired[bool] """ Whether this payment method domain is enabled. If the domain is not enabled, payment methods will not appear in Elements """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): enabled: NotRequired[bool] """ Whether this payment method domain is enabled. If the domain is not enabled, payment methods that require a payment method domain will not appear in Elements. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ValidateParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def list( self, params: "PaymentMethodDomainService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[PaymentMethodDomain]: """ Lists the details of existing payment method domains. """ return cast( ListObject[PaymentMethodDomain], self._request( "get", "/v1/payment_method_domains", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "PaymentMethodDomainService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[PaymentMethodDomain]: """ Lists the details of existing payment method domains. """ return cast( ListObject[PaymentMethodDomain], await self._request_async( "get", "/v1/payment_method_domains", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "PaymentMethodDomainService.CreateParams", options: RequestOptions = {}, ) -> PaymentMethodDomain: """ Creates a payment method domain. """ return cast( PaymentMethodDomain, self._request( "post", "/v1/payment_method_domains", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "PaymentMethodDomainService.CreateParams", options: RequestOptions = {}, ) -> PaymentMethodDomain: """ Creates a payment method domain. """ return cast( PaymentMethodDomain, await self._request_async( "post", "/v1/payment_method_domains", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, payment_method_domain: str, params: "PaymentMethodDomainService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> PaymentMethodDomain: """ Retrieves the details of an existing payment method domain. """ return cast( PaymentMethodDomain, self._request( "get", "/v1/payment_method_domains/{payment_method_domain}".format( payment_method_domain=sanitize_id(payment_method_domain), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, payment_method_domain: str, params: "PaymentMethodDomainService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> PaymentMethodDomain: """ Retrieves the details of an existing payment method domain. """ return cast( PaymentMethodDomain, await self._request_async( "get", "/v1/payment_method_domains/{payment_method_domain}".format( payment_method_domain=sanitize_id(payment_method_domain), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, payment_method_domain: str, params: "PaymentMethodDomainService.UpdateParams" = {}, options: RequestOptions = {}, ) -> PaymentMethodDomain: """ Updates an existing payment method domain. """ return cast( PaymentMethodDomain, self._request( "post", "/v1/payment_method_domains/{payment_method_domain}".format( payment_method_domain=sanitize_id(payment_method_domain), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, payment_method_domain: str, params: "PaymentMethodDomainService.UpdateParams" = {}, options: RequestOptions = {}, ) -> PaymentMethodDomain: """ Updates an existing payment method domain. """ return cast( PaymentMethodDomain, await self._request_async( "post", "/v1/payment_method_domains/{payment_method_domain}".format( payment_method_domain=sanitize_id(payment_method_domain), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def validate( self, payment_method_domain: str, params: "PaymentMethodDomainService.ValidateParams" = {}, options: RequestOptions = {}, ) -> PaymentMethodDomain: """ Some payment methods such as Apple Pay require additional steps to verify a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. The payment method doesn't appear in Elements for this domain until it is active. To activate a payment method on an existing payment method domain, complete the required validation steps specific to the payment method, and then validate the payment method domain with this endpoint. Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration). """ return cast( PaymentMethodDomain, self._request( "post", "/v1/payment_method_domains/{payment_method_domain}/validate".format( payment_method_domain=sanitize_id(payment_method_domain), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def validate_async( self, payment_method_domain: str, params: "PaymentMethodDomainService.ValidateParams" = {}, options: RequestOptions = {}, ) -> PaymentMethodDomain: """ Some payment methods such as Apple Pay require additional steps to verify a domain. If the requirements weren't satisfied when the domain was created, the payment method will be inactive on the domain. The payment method doesn't appear in Elements for this domain until it is active. To activate a payment method on an existing payment method domain, complete the required validation steps specific to the payment method, and then validate the payment method domain with this endpoint. Related guides: [Payment method domains](https://stripe.com/docs/payments/payment-methods/pmd-registration). """ return cast( PaymentMethodDomain, await self._request_async( "post", "/v1/payment_method_domains/{payment_method_domain}/validate".format( payment_method_domain=sanitize_id(payment_method_domain), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_payment_method_service.py0000644000175100001770000012214014637354563021300 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._payment_method import PaymentMethod from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class PaymentMethodService(StripeService): class AttachParams(TypedDict): customer: str """ The ID of the customer to which to attach the PaymentMethod. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CreateParams(TypedDict): acss_debit: NotRequired["PaymentMethodService.CreateParamsAcssDebit"] """ If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. """ affirm: NotRequired["PaymentMethodService.CreateParamsAffirm"] """ If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. """ afterpay_clearpay: NotRequired[ "PaymentMethodService.CreateParamsAfterpayClearpay" ] """ If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. """ alipay: NotRequired["PaymentMethodService.CreateParamsAlipay"] """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ allow_redisplay: NotRequired[ Literal["always", "limited", "unspecified"] ] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ amazon_pay: NotRequired["PaymentMethodService.CreateParamsAmazonPay"] """ If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. """ au_becs_debit: NotRequired[ "PaymentMethodService.CreateParamsAuBecsDebit" ] """ If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. """ bacs_debit: NotRequired["PaymentMethodService.CreateParamsBacsDebit"] """ If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. """ bancontact: NotRequired["PaymentMethodService.CreateParamsBancontact"] """ If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. """ billing_details: NotRequired[ "PaymentMethodService.CreateParamsBillingDetails" ] """ Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. """ blik: NotRequired["PaymentMethodService.CreateParamsBlik"] """ If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. """ boleto: NotRequired["PaymentMethodService.CreateParamsBoleto"] """ If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. """ card: NotRequired["PaymentMethodService.CreateParamsCard"] """ If this is a `card` PaymentMethod, this hash contains the user's card details. For backwards compatibility, you can alternatively provide a Stripe token (e.g., for Apple Pay, Amex Express Checkout, or legacy Checkout) into the card hash with format `card: {token: "tok_visa"}`. When providing a card number, you must meet the requirements for [PCI compliance](https://stripe.com/docs/security#validating-pci-compliance). We strongly recommend using Stripe.js instead of interacting with this API directly. """ cashapp: NotRequired["PaymentMethodService.CreateParamsCashapp"] """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ customer: NotRequired[str] """ The `Customer` to whom the original PaymentMethod is attached. """ customer_balance: NotRequired[ "PaymentMethodService.CreateParamsCustomerBalance" ] """ If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. """ eps: NotRequired["PaymentMethodService.CreateParamsEps"] """ If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ fpx: NotRequired["PaymentMethodService.CreateParamsFpx"] """ If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. """ giropay: NotRequired["PaymentMethodService.CreateParamsGiropay"] """ If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. """ grabpay: NotRequired["PaymentMethodService.CreateParamsGrabpay"] """ If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ ideal: NotRequired["PaymentMethodService.CreateParamsIdeal"] """ If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. """ interac_present: NotRequired[ "PaymentMethodService.CreateParamsInteracPresent" ] """ If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. """ klarna: NotRequired["PaymentMethodService.CreateParamsKlarna"] """ If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. """ konbini: NotRequired["PaymentMethodService.CreateParamsKonbini"] """ If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. """ link: NotRequired["PaymentMethodService.CreateParamsLink"] """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ mobilepay: NotRequired["PaymentMethodService.CreateParamsMobilepay"] """ If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. """ multibanco: NotRequired["PaymentMethodService.CreateParamsMultibanco"] """ If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. """ oxxo: NotRequired["PaymentMethodService.CreateParamsOxxo"] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. """ p24: NotRequired["PaymentMethodService.CreateParamsP24"] """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ payment_method: NotRequired[str] """ The PaymentMethod to share. """ paynow: NotRequired["PaymentMethodService.CreateParamsPaynow"] """ If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. """ paypal: NotRequired["PaymentMethodService.CreateParamsPaypal"] """ If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. """ pix: NotRequired["PaymentMethodService.CreateParamsPix"] """ If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. """ promptpay: NotRequired["PaymentMethodService.CreateParamsPromptpay"] """ If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. """ radar_options: NotRequired[ "PaymentMethodService.CreateParamsRadarOptions" ] """ Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. """ revolut_pay: NotRequired["PaymentMethodService.CreateParamsRevolutPay"] """ If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. """ sepa_debit: NotRequired["PaymentMethodService.CreateParamsSepaDebit"] """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ sofort: NotRequired["PaymentMethodService.CreateParamsSofort"] """ If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. """ swish: NotRequired["PaymentMethodService.CreateParamsSwish"] """ If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. """ twint: NotRequired["PaymentMethodService.CreateParamsTwint"] """ If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. """ type: NotRequired[ Literal[ "acss_debit", "affirm", "afterpay_clearpay", "alipay", "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", "blik", "boleto", "card", "cashapp", "customer_balance", "eps", "fpx", "giropay", "grabpay", "ideal", "klarna", "konbini", "link", "mobilepay", "multibanco", "oxxo", "p24", "paynow", "paypal", "pix", "promptpay", "revolut_pay", "sepa_debit", "sofort", "swish", "twint", "us_bank_account", "wechat_pay", "zip", ] ] """ The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. """ us_bank_account: NotRequired[ "PaymentMethodService.CreateParamsUsBankAccount" ] """ If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. """ wechat_pay: NotRequired["PaymentMethodService.CreateParamsWechatPay"] """ If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. """ zip: NotRequired["PaymentMethodService.CreateParamsZip"] """ If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. """ class CreateParamsAcssDebit(TypedDict): account_number: str """ Customer's bank account number. """ institution_number: str """ Institution number of the customer's bank. """ transit_number: str """ Transit number of the customer's bank. """ class CreateParamsAffirm(TypedDict): pass class CreateParamsAfterpayClearpay(TypedDict): pass class CreateParamsAlipay(TypedDict): pass class CreateParamsAmazonPay(TypedDict): pass class CreateParamsAuBecsDebit(TypedDict): account_number: str """ The account number for the bank account. """ bsb_number: str """ Bank-State-Branch number of the bank account. """ class CreateParamsBacsDebit(TypedDict): account_number: NotRequired[str] """ Account number of the bank account that the funds will be debited from. """ sort_code: NotRequired[str] """ Sort code of the bank account. (e.g., `10-20-30`) """ class CreateParamsBancontact(TypedDict): pass class CreateParamsBillingDetails(TypedDict): address: NotRequired[ "Literal['']|PaymentMethodService.CreateParamsBillingDetailsAddress" ] """ Billing address. """ email: NotRequired["Literal['']|str"] """ Email address. """ name: NotRequired["Literal['']|str"] """ Full name. """ phone: NotRequired["Literal['']|str"] """ Billing phone number (including extension). """ class CreateParamsBillingDetailsAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsBlik(TypedDict): pass class CreateParamsBoleto(TypedDict): tax_id: str """ The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) """ class CreateParamsCard(TypedDict): cvc: NotRequired[str] """ The card's CVC. It is highly recommended to always include this value. """ exp_month: NotRequired[int] """ Two-digit number representing the card's expiration month. """ exp_year: NotRequired[int] """ Four-digit number representing the card's expiration year. """ networks: NotRequired["PaymentMethodService.CreateParamsCardNetworks"] """ Contains information about card networks used to process the payment. """ number: NotRequired[str] """ The card number, as a string without any separators. """ token: NotRequired[str] """ For backwards compatibility, you can alternatively provide a Stripe token (e.g., for Apple Pay, Amex Express Checkout, or legacy Checkout) into the card hash with format card: {token: "tok_visa"}. """ class CreateParamsCardNetworks(TypedDict): preferred: NotRequired[ Literal["cartes_bancaires", "mastercard", "visa"] ] """ The customer's preferred card network for co-branded cards. Supports `cartes_bancaires`, `mastercard`, or `visa`. Selection of a network that does not apply to the card will be stored as `invalid_preference` on the card. """ class CreateParamsCashapp(TypedDict): pass class CreateParamsCustomerBalance(TypedDict): pass class CreateParamsEps(TypedDict): bank: NotRequired[ Literal[ "arzte_und_apotheker_bank", "austrian_anadi_bank_ag", "bank_austria", "bankhaus_carl_spangler", "bankhaus_schelhammer_und_schattera_ag", "bawag_psk_ag", "bks_bank_ag", "brull_kallmus_bank_ag", "btv_vier_lander_bank", "capital_bank_grawe_gruppe_ag", "deutsche_bank_ag", "dolomitenbank", "easybank_ag", "erste_bank_und_sparkassen", "hypo_alpeadriabank_international_ag", "hypo_bank_burgenland_aktiengesellschaft", "hypo_noe_lb_fur_niederosterreich_u_wien", "hypo_oberosterreich_salzburg_steiermark", "hypo_tirol_bank_ag", "hypo_vorarlberg_bank_ag", "marchfelder_bank", "oberbank_ag", "raiffeisen_bankengruppe_osterreich", "schoellerbank_ag", "sparda_bank_wien", "volksbank_gruppe", "volkskreditbank_ag", "vr_bank_braunau", ] ] """ The customer's bank. """ class CreateParamsFpx(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type for FPX transaction """ bank: Literal[ "affin_bank", "agrobank", "alliance_bank", "ambank", "bank_islam", "bank_muamalat", "bank_of_china", "bank_rakyat", "bsn", "cimb", "deutsche_bank", "hong_leong_bank", "hsbc", "kfh", "maybank2e", "maybank2u", "ocbc", "pb_enterprise", "public_bank", "rhb", "standard_chartered", "uob", ] """ The customer's bank. """ class CreateParamsGiropay(TypedDict): pass class CreateParamsGrabpay(TypedDict): pass class CreateParamsIdeal(TypedDict): bank: NotRequired[ Literal[ "abn_amro", "asn_bank", "bunq", "handelsbanken", "ing", "knab", "moneyou", "n26", "nn", "rabobank", "regiobank", "revolut", "sns_bank", "triodos_bank", "van_lanschot", "yoursafe", ] ] """ The customer's bank. """ class CreateParamsInteracPresent(TypedDict): pass class CreateParamsKlarna(TypedDict): dob: NotRequired["PaymentMethodService.CreateParamsKlarnaDob"] """ Customer's date of birth """ class CreateParamsKlarnaDob(TypedDict): day: int """ The day of birth, between 1 and 31. """ month: int """ The month of birth, between 1 and 12. """ year: int """ The four-digit year of birth. """ class CreateParamsKonbini(TypedDict): pass class CreateParamsLink(TypedDict): pass class CreateParamsMobilepay(TypedDict): pass class CreateParamsMultibanco(TypedDict): pass class CreateParamsOxxo(TypedDict): pass class CreateParamsP24(TypedDict): bank: NotRequired[ Literal[ "alior_bank", "bank_millennium", "bank_nowy_bfg_sa", "bank_pekao_sa", "banki_spbdzielcze", "blik", "bnp_paribas", "boz", "citi_handlowy", "credit_agricole", "envelobank", "etransfer_pocztowy24", "getin_bank", "ideabank", "ing", "inteligo", "mbank_mtransfer", "nest_przelew", "noble_pay", "pbac_z_ipko", "plus_bank", "santander_przelew24", "tmobile_usbugi_bankowe", "toyota_bank", "velobank", "volkswagen_bank", ] ] """ The customer's bank. """ class CreateParamsPaynow(TypedDict): pass class CreateParamsPaypal(TypedDict): pass class CreateParamsPix(TypedDict): pass class CreateParamsPromptpay(TypedDict): pass class CreateParamsRadarOptions(TypedDict): session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ class CreateParamsRevolutPay(TypedDict): pass class CreateParamsSepaDebit(TypedDict): iban: str """ IBAN of the bank account. """ class CreateParamsSofort(TypedDict): country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] """ Two-letter ISO code representing the country the bank account is located in. """ class CreateParamsSwish(TypedDict): pass class CreateParamsTwint(TypedDict): pass class CreateParamsUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type: individual or company. """ account_number: NotRequired[str] """ Account number of the bank account. """ account_type: NotRequired[Literal["checking", "savings"]] """ Account type: checkings or savings. Defaults to checking if omitted. """ financial_connections_account: NotRequired[str] """ The ID of a Financial Connections Account to use as a payment method. """ routing_number: NotRequired[str] """ Routing number of the bank account. """ class CreateParamsWechatPay(TypedDict): pass class CreateParamsZip(TypedDict): pass class DetachParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ListParams(TypedDict): customer: NotRequired[str] """ The ID of the customer whose PaymentMethods will be retrieved. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ type: NotRequired[ Literal[ "acss_debit", "affirm", "afterpay_clearpay", "alipay", "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", "blik", "boleto", "card", "cashapp", "customer_balance", "eps", "fpx", "giropay", "grabpay", "ideal", "klarna", "konbini", "link", "mobilepay", "multibanco", "oxxo", "p24", "paynow", "paypal", "pix", "promptpay", "revolut_pay", "sepa_debit", "sofort", "swish", "twint", "us_bank_account", "wechat_pay", "zip", ] ] """ An optional filter on the list, based on the object `type` field. Without the filter, the list includes all current and future payment method types. If your integration expects only one type of payment method in the response, make sure to provide a type value in the request. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): allow_redisplay: NotRequired[ Literal["always", "limited", "unspecified"] ] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ billing_details: NotRequired[ "PaymentMethodService.UpdateParamsBillingDetails" ] """ Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. """ card: NotRequired["PaymentMethodService.UpdateParamsCard"] """ If this is a `card` PaymentMethod, this hash contains the user's card details. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ link: NotRequired["PaymentMethodService.UpdateParamsLink"] """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ us_bank_account: NotRequired[ "PaymentMethodService.UpdateParamsUsBankAccount" ] """ If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. """ class UpdateParamsBillingDetails(TypedDict): address: NotRequired[ "Literal['']|PaymentMethodService.UpdateParamsBillingDetailsAddress" ] """ Billing address. """ email: NotRequired["Literal['']|str"] """ Email address. """ name: NotRequired["Literal['']|str"] """ Full name. """ phone: NotRequired["Literal['']|str"] """ Billing phone number (including extension). """ class UpdateParamsBillingDetailsAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class UpdateParamsCard(TypedDict): exp_month: NotRequired[int] """ Two-digit number representing the card's expiration month. """ exp_year: NotRequired[int] """ Four-digit number representing the card's expiration year. """ networks: NotRequired["PaymentMethodService.UpdateParamsCardNetworks"] """ Contains information about card networks used to process the payment. """ class UpdateParamsCardNetworks(TypedDict): preferred: NotRequired[ "Literal['']|Literal['cartes_bancaires', 'mastercard', 'visa']" ] """ The customer's preferred card network for co-branded cards. Supports `cartes_bancaires`, `mastercard`, or `visa`. Selection of a network that does not apply to the card will be stored as `invalid_preference` on the card. """ class UpdateParamsLink(TypedDict): pass class UpdateParamsUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ Bank account holder type. """ account_type: NotRequired[Literal["checking", "savings"]] """ Bank account type. """ def list( self, params: "PaymentMethodService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[PaymentMethod]: """ Returns a list of PaymentMethods for Treasury flows. If you want to list the PaymentMethods attached to a Customer for payments, you should use the [List a Customer's PaymentMethods](https://stripe.com/docs/api/payment_methods/customer_list) API instead. """ return cast( ListObject[PaymentMethod], self._request( "get", "/v1/payment_methods", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "PaymentMethodService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[PaymentMethod]: """ Returns a list of PaymentMethods for Treasury flows. If you want to list the PaymentMethods attached to a Customer for payments, you should use the [List a Customer's PaymentMethods](https://stripe.com/docs/api/payment_methods/customer_list) API instead. """ return cast( ListObject[PaymentMethod], await self._request_async( "get", "/v1/payment_methods", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "PaymentMethodService.CreateParams" = {}, options: RequestOptions = {}, ) -> PaymentMethod: """ Creates a PaymentMethod object. Read the [Stripe.js reference](https://stripe.com/docs/stripe-js/reference#stripe-create-payment-method) to learn how to create PaymentMethods via Stripe.js. Instead of creating a PaymentMethod directly, we recommend using the [PaymentIntents API to accept a payment immediately or the SetupIntent](https://stripe.com/docs/payments/accept-a-payment) API to collect payment method details ahead of a future payment. """ return cast( PaymentMethod, self._request( "post", "/v1/payment_methods", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "PaymentMethodService.CreateParams" = {}, options: RequestOptions = {}, ) -> PaymentMethod: """ Creates a PaymentMethod object. Read the [Stripe.js reference](https://stripe.com/docs/stripe-js/reference#stripe-create-payment-method) to learn how to create PaymentMethods via Stripe.js. Instead of creating a PaymentMethod directly, we recommend using the [PaymentIntents API to accept a payment immediately or the SetupIntent](https://stripe.com/docs/payments/accept-a-payment) API to collect payment method details ahead of a future payment. """ return cast( PaymentMethod, await self._request_async( "post", "/v1/payment_methods", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, payment_method: str, params: "PaymentMethodService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> PaymentMethod: """ Retrieves a PaymentMethod object attached to the StripeAccount. To retrieve a payment method attached to a Customer, you should use [Retrieve a Customer's PaymentMethods](https://stripe.com/docs/api/payment_methods/customer) """ return cast( PaymentMethod, self._request( "get", "/v1/payment_methods/{payment_method}".format( payment_method=sanitize_id(payment_method), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, payment_method: str, params: "PaymentMethodService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> PaymentMethod: """ Retrieves a PaymentMethod object attached to the StripeAccount. To retrieve a payment method attached to a Customer, you should use [Retrieve a Customer's PaymentMethods](https://stripe.com/docs/api/payment_methods/customer) """ return cast( PaymentMethod, await self._request_async( "get", "/v1/payment_methods/{payment_method}".format( payment_method=sanitize_id(payment_method), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, payment_method: str, params: "PaymentMethodService.UpdateParams" = {}, options: RequestOptions = {}, ) -> PaymentMethod: """ Updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated. """ return cast( PaymentMethod, self._request( "post", "/v1/payment_methods/{payment_method}".format( payment_method=sanitize_id(payment_method), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, payment_method: str, params: "PaymentMethodService.UpdateParams" = {}, options: RequestOptions = {}, ) -> PaymentMethod: """ Updates a PaymentMethod object. A PaymentMethod must be attached a customer to be updated. """ return cast( PaymentMethod, await self._request_async( "post", "/v1/payment_methods/{payment_method}".format( payment_method=sanitize_id(payment_method), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def attach( self, payment_method: str, params: "PaymentMethodService.AttachParams", options: RequestOptions = {}, ) -> PaymentMethod: """ Attaches a PaymentMethod object to a Customer. To attach a new PaymentMethod to a customer for future payments, we recommend you use a [SetupIntent](https://stripe.com/docs/api/setup_intents) or a PaymentIntent with [setup_future_usage](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage). These approaches will perform any necessary steps to set up the PaymentMethod for future payments. Using the /v1/payment_methods/:id/attach endpoint without first using a SetupIntent or PaymentIntent with setup_future_usage does not optimize the PaymentMethod for future use, which makes later declines and payment friction more likely. See [Optimizing cards for future payments](https://stripe.com/docs/payments/payment-intents#future-usage) for more information about setting up future payments. To use this PaymentMethod as the default for invoice or subscription payments, set [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method), on the Customer to the PaymentMethod's ID. """ return cast( PaymentMethod, self._request( "post", "/v1/payment_methods/{payment_method}/attach".format( payment_method=sanitize_id(payment_method), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def attach_async( self, payment_method: str, params: "PaymentMethodService.AttachParams", options: RequestOptions = {}, ) -> PaymentMethod: """ Attaches a PaymentMethod object to a Customer. To attach a new PaymentMethod to a customer for future payments, we recommend you use a [SetupIntent](https://stripe.com/docs/api/setup_intents) or a PaymentIntent with [setup_future_usage](https://stripe.com/docs/api/payment_intents/create#create_payment_intent-setup_future_usage). These approaches will perform any necessary steps to set up the PaymentMethod for future payments. Using the /v1/payment_methods/:id/attach endpoint without first using a SetupIntent or PaymentIntent with setup_future_usage does not optimize the PaymentMethod for future use, which makes later declines and payment friction more likely. See [Optimizing cards for future payments](https://stripe.com/docs/payments/payment-intents#future-usage) for more information about setting up future payments. To use this PaymentMethod as the default for invoice or subscription payments, set [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method), on the Customer to the PaymentMethod's ID. """ return cast( PaymentMethod, await self._request_async( "post", "/v1/payment_methods/{payment_method}/attach".format( payment_method=sanitize_id(payment_method), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def detach( self, payment_method: str, params: "PaymentMethodService.DetachParams" = {}, options: RequestOptions = {}, ) -> PaymentMethod: """ Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer. """ return cast( PaymentMethod, self._request( "post", "/v1/payment_methods/{payment_method}/detach".format( payment_method=sanitize_id(payment_method), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def detach_async( self, payment_method: str, params: "PaymentMethodService.DetachParams" = {}, options: RequestOptions = {}, ) -> PaymentMethod: """ Detaches a PaymentMethod object from a Customer. After a PaymentMethod is detached, it can no longer be used for a payment or re-attached to a Customer. """ return cast( PaymentMethod, await self._request_async( "post", "/v1/payment_methods/{payment_method}/detach".format( payment_method=sanitize_id(payment_method), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_payout.py0000644000175100001770000006710514637354563016075 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, Union, cast, overload from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._application_fee import ApplicationFee from stripe._balance_transaction import BalanceTransaction from stripe._bank_account import BankAccount from stripe._card import Card class Payout( CreateableAPIResource["Payout"], ListableAPIResource["Payout"], UpdateableAPIResource["Payout"], ): """ A `Payout` object is created when you receive funds from Stripe, or when you initiate a payout to either a bank account or debit card of a [connected Stripe account](https://stripe.com/docs/connect/bank-debit-card-payouts). You can retrieve individual payouts, and list all payouts. Payouts are made on [varying schedules](https://stripe.com/docs/connect/manage-payout-schedule), depending on your country and industry. Related guide: [Receiving payouts](https://stripe.com/docs/payouts) """ OBJECT_NAME: ClassVar[Literal["payout"]] = "payout" class CancelParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CreateParams(RequestOptions): amount: int """ A positive integer in cents representing how much to payout. """ 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 string attached to the object. Often useful for displaying to users. """ destination: NotRequired[str] """ The ID of a bank account or a card to send the payout to. If you don't provide a destination, we use the default external account for the specified currency. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ method: NotRequired[Literal["instant", "standard"]] """ The method used to send this payout, which is `standard` or `instant`. We support `instant` for payouts to debit cards and bank accounts in certain countries. Learn more about [bank support for Instant Payouts](https://stripe.com/docs/payouts/instant-payouts-banks). """ source_type: NotRequired[Literal["bank_account", "card", "fpx"]] """ The balance type of your Stripe balance to draw this payout from. Balances for different payment sources are kept separately. You can find the amounts with the Balances API. One of `bank_account`, `card`, or `fpx`. """ statement_descriptor: NotRequired[str] """ A string that displays on the recipient's bank or card statement (up to 22 characters). A `statement_descriptor` that's longer than 22 characters return an error. Most banks truncate this information and display it inconsistently. Some banks might not display it at all. """ class ListParams(RequestOptions): arrival_date: NotRequired["Payout.ListParamsArrivalDate|int"] """ Only return payouts that are expected to arrive during the given date interval. """ created: NotRequired["Payout.ListParamsCreated|int"] """ Only return payouts that were created during the given date interval. """ destination: NotRequired[str] """ The ID of an external account - only return payouts sent to this external account. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[str] """ Only return payouts that have the given status: `pending`, `paid`, `failed`, or `canceled`. """ class ListParamsArrivalDate(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ReverseParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ amount: int """ The amount (in cents (or local equivalent)) that transfers to your bank account or debit card. """ application_fee: Optional[ExpandableField["ApplicationFee"]] """ The application fee (if any) for the payout. [See the Connect documentation](https://stripe.com/docs/connect/instant-payouts#monetization-and-fees) for details. """ application_fee_amount: Optional[int] """ The amount of the application fee (if any) requested for the payout. [See the Connect documentation](https://stripe.com/docs/connect/instant-payouts#monetization-and-fees) for details. """ arrival_date: int """ Date that you can expect the payout to arrive in the bank. This factors in delays to account for weekends or bank holidays. """ automatic: bool """ Returns `true` if the payout is created by an [automated payout schedule](https://stripe.com/docs/payouts#payout-schedule) and `false` if it's [requested manually](https://stripe.com/docs/payouts#manual-payouts). """ balance_transaction: Optional[ExpandableField["BalanceTransaction"]] """ ID of the balance transaction that describes the impact of this payout on your account balance. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ 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. """ destination: Optional[ExpandableField[Union["BankAccount", "Card"]]] """ ID of the bank account or card the payout is sent to. """ failure_balance_transaction: Optional[ ExpandableField["BalanceTransaction"] ] """ If the payout fails or cancels, this is the ID of the balance transaction that reverses the initial balance transaction and returns the funds from the failed payout back in your balance. """ failure_code: Optional[str] """ Error code that provides a reason for a payout failure, if available. View our [list of failure codes](https://stripe.com/docs/api#payout_failures). """ failure_message: Optional[str] """ Message that provides the reason for a payout failure, if available. """ id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ metadata: Optional[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ method: str """ The method used to send this payout, which can be `standard` or `instant`. `instant` is supported for payouts to debit cards and bank accounts in certain countries. Learn more about [bank support for Instant Payouts](https://stripe.com/docs/payouts/instant-payouts-banks). """ object: Literal["payout"] """ String representing the object's type. Objects of the same type share the same value. """ original_payout: Optional[ExpandableField["Payout"]] """ If the payout reverses another, this is the ID of the original payout. """ reconciliation_status: Literal[ "completed", "in_progress", "not_applicable" ] """ If `completed`, you can use the [Balance Transactions API](https://stripe.com/docs/api/balance_transactions/list#balance_transaction_list-payout) to list all balance transactions that are paid out in this payout. """ reversed_by: Optional[ExpandableField["Payout"]] """ If the payout reverses, this is the ID of the payout that reverses this payout. """ source_type: str """ The source balance this payout came from, which can be one of the following: `card`, `fpx`, or `bank_account`. """ statement_descriptor: Optional[str] """ Extra information about a payout that displays on the user's bank statement. """ status: str """ Current status of the payout: `paid`, `pending`, `in_transit`, `canceled` or `failed`. A payout is `pending` until it's submitted to the bank, when it becomes `in_transit`. The status changes to `paid` if the transaction succeeds, or to `failed` or `canceled` (within 5 business days). Some payouts that fail might initially show as `paid`, then change to `failed`. """ type: Literal["bank_account", "card"] """ Can be `bank_account` or `card`. """ @classmethod def _cls_cancel( cls, payout: str, **params: Unpack["Payout.CancelParams"] ) -> "Payout": """ You can cancel a previously created payout if its status is pending. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts. """ return cast( "Payout", cls._static_request( "post", "/v1/payouts/{payout}/cancel".format( payout=sanitize_id(payout) ), params=params, ), ) @overload @staticmethod def cancel( payout: str, **params: Unpack["Payout.CancelParams"] ) -> "Payout": """ You can cancel a previously created payout if its status is pending. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts. """ ... @overload def cancel(self, **params: Unpack["Payout.CancelParams"]) -> "Payout": """ You can cancel a previously created payout if its status is pending. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts. """ ... @class_method_variant("_cls_cancel") def cancel( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Payout.CancelParams"] ) -> "Payout": """ You can cancel a previously created payout if its status is pending. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts. """ return cast( "Payout", self._request( "post", "/v1/payouts/{payout}/cancel".format( payout=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_cancel_async( cls, payout: str, **params: Unpack["Payout.CancelParams"] ) -> "Payout": """ You can cancel a previously created payout if its status is pending. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts. """ return cast( "Payout", await cls._static_request_async( "post", "/v1/payouts/{payout}/cancel".format( payout=sanitize_id(payout) ), params=params, ), ) @overload @staticmethod async def cancel_async( payout: str, **params: Unpack["Payout.CancelParams"] ) -> "Payout": """ You can cancel a previously created payout if its status is pending. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts. """ ... @overload async def cancel_async( self, **params: Unpack["Payout.CancelParams"] ) -> "Payout": """ You can cancel a previously created payout if its status is pending. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts. """ ... @class_method_variant("_cls_cancel_async") async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Payout.CancelParams"] ) -> "Payout": """ You can cancel a previously created payout if its status is pending. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts. """ return cast( "Payout", await self._request_async( "post", "/v1/payouts/{payout}/cancel".format( payout=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def create(cls, **params: Unpack["Payout.CreateParams"]) -> "Payout": """ To send funds to your own bank account, create a new payout object. Your [Stripe balance](https://stripe.com/docs/api#balance) must cover the payout amount. If it doesn't, you receive an “Insufficient Funds” error. If your API key is in test mode, money won't actually be sent, though every other action occurs as if you're in live mode. If you create a manual payout on a Stripe account that uses multiple payment source types, you need to specify the source type balance that the payout draws from. The [balance object](https://stripe.com/docs/api#balance_object) details available and pending amounts by source type. """ return cast( "Payout", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["Payout.CreateParams"] ) -> "Payout": """ To send funds to your own bank account, create a new payout object. Your [Stripe balance](https://stripe.com/docs/api#balance) must cover the payout amount. If it doesn't, you receive an “Insufficient Funds” error. If your API key is in test mode, money won't actually be sent, though every other action occurs as if you're in live mode. If you create a manual payout on a Stripe account that uses multiple payment source types, you need to specify the source type balance that the payout draws from. The [balance object](https://stripe.com/docs/api#balance_object) details available and pending amounts by source type. """ return cast( "Payout", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def list( cls, **params: Unpack["Payout.ListParams"] ) -> ListObject["Payout"]: """ Returns a list of existing payouts sent to third-party bank accounts or payouts that Stripe sent to you. The payouts return in sorted order, with the most recently created payouts appearing first. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["Payout.ListParams"] ) -> ListObject["Payout"]: """ Returns a list of existing payouts sent to third-party bank accounts or payouts that Stripe sent to you. The payouts return in sorted order, with the most recently created payouts appearing first. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def modify( cls, id: str, **params: Unpack["Payout.ModifyParams"] ) -> "Payout": """ Updates the specified payout by setting the values of the parameters you pass. We don't change parameters that you don't provide. This request only accepts the metadata as arguments. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Payout", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["Payout.ModifyParams"] ) -> "Payout": """ Updates the specified payout by setting the values of the parameters you pass. We don't change parameters that you don't provide. This request only accepts the metadata as arguments. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Payout", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["Payout.RetrieveParams"] ) -> "Payout": """ Retrieves the details of an existing payout. Supply the unique payout ID from either a payout creation request or the payout list. Stripe returns the corresponding payout information. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["Payout.RetrieveParams"] ) -> "Payout": """ Retrieves the details of an existing payout. Supply the unique payout ID from either a payout creation request or the payout list. Stripe returns the corresponding payout information. """ instance = cls(id, **params) await instance.refresh_async() return instance @classmethod def _cls_reverse( cls, payout: str, **params: Unpack["Payout.ReverseParams"] ) -> "Payout": """ Reverses a payout by debiting the destination bank account. At this time, you can only reverse payouts for connected accounts to US bank accounts. If the payout is manual and in the pending status, use /v1/payouts/:id/cancel instead. By requesting a reversal through /v1/payouts/:id/reverse, you confirm that the authorized signatory of the selected bank account authorizes the debit on the bank account and that no other authorization is required. """ return cast( "Payout", cls._static_request( "post", "/v1/payouts/{payout}/reverse".format( payout=sanitize_id(payout) ), params=params, ), ) @overload @staticmethod def reverse( payout: str, **params: Unpack["Payout.ReverseParams"] ) -> "Payout": """ Reverses a payout by debiting the destination bank account. At this time, you can only reverse payouts for connected accounts to US bank accounts. If the payout is manual and in the pending status, use /v1/payouts/:id/cancel instead. By requesting a reversal through /v1/payouts/:id/reverse, you confirm that the authorized signatory of the selected bank account authorizes the debit on the bank account and that no other authorization is required. """ ... @overload def reverse(self, **params: Unpack["Payout.ReverseParams"]) -> "Payout": """ Reverses a payout by debiting the destination bank account. At this time, you can only reverse payouts for connected accounts to US bank accounts. If the payout is manual and in the pending status, use /v1/payouts/:id/cancel instead. By requesting a reversal through /v1/payouts/:id/reverse, you confirm that the authorized signatory of the selected bank account authorizes the debit on the bank account and that no other authorization is required. """ ... @class_method_variant("_cls_reverse") def reverse( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Payout.ReverseParams"] ) -> "Payout": """ Reverses a payout by debiting the destination bank account. At this time, you can only reverse payouts for connected accounts to US bank accounts. If the payout is manual and in the pending status, use /v1/payouts/:id/cancel instead. By requesting a reversal through /v1/payouts/:id/reverse, you confirm that the authorized signatory of the selected bank account authorizes the debit on the bank account and that no other authorization is required. """ return cast( "Payout", self._request( "post", "/v1/payouts/{payout}/reverse".format( payout=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_reverse_async( cls, payout: str, **params: Unpack["Payout.ReverseParams"] ) -> "Payout": """ Reverses a payout by debiting the destination bank account. At this time, you can only reverse payouts for connected accounts to US bank accounts. If the payout is manual and in the pending status, use /v1/payouts/:id/cancel instead. By requesting a reversal through /v1/payouts/:id/reverse, you confirm that the authorized signatory of the selected bank account authorizes the debit on the bank account and that no other authorization is required. """ return cast( "Payout", await cls._static_request_async( "post", "/v1/payouts/{payout}/reverse".format( payout=sanitize_id(payout) ), params=params, ), ) @overload @staticmethod async def reverse_async( payout: str, **params: Unpack["Payout.ReverseParams"] ) -> "Payout": """ Reverses a payout by debiting the destination bank account. At this time, you can only reverse payouts for connected accounts to US bank accounts. If the payout is manual and in the pending status, use /v1/payouts/:id/cancel instead. By requesting a reversal through /v1/payouts/:id/reverse, you confirm that the authorized signatory of the selected bank account authorizes the debit on the bank account and that no other authorization is required. """ ... @overload async def reverse_async( self, **params: Unpack["Payout.ReverseParams"] ) -> "Payout": """ Reverses a payout by debiting the destination bank account. At this time, you can only reverse payouts for connected accounts to US bank accounts. If the payout is manual and in the pending status, use /v1/payouts/:id/cancel instead. By requesting a reversal through /v1/payouts/:id/reverse, you confirm that the authorized signatory of the selected bank account authorizes the debit on the bank account and that no other authorization is required. """ ... @class_method_variant("_cls_reverse_async") async def reverse_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Payout.ReverseParams"] ) -> "Payout": """ Reverses a payout by debiting the destination bank account. At this time, you can only reverse payouts for connected accounts to US bank accounts. If the payout is manual and in the pending status, use /v1/payouts/:id/cancel instead. By requesting a reversal through /v1/payouts/:id/reverse, you confirm that the authorized signatory of the selected bank account authorizes the debit on the bank account and that no other authorization is required. """ return cast( "Payout", await self._request_async( "post", "/v1/payouts/{payout}/reverse".format( payout=sanitize_id(self.get("id")) ), params=params, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_payout_service.py0000644000175100001770000004054714637354563017616 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._payout import Payout from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class PayoutService(StripeService): class CancelParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CreateParams(TypedDict): amount: int """ A positive integer in cents representing how much to payout. """ 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 string attached to the object. Often useful for displaying to users. """ destination: NotRequired[str] """ The ID of a bank account or a card to send the payout to. If you don't provide a destination, we use the default external account for the specified currency. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ method: NotRequired[Literal["instant", "standard"]] """ The method used to send this payout, which is `standard` or `instant`. We support `instant` for payouts to debit cards and bank accounts in certain countries. Learn more about [bank support for Instant Payouts](https://stripe.com/docs/payouts/instant-payouts-banks). """ source_type: NotRequired[Literal["bank_account", "card", "fpx"]] """ The balance type of your Stripe balance to draw this payout from. Balances for different payment sources are kept separately. You can find the amounts with the Balances API. One of `bank_account`, `card`, or `fpx`. """ statement_descriptor: NotRequired[str] """ A string that displays on the recipient's bank or card statement (up to 22 characters). A `statement_descriptor` that's longer than 22 characters return an error. Most banks truncate this information and display it inconsistently. Some banks might not display it at all. """ class ListParams(TypedDict): arrival_date: NotRequired["PayoutService.ListParamsArrivalDate|int"] """ Only return payouts that are expected to arrive during the given date interval. """ created: NotRequired["PayoutService.ListParamsCreated|int"] """ Only return payouts that were created during the given date interval. """ destination: NotRequired[str] """ The ID of an external account - only return payouts sent to this external account. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[str] """ Only return payouts that have the given status: `pending`, `paid`, `failed`, or `canceled`. """ class ListParamsArrivalDate(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ReverseParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ class UpdateParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ def list( self, params: "PayoutService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Payout]: """ Returns a list of existing payouts sent to third-party bank accounts or payouts that Stripe sent to you. The payouts return in sorted order, with the most recently created payouts appearing first. """ return cast( ListObject[Payout], self._request( "get", "/v1/payouts", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "PayoutService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Payout]: """ Returns a list of existing payouts sent to third-party bank accounts or payouts that Stripe sent to you. The payouts return in sorted order, with the most recently created payouts appearing first. """ return cast( ListObject[Payout], await self._request_async( "get", "/v1/payouts", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "PayoutService.CreateParams", options: RequestOptions = {}, ) -> Payout: """ To send funds to your own bank account, create a new payout object. Your [Stripe balance](https://stripe.com/docs/api#balance) must cover the payout amount. If it doesn't, you receive an “Insufficient Funds” error. If your API key is in test mode, money won't actually be sent, though every other action occurs as if you're in live mode. If you create a manual payout on a Stripe account that uses multiple payment source types, you need to specify the source type balance that the payout draws from. The [balance object](https://stripe.com/docs/api#balance_object) details available and pending amounts by source type. """ return cast( Payout, self._request( "post", "/v1/payouts", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "PayoutService.CreateParams", options: RequestOptions = {}, ) -> Payout: """ To send funds to your own bank account, create a new payout object. Your [Stripe balance](https://stripe.com/docs/api#balance) must cover the payout amount. If it doesn't, you receive an “Insufficient Funds” error. If your API key is in test mode, money won't actually be sent, though every other action occurs as if you're in live mode. If you create a manual payout on a Stripe account that uses multiple payment source types, you need to specify the source type balance that the payout draws from. The [balance object](https://stripe.com/docs/api#balance_object) details available and pending amounts by source type. """ return cast( Payout, await self._request_async( "post", "/v1/payouts", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, payout: str, params: "PayoutService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Payout: """ Retrieves the details of an existing payout. Supply the unique payout ID from either a payout creation request or the payout list. Stripe returns the corresponding payout information. """ return cast( Payout, self._request( "get", "/v1/payouts/{payout}".format(payout=sanitize_id(payout)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, payout: str, params: "PayoutService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Payout: """ Retrieves the details of an existing payout. Supply the unique payout ID from either a payout creation request or the payout list. Stripe returns the corresponding payout information. """ return cast( Payout, await self._request_async( "get", "/v1/payouts/{payout}".format(payout=sanitize_id(payout)), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, payout: str, params: "PayoutService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Payout: """ Updates the specified payout by setting the values of the parameters you pass. We don't change parameters that you don't provide. This request only accepts the metadata as arguments. """ return cast( Payout, self._request( "post", "/v1/payouts/{payout}".format(payout=sanitize_id(payout)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, payout: str, params: "PayoutService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Payout: """ Updates the specified payout by setting the values of the parameters you pass. We don't change parameters that you don't provide. This request only accepts the metadata as arguments. """ return cast( Payout, await self._request_async( "post", "/v1/payouts/{payout}".format(payout=sanitize_id(payout)), api_mode="V1", base_address="api", params=params, options=options, ), ) def cancel( self, payout: str, params: "PayoutService.CancelParams" = {}, options: RequestOptions = {}, ) -> Payout: """ You can cancel a previously created payout if its status is pending. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts. """ return cast( Payout, self._request( "post", "/v1/payouts/{payout}/cancel".format( payout=sanitize_id(payout), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def cancel_async( self, payout: str, params: "PayoutService.CancelParams" = {}, options: RequestOptions = {}, ) -> Payout: """ You can cancel a previously created payout if its status is pending. Stripe refunds the funds to your available balance. You can't cancel automatic Stripe payouts. """ return cast( Payout, await self._request_async( "post", "/v1/payouts/{payout}/cancel".format( payout=sanitize_id(payout), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def reverse( self, payout: str, params: "PayoutService.ReverseParams" = {}, options: RequestOptions = {}, ) -> Payout: """ Reverses a payout by debiting the destination bank account. At this time, you can only reverse payouts for connected accounts to US bank accounts. If the payout is manual and in the pending status, use /v1/payouts/:id/cancel instead. By requesting a reversal through /v1/payouts/:id/reverse, you confirm that the authorized signatory of the selected bank account authorizes the debit on the bank account and that no other authorization is required. """ return cast( Payout, self._request( "post", "/v1/payouts/{payout}/reverse".format( payout=sanitize_id(payout), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def reverse_async( self, payout: str, params: "PayoutService.ReverseParams" = {}, options: RequestOptions = {}, ) -> Payout: """ Reverses a payout by debiting the destination bank account. At this time, you can only reverse payouts for connected accounts to US bank accounts. If the payout is manual and in the pending status, use /v1/payouts/:id/cancel instead. By requesting a reversal through /v1/payouts/:id/reverse, you confirm that the authorized signatory of the selected bank account authorizes the debit on the bank account and that no other authorization is required. """ return cast( Payout, await self._request_async( "post", "/v1/payouts/{payout}/reverse".format( payout=sanitize_id(payout), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_person.py0000644000175100001770000007412114637354563016056 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec import stripe from stripe._expandable_field import ExpandableField from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import sanitize_id from typing import ClassVar, Dict, List, Optional from typing_extensions import Literal, TYPE_CHECKING if TYPE_CHECKING: from stripe._file import File class Person(UpdateableAPIResource["Person"]): """ This is an object representing a person associated with a Stripe account. A platform cannot access a person for an account where [account.controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is `stripe`, which includes Standard and Express accounts, after creating an Account Link or Account Session to start Connect onboarding. See the [Standard onboarding](https://stripe.com/connect/standard-accounts) or [Express onboarding](https://stripe.com/connect/express-accounts) documentation for information about prefilling information and account onboarding steps. Learn more about [handling identity verification with the API](https://stripe.com/connect/handling-api-verification#person-information). """ OBJECT_NAME: ClassVar[Literal["person"]] = "person" class AdditionalTosAcceptances(StripeObject): class Account(StripeObject): date: Optional[int] """ The Unix timestamp marking when the legal guardian accepted the service agreement. """ ip: Optional[str] """ The IP address from which the legal guardian accepted the service agreement. """ user_agent: Optional[str] """ The user agent of the browser from which the legal guardian accepted the service agreement. """ account: Account _inner_class_types = {"account": Account} 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 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State, county, province, or region. """ class AddressKana(StripeObject): city: Optional[str] """ City/Ward. """ 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] """ Block/Building number. """ line2: Optional[str] """ Building details. """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ Prefecture. """ town: Optional[str] """ Town/cho-me. """ class AddressKanji(StripeObject): city: Optional[str] """ City/Ward. """ 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] """ Block/Building number. """ line2: Optional[str] """ Building details. """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ Prefecture. """ town: Optional[str] """ Town/cho-me. """ class Dob(StripeObject): day: Optional[int] """ The day of birth, between 1 and 31. """ month: Optional[int] """ The month of birth, between 1 and 12. """ year: Optional[int] """ The four-digit year of birth. """ class FutureRequirements(StripeObject): class Alternative(StripeObject): alternative_fields_due: List[str] """ Fields that can be provided to satisfy all fields in `original_fields_due`. """ original_fields_due: List[str] """ Fields that are due and can be satisfied by providing all fields in `alternative_fields_due`. """ class Error(StripeObject): code: Literal[ "invalid_address_city_state_postal_code", "invalid_address_highway_contract_box", "invalid_address_private_mailbox", "invalid_business_profile_name", "invalid_business_profile_name_denylisted", "invalid_company_name_denylisted", "invalid_dob_age_over_maximum", "invalid_dob_age_under_18", "invalid_dob_age_under_minimum", "invalid_product_description_length", "invalid_product_description_url_match", "invalid_representative_country", "invalid_statement_descriptor_business_mismatch", "invalid_statement_descriptor_denylisted", "invalid_statement_descriptor_length", "invalid_statement_descriptor_prefix_denylisted", "invalid_statement_descriptor_prefix_mismatch", "invalid_street_address", "invalid_tax_id", "invalid_tax_id_format", "invalid_tos_acceptance", "invalid_url_denylisted", "invalid_url_format", "invalid_url_length", "invalid_url_web_presence_detected", "invalid_url_website_business_information_mismatch", "invalid_url_website_empty", "invalid_url_website_inaccessible", "invalid_url_website_inaccessible_geoblocked", "invalid_url_website_inaccessible_password_protected", "invalid_url_website_incomplete", "invalid_url_website_incomplete_cancellation_policy", "invalid_url_website_incomplete_customer_service_details", "invalid_url_website_incomplete_legal_restrictions", "invalid_url_website_incomplete_refund_policy", "invalid_url_website_incomplete_return_policy", "invalid_url_website_incomplete_terms_and_conditions", "invalid_url_website_incomplete_under_construction", "invalid_url_website_other", "invalid_value_other", "verification_directors_mismatch", "verification_document_address_mismatch", "verification_document_address_missing", "verification_document_corrupt", "verification_document_country_not_supported", "verification_document_directors_mismatch", "verification_document_dob_mismatch", "verification_document_duplicate_type", "verification_document_expired", "verification_document_failed_copy", "verification_document_failed_greyscale", "verification_document_failed_other", "verification_document_failed_test_mode", "verification_document_fraudulent", "verification_document_id_number_mismatch", "verification_document_id_number_missing", "verification_document_incomplete", "verification_document_invalid", "verification_document_issue_or_expiry_date_missing", "verification_document_manipulated", "verification_document_missing_back", "verification_document_missing_front", "verification_document_name_mismatch", "verification_document_name_missing", "verification_document_nationality_mismatch", "verification_document_not_readable", "verification_document_not_signed", "verification_document_not_uploaded", "verification_document_photo_mismatch", "verification_document_too_large", "verification_document_type_not_supported", "verification_extraneous_directors", "verification_failed_address_match", "verification_failed_business_iec_number", "verification_failed_document_match", "verification_failed_id_number_match", "verification_failed_keyed_identity", "verification_failed_keyed_match", "verification_failed_name_match", "verification_failed_other", "verification_failed_representative_authority", "verification_failed_residential_address", "verification_failed_tax_id_match", "verification_failed_tax_id_not_issued", "verification_missing_directors", "verification_missing_executives", "verification_missing_owners", "verification_requires_additional_memorandum_of_associations", "verification_requires_additional_proof_of_registration", ] """ The code for the type of error. """ reason: str """ An informative message that indicates the error type and provides additional details about the error. """ requirement: str """ The specific user onboarding requirement field (in the requirements hash) that needs to be resolved. """ alternatives: Optional[List[Alternative]] """ Fields that are due and can be satisfied by providing the corresponding alternative fields instead. """ currently_due: List[str] """ Fields that need to be collected to keep the person's account enabled. If not collected by the account's `future_requirements[current_deadline]`, these fields will transition to the main `requirements` hash, and may immediately become `past_due`, but the account may also be given a grace period depending on the account's enablement state prior to transition. """ errors: List[Error] """ Fields that are `currently_due` and need to be collected again because validation or verification failed. """ eventually_due: List[str] """ Fields that need to be collected assuming all volume thresholds are reached. As they become required, they appear in `currently_due` as well, and the account's `future_requirements[current_deadline]` becomes set. """ past_due: List[str] """ Fields that weren't collected by the account's `requirements.current_deadline`. These fields need to be collected to enable the person's account. New fields will never appear here; `future_requirements.past_due` will always be a subset of `requirements.past_due`. """ pending_verification: List[str] """ Fields that might become required depending on the results of verification or review. It's an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due` or `currently_due`. Fields might appear in `eventually_due` or `currently_due` and in `pending_verification` if verification fails but another verification is still pending. """ _inner_class_types = {"alternatives": Alternative, "errors": Error} class RegisteredAddress(StripeObject): city: Optional[str] """ City, district, suburb, town, or village. """ country: Optional[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: Optional[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State, county, province, or region. """ class Relationship(StripeObject): director: Optional[bool] """ Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. """ executive: Optional[bool] """ Whether the person has significant responsibility to control, manage, or direct the organization. """ legal_guardian: Optional[bool] """ Whether the person is the legal guardian of the account's representative. """ owner: Optional[bool] """ Whether the person is an owner of the account's legal entity. """ percent_ownership: Optional[float] """ The percent owned by the person of the account's legal entity. """ representative: Optional[bool] """ Whether the person is authorized as the primary representative of the account. This is the person nominated by the business to provide information about themselves, and general information about the account. There can only be one representative at any given time. At the time the account is created, this person should be set to the person responsible for opening the account. """ title: Optional[str] """ The person's title (e.g., CEO, Support Engineer). """ class Requirements(StripeObject): class Alternative(StripeObject): alternative_fields_due: List[str] """ Fields that can be provided to satisfy all fields in `original_fields_due`. """ original_fields_due: List[str] """ Fields that are due and can be satisfied by providing all fields in `alternative_fields_due`. """ class Error(StripeObject): code: Literal[ "invalid_address_city_state_postal_code", "invalid_address_highway_contract_box", "invalid_address_private_mailbox", "invalid_business_profile_name", "invalid_business_profile_name_denylisted", "invalid_company_name_denylisted", "invalid_dob_age_over_maximum", "invalid_dob_age_under_18", "invalid_dob_age_under_minimum", "invalid_product_description_length", "invalid_product_description_url_match", "invalid_representative_country", "invalid_statement_descriptor_business_mismatch", "invalid_statement_descriptor_denylisted", "invalid_statement_descriptor_length", "invalid_statement_descriptor_prefix_denylisted", "invalid_statement_descriptor_prefix_mismatch", "invalid_street_address", "invalid_tax_id", "invalid_tax_id_format", "invalid_tos_acceptance", "invalid_url_denylisted", "invalid_url_format", "invalid_url_length", "invalid_url_web_presence_detected", "invalid_url_website_business_information_mismatch", "invalid_url_website_empty", "invalid_url_website_inaccessible", "invalid_url_website_inaccessible_geoblocked", "invalid_url_website_inaccessible_password_protected", "invalid_url_website_incomplete", "invalid_url_website_incomplete_cancellation_policy", "invalid_url_website_incomplete_customer_service_details", "invalid_url_website_incomplete_legal_restrictions", "invalid_url_website_incomplete_refund_policy", "invalid_url_website_incomplete_return_policy", "invalid_url_website_incomplete_terms_and_conditions", "invalid_url_website_incomplete_under_construction", "invalid_url_website_other", "invalid_value_other", "verification_directors_mismatch", "verification_document_address_mismatch", "verification_document_address_missing", "verification_document_corrupt", "verification_document_country_not_supported", "verification_document_directors_mismatch", "verification_document_dob_mismatch", "verification_document_duplicate_type", "verification_document_expired", "verification_document_failed_copy", "verification_document_failed_greyscale", "verification_document_failed_other", "verification_document_failed_test_mode", "verification_document_fraudulent", "verification_document_id_number_mismatch", "verification_document_id_number_missing", "verification_document_incomplete", "verification_document_invalid", "verification_document_issue_or_expiry_date_missing", "verification_document_manipulated", "verification_document_missing_back", "verification_document_missing_front", "verification_document_name_mismatch", "verification_document_name_missing", "verification_document_nationality_mismatch", "verification_document_not_readable", "verification_document_not_signed", "verification_document_not_uploaded", "verification_document_photo_mismatch", "verification_document_too_large", "verification_document_type_not_supported", "verification_extraneous_directors", "verification_failed_address_match", "verification_failed_business_iec_number", "verification_failed_document_match", "verification_failed_id_number_match", "verification_failed_keyed_identity", "verification_failed_keyed_match", "verification_failed_name_match", "verification_failed_other", "verification_failed_representative_authority", "verification_failed_residential_address", "verification_failed_tax_id_match", "verification_failed_tax_id_not_issued", "verification_missing_directors", "verification_missing_executives", "verification_missing_owners", "verification_requires_additional_memorandum_of_associations", "verification_requires_additional_proof_of_registration", ] """ The code for the type of error. """ reason: str """ An informative message that indicates the error type and provides additional details about the error. """ requirement: str """ The specific user onboarding requirement field (in the requirements hash) that needs to be resolved. """ alternatives: Optional[List[Alternative]] """ Fields that are due and can be satisfied by providing the corresponding alternative fields instead. """ currently_due: List[str] """ Fields that need to be collected to keep the person's account enabled. If not collected by the account's `current_deadline`, these fields appear in `past_due` as well, and the account is disabled. """ errors: List[Error] """ Fields that are `currently_due` and need to be collected again because validation or verification failed. """ eventually_due: List[str] """ Fields that need to be collected assuming all volume thresholds are reached. As they become required, they appear in `currently_due` as well, and the account's `current_deadline` becomes set. """ past_due: List[str] """ Fields that weren't collected by the account's `current_deadline`. These fields need to be collected to enable the person's account. """ pending_verification: List[str] """ Fields that might become required depending on the results of verification or review. It's an empty array unless an asynchronous verification is pending. If verification fails, these fields move to `eventually_due`, `currently_due`, or `past_due`. Fields might appear in `eventually_due`, `currently_due`, or `past_due` and in `pending_verification` if verification fails but another verification is still pending. """ _inner_class_types = {"alternatives": Alternative, "errors": Error} class Verification(StripeObject): class AdditionalDocument(StripeObject): back: Optional[ExpandableField["File"]] """ The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. """ details: Optional[str] """ A user-displayable string describing the verification state of this document. For example, if a document is uploaded and the picture is too fuzzy, this may say "Identity document is too unclear to read". """ details_code: Optional[str] """ One of `document_corrupt`, `document_country_not_supported`, `document_expired`, `document_failed_copy`, `document_failed_other`, `document_failed_test_mode`, `document_fraudulent`, `document_failed_greyscale`, `document_incomplete`, `document_invalid`, `document_manipulated`, `document_missing_back`, `document_missing_front`, `document_not_readable`, `document_not_uploaded`, `document_photo_mismatch`, `document_too_large`, or `document_type_not_supported`. A machine-readable code specifying the verification state for this document. """ front: Optional[ExpandableField["File"]] """ The front of an ID returned by a [file upload](https://stripe.com/docs/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://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. """ details: Optional[str] """ A user-displayable string describing the verification state of this document. For example, if a document is uploaded and the picture is too fuzzy, this may say "Identity document is too unclear to read". """ details_code: Optional[str] """ One of `document_corrupt`, `document_country_not_supported`, `document_expired`, `document_failed_copy`, `document_failed_other`, `document_failed_test_mode`, `document_fraudulent`, `document_failed_greyscale`, `document_incomplete`, `document_invalid`, `document_manipulated`, `document_missing_back`, `document_missing_front`, `document_not_readable`, `document_not_uploaded`, `document_photo_mismatch`, `document_too_large`, or `document_type_not_supported`. A machine-readable code specifying the verification state for this document. """ front: Optional[ExpandableField["File"]] """ The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. """ additional_document: Optional[AdditionalDocument] """ A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. """ details: Optional[str] """ A user-displayable string describing the verification state for the person. For example, this may say "Provided identity information could not be verified". """ details_code: Optional[str] """ One of `document_address_mismatch`, `document_dob_mismatch`, `document_duplicate_type`, `document_id_number_mismatch`, `document_name_mismatch`, `document_nationality_mismatch`, `failed_keyed_identity`, or `failed_other`. A machine-readable code specifying the verification state for the person. """ document: Optional[Document] status: str """ The state of verification for the person. Possible values are `unverified`, `pending`, or `verified`. """ _inner_class_types = { "additional_document": AdditionalDocument, "document": Document, } account: Optional[str] """ The account the person is associated with. """ additional_tos_acceptances: Optional[AdditionalTosAcceptances] address: Optional[Address] address_kana: Optional[AddressKana] """ The Kana variation of the person's address (Japan only). """ address_kanji: Optional[AddressKanji] """ The Kanji variation of the person's address (Japan only). """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ dob: Optional[Dob] email: Optional[str] """ The person's email address. """ first_name: Optional[str] """ The person's first name. """ first_name_kana: Optional[str] """ The Kana variation of the person's first name (Japan only). """ first_name_kanji: Optional[str] """ The Kanji variation of the person's first name (Japan only). """ full_name_aliases: Optional[List[str]] """ A list of alternate names or aliases that the person is known by. """ future_requirements: Optional[FutureRequirements] """ Information about the [upcoming new requirements for this person](https://stripe.com/docs/connect/custom-accounts/future-requirements), including what information needs to be collected, and by when. """ gender: Optional[str] """ The person's gender (International regulations require either "male" or "female"). """ id: str """ Unique identifier for the object. """ id_number_provided: Optional[bool] """ Whether the person's `id_number` was provided. True if either the full ID number was provided or if only the required part of the ID number was provided (ex. last four of an individual's SSN for the US indicated by `ssn_last_4_provided`). """ id_number_secondary_provided: Optional[bool] """ Whether the person's `id_number_secondary` was provided. """ last_name: Optional[str] """ The person's last name. """ last_name_kana: Optional[str] """ The Kana variation of the person's last name (Japan only). """ last_name_kanji: Optional[str] """ The Kanji variation of the person's last name (Japan only). """ maiden_name: Optional[str] """ The person's maiden name. """ metadata: Optional[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ nationality: Optional[str] """ The country where the person is a national. """ object: Literal["person"] """ String representing the object's type. Objects of the same type share the same value. """ phone: Optional[str] """ The person's phone number. """ political_exposure: Optional[Literal["existing", "none"]] """ Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. """ registered_address: Optional[RegisteredAddress] relationship: Optional[Relationship] requirements: Optional[Requirements] """ Information about the requirements for this person, including what information needs to be collected, and by when. """ ssn_last_4_provided: Optional[bool] """ Whether the last four digits of the person's Social Security number have been provided (U.S. only). """ verification: Optional[Verification] deleted: Optional[Literal[True]] """ Always true for a deleted object """ def instance_url(self): token = self.id account = self.account base = stripe.Account.class_url() assert account is not None acct_extn = sanitize_id(account) extn = sanitize_id(token) return "%s/%s/persons/%s" % (base, acct_extn, extn) @classmethod def modify(cls, sid, **params): raise NotImplementedError( "Can't modify a person without an account ID. " "Use stripe.Account.modify_person('account_id', 'person_id', ...) " "(see https://stripe.com/docs/api/persons/update)." ) @classmethod def retrieve(cls, id, **params): raise NotImplementedError( "Can't retrieve a person without an account ID. " "Use stripe.Account.retrieve_person('account_id', 'person_id') " "(see https://stripe.com/docs/api/persons/retrieve)." ) _inner_class_types = { "additional_tos_acceptances": AdditionalTosAcceptances, "address": Address, "address_kana": AddressKana, "address_kanji": AddressKanji, "dob": Dob, "future_requirements": FutureRequirements, "registered_address": RegisteredAddress, "relationship": Relationship, "requirements": Requirements, "verification": Verification, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_plan.py0000644000175100001770000006210614637354563015502 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._deletable_api_resource import DeletableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, Union, cast, overload from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._product import Product class Plan( CreateableAPIResource["Plan"], DeletableAPIResource["Plan"], ListableAPIResource["Plan"], UpdateableAPIResource["Plan"], ): """ You can now model subscriptions more flexibly using the [Prices API](https://stripe.com/docs/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://stripe.com/docs/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. Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription) and more about [products and prices](https://stripe.com/docs/products-prices/overview). """ OBJECT_NAME: ClassVar[Literal["plan"]] = "plan" class Tier(StripeObject): flat_amount: Optional[int] """ Price for the entire tier. """ flat_amount_decimal: Optional[str] """ Same as `flat_amount`, but contains a decimal value with at most 12 decimal places. """ unit_amount: Optional[int] """ Per unit price for units relevant to the tier. """ unit_amount_decimal: Optional[str] """ Same as `unit_amount`, but contains a decimal value with at most 12 decimal places. """ up_to: Optional[int] """ Up to and including to this quantity will be contained in the tier. """ class TransformUsage(StripeObject): divide_by: int """ Divide usage by this number. """ round: Literal["down", "up"] """ After division, either round the result `up` or `down`. """ class CreateParams(RequestOptions): active: NotRequired[bool] """ Whether the plan is currently available for new subscriptions. Defaults to `true`. """ aggregate_usage: NotRequired[ Literal["last_during_period", "last_ever", "max", "sum"] ] """ Specifies a usage aggregation strategy for plans of `usage_type=metered`. Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. Defaults to `sum`. """ amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free plan) representing how much to charge on a recurring basis. """ amount_decimal: NotRequired[str] """ Same as `amount`, but accepts a decimal value with at most 12 decimal places. Only one of `amount` and `amount_decimal` can be set. """ billing_scheme: NotRequired[Literal["per_unit", "tiered"]] """ Describes how to compute the price per period. Either `per_unit` or `tiered`. `per_unit` indicates that the fixed amount (specified in `amount`) will be charged per unit in `quantity` (for plans with `usage_type=licensed`), or per unit of total usage (for plans with `usage_type=metered`). `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes. """ 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). """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ id: NotRequired[str] """ An identifier randomly generated by Stripe. Used to identify this plan when subscribing a customer. You can optionally override this ID, but the ID must be unique across all plans in your Stripe account. You can, however, use the same plan ID in both live and test modes. """ interval: Literal["day", "month", "week", "year"] """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ meter: NotRequired[str] """ The meter tracking the usage of a metered price """ nickname: NotRequired[str] """ A brief description of the plan, hidden from customers. """ product: NotRequired["Plan.CreateParamsProduct|str"] tiers: NotRequired[List["Plan.CreateParamsTier"]] """ Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. """ tiers_mode: NotRequired[Literal["graduated", "volume"]] """ Defines if the tiering price should be `graduated` or `volume` based. In `volume`-based tiering, the maximum quantity within a period determines the per unit price, in `graduated` tiering pricing can successively change as the quantity grows. """ transform_usage: NotRequired["Plan.CreateParamsTransformUsage"] """ Apply a transformation to the reported usage or set quantity before computing the billed price. Cannot be combined with `tiers`. """ trial_period_days: NotRequired[int] """ Default number of trial days when subscribing a customer to this plan using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). """ usage_type: NotRequired[Literal["licensed", "metered"]] """ Configures how the quantity per period should be determined. Can be either `metered` or `licensed`. `licensed` automatically bills the `quantity` set when adding it to a subscription. `metered` aggregates the total usage based on usage records. Defaults to `licensed`. """ class CreateParamsProduct(TypedDict): active: NotRequired[bool] """ Whether the product is currently available for purchase. Defaults to `true`. """ id: NotRequired[str] """ The identifier for the product. Must be unique. If not provided, an identifier will be randomly generated. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ name: str """ The product's name, meant to be displayable to the customer. """ statement_descriptor: NotRequired[str] """ An arbitrary string to be displayed on your customer's credit card or bank statement. While most banks display this information consistently, some may display it incorrectly or not at all. This may be up to 22 characters. The statement description may not include `<`, `>`, `\\`, `"`, `'` characters, and will appear on your customer's statement in capital letters. Non-ASCII characters are automatically stripped. """ tax_code: NotRequired[str] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ unit_label: NotRequired[str] """ A label that represents units of this product. When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. """ class CreateParamsTier(TypedDict): flat_amount: NotRequired[int] """ The flat billing amount for an entire tier, regardless of the number of units in the tier. """ flat_amount_decimal: NotRequired[str] """ Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. Only one of `flat_amount` and `flat_amount_decimal` can be set. """ unit_amount: NotRequired[int] """ The per unit billing amount for each individual unit for which this tier applies. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ up_to: Union[Literal["inf"], int] """ Specifies the upper bound of this tier. The lower bound of a tier is the upper bound of the previous tier adding one. Use `inf` to define a fallback tier. """ class CreateParamsTransformUsage(TypedDict): divide_by: int """ Divide usage by this number. """ round: Literal["down", "up"] """ After division, either round the result `up` or `down`. """ class DeleteParams(RequestOptions): pass class ListParams(RequestOptions): active: NotRequired[bool] """ Only return plans that are active or inactive (e.g., pass `false` to list all inactive plans). """ created: NotRequired["Plan.ListParamsCreated|int"] """ A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ product: NotRequired[str] """ Only return plans for the given product. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): active: NotRequired[bool] """ Whether the plan is currently available for new subscriptions. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ nickname: NotRequired[str] """ A brief description of the plan, hidden from customers. """ product: NotRequired[str] """ The product the plan belongs to. This cannot be changed once it has been used in a subscription or subscription schedule. """ trial_period_days: NotRequired[int] """ Default number of trial days when subscribing a customer to this plan using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ active: bool """ Whether the plan can be used for new purchases. """ aggregate_usage: Optional[ Literal["last_during_period", "last_ever", "max", "sum"] ] """ Specifies a usage aggregation strategy for plans of `usage_type=metered`. Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. Defaults to `sum`. """ amount: Optional[int] """ The unit amount in cents (or local equivalent) to be charged, represented as a whole integer if possible. Only set if `billing_scheme=per_unit`. """ amount_decimal: Optional[str] """ The unit amount in cents (or local equivalent) to be charged, represented as a decimal string with at most 12 decimal places. Only set if `billing_scheme=per_unit`. """ billing_scheme: Literal["per_unit", "tiered"] """ Describes how to compute the price per period. Either `per_unit` or `tiered`. `per_unit` indicates that the fixed amount (specified in `amount`) will be charged per unit in `quantity` (for plans with `usage_type=licensed`), or per unit of total usage (for plans with `usage_type=metered`). `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ 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). """ id: str """ Unique identifier for the object. """ interval: Literal["day", "month", "week", "year"] """ The frequency at which a subscription is billed. One of `day`, `week`, `month` or `year`. """ interval_count: int """ The number of intervals (specified in the `interval` attribute) between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ metadata: Optional[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ meter: Optional[str] """ The meter tracking the usage of a metered price """ nickname: Optional[str] """ A brief description of the plan, hidden from customers. """ object: Literal["plan"] """ String representing the object's type. Objects of the same type share the same value. """ product: Optional[ExpandableField["Product"]] """ The product whose pricing this plan determines. """ tiers: Optional[List[Tier]] """ Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. """ tiers_mode: Optional[Literal["graduated", "volume"]] """ Defines if the tiering price should be `graduated` or `volume` based. In `volume`-based tiering, the maximum quantity within a period determines the per unit price. In `graduated` tiering, pricing can change as the quantity grows. """ transform_usage: Optional[TransformUsage] """ Apply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined with `tiers`. """ trial_period_days: Optional[int] """ Default number of trial days when subscribing a customer to this plan using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). """ usage_type: Literal["licensed", "metered"] """ Configures how the quantity per period should be determined. Can be either `metered` or `licensed`. `licensed` automatically bills the `quantity` set when adding it to a subscription. `metered` aggregates the total usage based on usage records. Defaults to `licensed`. """ deleted: Optional[Literal[True]] """ Always true for a deleted object """ @classmethod def create(cls, **params: Unpack["Plan.CreateParams"]) -> "Plan": """ You can now model subscriptions more flexibly using the [Prices API](https://stripe.com/docs/api#prices). It replaces the Plans API and is backwards compatible to simplify your migration. """ return cast( "Plan", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["Plan.CreateParams"] ) -> "Plan": """ You can now model subscriptions more flexibly using the [Prices API](https://stripe.com/docs/api#prices). It replaces the Plans API and is backwards compatible to simplify your migration. """ return cast( "Plan", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def _cls_delete( cls, sid: str, **params: Unpack["Plan.DeleteParams"] ) -> "Plan": """ Deleting plans means new subscribers can't be added. Existing subscribers aren't affected. """ url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "Plan", cls._static_request( "delete", url, params=params, ), ) @overload @staticmethod def delete(sid: str, **params: Unpack["Plan.DeleteParams"]) -> "Plan": """ Deleting plans means new subscribers can't be added. Existing subscribers aren't affected. """ ... @overload def delete(self, **params: Unpack["Plan.DeleteParams"]) -> "Plan": """ Deleting plans means new subscribers can't be added. Existing subscribers aren't affected. """ ... @class_method_variant("_cls_delete") def delete( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Plan.DeleteParams"] ) -> "Plan": """ Deleting plans means new subscribers can't be added. Existing subscribers aren't affected. """ return self._request_and_refresh( "delete", self.instance_url(), params=params, ) @classmethod async def _cls_delete_async( cls, sid: str, **params: Unpack["Plan.DeleteParams"] ) -> "Plan": """ Deleting plans means new subscribers can't be added. Existing subscribers aren't affected. """ url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "Plan", await cls._static_request_async( "delete", url, params=params, ), ) @overload @staticmethod async def delete_async( sid: str, **params: Unpack["Plan.DeleteParams"] ) -> "Plan": """ Deleting plans means new subscribers can't be added. Existing subscribers aren't affected. """ ... @overload async def delete_async( self, **params: Unpack["Plan.DeleteParams"] ) -> "Plan": """ Deleting plans means new subscribers can't be added. Existing subscribers aren't affected. """ ... @class_method_variant("_cls_delete_async") async def delete_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Plan.DeleteParams"] ) -> "Plan": """ Deleting plans means new subscribers can't be added. Existing subscribers aren't affected. """ return await self._request_and_refresh_async( "delete", self.instance_url(), params=params, ) @classmethod def list(cls, **params: Unpack["Plan.ListParams"]) -> ListObject["Plan"]: """ Returns a list of your plans. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["Plan.ListParams"] ) -> ListObject["Plan"]: """ Returns a list of your plans. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def modify(cls, id: str, **params: Unpack["Plan.ModifyParams"]) -> "Plan": """ Updates the specified plan by setting the values of the parameters passed. Any parameters not provided are left unchanged. By design, you cannot change a plan's ID, amount, currency, or billing cycle. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Plan", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["Plan.ModifyParams"] ) -> "Plan": """ Updates the specified plan by setting the values of the parameters passed. Any parameters not provided are left unchanged. By design, you cannot change a plan's ID, amount, currency, or billing cycle. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Plan", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["Plan.RetrieveParams"] ) -> "Plan": """ Retrieves the plan with the given ID. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["Plan.RetrieveParams"] ) -> "Plan": """ Retrieves the plan with the given ID. """ instance = cls(id, **params) await instance.refresh_async() return instance _inner_class_types = {"tiers": Tier, "transform_usage": TransformUsage} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_plan_service.py0000644000175100001770000004276514637354563017233 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._plan import Plan from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import Dict, List, Union, cast from typing_extensions import Literal, NotRequired, TypedDict class PlanService(StripeService): class CreateParams(TypedDict): active: NotRequired[bool] """ Whether the plan is currently available for new subscriptions. Defaults to `true`. """ aggregate_usage: NotRequired[ Literal["last_during_period", "last_ever", "max", "sum"] ] """ Specifies a usage aggregation strategy for plans of `usage_type=metered`. Allowed values are `sum` for summing up all usage during a period, `last_during_period` for using the last usage record reported within a period, `last_ever` for using the last usage record ever (across period bounds) or `max` which uses the usage record with the maximum reported usage during a period. Defaults to `sum`. """ amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free plan) representing how much to charge on a recurring basis. """ amount_decimal: NotRequired[str] """ Same as `amount`, but accepts a decimal value with at most 12 decimal places. Only one of `amount` and `amount_decimal` can be set. """ billing_scheme: NotRequired[Literal["per_unit", "tiered"]] """ Describes how to compute the price per period. Either `per_unit` or `tiered`. `per_unit` indicates that the fixed amount (specified in `amount`) will be charged per unit in `quantity` (for plans with `usage_type=licensed`), or per unit of total usage (for plans with `usage_type=metered`). `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes. """ 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). """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ id: NotRequired[str] """ An identifier randomly generated by Stripe. Used to identify this plan when subscribing a customer. You can optionally override this ID, but the ID must be unique across all plans in your Stripe account. You can, however, use the same plan ID in both live and test modes. """ interval: Literal["day", "month", "week", "year"] """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ meter: NotRequired[str] """ The meter tracking the usage of a metered price """ nickname: NotRequired[str] """ A brief description of the plan, hidden from customers. """ product: NotRequired["PlanService.CreateParamsProduct|str"] tiers: NotRequired[List["PlanService.CreateParamsTier"]] """ Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. """ tiers_mode: NotRequired[Literal["graduated", "volume"]] """ Defines if the tiering price should be `graduated` or `volume` based. In `volume`-based tiering, the maximum quantity within a period determines the per unit price, in `graduated` tiering pricing can successively change as the quantity grows. """ transform_usage: NotRequired["PlanService.CreateParamsTransformUsage"] """ Apply a transformation to the reported usage or set quantity before computing the billed price. Cannot be combined with `tiers`. """ trial_period_days: NotRequired[int] """ Default number of trial days when subscribing a customer to this plan using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). """ usage_type: NotRequired[Literal["licensed", "metered"]] """ Configures how the quantity per period should be determined. Can be either `metered` or `licensed`. `licensed` automatically bills the `quantity` set when adding it to a subscription. `metered` aggregates the total usage based on usage records. Defaults to `licensed`. """ class CreateParamsProduct(TypedDict): active: NotRequired[bool] """ Whether the product is currently available for purchase. Defaults to `true`. """ id: NotRequired[str] """ The identifier for the product. Must be unique. If not provided, an identifier will be randomly generated. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ name: str """ The product's name, meant to be displayable to the customer. """ statement_descriptor: NotRequired[str] """ An arbitrary string to be displayed on your customer's credit card or bank statement. While most banks display this information consistently, some may display it incorrectly or not at all. This may be up to 22 characters. The statement description may not include `<`, `>`, `\\`, `"`, `'` characters, and will appear on your customer's statement in capital letters. Non-ASCII characters are automatically stripped. """ tax_code: NotRequired[str] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ unit_label: NotRequired[str] """ A label that represents units of this product. When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. """ class CreateParamsTier(TypedDict): flat_amount: NotRequired[int] """ The flat billing amount for an entire tier, regardless of the number of units in the tier. """ flat_amount_decimal: NotRequired[str] """ Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. Only one of `flat_amount` and `flat_amount_decimal` can be set. """ unit_amount: NotRequired[int] """ The per unit billing amount for each individual unit for which this tier applies. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ up_to: Union[Literal["inf"], int] """ Specifies the upper bound of this tier. The lower bound of a tier is the upper bound of the previous tier adding one. Use `inf` to define a fallback tier. """ class CreateParamsTransformUsage(TypedDict): divide_by: int """ Divide usage by this number. """ round: Literal["down", "up"] """ After division, either round the result `up` or `down`. """ class DeleteParams(TypedDict): pass class ListParams(TypedDict): active: NotRequired[bool] """ Only return plans that are active or inactive (e.g., pass `false` to list all inactive plans). """ created: NotRequired["PlanService.ListParamsCreated|int"] """ A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ product: NotRequired[str] """ Only return plans for the given product. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): active: NotRequired[bool] """ Whether the plan is currently available for new subscriptions. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ nickname: NotRequired[str] """ A brief description of the plan, hidden from customers. """ product: NotRequired[str] """ The product the plan belongs to. This cannot be changed once it has been used in a subscription or subscription schedule. """ trial_period_days: NotRequired[int] """ Default number of trial days when subscribing a customer to this plan using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). """ def delete( self, plan: str, params: "PlanService.DeleteParams" = {}, options: RequestOptions = {}, ) -> Plan: """ Deleting plans means new subscribers can't be added. Existing subscribers aren't affected. """ return cast( Plan, self._request( "delete", "/v1/plans/{plan}".format(plan=sanitize_id(plan)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def delete_async( self, plan: str, params: "PlanService.DeleteParams" = {}, options: RequestOptions = {}, ) -> Plan: """ Deleting plans means new subscribers can't be added. Existing subscribers aren't affected. """ return cast( Plan, await self._request_async( "delete", "/v1/plans/{plan}".format(plan=sanitize_id(plan)), api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, plan: str, params: "PlanService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Plan: """ Retrieves the plan with the given ID. """ return cast( Plan, self._request( "get", "/v1/plans/{plan}".format(plan=sanitize_id(plan)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, plan: str, params: "PlanService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Plan: """ Retrieves the plan with the given ID. """ return cast( Plan, await self._request_async( "get", "/v1/plans/{plan}".format(plan=sanitize_id(plan)), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, plan: str, params: "PlanService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Plan: """ Updates the specified plan by setting the values of the parameters passed. Any parameters not provided are left unchanged. By design, you cannot change a plan's ID, amount, currency, or billing cycle. """ return cast( Plan, self._request( "post", "/v1/plans/{plan}".format(plan=sanitize_id(plan)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, plan: str, params: "PlanService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Plan: """ Updates the specified plan by setting the values of the parameters passed. Any parameters not provided are left unchanged. By design, you cannot change a plan's ID, amount, currency, or billing cycle. """ return cast( Plan, await self._request_async( "post", "/v1/plans/{plan}".format(plan=sanitize_id(plan)), api_mode="V1", base_address="api", params=params, options=options, ), ) def list( self, params: "PlanService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Plan]: """ Returns a list of your plans. """ return cast( ListObject[Plan], self._request( "get", "/v1/plans", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "PlanService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Plan]: """ Returns a list of your plans. """ return cast( ListObject[Plan], await self._request_async( "get", "/v1/plans", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "PlanService.CreateParams", options: RequestOptions = {} ) -> Plan: """ You can now model subscriptions more flexibly using the [Prices API](https://stripe.com/docs/api#prices). It replaces the Plans API and is backwards compatible to simplify your migration. """ return cast( Plan, self._request( "post", "/v1/plans", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "PlanService.CreateParams", options: RequestOptions = {} ) -> Plan: """ You can now model subscriptions more flexibly using the [Prices API](https://stripe.com/docs/api#prices). It replaces the Plans API and is backwards compatible to simplify your migration. """ return cast( Plan, await self._request_async( "post", "/v1/plans", api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_price.py0000644000175100001770000012012514637354563015646 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._search_result_object import SearchResultObject from stripe._searchable_api_resource import SearchableAPIResource from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import sanitize_id from typing import ( AsyncIterator, ClassVar, Dict, Iterator, List, Optional, Union, cast, ) from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._product import Product class Price( CreateableAPIResource["Price"], ListableAPIResource["Price"], SearchableAPIResource["Price"], UpdateableAPIResource["Price"], ): """ Prices define the unit cost, currency, and (optional) billing cycle for both recurring and one-time purchases of products. [Products](https://stripe.com/docs/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. Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription), [create an invoice](https://stripe.com/docs/billing/invoices/create), and more about [products and prices](https://stripe.com/docs/products-prices/overview). """ OBJECT_NAME: ClassVar[Literal["price"]] = "price" class CurrencyOptions(StripeObject): class CustomUnitAmount(StripeObject): maximum: Optional[int] """ The maximum unit amount the customer can specify for this item. """ minimum: Optional[int] """ The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount. """ preset: Optional[int] """ The starting unit amount which can be updated by the customer. """ class Tier(StripeObject): flat_amount: Optional[int] """ Price for the entire tier. """ flat_amount_decimal: Optional[str] """ Same as `flat_amount`, but contains a decimal value with at most 12 decimal places. """ unit_amount: Optional[int] """ Per unit price for units relevant to the tier. """ unit_amount_decimal: Optional[str] """ Same as `unit_amount`, but contains a decimal value with at most 12 decimal places. """ up_to: Optional[int] """ Up to and including to this quantity will be contained in the tier. """ custom_unit_amount: Optional[CustomUnitAmount] """ When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. """ tax_behavior: Optional[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ tiers: Optional[List[Tier]] """ Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. """ unit_amount: Optional[int] """ The unit amount in cents (or local equivalent) to be charged, represented as a whole integer if possible. Only set if `billing_scheme=per_unit`. """ unit_amount_decimal: Optional[str] """ The unit amount in cents (or local equivalent) to be charged, represented as a decimal string with at most 12 decimal places. Only set if `billing_scheme=per_unit`. """ _inner_class_types = { "custom_unit_amount": CustomUnitAmount, "tiers": Tier, } class CustomUnitAmount(StripeObject): maximum: Optional[int] """ The maximum unit amount the customer can specify for this item. """ minimum: Optional[int] """ The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount. """ preset: Optional[int] """ The starting unit amount which can be updated by the customer. """ class Recurring(StripeObject): aggregate_usage: Optional[ Literal["last_during_period", "last_ever", "max", "sum"] ] """ Specifies a usage aggregation strategy for prices of `usage_type=metered`. Defaults to `sum`. """ interval: Literal["day", "month", "week", "year"] """ The frequency at which a subscription is billed. One of `day`, `week`, `month` or `year`. """ interval_count: int """ The number of intervals (specified in the `interval` attribute) between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. """ meter: Optional[str] """ The meter tracking the usage of a metered price """ trial_period_days: Optional[int] """ Default number of trial days when subscribing a customer to this price using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). """ usage_type: Literal["licensed", "metered"] """ Configures how the quantity per period should be determined. Can be either `metered` or `licensed`. `licensed` automatically bills the `quantity` set when adding it to a subscription. `metered` aggregates the total usage based on usage records. Defaults to `licensed`. """ class Tier(StripeObject): flat_amount: Optional[int] """ Price for the entire tier. """ flat_amount_decimal: Optional[str] """ Same as `flat_amount`, but contains a decimal value with at most 12 decimal places. """ unit_amount: Optional[int] """ Per unit price for units relevant to the tier. """ unit_amount_decimal: Optional[str] """ Same as `unit_amount`, but contains a decimal value with at most 12 decimal places. """ up_to: Optional[int] """ Up to and including to this quantity will be contained in the tier. """ class TransformQuantity(StripeObject): divide_by: int """ Divide usage by this number. """ round: Literal["down", "up"] """ After division, either round the result `up` or `down`. """ class CreateParams(RequestOptions): active: NotRequired[bool] """ Whether the price can be used for new purchases. Defaults to `true`. """ billing_scheme: NotRequired[Literal["per_unit", "tiered"]] """ Describes how to compute the price per period. Either `per_unit` or `tiered`. `per_unit` indicates that the fixed amount (specified in `unit_amount` or `unit_amount_decimal`) will be charged per unit in `quantity` (for prices with `usage_type=licensed`), or per unit of total usage (for prices with `usage_type=metered`). `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes. """ 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). """ currency_options: NotRequired[ Dict[str, "Price.CreateParamsCurrencyOptions"] ] """ Prices defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ custom_unit_amount: NotRequired["Price.CreateParamsCustomUnitAmount"] """ When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ lookup_key: NotRequired[str] """ A lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ nickname: NotRequired[str] """ A brief description of the price, hidden from customers. """ product: NotRequired[str] """ The ID of the product that this price will belong to. """ product_data: NotRequired["Price.CreateParamsProductData"] """ These fields can be used to create a new product that this price will belong to. """ recurring: NotRequired["Price.CreateParamsRecurring"] """ The recurring components of a price such as `interval` and `usage_type`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ tiers: NotRequired[List["Price.CreateParamsTier"]] """ Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. """ tiers_mode: NotRequired[Literal["graduated", "volume"]] """ Defines if the tiering price should be `graduated` or `volume` based. In `volume`-based tiering, the maximum quantity within a period determines the per unit price, in `graduated` tiering pricing can successively change as the quantity grows. """ transfer_lookup_key: NotRequired[bool] """ If set to true, will atomically remove the lookup key from the existing price, and assign it to this price. """ transform_quantity: NotRequired["Price.CreateParamsTransformQuantity"] """ Apply a transformation to the reported usage or set quantity before computing the billed price. Cannot be combined with `tiers`. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. One of `unit_amount`, `unit_amount_decimal`, or `custom_unit_amount` is required, unless `billing_scheme=tiered`. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class CreateParamsCurrencyOptions(TypedDict): custom_unit_amount: NotRequired[ "Price.CreateParamsCurrencyOptionsCustomUnitAmount" ] """ When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ tiers: NotRequired[List["Price.CreateParamsCurrencyOptionsTier"]] """ Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class CreateParamsCurrencyOptionsCustomUnitAmount(TypedDict): enabled: bool """ Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. """ maximum: NotRequired[int] """ The maximum unit amount the customer can specify for this item. """ minimum: NotRequired[int] """ The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount. """ preset: NotRequired[int] """ The starting unit amount which can be updated by the customer. """ class CreateParamsCurrencyOptionsTier(TypedDict): flat_amount: NotRequired[int] """ The flat billing amount for an entire tier, regardless of the number of units in the tier. """ flat_amount_decimal: NotRequired[str] """ Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. Only one of `flat_amount` and `flat_amount_decimal` can be set. """ unit_amount: NotRequired[int] """ The per unit billing amount for each individual unit for which this tier applies. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ up_to: Union[Literal["inf"], int] """ Specifies the upper bound of this tier. The lower bound of a tier is the upper bound of the previous tier adding one. Use `inf` to define a fallback tier. """ class CreateParamsCustomUnitAmount(TypedDict): enabled: bool """ Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. """ maximum: NotRequired[int] """ The maximum unit amount the customer can specify for this item. """ minimum: NotRequired[int] """ The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount. """ preset: NotRequired[int] """ The starting unit amount which can be updated by the customer. """ class CreateParamsProductData(TypedDict): active: NotRequired[bool] """ Whether the product is currently available for purchase. Defaults to `true`. """ id: NotRequired[str] """ The identifier for the product. Must be unique. If not provided, an identifier will be randomly generated. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ name: str """ The product's name, meant to be displayable to the customer. """ statement_descriptor: NotRequired[str] """ An arbitrary string to be displayed on your customer's credit card or bank statement. While most banks display this information consistently, some may display it incorrectly or not at all. This may be up to 22 characters. The statement description may not include `<`, `>`, `\\`, `"`, `'` characters, and will appear on your customer's statement in capital letters. Non-ASCII characters are automatically stripped. """ tax_code: NotRequired[str] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ unit_label: NotRequired[str] """ A label that represents units of this product. When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. """ class CreateParamsRecurring(TypedDict): aggregate_usage: NotRequired[ Literal["last_during_period", "last_ever", "max", "sum"] ] """ Specifies a usage aggregation strategy for prices of `usage_type=metered`. Defaults to `sum`. """ interval: Literal["day", "month", "week", "year"] """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ meter: NotRequired[str] """ The meter tracking the usage of a metered price """ trial_period_days: NotRequired[int] """ Default number of trial days when subscribing a customer to this price using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). """ usage_type: NotRequired[Literal["licensed", "metered"]] """ Configures how the quantity per period should be determined. Can be either `metered` or `licensed`. `licensed` automatically bills the `quantity` set when adding it to a subscription. `metered` aggregates the total usage based on usage records. Defaults to `licensed`. """ class CreateParamsTier(TypedDict): flat_amount: NotRequired[int] """ The flat billing amount for an entire tier, regardless of the number of units in the tier. """ flat_amount_decimal: NotRequired[str] """ Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. Only one of `flat_amount` and `flat_amount_decimal` can be set. """ unit_amount: NotRequired[int] """ The per unit billing amount for each individual unit for which this tier applies. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ up_to: Union[Literal["inf"], int] """ Specifies the upper bound of this tier. The lower bound of a tier is the upper bound of the previous tier adding one. Use `inf` to define a fallback tier. """ class CreateParamsTransformQuantity(TypedDict): divide_by: int """ Divide usage by this number. """ round: Literal["down", "up"] """ After division, either round the result `up` or `down`. """ class ListParams(RequestOptions): active: NotRequired[bool] """ Only return prices that are active or inactive (e.g., pass `false` to list all inactive prices). """ created: NotRequired["Price.ListParamsCreated|int"] """ A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. """ currency: NotRequired[str] """ Only return prices for the given currency. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ lookup_keys: NotRequired[List[str]] """ Only return the price with these lookup_keys, if any exist. You can specify up to 10 lookup_keys. """ product: NotRequired[str] """ Only return prices for the given product. """ recurring: NotRequired["Price.ListParamsRecurring"] """ Only return prices with these recurring fields. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ type: NotRequired[Literal["one_time", "recurring"]] """ Only return prices of type `recurring` or `one_time`. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsRecurring(TypedDict): interval: NotRequired[Literal["day", "month", "week", "year"]] """ Filter by billing frequency. Either `day`, `week`, `month` or `year`. """ meter: NotRequired[str] """ Filter by the price's meter. """ usage_type: NotRequired[Literal["licensed", "metered"]] """ Filter by the usage type for this price. Can be either `metered` or `licensed`. """ class ModifyParams(RequestOptions): active: NotRequired[bool] """ Whether the price can be used for new purchases. Defaults to `true`. """ currency_options: NotRequired[ "Literal['']|Dict[str, Price.ModifyParamsCurrencyOptions]" ] """ Prices defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ lookup_key: NotRequired[str] """ A lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ nickname: NotRequired[str] """ A brief description of the price, hidden from customers. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ transfer_lookup_key: NotRequired[bool] """ If set to true, will atomically remove the lookup key from the existing price, and assign it to this price. """ class ModifyParamsCurrencyOptions(TypedDict): custom_unit_amount: NotRequired[ "Price.ModifyParamsCurrencyOptionsCustomUnitAmount" ] """ When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ tiers: NotRequired[List["Price.ModifyParamsCurrencyOptionsTier"]] """ Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class ModifyParamsCurrencyOptionsCustomUnitAmount(TypedDict): enabled: bool """ Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. """ maximum: NotRequired[int] """ The maximum unit amount the customer can specify for this item. """ minimum: NotRequired[int] """ The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount. """ preset: NotRequired[int] """ The starting unit amount which can be updated by the customer. """ class ModifyParamsCurrencyOptionsTier(TypedDict): flat_amount: NotRequired[int] """ The flat billing amount for an entire tier, regardless of the number of units in the tier. """ flat_amount_decimal: NotRequired[str] """ Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. Only one of `flat_amount` and `flat_amount_decimal` can be set. """ unit_amount: NotRequired[int] """ The per unit billing amount for each individual unit for which this tier applies. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ up_to: Union[Literal["inf"], int] """ Specifies the upper bound of this tier. The lower bound of a tier is the upper bound of the previous tier adding one. Use `inf` to define a fallback tier. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class SearchParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ page: NotRequired[str] """ A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. """ query: str """ The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for prices](https://stripe.com/docs/search#query-fields-for-prices). """ active: bool """ Whether the price can be used for new purchases. """ billing_scheme: Literal["per_unit", "tiered"] """ Describes how to compute the price per period. Either `per_unit` or `tiered`. `per_unit` indicates that the fixed amount (specified in `unit_amount` or `unit_amount_decimal`) will be charged per unit in `quantity` (for prices with `usage_type=licensed`), or per unit of total usage (for prices with `usage_type=metered`). `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ 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). """ currency_options: Optional[Dict[str, CurrencyOptions]] """ Prices defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ custom_unit_amount: Optional[CustomUnitAmount] """ When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. """ id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ lookup_key: Optional[str] """ A lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters. """ metadata: Dict[str, str] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ nickname: Optional[str] """ A brief description of the price, hidden from customers. """ object: Literal["price"] """ String representing the object's type. Objects of the same type share the same value. """ product: ExpandableField["Product"] """ The ID of the product this price is associated with. """ recurring: Optional[Recurring] """ The recurring components of a price such as `interval` and `usage_type`. """ tax_behavior: Optional[Literal["exclusive", "inclusive", "unspecified"]] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ tiers: Optional[List[Tier]] """ Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. """ tiers_mode: Optional[Literal["graduated", "volume"]] """ Defines if the tiering price should be `graduated` or `volume` based. In `volume`-based tiering, the maximum quantity within a period determines the per unit price. In `graduated` tiering, pricing can change as the quantity grows. """ transform_quantity: Optional[TransformQuantity] """ Apply a transformation to the reported usage or set quantity before computing the amount billed. Cannot be combined with `tiers`. """ type: Literal["one_time", "recurring"] """ One of `one_time` or `recurring` depending on whether the price is for a one-time purchase or a recurring (subscription) purchase. """ unit_amount: Optional[int] """ The unit amount in cents (or local equivalent) to be charged, represented as a whole integer if possible. Only set if `billing_scheme=per_unit`. """ unit_amount_decimal: Optional[str] """ The unit amount in cents (or local equivalent) to be charged, represented as a decimal string with at most 12 decimal places. Only set if `billing_scheme=per_unit`. """ deleted: Optional[Literal[True]] """ Always true for a deleted object """ @classmethod def create(cls, **params: Unpack["Price.CreateParams"]) -> "Price": """ Creates a new price for an existing product. The price can be recurring or one-time. """ return cast( "Price", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["Price.CreateParams"] ) -> "Price": """ Creates a new price for an existing product. The price can be recurring or one-time. """ return cast( "Price", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def list(cls, **params: Unpack["Price.ListParams"]) -> ListObject["Price"]: """ Returns a list of your active prices, excluding [inline prices](https://stripe.com/docs/products-prices/pricing-models#inline-pricing). For the list of inactive prices, set active to false. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["Price.ListParams"] ) -> ListObject["Price"]: """ Returns a list of your active prices, excluding [inline prices](https://stripe.com/docs/products-prices/pricing-models#inline-pricing). For the list of inactive prices, set active to false. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def modify( cls, id: str, **params: Unpack["Price.ModifyParams"] ) -> "Price": """ Updates the specified price by setting the values of the parameters passed. Any parameters not provided are left unchanged. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Price", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["Price.ModifyParams"] ) -> "Price": """ Updates the specified price by setting the values of the parameters passed. Any parameters not provided are left unchanged. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Price", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["Price.RetrieveParams"] ) -> "Price": """ Retrieves the price with the given ID. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["Price.RetrieveParams"] ) -> "Price": """ Retrieves the price with the given ID. """ instance = cls(id, **params) await instance.refresh_async() return instance @classmethod def search( cls, *args, **kwargs: Unpack["Price.SearchParams"] ) -> SearchResultObject["Price"]: """ Search for prices you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India. """ return cls._search(search_url="/v1/prices/search", *args, **kwargs) @classmethod async def search_async( cls, *args, **kwargs: Unpack["Price.SearchParams"] ) -> SearchResultObject["Price"]: """ Search for prices you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India. """ return await cls._search_async( search_url="/v1/prices/search", *args, **kwargs ) @classmethod def search_auto_paging_iter( cls, *args, **kwargs: Unpack["Price.SearchParams"] ) -> Iterator["Price"]: return cls.search(*args, **kwargs).auto_paging_iter() @classmethod async def search_auto_paging_iter_async( cls, *args, **kwargs: Unpack["Price.SearchParams"] ) -> AsyncIterator["Price"]: return (await cls.search_async(*args, **kwargs)).auto_paging_iter() _inner_class_types = { "currency_options": CurrencyOptions, "custom_unit_amount": CustomUnitAmount, "recurring": Recurring, "tiers": Tier, "transform_quantity": TransformQuantity, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_price_service.py0000644000175100001770000007313014637354563017371 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._price import Price from stripe._request_options import RequestOptions from stripe._search_result_object import SearchResultObject from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import Dict, List, Union, cast from typing_extensions import Literal, NotRequired, TypedDict class PriceService(StripeService): class CreateParams(TypedDict): active: NotRequired[bool] """ Whether the price can be used for new purchases. Defaults to `true`. """ billing_scheme: NotRequired[Literal["per_unit", "tiered"]] """ Describes how to compute the price per period. Either `per_unit` or `tiered`. `per_unit` indicates that the fixed amount (specified in `unit_amount` or `unit_amount_decimal`) will be charged per unit in `quantity` (for prices with `usage_type=licensed`), or per unit of total usage (for prices with `usage_type=metered`). `tiered` indicates that the unit pricing will be computed using a tiering strategy as defined using the `tiers` and `tiers_mode` attributes. """ 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). """ currency_options: NotRequired[ Dict[str, "PriceService.CreateParamsCurrencyOptions"] ] """ Prices defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ custom_unit_amount: NotRequired[ "PriceService.CreateParamsCustomUnitAmount" ] """ When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ lookup_key: NotRequired[str] """ A lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ nickname: NotRequired[str] """ A brief description of the price, hidden from customers. """ product: NotRequired[str] """ The ID of the product that this price will belong to. """ product_data: NotRequired["PriceService.CreateParamsProductData"] """ These fields can be used to create a new product that this price will belong to. """ recurring: NotRequired["PriceService.CreateParamsRecurring"] """ The recurring components of a price such as `interval` and `usage_type`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ tiers: NotRequired[List["PriceService.CreateParamsTier"]] """ Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. """ tiers_mode: NotRequired[Literal["graduated", "volume"]] """ Defines if the tiering price should be `graduated` or `volume` based. In `volume`-based tiering, the maximum quantity within a period determines the per unit price, in `graduated` tiering pricing can successively change as the quantity grows. """ transfer_lookup_key: NotRequired[bool] """ If set to true, will atomically remove the lookup key from the existing price, and assign it to this price. """ transform_quantity: NotRequired[ "PriceService.CreateParamsTransformQuantity" ] """ Apply a transformation to the reported usage or set quantity before computing the billed price. Cannot be combined with `tiers`. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. One of `unit_amount`, `unit_amount_decimal`, or `custom_unit_amount` is required, unless `billing_scheme=tiered`. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class CreateParamsCurrencyOptions(TypedDict): custom_unit_amount: NotRequired[ "PriceService.CreateParamsCurrencyOptionsCustomUnitAmount" ] """ When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ tiers: NotRequired[ List["PriceService.CreateParamsCurrencyOptionsTier"] ] """ Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class CreateParamsCurrencyOptionsCustomUnitAmount(TypedDict): enabled: bool """ Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. """ maximum: NotRequired[int] """ The maximum unit amount the customer can specify for this item. """ minimum: NotRequired[int] """ The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount. """ preset: NotRequired[int] """ The starting unit amount which can be updated by the customer. """ class CreateParamsCurrencyOptionsTier(TypedDict): flat_amount: NotRequired[int] """ The flat billing amount for an entire tier, regardless of the number of units in the tier. """ flat_amount_decimal: NotRequired[str] """ Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. Only one of `flat_amount` and `flat_amount_decimal` can be set. """ unit_amount: NotRequired[int] """ The per unit billing amount for each individual unit for which this tier applies. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ up_to: Union[Literal["inf"], int] """ Specifies the upper bound of this tier. The lower bound of a tier is the upper bound of the previous tier adding one. Use `inf` to define a fallback tier. """ class CreateParamsCustomUnitAmount(TypedDict): enabled: bool """ Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. """ maximum: NotRequired[int] """ The maximum unit amount the customer can specify for this item. """ minimum: NotRequired[int] """ The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount. """ preset: NotRequired[int] """ The starting unit amount which can be updated by the customer. """ class CreateParamsProductData(TypedDict): active: NotRequired[bool] """ Whether the product is currently available for purchase. Defaults to `true`. """ id: NotRequired[str] """ The identifier for the product. Must be unique. If not provided, an identifier will be randomly generated. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ name: str """ The product's name, meant to be displayable to the customer. """ statement_descriptor: NotRequired[str] """ An arbitrary string to be displayed on your customer's credit card or bank statement. While most banks display this information consistently, some may display it incorrectly or not at all. This may be up to 22 characters. The statement description may not include `<`, `>`, `\\`, `"`, `'` characters, and will appear on your customer's statement in capital letters. Non-ASCII characters are automatically stripped. """ tax_code: NotRequired[str] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ unit_label: NotRequired[str] """ A label that represents units of this product. When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. """ class CreateParamsRecurring(TypedDict): aggregate_usage: NotRequired[ Literal["last_during_period", "last_ever", "max", "sum"] ] """ Specifies a usage aggregation strategy for prices of `usage_type=metered`. Defaults to `sum`. """ interval: Literal["day", "month", "week", "year"] """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ meter: NotRequired[str] """ The meter tracking the usage of a metered price """ trial_period_days: NotRequired[int] """ Default number of trial days when subscribing a customer to this price using [`trial_from_plan=true`](https://stripe.com/docs/api#create_subscription-trial_from_plan). """ usage_type: NotRequired[Literal["licensed", "metered"]] """ Configures how the quantity per period should be determined. Can be either `metered` or `licensed`. `licensed` automatically bills the `quantity` set when adding it to a subscription. `metered` aggregates the total usage based on usage records. Defaults to `licensed`. """ class CreateParamsTier(TypedDict): flat_amount: NotRequired[int] """ The flat billing amount for an entire tier, regardless of the number of units in the tier. """ flat_amount_decimal: NotRequired[str] """ Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. Only one of `flat_amount` and `flat_amount_decimal` can be set. """ unit_amount: NotRequired[int] """ The per unit billing amount for each individual unit for which this tier applies. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ up_to: Union[Literal["inf"], int] """ Specifies the upper bound of this tier. The lower bound of a tier is the upper bound of the previous tier adding one. Use `inf` to define a fallback tier. """ class CreateParamsTransformQuantity(TypedDict): divide_by: int """ Divide usage by this number. """ round: Literal["down", "up"] """ After division, either round the result `up` or `down`. """ class ListParams(TypedDict): active: NotRequired[bool] """ Only return prices that are active or inactive (e.g., pass `false` to list all inactive prices). """ created: NotRequired["PriceService.ListParamsCreated|int"] """ A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. """ currency: NotRequired[str] """ Only return prices for the given currency. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ lookup_keys: NotRequired[List[str]] """ Only return the price with these lookup_keys, if any exist. You can specify up to 10 lookup_keys. """ product: NotRequired[str] """ Only return prices for the given product. """ recurring: NotRequired["PriceService.ListParamsRecurring"] """ Only return prices with these recurring fields. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ type: NotRequired[Literal["one_time", "recurring"]] """ Only return prices of type `recurring` or `one_time`. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsRecurring(TypedDict): interval: NotRequired[Literal["day", "month", "week", "year"]] """ Filter by billing frequency. Either `day`, `week`, `month` or `year`. """ meter: NotRequired[str] """ Filter by the price's meter. """ usage_type: NotRequired[Literal["licensed", "metered"]] """ Filter by the usage type for this price. Can be either `metered` or `licensed`. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class SearchParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ page: NotRequired[str] """ A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. """ query: str """ The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for prices](https://stripe.com/docs/search#query-fields-for-prices). """ class UpdateParams(TypedDict): active: NotRequired[bool] """ Whether the price can be used for new purchases. Defaults to `true`. """ currency_options: NotRequired[ "Literal['']|Dict[str, PriceService.UpdateParamsCurrencyOptions]" ] """ Prices defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ lookup_key: NotRequired[str] """ A lookup key used to retrieve prices dynamically from a static string. This may be up to 200 characters. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ nickname: NotRequired[str] """ A brief description of the price, hidden from customers. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ transfer_lookup_key: NotRequired[bool] """ If set to true, will atomically remove the lookup key from the existing price, and assign it to this price. """ class UpdateParamsCurrencyOptions(TypedDict): custom_unit_amount: NotRequired[ "PriceService.UpdateParamsCurrencyOptionsCustomUnitAmount" ] """ When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ tiers: NotRequired[ List["PriceService.UpdateParamsCurrencyOptionsTier"] ] """ Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class UpdateParamsCurrencyOptionsCustomUnitAmount(TypedDict): enabled: bool """ Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. """ maximum: NotRequired[int] """ The maximum unit amount the customer can specify for this item. """ minimum: NotRequired[int] """ The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount. """ preset: NotRequired[int] """ The starting unit amount which can be updated by the customer. """ class UpdateParamsCurrencyOptionsTier(TypedDict): flat_amount: NotRequired[int] """ The flat billing amount for an entire tier, regardless of the number of units in the tier. """ flat_amount_decimal: NotRequired[str] """ Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. Only one of `flat_amount` and `flat_amount_decimal` can be set. """ unit_amount: NotRequired[int] """ The per unit billing amount for each individual unit for which this tier applies. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ up_to: Union[Literal["inf"], int] """ Specifies the upper bound of this tier. The lower bound of a tier is the upper bound of the previous tier adding one. Use `inf` to define a fallback tier. """ def list( self, params: "PriceService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Price]: """ Returns a list of your active prices, excluding [inline prices](https://stripe.com/docs/products-prices/pricing-models#inline-pricing). For the list of inactive prices, set active to false. """ return cast( ListObject[Price], self._request( "get", "/v1/prices", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "PriceService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Price]: """ Returns a list of your active prices, excluding [inline prices](https://stripe.com/docs/products-prices/pricing-models#inline-pricing). For the list of inactive prices, set active to false. """ return cast( ListObject[Price], await self._request_async( "get", "/v1/prices", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "PriceService.CreateParams", options: RequestOptions = {} ) -> Price: """ Creates a new price for an existing product. The price can be recurring or one-time. """ return cast( Price, self._request( "post", "/v1/prices", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "PriceService.CreateParams", options: RequestOptions = {} ) -> Price: """ Creates a new price for an existing product. The price can be recurring or one-time. """ return cast( Price, await self._request_async( "post", "/v1/prices", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, price: str, params: "PriceService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Price: """ Retrieves the price with the given ID. """ return cast( Price, self._request( "get", "/v1/prices/{price}".format(price=sanitize_id(price)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, price: str, params: "PriceService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Price: """ Retrieves the price with the given ID. """ return cast( Price, await self._request_async( "get", "/v1/prices/{price}".format(price=sanitize_id(price)), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, price: str, params: "PriceService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Price: """ Updates the specified price by setting the values of the parameters passed. Any parameters not provided are left unchanged. """ return cast( Price, self._request( "post", "/v1/prices/{price}".format(price=sanitize_id(price)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, price: str, params: "PriceService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Price: """ Updates the specified price by setting the values of the parameters passed. Any parameters not provided are left unchanged. """ return cast( Price, await self._request_async( "post", "/v1/prices/{price}".format(price=sanitize_id(price)), api_mode="V1", base_address="api", params=params, options=options, ), ) def search( self, params: "PriceService.SearchParams", options: RequestOptions = {} ) -> SearchResultObject[Price]: """ Search for prices you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India. """ return cast( SearchResultObject[Price], self._request( "get", "/v1/prices/search", api_mode="V1", base_address="api", params=params, options=options, ), ) async def search_async( self, params: "PriceService.SearchParams", options: RequestOptions = {} ) -> SearchResultObject[Price]: """ Search for prices you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India. """ return cast( SearchResultObject[Price], await self._request_async( "get", "/v1/prices/search", api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_product.py0000644000175100001770000011526414637354563016234 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._deletable_api_resource import DeletableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._nested_resource_class_methods import nested_resource_class_methods from stripe._request_options import RequestOptions from stripe._search_result_object import SearchResultObject from stripe._searchable_api_resource import SearchableAPIResource from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ( AsyncIterator, ClassVar, Dict, Iterator, List, Optional, Union, cast, overload, ) from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._price import Price from stripe._product_feature import ProductFeature from stripe._tax_code import TaxCode @nested_resource_class_methods("feature") class Product( CreateableAPIResource["Product"], DeletableAPIResource["Product"], ListableAPIResource["Product"], SearchableAPIResource["Product"], UpdateableAPIResource["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://stripe.com/docs/api#prices) to configure pricing in Payment Links, Checkout, and Subscriptions. Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription), [share a Payment Link](https://stripe.com/docs/payment-links), [accept payments with Checkout](https://stripe.com/docs/payments/accept-a-payment#create-product-prices-upfront), and more about [Products and Prices](https://stripe.com/docs/products-prices/overview) """ OBJECT_NAME: ClassVar[Literal["product"]] = "product" class MarketingFeature(StripeObject): name: Optional[str] """ The marketing feature name. Up to 80 characters long. """ class PackageDimensions(StripeObject): height: float """ Height, in inches. """ length: float """ Length, in inches. """ weight: float """ Weight, in ounces. """ width: float """ Width, in inches. """ class CreateFeatureParams(RequestOptions): entitlement_feature: str """ The ID of the [Feature](https://stripe.com/docs/api/entitlements/feature) object attached to this product. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CreateParams(RequestOptions): active: NotRequired[bool] """ Whether the product is currently available for purchase. Defaults to `true`. """ default_price_data: NotRequired["Product.CreateParamsDefaultPriceData"] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object. This Price will be set as the default price for this product. """ description: NotRequired[str] """ The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ id: NotRequired[str] """ An identifier will be randomly generated by Stripe. You can optionally override this ID, but the ID must be unique across all products in your Stripe account. """ images: NotRequired[List[str]] """ A list of up to 8 URLs of images for this product, meant to be displayable to the customer. """ marketing_features: NotRequired[ List["Product.CreateParamsMarketingFeature"] ] """ A list of up to 15 marketing features for this product. These are displayed in [pricing tables](https://stripe.com/docs/payments/checkout/pricing-table). """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ name: str """ The product's name, meant to be displayable to the customer. """ package_dimensions: NotRequired[ "Product.CreateParamsPackageDimensions" ] """ The dimensions of this product for shipping purposes. """ shippable: NotRequired[bool] """ Whether this product is shipped (i.e., physical goods). """ statement_descriptor: NotRequired[str] """ An arbitrary string to be displayed on your customer's credit card or bank statement. While most banks display this information consistently, some may display it incorrectly or not at all. This may be up to 22 characters. The statement description may not include `<`, `>`, `\\`, `"`, `'` characters, and will appear on your customer's statement in capital letters. Non-ASCII characters are automatically stripped. It must contain at least one letter. Only used for subscription payments. """ tax_code: NotRequired[str] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ type: NotRequired[Literal["good", "service"]] """ The type of the product. Defaults to `service` if not explicitly specified, enabling use of this product with Subscriptions and Plans. Set this parameter to `good` to use this product with Orders and SKUs. On API versions before `2018-02-05`, this field defaults to `good` for compatibility reasons. """ unit_label: NotRequired[str] """ A label that represents units of this product. When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. """ url: NotRequired[str] """ A URL of a publicly-accessible webpage for this product. """ class CreateParamsDefaultPriceData(TypedDict): 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). """ currency_options: NotRequired[ Dict[str, "Product.CreateParamsDefaultPriceDataCurrencyOptions"] ] """ Prices defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ recurring: NotRequired["Product.CreateParamsDefaultPriceDataRecurring"] """ The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class CreateParamsDefaultPriceDataCurrencyOptions(TypedDict): custom_unit_amount: NotRequired[ "Product.CreateParamsDefaultPriceDataCurrencyOptionsCustomUnitAmount" ] """ When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ tiers: NotRequired[ List["Product.CreateParamsDefaultPriceDataCurrencyOptionsTier"] ] """ Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class CreateParamsDefaultPriceDataCurrencyOptionsCustomUnitAmount( TypedDict, ): enabled: bool """ Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. """ maximum: NotRequired[int] """ The maximum unit amount the customer can specify for this item. """ minimum: NotRequired[int] """ The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount. """ preset: NotRequired[int] """ The starting unit amount which can be updated by the customer. """ class CreateParamsDefaultPriceDataCurrencyOptionsTier(TypedDict): flat_amount: NotRequired[int] """ The flat billing amount for an entire tier, regardless of the number of units in the tier. """ flat_amount_decimal: NotRequired[str] """ Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. Only one of `flat_amount` and `flat_amount_decimal` can be set. """ unit_amount: NotRequired[int] """ The per unit billing amount for each individual unit for which this tier applies. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ up_to: Union[Literal["inf"], int] """ Specifies the upper bound of this tier. The lower bound of a tier is the upper bound of the previous tier adding one. Use `inf` to define a fallback tier. """ class CreateParamsDefaultPriceDataRecurring(TypedDict): interval: Literal["day", "month", "week", "year"] """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class CreateParamsMarketingFeature(TypedDict): name: str """ The marketing feature name. Up to 80 characters long. """ class CreateParamsPackageDimensions(TypedDict): height: float """ Height, in inches. Maximum precision is 2 decimal places. """ length: float """ Length, in inches. Maximum precision is 2 decimal places. """ weight: float """ Weight, in ounces. Maximum precision is 2 decimal places. """ width: float """ Width, in inches. Maximum precision is 2 decimal places. """ class DeleteFeatureParams(RequestOptions): pass class DeleteParams(RequestOptions): pass class ListFeaturesParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParams(RequestOptions): active: NotRequired[bool] """ Only return products that are active or inactive (e.g., pass `false` to list all inactive products). """ created: NotRequired["Product.ListParamsCreated|int"] """ Only return products that were created during the given date interval. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ ids: NotRequired[List[str]] """ Only return products with the given IDs. Cannot be used with [starting_after](https://stripe.com/docs/api#list_products-starting_after) or [ending_before](https://stripe.com/docs/api#list_products-ending_before). """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ shippable: NotRequired[bool] """ Only return products that can be shipped (i.e., physical, not digital products). """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ type: NotRequired[Literal["good", "service"]] """ Only return products of this type. """ url: NotRequired[str] """ Only return products with the given url. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): active: NotRequired[bool] """ Whether the product is available for purchase. """ default_price: NotRequired[str] """ The ID of the [Price](https://stripe.com/docs/api/prices) object that is the default price for this product. """ description: NotRequired["Literal['']|str"] """ The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ images: NotRequired["Literal['']|List[str]"] """ A list of up to 8 URLs of images for this product, meant to be displayable to the customer. """ marketing_features: NotRequired[ "Literal['']|List[Product.ModifyParamsMarketingFeature]" ] """ A list of up to 15 marketing features for this product. These are displayed in [pricing tables](https://stripe.com/docs/payments/checkout/pricing-table). """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ name: NotRequired[str] """ The product's name, meant to be displayable to the customer. """ package_dimensions: NotRequired[ "Literal['']|Product.ModifyParamsPackageDimensions" ] """ The dimensions of this product for shipping purposes. """ shippable: NotRequired[bool] """ Whether this product is shipped (i.e., physical goods). """ statement_descriptor: NotRequired[str] """ An arbitrary string to be displayed on your customer's credit card or bank statement. While most banks display this information consistently, some may display it incorrectly or not at all. This may be up to 22 characters. The statement description may not include `<`, `>`, `\\`, `"`, `'` characters, and will appear on your customer's statement in capital letters. Non-ASCII characters are automatically stripped. It must contain at least one letter. May only be set if `type=service`. Only used for subscription payments. """ tax_code: NotRequired["Literal['']|str"] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ unit_label: NotRequired["Literal['']|str"] """ A label that represents units of this product. When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. May only be set if `type=service`. """ url: NotRequired["Literal['']|str"] """ A URL of a publicly-accessible webpage for this product. """ class ModifyParamsMarketingFeature(TypedDict): name: str """ The marketing feature name. Up to 80 characters long. """ class ModifyParamsPackageDimensions(TypedDict): height: float """ Height, in inches. Maximum precision is 2 decimal places. """ length: float """ Length, in inches. Maximum precision is 2 decimal places. """ weight: float """ Weight, in ounces. Maximum precision is 2 decimal places. """ width: float """ Width, in inches. Maximum precision is 2 decimal places. """ class RetrieveFeatureParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class SearchParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ page: NotRequired[str] """ A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. """ query: str """ The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for products](https://stripe.com/docs/search#query-fields-for-products). """ active: bool """ Whether the product is currently available for purchase. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ default_price: Optional[ExpandableField["Price"]] """ The ID of the [Price](https://stripe.com/docs/api/prices) object that is the default price for this product. """ description: Optional[str] """ The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. """ id: str """ Unique identifier for the object. """ images: List[str] """ A list of up to 8 URLs of images for this product, meant to be displayable to the customer. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ marketing_features: List[MarketingFeature] """ A list of up to 15 marketing features for this product. These are displayed in [pricing tables](https://stripe.com/docs/payments/checkout/pricing-table). """ metadata: Dict[str, str] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ name: str """ The product's name, meant to be displayable to the customer. """ object: Literal["product"] """ String representing the object's type. Objects of the same type share the same value. """ package_dimensions: Optional[PackageDimensions] """ The dimensions of this product for shipping purposes. """ shippable: Optional[bool] """ Whether this product is shipped (i.e., physical goods). """ statement_descriptor: Optional[str] """ Extra information about a product which will appear on your customer's credit card statement. In the case that multiple products are billed at once, the first statement descriptor will be used. Only used for subscription payments. """ tax_code: Optional[ExpandableField["TaxCode"]] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ type: Literal["good", "service"] """ The type of the product. The product is either of type `good`, which is eligible for use with Orders and SKUs, or `service`, which is eligible for use with Subscriptions and Plans. """ unit_label: Optional[str] """ A label that represents units of this product. When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. """ updated: int """ Time at which the object was last updated. Measured in seconds since the Unix epoch. """ url: Optional[str] """ A URL of a publicly-accessible webpage for this product. """ deleted: Optional[Literal[True]] """ Always true for a deleted object """ @classmethod def create(cls, **params: Unpack["Product.CreateParams"]) -> "Product": """ Creates a new product object. """ return cast( "Product", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["Product.CreateParams"] ) -> "Product": """ Creates a new product object. """ return cast( "Product", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def _cls_delete( cls, sid: str, **params: Unpack["Product.DeleteParams"] ) -> "Product": """ Delete a product. Deleting a product is only possible if it has no prices associated with it. Additionally, deleting a product with type=good is only possible if it has no SKUs associated with it. """ url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "Product", cls._static_request( "delete", url, params=params, ), ) @overload @staticmethod def delete( sid: str, **params: Unpack["Product.DeleteParams"] ) -> "Product": """ Delete a product. Deleting a product is only possible if it has no prices associated with it. Additionally, deleting a product with type=good is only possible if it has no SKUs associated with it. """ ... @overload def delete(self, **params: Unpack["Product.DeleteParams"]) -> "Product": """ Delete a product. Deleting a product is only possible if it has no prices associated with it. Additionally, deleting a product with type=good is only possible if it has no SKUs associated with it. """ ... @class_method_variant("_cls_delete") def delete( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Product.DeleteParams"] ) -> "Product": """ Delete a product. Deleting a product is only possible if it has no prices associated with it. Additionally, deleting a product with type=good is only possible if it has no SKUs associated with it. """ return self._request_and_refresh( "delete", self.instance_url(), params=params, ) @classmethod async def _cls_delete_async( cls, sid: str, **params: Unpack["Product.DeleteParams"] ) -> "Product": """ Delete a product. Deleting a product is only possible if it has no prices associated with it. Additionally, deleting a product with type=good is only possible if it has no SKUs associated with it. """ url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "Product", await cls._static_request_async( "delete", url, params=params, ), ) @overload @staticmethod async def delete_async( sid: str, **params: Unpack["Product.DeleteParams"] ) -> "Product": """ Delete a product. Deleting a product is only possible if it has no prices associated with it. Additionally, deleting a product with type=good is only possible if it has no SKUs associated with it. """ ... @overload async def delete_async( self, **params: Unpack["Product.DeleteParams"] ) -> "Product": """ Delete a product. Deleting a product is only possible if it has no prices associated with it. Additionally, deleting a product with type=good is only possible if it has no SKUs associated with it. """ ... @class_method_variant("_cls_delete_async") async def delete_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Product.DeleteParams"] ) -> "Product": """ Delete a product. Deleting a product is only possible if it has no prices associated with it. Additionally, deleting a product with type=good is only possible if it has no SKUs associated with it. """ return await self._request_and_refresh_async( "delete", self.instance_url(), params=params, ) @classmethod def list( cls, **params: Unpack["Product.ListParams"] ) -> ListObject["Product"]: """ Returns a list of your products. The products are returned sorted by creation date, with the most recently created products appearing first. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["Product.ListParams"] ) -> ListObject["Product"]: """ Returns a list of your products. The products are returned sorted by creation date, with the most recently created products appearing first. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def modify( cls, id: str, **params: Unpack["Product.ModifyParams"] ) -> "Product": """ Updates the specific product by setting the values of the parameters passed. Any parameters not provided will be left unchanged. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Product", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["Product.ModifyParams"] ) -> "Product": """ Updates the specific product by setting the values of the parameters passed. Any parameters not provided will be left unchanged. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Product", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["Product.RetrieveParams"] ) -> "Product": """ Retrieves the details of an existing product. Supply the unique product ID from either a product creation request or the product list, and Stripe will return the corresponding product information. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["Product.RetrieveParams"] ) -> "Product": """ Retrieves the details of an existing product. Supply the unique product ID from either a product creation request or the product list, and Stripe will return the corresponding product information. """ instance = cls(id, **params) await instance.refresh_async() return instance @classmethod def search( cls, *args, **kwargs: Unpack["Product.SearchParams"] ) -> SearchResultObject["Product"]: """ Search for products you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India. """ return cls._search(search_url="/v1/products/search", *args, **kwargs) @classmethod async def search_async( cls, *args, **kwargs: Unpack["Product.SearchParams"] ) -> SearchResultObject["Product"]: """ Search for products you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India. """ return await cls._search_async( search_url="/v1/products/search", *args, **kwargs ) @classmethod def search_auto_paging_iter( cls, *args, **kwargs: Unpack["Product.SearchParams"] ) -> Iterator["Product"]: return cls.search(*args, **kwargs).auto_paging_iter() @classmethod async def search_auto_paging_iter_async( cls, *args, **kwargs: Unpack["Product.SearchParams"] ) -> AsyncIterator["Product"]: return (await cls.search_async(*args, **kwargs)).auto_paging_iter() @classmethod def delete_feature( cls, product: str, id: str, **params: Unpack["Product.DeleteFeatureParams"], ) -> "ProductFeature": """ Deletes the feature attachment to a product """ return cast( "ProductFeature", cls._static_request( "delete", "/v1/products/{product}/features/{id}".format( product=sanitize_id(product), id=sanitize_id(id) ), params=params, ), ) @classmethod async def delete_feature_async( cls, product: str, id: str, **params: Unpack["Product.DeleteFeatureParams"], ) -> "ProductFeature": """ Deletes the feature attachment to a product """ return cast( "ProductFeature", await cls._static_request_async( "delete", "/v1/products/{product}/features/{id}".format( product=sanitize_id(product), id=sanitize_id(id) ), params=params, ), ) @classmethod def list_features( cls, product: str, **params: Unpack["Product.ListFeaturesParams"] ) -> ListObject["ProductFeature"]: """ Retrieve a list of features for a product """ return cast( ListObject["ProductFeature"], cls._static_request( "get", "/v1/products/{product}/features".format( product=sanitize_id(product) ), params=params, ), ) @classmethod async def list_features_async( cls, product: str, **params: Unpack["Product.ListFeaturesParams"] ) -> ListObject["ProductFeature"]: """ Retrieve a list of features for a product """ return cast( ListObject["ProductFeature"], await cls._static_request_async( "get", "/v1/products/{product}/features".format( product=sanitize_id(product) ), params=params, ), ) @classmethod def create_feature( cls, product: str, **params: Unpack["Product.CreateFeatureParams"] ) -> "ProductFeature": """ Creates a product_feature, which represents a feature attachment to a product """ return cast( "ProductFeature", cls._static_request( "post", "/v1/products/{product}/features".format( product=sanitize_id(product) ), params=params, ), ) @classmethod async def create_feature_async( cls, product: str, **params: Unpack["Product.CreateFeatureParams"] ) -> "ProductFeature": """ Creates a product_feature, which represents a feature attachment to a product """ return cast( "ProductFeature", await cls._static_request_async( "post", "/v1/products/{product}/features".format( product=sanitize_id(product) ), params=params, ), ) @classmethod def retrieve_feature( cls, product: str, id: str, **params: Unpack["Product.RetrieveFeatureParams"], ) -> "ProductFeature": """ Retrieves a product_feature, which represents a feature attachment to a product """ return cast( "ProductFeature", cls._static_request( "get", "/v1/products/{product}/features/{id}".format( product=sanitize_id(product), id=sanitize_id(id) ), params=params, ), ) @classmethod async def retrieve_feature_async( cls, product: str, id: str, **params: Unpack["Product.RetrieveFeatureParams"], ) -> "ProductFeature": """ Retrieves a product_feature, which represents a feature attachment to a product """ return cast( "ProductFeature", await cls._static_request_async( "get", "/v1/products/{product}/features/{id}".format( product=sanitize_id(product), id=sanitize_id(id) ), params=params, ), ) _inner_class_types = { "marketing_features": MarketingFeature, "package_dimensions": PackageDimensions, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_product_feature.py0000644000175100001770000000252214637354563017737 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject from typing import ClassVar, Optional from typing_extensions import Literal, TYPE_CHECKING if TYPE_CHECKING: from stripe.entitlements._feature import Feature class ProductFeature(StripeObject): """ A product_feature represents an attachment between a feature and a product. When a product is purchased that has a feature attached, Stripe will create an entitlement to the feature for the purchasing customer. """ OBJECT_NAME: ClassVar[Literal["product_feature"]] = "product_feature" entitlement_feature: "Feature" """ A feature represents a monetizable ability or functionality in your system. Features can be assigned to products, and when those products are purchased, Stripe will create an entitlement to the feature for the purchasing customer. """ id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ object: Literal["product_feature"] """ String representing the object's type. Objects of the same type share the same value. """ deleted: Optional[Literal[True]] """ Always true for a deleted object """ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_product_feature_service.py0000644000175100001770000001672714637354563021473 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._product_feature import ProductFeature from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict class ProductFeatureService(StripeService): class CreateParams(TypedDict): entitlement_feature: str """ The ID of the [Feature](https://stripe.com/docs/api/entitlements/feature) object attached to this product. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class DeleteParams(TypedDict): pass class ListParams(TypedDict): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def delete( self, product: str, id: str, params: "ProductFeatureService.DeleteParams" = {}, options: RequestOptions = {}, ) -> ProductFeature: """ Deletes the feature attachment to a product """ return cast( ProductFeature, self._request( "delete", "/v1/products/{product}/features/{id}".format( product=sanitize_id(product), id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def delete_async( self, product: str, id: str, params: "ProductFeatureService.DeleteParams" = {}, options: RequestOptions = {}, ) -> ProductFeature: """ Deletes the feature attachment to a product """ return cast( ProductFeature, await self._request_async( "delete", "/v1/products/{product}/features/{id}".format( product=sanitize_id(product), id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, product: str, id: str, params: "ProductFeatureService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> ProductFeature: """ Retrieves a product_feature, which represents a feature attachment to a product """ return cast( ProductFeature, self._request( "get", "/v1/products/{product}/features/{id}".format( product=sanitize_id(product), id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, product: str, id: str, params: "ProductFeatureService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> ProductFeature: """ Retrieves a product_feature, which represents a feature attachment to a product """ return cast( ProductFeature, await self._request_async( "get", "/v1/products/{product}/features/{id}".format( product=sanitize_id(product), id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def list( self, product: str, params: "ProductFeatureService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[ProductFeature]: """ Retrieve a list of features for a product """ return cast( ListObject[ProductFeature], self._request( "get", "/v1/products/{product}/features".format( product=sanitize_id(product), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, product: str, params: "ProductFeatureService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[ProductFeature]: """ Retrieve a list of features for a product """ return cast( ListObject[ProductFeature], await self._request_async( "get", "/v1/products/{product}/features".format( product=sanitize_id(product), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, product: str, params: "ProductFeatureService.CreateParams", options: RequestOptions = {}, ) -> ProductFeature: """ Creates a product_feature, which represents a feature attachment to a product """ return cast( ProductFeature, self._request( "post", "/v1/products/{product}/features".format( product=sanitize_id(product), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, product: str, params: "ProductFeatureService.CreateParams", options: RequestOptions = {}, ) -> ProductFeature: """ Creates a product_feature, which represents a feature attachment to a product """ return cast( ProductFeature, await self._request_async( "post", "/v1/products/{product}/features".format( product=sanitize_id(product), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_product_service.py0000644000175100001770000006441314637354563017753 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._product import Product from stripe._product_feature_service import ProductFeatureService from stripe._request_options import RequestOptions from stripe._search_result_object import SearchResultObject from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import Dict, List, Union, cast from typing_extensions import Literal, NotRequired, TypedDict class ProductService(StripeService): def __init__(self, requestor): super().__init__(requestor) self.features = ProductFeatureService(self._requestor) class CreateParams(TypedDict): active: NotRequired[bool] """ Whether the product is currently available for purchase. Defaults to `true`. """ default_price_data: NotRequired[ "ProductService.CreateParamsDefaultPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object. This Price will be set as the default price for this product. """ description: NotRequired[str] """ The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ id: NotRequired[str] """ An identifier will be randomly generated by Stripe. You can optionally override this ID, but the ID must be unique across all products in your Stripe account. """ images: NotRequired[List[str]] """ A list of up to 8 URLs of images for this product, meant to be displayable to the customer. """ marketing_features: NotRequired[ List["ProductService.CreateParamsMarketingFeature"] ] """ A list of up to 15 marketing features for this product. These are displayed in [pricing tables](https://stripe.com/docs/payments/checkout/pricing-table). """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ name: str """ The product's name, meant to be displayable to the customer. """ package_dimensions: NotRequired[ "ProductService.CreateParamsPackageDimensions" ] """ The dimensions of this product for shipping purposes. """ shippable: NotRequired[bool] """ Whether this product is shipped (i.e., physical goods). """ statement_descriptor: NotRequired[str] """ An arbitrary string to be displayed on your customer's credit card or bank statement. While most banks display this information consistently, some may display it incorrectly or not at all. This may be up to 22 characters. The statement description may not include `<`, `>`, `\\`, `"`, `'` characters, and will appear on your customer's statement in capital letters. Non-ASCII characters are automatically stripped. It must contain at least one letter. Only used for subscription payments. """ tax_code: NotRequired[str] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ type: NotRequired[Literal["good", "service"]] """ The type of the product. Defaults to `service` if not explicitly specified, enabling use of this product with Subscriptions and Plans. Set this parameter to `good` to use this product with Orders and SKUs. On API versions before `2018-02-05`, this field defaults to `good` for compatibility reasons. """ unit_label: NotRequired[str] """ A label that represents units of this product. When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. """ url: NotRequired[str] """ A URL of a publicly-accessible webpage for this product. """ class CreateParamsDefaultPriceData(TypedDict): 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). """ currency_options: NotRequired[ Dict[ str, "ProductService.CreateParamsDefaultPriceDataCurrencyOptions", ] ] """ Prices defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ recurring: NotRequired[ "ProductService.CreateParamsDefaultPriceDataRecurring" ] """ The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class CreateParamsDefaultPriceDataCurrencyOptions(TypedDict): custom_unit_amount: NotRequired[ "ProductService.CreateParamsDefaultPriceDataCurrencyOptionsCustomUnitAmount" ] """ When set, provides configuration for the amount to be adjusted by the customer during Checkout Sessions and Payment Links. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ tiers: NotRequired[ List[ "ProductService.CreateParamsDefaultPriceDataCurrencyOptionsTier" ] ] """ Each element represents a pricing tier. This parameter requires `billing_scheme` to be set to `tiered`. See also the documentation for `billing_scheme`. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class CreateParamsDefaultPriceDataCurrencyOptionsCustomUnitAmount( TypedDict, ): enabled: bool """ Pass in `true` to enable `custom_unit_amount`, otherwise omit `custom_unit_amount`. """ maximum: NotRequired[int] """ The maximum unit amount the customer can specify for this item. """ minimum: NotRequired[int] """ The minimum unit amount the customer can specify for this item. Must be at least the minimum charge amount. """ preset: NotRequired[int] """ The starting unit amount which can be updated by the customer. """ class CreateParamsDefaultPriceDataCurrencyOptionsTier(TypedDict): flat_amount: NotRequired[int] """ The flat billing amount for an entire tier, regardless of the number of units in the tier. """ flat_amount_decimal: NotRequired[str] """ Same as `flat_amount`, but accepts a decimal value representing an integer in the minor units of the currency. Only one of `flat_amount` and `flat_amount_decimal` can be set. """ unit_amount: NotRequired[int] """ The per unit billing amount for each individual unit for which this tier applies. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ up_to: Union[Literal["inf"], int] """ Specifies the upper bound of this tier. The lower bound of a tier is the upper bound of the previous tier adding one. Use `inf` to define a fallback tier. """ class CreateParamsDefaultPriceDataRecurring(TypedDict): interval: Literal["day", "month", "week", "year"] """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class CreateParamsMarketingFeature(TypedDict): name: str """ The marketing feature name. Up to 80 characters long. """ class CreateParamsPackageDimensions(TypedDict): height: float """ Height, in inches. Maximum precision is 2 decimal places. """ length: float """ Length, in inches. Maximum precision is 2 decimal places. """ weight: float """ Weight, in ounces. Maximum precision is 2 decimal places. """ width: float """ Width, in inches. Maximum precision is 2 decimal places. """ class DeleteParams(TypedDict): pass class ListParams(TypedDict): active: NotRequired[bool] """ Only return products that are active or inactive (e.g., pass `false` to list all inactive products). """ created: NotRequired["ProductService.ListParamsCreated|int"] """ Only return products that were created during the given date interval. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ ids: NotRequired[List[str]] """ Only return products with the given IDs. Cannot be used with [starting_after](https://stripe.com/docs/api#list_products-starting_after) or [ending_before](https://stripe.com/docs/api#list_products-ending_before). """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ shippable: NotRequired[bool] """ Only return products that can be shipped (i.e., physical, not digital products). """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ type: NotRequired[Literal["good", "service"]] """ Only return products of this type. """ url: NotRequired[str] """ Only return products with the given url. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class SearchParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ page: NotRequired[str] """ A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. """ query: str """ The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for products](https://stripe.com/docs/search#query-fields-for-products). """ class UpdateParams(TypedDict): active: NotRequired[bool] """ Whether the product is available for purchase. """ default_price: NotRequired[str] """ The ID of the [Price](https://stripe.com/docs/api/prices) object that is the default price for this product. """ description: NotRequired["Literal['']|str"] """ The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ images: NotRequired["Literal['']|List[str]"] """ A list of up to 8 URLs of images for this product, meant to be displayable to the customer. """ marketing_features: NotRequired[ "Literal['']|List[ProductService.UpdateParamsMarketingFeature]" ] """ A list of up to 15 marketing features for this product. These are displayed in [pricing tables](https://stripe.com/docs/payments/checkout/pricing-table). """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ name: NotRequired[str] """ The product's name, meant to be displayable to the customer. """ package_dimensions: NotRequired[ "Literal['']|ProductService.UpdateParamsPackageDimensions" ] """ The dimensions of this product for shipping purposes. """ shippable: NotRequired[bool] """ Whether this product is shipped (i.e., physical goods). """ statement_descriptor: NotRequired[str] """ An arbitrary string to be displayed on your customer's credit card or bank statement. While most banks display this information consistently, some may display it incorrectly or not at all. This may be up to 22 characters. The statement description may not include `<`, `>`, `\\`, `"`, `'` characters, and will appear on your customer's statement in capital letters. Non-ASCII characters are automatically stripped. It must contain at least one letter. May only be set if `type=service`. Only used for subscription payments. """ tax_code: NotRequired["Literal['']|str"] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ unit_label: NotRequired["Literal['']|str"] """ A label that represents units of this product. When set, this will be included in customers' receipts, invoices, Checkout, and the customer portal. May only be set if `type=service`. """ url: NotRequired["Literal['']|str"] """ A URL of a publicly-accessible webpage for this product. """ class UpdateParamsMarketingFeature(TypedDict): name: str """ The marketing feature name. Up to 80 characters long. """ class UpdateParamsPackageDimensions(TypedDict): height: float """ Height, in inches. Maximum precision is 2 decimal places. """ length: float """ Length, in inches. Maximum precision is 2 decimal places. """ weight: float """ Weight, in ounces. Maximum precision is 2 decimal places. """ width: float """ Width, in inches. Maximum precision is 2 decimal places. """ def delete( self, id: str, params: "ProductService.DeleteParams" = {}, options: RequestOptions = {}, ) -> Product: """ Delete a product. Deleting a product is only possible if it has no prices associated with it. Additionally, deleting a product with type=good is only possible if it has no SKUs associated with it. """ return cast( Product, self._request( "delete", "/v1/products/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def delete_async( self, id: str, params: "ProductService.DeleteParams" = {}, options: RequestOptions = {}, ) -> Product: """ Delete a product. Deleting a product is only possible if it has no prices associated with it. Additionally, deleting a product with type=good is only possible if it has no SKUs associated with it. """ return cast( Product, await self._request_async( "delete", "/v1/products/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, id: str, params: "ProductService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Product: """ Retrieves the details of an existing product. Supply the unique product ID from either a product creation request or the product list, and Stripe will return the corresponding product information. """ return cast( Product, self._request( "get", "/v1/products/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, id: str, params: "ProductService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Product: """ Retrieves the details of an existing product. Supply the unique product ID from either a product creation request or the product list, and Stripe will return the corresponding product information. """ return cast( Product, await self._request_async( "get", "/v1/products/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, id: str, params: "ProductService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Product: """ Updates the specific product by setting the values of the parameters passed. Any parameters not provided will be left unchanged. """ return cast( Product, self._request( "post", "/v1/products/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, id: str, params: "ProductService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Product: """ Updates the specific product by setting the values of the parameters passed. Any parameters not provided will be left unchanged. """ return cast( Product, await self._request_async( "post", "/v1/products/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) def list( self, params: "ProductService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Product]: """ Returns a list of your products. The products are returned sorted by creation date, with the most recently created products appearing first. """ return cast( ListObject[Product], self._request( "get", "/v1/products", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "ProductService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Product]: """ Returns a list of your products. The products are returned sorted by creation date, with the most recently created products appearing first. """ return cast( ListObject[Product], await self._request_async( "get", "/v1/products", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "ProductService.CreateParams", options: RequestOptions = {}, ) -> Product: """ Creates a new product object. """ return cast( Product, self._request( "post", "/v1/products", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "ProductService.CreateParams", options: RequestOptions = {}, ) -> Product: """ Creates a new product object. """ return cast( Product, await self._request_async( "post", "/v1/products", api_mode="V1", base_address="api", params=params, options=options, ), ) def search( self, params: "ProductService.SearchParams", options: RequestOptions = {}, ) -> SearchResultObject[Product]: """ Search for products you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India. """ return cast( SearchResultObject[Product], self._request( "get", "/v1/products/search", api_mode="V1", base_address="api", params=params, options=options, ), ) async def search_async( self, params: "ProductService.SearchParams", options: RequestOptions = {}, ) -> SearchResultObject[Product]: """ Search for products you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India. """ return cast( SearchResultObject[Product], await self._request_async( "get", "/v1/products/search", api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_promotion_code.py0000644000175100001770000003711514637354563017572 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import sanitize_id from typing import ClassVar, Dict, List, Optional, cast from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._coupon import Coupon from stripe._customer import Customer class PromotionCode( CreateableAPIResource["PromotionCode"], ListableAPIResource["PromotionCode"], UpdateableAPIResource["PromotionCode"], ): """ A Promotion Code represents a customer-redeemable code for a [coupon](https://stripe.com/docs/api#coupons). It can be used to create multiple codes for a single coupon. """ OBJECT_NAME: ClassVar[Literal["promotion_code"]] = "promotion_code" class Restrictions(StripeObject): class CurrencyOptions(StripeObject): minimum_amount: int """ Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). """ currency_options: Optional[Dict[str, CurrencyOptions]] """ Promotion code restrictions defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ first_time_transaction: bool """ A Boolean indicating if the Promotion Code should only be redeemed for Customers without any successful payments or invoices """ minimum_amount: Optional[int] """ Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). """ minimum_amount_currency: Optional[str] """ Three-letter [ISO code](https://stripe.com/docs/currencies) for minimum_amount """ _inner_class_types = {"currency_options": CurrencyOptions} _inner_class_dicts = ["currency_options"] class CreateParams(RequestOptions): active: NotRequired[bool] """ Whether the promotion code is currently active. """ code: NotRequired[str] """ The customer-facing code. Regardless of case, this code must be unique across all active promotion codes for a specific customer. If left blank, we will generate one automatically. """ coupon: str """ The coupon for this promotion code. """ customer: NotRequired[str] """ The customer that this promotion code can be used by. If not set, the promotion code can be used by all customers. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ expires_at: NotRequired[int] """ The timestamp at which this promotion code will expire. If the coupon has specified a `redeems_by`, then this value cannot be after the coupon's `redeems_by`. """ max_redemptions: NotRequired[int] """ A positive integer specifying the number of times the promotion code can be redeemed. If the coupon has specified a `max_redemptions`, then this value cannot be greater than the coupon's `max_redemptions`. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ restrictions: NotRequired["PromotionCode.CreateParamsRestrictions"] """ Settings that restrict the redemption of the promotion code. """ class CreateParamsRestrictions(TypedDict): currency_options: NotRequired[ Dict[str, "PromotionCode.CreateParamsRestrictionsCurrencyOptions"] ] """ Promotion codes defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ first_time_transaction: NotRequired[bool] """ A Boolean indicating if the Promotion Code should only be redeemed for Customers without any successful payments or invoices """ minimum_amount: NotRequired[int] """ Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). """ minimum_amount_currency: NotRequired[str] """ Three-letter [ISO code](https://stripe.com/docs/currencies) for minimum_amount """ class CreateParamsRestrictionsCurrencyOptions(TypedDict): minimum_amount: NotRequired[int] """ Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). """ class ListParams(RequestOptions): active: NotRequired[bool] """ Filter promotion codes by whether they are active. """ code: NotRequired[str] """ Only return promotion codes that have this case-insensitive code. """ coupon: NotRequired[str] """ Only return promotion codes for this coupon. """ created: NotRequired["PromotionCode.ListParamsCreated|int"] """ A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. """ customer: NotRequired[str] """ Only return promotion codes that are restricted to this customer. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): active: NotRequired[bool] """ Whether the promotion code is currently active. A promotion code can only be reactivated when the coupon is still valid and the promotion code is otherwise redeemable. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ restrictions: NotRequired["PromotionCode.ModifyParamsRestrictions"] """ Settings that restrict the redemption of the promotion code. """ class ModifyParamsRestrictions(TypedDict): currency_options: NotRequired[ Dict[str, "PromotionCode.ModifyParamsRestrictionsCurrencyOptions"] ] """ Promotion codes defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ class ModifyParamsRestrictionsCurrencyOptions(TypedDict): minimum_amount: NotRequired[int] """ Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ active: bool """ Whether the promotion code is currently active. A promotion code is only active if the coupon is also valid. """ code: str """ The customer-facing code. Regardless of case, this code must be unique across all active promotion codes for each customer. """ coupon: "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://stripe.com/docs/api#subscriptions), [invoices](https://stripe.com/docs/api#invoices), [checkout sessions](https://stripe.com/docs/api/checkout/sessions), [quotes](https://stripe.com/docs/api#quotes), and more. Coupons do not work with conventional one-off [charges](https://stripe.com/docs/api#create_charge) or [payment intents](https://stripe.com/docs/api/payment_intents). """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ customer: Optional[ExpandableField["Customer"]] """ The customer that this promotion code can be used by. """ expires_at: Optional[int] """ Date at which the promotion code can no longer be redeemed. """ id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ max_redemptions: Optional[int] """ Maximum number of times this promotion code can be redeemed. """ metadata: Optional[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ object: Literal["promotion_code"] """ String representing the object's type. Objects of the same type share the same value. """ restrictions: Restrictions times_redeemed: int """ Number of times this promotion code has been used. """ @classmethod def create( cls, **params: Unpack["PromotionCode.CreateParams"] ) -> "PromotionCode": """ A promotion code points to a coupon. You can optionally restrict the code to a specific customer, redemption limit, and expiration date. """ return cast( "PromotionCode", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["PromotionCode.CreateParams"] ) -> "PromotionCode": """ A promotion code points to a coupon. You can optionally restrict the code to a specific customer, redemption limit, and expiration date. """ return cast( "PromotionCode", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def list( cls, **params: Unpack["PromotionCode.ListParams"] ) -> ListObject["PromotionCode"]: """ Returns a list of your promotion codes. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["PromotionCode.ListParams"] ) -> ListObject["PromotionCode"]: """ Returns a list of your promotion codes. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def modify( cls, id: str, **params: Unpack["PromotionCode.ModifyParams"] ) -> "PromotionCode": """ Updates the specified promotion code by setting the values of the parameters passed. Most fields are, by design, not editable. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "PromotionCode", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["PromotionCode.ModifyParams"] ) -> "PromotionCode": """ Updates the specified promotion code by setting the values of the parameters passed. Most fields are, by design, not editable. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "PromotionCode", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["PromotionCode.RetrieveParams"] ) -> "PromotionCode": """ Retrieves the promotion code with the given ID. In order to retrieve a promotion code by the customer-facing code use [list](https://stripe.com/docs/api/promotion_codes/list) with the desired code. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["PromotionCode.RetrieveParams"] ) -> "PromotionCode": """ Retrieves the promotion code with the given ID. In order to retrieve a promotion code by the customer-facing code use [list](https://stripe.com/docs/api/promotion_codes/list) with the desired code. """ instance = cls(id, **params) await instance.refresh_async() return instance _inner_class_types = {"restrictions": Restrictions} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_promotion_code_service.py0000644000175100001770000003203014637354563021301 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._promotion_code import PromotionCode from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class PromotionCodeService(StripeService): class CreateParams(TypedDict): active: NotRequired[bool] """ Whether the promotion code is currently active. """ code: NotRequired[str] """ The customer-facing code. Regardless of case, this code must be unique across all active promotion codes for a specific customer. If left blank, we will generate one automatically. """ coupon: str """ The coupon for this promotion code. """ customer: NotRequired[str] """ The customer that this promotion code can be used by. If not set, the promotion code can be used by all customers. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ expires_at: NotRequired[int] """ The timestamp at which this promotion code will expire. If the coupon has specified a `redeems_by`, then this value cannot be after the coupon's `redeems_by`. """ max_redemptions: NotRequired[int] """ A positive integer specifying the number of times the promotion code can be redeemed. If the coupon has specified a `max_redemptions`, then this value cannot be greater than the coupon's `max_redemptions`. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ restrictions: NotRequired[ "PromotionCodeService.CreateParamsRestrictions" ] """ Settings that restrict the redemption of the promotion code. """ class CreateParamsRestrictions(TypedDict): currency_options: NotRequired[ Dict[ str, "PromotionCodeService.CreateParamsRestrictionsCurrencyOptions", ] ] """ Promotion codes defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ first_time_transaction: NotRequired[bool] """ A Boolean indicating if the Promotion Code should only be redeemed for Customers without any successful payments or invoices """ minimum_amount: NotRequired[int] """ Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). """ minimum_amount_currency: NotRequired[str] """ Three-letter [ISO code](https://stripe.com/docs/currencies) for minimum_amount """ class CreateParamsRestrictionsCurrencyOptions(TypedDict): minimum_amount: NotRequired[int] """ Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). """ class ListParams(TypedDict): active: NotRequired[bool] """ Filter promotion codes by whether they are active. """ code: NotRequired[str] """ Only return promotion codes that have this case-insensitive code. """ coupon: NotRequired[str] """ Only return promotion codes for this coupon. """ created: NotRequired["PromotionCodeService.ListParamsCreated|int"] """ A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. """ customer: NotRequired[str] """ Only return promotion codes that are restricted to this customer. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): active: NotRequired[bool] """ Whether the promotion code is currently active. A promotion code can only be reactivated when the coupon is still valid and the promotion code is otherwise redeemable. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ restrictions: NotRequired[ "PromotionCodeService.UpdateParamsRestrictions" ] """ Settings that restrict the redemption of the promotion code. """ class UpdateParamsRestrictions(TypedDict): currency_options: NotRequired[ Dict[ str, "PromotionCodeService.UpdateParamsRestrictionsCurrencyOptions", ] ] """ Promotion codes defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ class UpdateParamsRestrictionsCurrencyOptions(TypedDict): minimum_amount: NotRequired[int] """ Minimum amount required to redeem this Promotion Code into a Coupon (e.g., a purchase must be $100 or more to work). """ def list( self, params: "PromotionCodeService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[PromotionCode]: """ Returns a list of your promotion codes. """ return cast( ListObject[PromotionCode], self._request( "get", "/v1/promotion_codes", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "PromotionCodeService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[PromotionCode]: """ Returns a list of your promotion codes. """ return cast( ListObject[PromotionCode], await self._request_async( "get", "/v1/promotion_codes", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "PromotionCodeService.CreateParams", options: RequestOptions = {}, ) -> PromotionCode: """ A promotion code points to a coupon. You can optionally restrict the code to a specific customer, redemption limit, and expiration date. """ return cast( PromotionCode, self._request( "post", "/v1/promotion_codes", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "PromotionCodeService.CreateParams", options: RequestOptions = {}, ) -> PromotionCode: """ A promotion code points to a coupon. You can optionally restrict the code to a specific customer, redemption limit, and expiration date. """ return cast( PromotionCode, await self._request_async( "post", "/v1/promotion_codes", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, promotion_code: str, params: "PromotionCodeService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> PromotionCode: """ Retrieves the promotion code with the given ID. In order to retrieve a promotion code by the customer-facing code use [list](https://stripe.com/docs/api/promotion_codes/list) with the desired code. """ return cast( PromotionCode, self._request( "get", "/v1/promotion_codes/{promotion_code}".format( promotion_code=sanitize_id(promotion_code), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, promotion_code: str, params: "PromotionCodeService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> PromotionCode: """ Retrieves the promotion code with the given ID. In order to retrieve a promotion code by the customer-facing code use [list](https://stripe.com/docs/api/promotion_codes/list) with the desired code. """ return cast( PromotionCode, await self._request_async( "get", "/v1/promotion_codes/{promotion_code}".format( promotion_code=sanitize_id(promotion_code), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, promotion_code: str, params: "PromotionCodeService.UpdateParams" = {}, options: RequestOptions = {}, ) -> PromotionCode: """ Updates the specified promotion code by setting the values of the parameters passed. Most fields are, by design, not editable. """ return cast( PromotionCode, self._request( "post", "/v1/promotion_codes/{promotion_code}".format( promotion_code=sanitize_id(promotion_code), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, promotion_code: str, params: "PromotionCodeService.UpdateParams" = {}, options: RequestOptions = {}, ) -> PromotionCode: """ Updates the specified promotion code by setting the values of the parameters passed. Most fields are, by design, not editable. """ return cast( PromotionCode, await self._request_async( "post", "/v1/promotion_codes/{promotion_code}".format( promotion_code=sanitize_id(promotion_code), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_quote.py0000644000175100001770000023606714637354563015716 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import Any, ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._account import Account from stripe._application import Application from stripe._customer import Customer from stripe._discount import Discount as DiscountResource from stripe._invoice import Invoice from stripe._line_item import LineItem from stripe._subscription import Subscription from stripe._subscription_schedule import SubscriptionSchedule from stripe._tax_rate import TaxRate from stripe.test_helpers._test_clock import TestClock class Quote( CreateableAPIResource["Quote"], ListableAPIResource["Quote"], UpdateableAPIResource["Quote"], ): """ A Quote is a way to model prices that you'd like to provide to a customer. Once accepted, it will automatically create an invoice, subscription or subscription schedule. """ OBJECT_NAME: ClassVar[Literal["quote"]] = "quote" class AutomaticTax(StripeObject): class Liability(StripeObject): account: Optional[ExpandableField["Account"]] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced. """ enabled: bool """ Automatically calculate taxes """ liability: Optional[Liability] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ status: Optional[ Literal["complete", "failed", "requires_location_inputs"] ] """ The status of the most recent automated tax calculation for this quote. """ _inner_class_types = {"liability": Liability} class Computed(StripeObject): class Recurring(StripeObject): class TotalDetails(StripeObject): class Breakdown(StripeObject): class Discount(StripeObject): amount: int """ The amount discounted. """ discount: "DiscountResource" """ A discount represents the actual application of a [coupon](https://stripe.com/docs/api#coupons) or [promotion code](https://stripe.com/docs/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://stripe.com/docs/billing/subscriptions/discounts) """ class Tax(StripeObject): amount: int """ Amount of tax applied for this rate. """ rate: "TaxRate" """ Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates) """ taxability_reason: Optional[ Literal[ "customer_exempt", "not_collecting", "not_subject_to_tax", "not_supported", "portion_product_exempt", "portion_reduced_rated", "portion_standard_rated", "product_exempt", "product_exempt_holiday", "proportionally_rated", "reduced_rated", "reverse_charge", "standard_rated", "taxable_basis_reduced", "zero_rated", ] ] """ The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. """ taxable_amount: Optional[int] """ The amount on which tax is calculated, in cents (or local equivalent). """ discounts: List[Discount] """ The aggregated discounts. """ taxes: List[Tax] """ The aggregated tax amounts by rate. """ _inner_class_types = {"discounts": Discount, "taxes": Tax} amount_discount: int """ This is the sum of all the discounts. """ amount_shipping: Optional[int] """ This is the sum of all the shipping amounts. """ amount_tax: int """ This is the sum of all the tax amounts. """ breakdown: Optional[Breakdown] _inner_class_types = {"breakdown": Breakdown} amount_subtotal: int """ Total before any discounts or taxes are applied. """ amount_total: int """ Total after discounts and taxes are applied. """ interval: Literal["day", "month", "week", "year"] """ The frequency at which a subscription is billed. One of `day`, `week`, `month` or `year`. """ interval_count: int """ The number of intervals (specified in the `interval` attribute) between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. """ total_details: TotalDetails _inner_class_types = {"total_details": TotalDetails} class Upfront(StripeObject): class TotalDetails(StripeObject): class Breakdown(StripeObject): class Discount(StripeObject): amount: int """ The amount discounted. """ discount: "DiscountResource" """ A discount represents the actual application of a [coupon](https://stripe.com/docs/api#coupons) or [promotion code](https://stripe.com/docs/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://stripe.com/docs/billing/subscriptions/discounts) """ class Tax(StripeObject): amount: int """ Amount of tax applied for this rate. """ rate: "TaxRate" """ Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates) """ taxability_reason: Optional[ Literal[ "customer_exempt", "not_collecting", "not_subject_to_tax", "not_supported", "portion_product_exempt", "portion_reduced_rated", "portion_standard_rated", "product_exempt", "product_exempt_holiday", "proportionally_rated", "reduced_rated", "reverse_charge", "standard_rated", "taxable_basis_reduced", "zero_rated", ] ] """ The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. """ taxable_amount: Optional[int] """ The amount on which tax is calculated, in cents (or local equivalent). """ discounts: List[Discount] """ The aggregated discounts. """ taxes: List[Tax] """ The aggregated tax amounts by rate. """ _inner_class_types = {"discounts": Discount, "taxes": Tax} amount_discount: int """ This is the sum of all the discounts. """ amount_shipping: Optional[int] """ This is the sum of all the shipping amounts. """ amount_tax: int """ This is the sum of all the tax amounts. """ breakdown: Optional[Breakdown] _inner_class_types = {"breakdown": Breakdown} amount_subtotal: int """ Total before any discounts or taxes are applied. """ amount_total: int """ Total after discounts and taxes are applied. """ line_items: Optional[ListObject["LineItem"]] """ The line items that will appear on the next invoice after this quote is accepted. This does not include pending invoice items that exist on the customer but may still be included in the next invoice. """ total_details: TotalDetails _inner_class_types = {"total_details": TotalDetails} recurring: Optional[Recurring] """ The definitive totals and line items the customer will be charged on a recurring basis. Takes into account the line items with recurring prices and discounts with `duration=forever` coupons only. Defaults to `null` if no inputted line items with recurring prices. """ upfront: Upfront _inner_class_types = {"recurring": Recurring, "upfront": Upfront} class FromQuote(StripeObject): is_revision: bool """ Whether this quote is a revision of a different quote. """ quote: ExpandableField["Quote"] """ The quote that was cloned. """ class InvoiceSettings(StripeObject): class Issuer(StripeObject): account: Optional[ExpandableField["Account"]] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced. """ days_until_due: Optional[int] """ Number of days within which a customer must pay invoices generated by this quote. This value will be `null` for quotes where `collection_method=charge_automatically`. """ issuer: Issuer _inner_class_types = {"issuer": Issuer} class StatusTransitions(StripeObject): accepted_at: Optional[int] """ The time that the quote was accepted. Measured in seconds since Unix epoch. """ canceled_at: Optional[int] """ The time that the quote was canceled. Measured in seconds since Unix epoch. """ finalized_at: Optional[int] """ The time that the quote was finalized. Measured in seconds since Unix epoch. """ class SubscriptionData(StripeObject): description: Optional[str] """ The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ effective_date: Optional[int] """ When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. This date is ignored if it is in the past when the quote is accepted. Measured in seconds since the Unix epoch. """ metadata: Optional[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on the subscription or subscription schedule when the quote is accepted. If a recurring price is included in `line_items`, this field will be passed to the resulting subscription's `metadata` field. If `subscription_data.effective_date` is used, this field will be passed to the resulting subscription schedule's `phases.metadata` field. Unlike object-level metadata, this field is declarative. Updates will clear prior values. """ trial_period_days: Optional[int] """ Integer representing the number of trial period days before the customer is charged for the first time. """ class TotalDetails(StripeObject): class Breakdown(StripeObject): class Discount(StripeObject): amount: int """ The amount discounted. """ discount: "DiscountResource" """ A discount represents the actual application of a [coupon](https://stripe.com/docs/api#coupons) or [promotion code](https://stripe.com/docs/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://stripe.com/docs/billing/subscriptions/discounts) """ class Tax(StripeObject): amount: int """ Amount of tax applied for this rate. """ rate: "TaxRate" """ Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates) """ taxability_reason: Optional[ Literal[ "customer_exempt", "not_collecting", "not_subject_to_tax", "not_supported", "portion_product_exempt", "portion_reduced_rated", "portion_standard_rated", "product_exempt", "product_exempt_holiday", "proportionally_rated", "reduced_rated", "reverse_charge", "standard_rated", "taxable_basis_reduced", "zero_rated", ] ] """ The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. """ taxable_amount: Optional[int] """ The amount on which tax is calculated, in cents (or local equivalent). """ discounts: List[Discount] """ The aggregated discounts. """ taxes: List[Tax] """ The aggregated tax amounts by rate. """ _inner_class_types = {"discounts": Discount, "taxes": Tax} amount_discount: int """ This is the sum of all the discounts. """ amount_shipping: Optional[int] """ This is the sum of all the shipping amounts. """ amount_tax: int """ This is the sum of all the tax amounts. """ breakdown: Optional[Breakdown] _inner_class_types = {"breakdown": Breakdown} class TransferData(StripeObject): amount: Optional[int] """ The amount in cents (or local equivalent) that will be transferred to the destination account when the invoice is paid. By default, the entire amount is transferred to the destination. """ amount_percent: Optional[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount will be transferred to the destination. """ destination: ExpandableField["Account"] """ The account where funds from the payment will be transferred to upon payment success. """ class AcceptParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CancelParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CreateParams(RequestOptions): application_fee_amount: NotRequired["Literal['']|int"] """ The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. There cannot be any line items with recurring prices when using this field. """ application_fee_percent: NotRequired["Literal['']|float"] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. There must be at least 1 line item with a recurring price to use this field. """ automatic_tax: NotRequired["Quote.CreateParamsAutomaticTax"] """ Settings for automatic tax lookup for this quote and resulting invoices and subscriptions. """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or at invoice finalization using the default payment method attached to the subscription or customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`. """ customer: NotRequired[str] """ The customer for which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed. """ default_tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates that will apply to any line item that does not have `tax_rates` set. """ description: NotRequired["Literal['']|str"] """ A description that will be displayed on the quote PDF. If no value is passed, the default description configured in your [quote template settings](https://dashboard.stripe.com/settings/billing/quote) will be used. """ discounts: NotRequired["Literal['']|List[Quote.CreateParamsDiscount]"] """ The discounts applied to the quote. You can only set up to one discount. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ expires_at: NotRequired[int] """ A future timestamp on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch. If no value is passed, the default expiration date configured in your [quote template settings](https://dashboard.stripe.com/settings/billing/quote) will be used. """ footer: NotRequired["Literal['']|str"] """ A footer that will be displayed on the quote PDF. If no value is passed, the default footer configured in your [quote template settings](https://dashboard.stripe.com/settings/billing/quote) will be used. """ from_quote: NotRequired["Quote.CreateParamsFromQuote"] """ Clone an existing quote. The new quote will be created in `status=draft`. When using this parameter, you cannot specify any other parameters except for `expires_at`. """ header: NotRequired["Literal['']|str"] """ A header that will be displayed on the quote PDF. If no value is passed, the default header configured in your [quote template settings](https://dashboard.stripe.com/settings/billing/quote) will be used. """ invoice_settings: NotRequired["Quote.CreateParamsInvoiceSettings"] """ All invoices will be billed using the specified settings. """ line_items: NotRequired[List["Quote.CreateParamsLineItem"]] """ A list of line items the customer is being quoted for. Each line item includes information about the product, the quantity, and the resulting cost. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ on_behalf_of: NotRequired["Literal['']|str"] """ The account on behalf of which to charge. """ subscription_data: NotRequired["Quote.CreateParamsSubscriptionData"] """ When creating a subscription or subscription schedule, the specified configuration data will be used. There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. A subscription schedule is created if `subscription_data[effective_date]` is present and in the future, otherwise a subscription is created. """ test_clock: NotRequired[str] """ ID of the test clock to attach to the quote. """ transfer_data: NotRequired[ "Literal['']|Quote.CreateParamsTransferData" ] """ The data with which to automatically create a Transfer for each of the invoices. """ class CreateParamsAutomaticTax(TypedDict): enabled: bool """ Controls whether Stripe will automatically compute tax on the resulting invoices or subscriptions as well as the quote itself. """ liability: NotRequired["Quote.CreateParamsAutomaticTaxLiability"] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ class CreateParamsAutomaticTaxLiability(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class CreateParamsDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class CreateParamsFromQuote(TypedDict): is_revision: NotRequired[bool] """ Whether this quote is a revision of the previous quote. """ quote: str """ The `id` of the quote that will be cloned. """ class CreateParamsInvoiceSettings(TypedDict): days_until_due: NotRequired[int] """ Number of days within which a customer must pay the invoice generated by this quote. This value will be `null` for quotes where `collection_method=charge_automatically`. """ issuer: NotRequired["Quote.CreateParamsInvoiceSettingsIssuer"] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ class CreateParamsInvoiceSettingsIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class CreateParamsLineItem(TypedDict): discounts: NotRequired[ "Literal['']|List[Quote.CreateParamsLineItemDiscount]" ] """ The discounts applied to this line item. """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired["Quote.CreateParamsLineItemPriceData"] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ The quantity of the line item. """ tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates which apply to the line item. When set, the `default_tax_rates` on the quote do not apply to this line item. """ class CreateParamsLineItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class CreateParamsLineItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ recurring: NotRequired["Quote.CreateParamsLineItemPriceDataRecurring"] """ The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class CreateParamsLineItemPriceDataRecurring(TypedDict): interval: Literal["day", "month", "week", "year"] """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class CreateParamsSubscriptionData(TypedDict): description: NotRequired[str] """ The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ effective_date: NotRequired[ "Literal['']|Literal['current_period_end']|int" ] """ When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on the subscription or subscription schedule when the quote is accepted. If a recurring price is included in `line_items`, this field will be passed to the resulting subscription's `metadata` field. If `subscription_data.effective_date` is used, this field will be passed to the resulting subscription schedule's `phases.metadata` field. Unlike object-level metadata, this field is declarative. Updates will clear prior values. """ trial_period_days: NotRequired["Literal['']|int"] """ Integer representing the number of trial period days before the customer is charged for the first time. """ class CreateParamsTransferData(TypedDict): amount: NotRequired[int] """ The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field. """ amount_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. There must be at least 1 line item with a recurring price to use this field. """ destination: str """ ID of an existing, connected Stripe account. """ class FinalizeQuoteParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ expires_at: NotRequired[int] """ A future timestamp on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch. """ class ListComputedUpfrontLineItemsParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListLineItemsParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParams(RequestOptions): customer: NotRequired[str] """ The ID of the customer whose quotes will be retrieved. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[Literal["accepted", "canceled", "draft", "open"]] """ The status of the quote. """ test_clock: NotRequired[str] """ Provides a list of quotes that are associated with the specified test clock. The response will not include quotes with test clocks if this and the customer parameter is not set. """ class ModifyParams(RequestOptions): application_fee_amount: NotRequired["Literal['']|int"] """ The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. There cannot be any line items with recurring prices when using this field. """ application_fee_percent: NotRequired["Literal['']|float"] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. There must be at least 1 line item with a recurring price to use this field. """ automatic_tax: NotRequired["Quote.ModifyParamsAutomaticTax"] """ Settings for automatic tax lookup for this quote and resulting invoices and subscriptions. """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or at invoice finalization using the default payment method attached to the subscription or customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`. """ customer: NotRequired[str] """ The customer for which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed. """ default_tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates that will apply to any line item that does not have `tax_rates` set. """ description: NotRequired["Literal['']|str"] """ A description that will be displayed on the quote PDF. """ discounts: NotRequired["Literal['']|List[Quote.ModifyParamsDiscount]"] """ The discounts applied to the quote. You can only set up to one discount. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ expires_at: NotRequired[int] """ A future timestamp on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch. """ footer: NotRequired["Literal['']|str"] """ A footer that will be displayed on the quote PDF. """ header: NotRequired["Literal['']|str"] """ A header that will be displayed on the quote PDF. """ invoice_settings: NotRequired["Quote.ModifyParamsInvoiceSettings"] """ All invoices will be billed using the specified settings. """ line_items: NotRequired[List["Quote.ModifyParamsLineItem"]] """ A list of line items the customer is being quoted for. Each line item includes information about the product, the quantity, and the resulting cost. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ on_behalf_of: NotRequired["Literal['']|str"] """ The account on behalf of which to charge. """ subscription_data: NotRequired["Quote.ModifyParamsSubscriptionData"] """ When creating a subscription or subscription schedule, the specified configuration data will be used. There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. A subscription schedule is created if `subscription_data[effective_date]` is present and in the future, otherwise a subscription is created. """ transfer_data: NotRequired[ "Literal['']|Quote.ModifyParamsTransferData" ] """ The data with which to automatically create a Transfer for each of the invoices. """ class ModifyParamsAutomaticTax(TypedDict): enabled: bool """ Controls whether Stripe will automatically compute tax on the resulting invoices or subscriptions as well as the quote itself. """ liability: NotRequired["Quote.ModifyParamsAutomaticTaxLiability"] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ class ModifyParamsAutomaticTaxLiability(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class ModifyParamsDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class ModifyParamsInvoiceSettings(TypedDict): days_until_due: NotRequired[int] """ Number of days within which a customer must pay the invoice generated by this quote. This value will be `null` for quotes where `collection_method=charge_automatically`. """ issuer: NotRequired["Quote.ModifyParamsInvoiceSettingsIssuer"] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ class ModifyParamsInvoiceSettingsIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class ModifyParamsLineItem(TypedDict): discounts: NotRequired[ "Literal['']|List[Quote.ModifyParamsLineItemDiscount]" ] """ The discounts applied to this line item. """ id: NotRequired[str] """ The ID of an existing line item on the quote. """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired["Quote.ModifyParamsLineItemPriceData"] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ The quantity of the line item. """ tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates which apply to the line item. When set, the `default_tax_rates` on the quote do not apply to this line item. """ class ModifyParamsLineItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class ModifyParamsLineItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ recurring: NotRequired["Quote.ModifyParamsLineItemPriceDataRecurring"] """ The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class ModifyParamsLineItemPriceDataRecurring(TypedDict): interval: Literal["day", "month", "week", "year"] """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class ModifyParamsSubscriptionData(TypedDict): description: NotRequired["Literal['']|str"] """ The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ effective_date: NotRequired[ "Literal['']|Literal['current_period_end']|int" ] """ When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on the subscription or subscription schedule when the quote is accepted. If a recurring price is included in `line_items`, this field will be passed to the resulting subscription's `metadata` field. If `subscription_data.effective_date` is used, this field will be passed to the resulting subscription schedule's `phases.metadata` field. Unlike object-level metadata, this field is declarative. Updates will clear prior values. """ trial_period_days: NotRequired["Literal['']|int"] """ Integer representing the number of trial period days before the customer is charged for the first time. """ class ModifyParamsTransferData(TypedDict): amount: NotRequired[int] """ The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field. """ amount_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. There must be at least 1 line item with a recurring price to use this field. """ destination: str """ ID of an existing, connected Stripe account. """ class PdfParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ amount_subtotal: int """ Total before any discounts or taxes are applied. """ amount_total: int """ Total after discounts and taxes are applied. """ application: Optional[ExpandableField["Application"]] """ ID of the Connect Application that created the quote. """ application_fee_amount: Optional[int] """ The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. Only applicable if there are no line items with recurring prices on the quote. """ application_fee_percent: Optional[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. Only applicable if there are line items with recurring prices on the quote. """ automatic_tax: AutomaticTax collection_method: Literal["charge_automatically", "send_invoice"] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or on finalization using the default payment method attached to the subscription or customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`. """ computed: Computed created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ currency: Optional[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). """ customer: Optional[ExpandableField["Customer"]] """ The customer which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed. """ default_tax_rates: Optional[List[ExpandableField["TaxRate"]]] """ The tax rates applied to this quote. """ description: Optional[str] """ A description that will be displayed on the quote PDF. """ discounts: List[ExpandableField["DiscountResource"]] """ The discounts applied to this quote. """ expires_at: int """ The date on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch. """ footer: Optional[str] """ A footer that will be displayed on the quote PDF. """ from_quote: Optional[FromQuote] """ Details of the quote that was cloned. See the [cloning documentation](https://stripe.com/docs/quotes/clone) for more details. """ header: Optional[str] """ A header that will be displayed on the quote PDF. """ id: str """ Unique identifier for the object. """ invoice: Optional[ExpandableField["Invoice"]] """ The invoice that was created from this quote. """ invoice_settings: InvoiceSettings line_items: Optional[ListObject["LineItem"]] """ A list of items the customer is being quoted for. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ metadata: Dict[str, str] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ number: Optional[str] """ A unique number that identifies this particular quote. This number is assigned once the quote is [finalized](https://stripe.com/docs/quotes/overview#finalize). """ object: Literal["quote"] """ String representing the object's type. Objects of the same type share the same value. """ on_behalf_of: Optional[ExpandableField["Account"]] """ The account on behalf of which to charge. See the [Connect documentation](https://support.stripe.com/questions/sending-invoices-on-behalf-of-connected-accounts) for details. """ status: Literal["accepted", "canceled", "draft", "open"] """ The status of the quote. """ status_transitions: StatusTransitions subscription: Optional[ExpandableField["Subscription"]] """ The subscription that was created or updated from this quote. """ subscription_data: SubscriptionData subscription_schedule: Optional[ExpandableField["SubscriptionSchedule"]] """ The subscription schedule that was created or updated from this quote. """ test_clock: Optional[ExpandableField["TestClock"]] """ ID of the test clock this quote belongs to. """ total_details: TotalDetails transfer_data: Optional[TransferData] """ The account (if any) the payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the invoices. """ @classmethod def _cls_accept( cls, quote: str, **params: Unpack["Quote.AcceptParams"] ) -> "Quote": """ Accepts the specified quote. """ return cast( "Quote", cls._static_request( "post", "/v1/quotes/{quote}/accept".format(quote=sanitize_id(quote)), params=params, ), ) @overload @staticmethod def accept(quote: str, **params: Unpack["Quote.AcceptParams"]) -> "Quote": """ Accepts the specified quote. """ ... @overload def accept(self, **params: Unpack["Quote.AcceptParams"]) -> "Quote": """ Accepts the specified quote. """ ... @class_method_variant("_cls_accept") def accept( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Quote.AcceptParams"] ) -> "Quote": """ Accepts the specified quote. """ return cast( "Quote", self._request( "post", "/v1/quotes/{quote}/accept".format( quote=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_accept_async( cls, quote: str, **params: Unpack["Quote.AcceptParams"] ) -> "Quote": """ Accepts the specified quote. """ return cast( "Quote", await cls._static_request_async( "post", "/v1/quotes/{quote}/accept".format(quote=sanitize_id(quote)), params=params, ), ) @overload @staticmethod async def accept_async( quote: str, **params: Unpack["Quote.AcceptParams"] ) -> "Quote": """ Accepts the specified quote. """ ... @overload async def accept_async( self, **params: Unpack["Quote.AcceptParams"] ) -> "Quote": """ Accepts the specified quote. """ ... @class_method_variant("_cls_accept_async") async def accept_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Quote.AcceptParams"] ) -> "Quote": """ Accepts the specified quote. """ return cast( "Quote", await self._request_async( "post", "/v1/quotes/{quote}/accept".format( quote=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def _cls_cancel( cls, quote: str, **params: Unpack["Quote.CancelParams"] ) -> "Quote": """ Cancels the quote. """ return cast( "Quote", cls._static_request( "post", "/v1/quotes/{quote}/cancel".format(quote=sanitize_id(quote)), params=params, ), ) @overload @staticmethod def cancel(quote: str, **params: Unpack["Quote.CancelParams"]) -> "Quote": """ Cancels the quote. """ ... @overload def cancel(self, **params: Unpack["Quote.CancelParams"]) -> "Quote": """ Cancels the quote. """ ... @class_method_variant("_cls_cancel") def cancel( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Quote.CancelParams"] ) -> "Quote": """ Cancels the quote. """ return cast( "Quote", self._request( "post", "/v1/quotes/{quote}/cancel".format( quote=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_cancel_async( cls, quote: str, **params: Unpack["Quote.CancelParams"] ) -> "Quote": """ Cancels the quote. """ return cast( "Quote", await cls._static_request_async( "post", "/v1/quotes/{quote}/cancel".format(quote=sanitize_id(quote)), params=params, ), ) @overload @staticmethod async def cancel_async( quote: str, **params: Unpack["Quote.CancelParams"] ) -> "Quote": """ Cancels the quote. """ ... @overload async def cancel_async( self, **params: Unpack["Quote.CancelParams"] ) -> "Quote": """ Cancels the quote. """ ... @class_method_variant("_cls_cancel_async") async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Quote.CancelParams"] ) -> "Quote": """ Cancels the quote. """ return cast( "Quote", await self._request_async( "post", "/v1/quotes/{quote}/cancel".format( quote=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def create(cls, **params: Unpack["Quote.CreateParams"]) -> "Quote": """ A quote models prices and services for a customer. Default options for header, description, footer, and expires_at can be set in the dashboard via the [quote template](https://dashboard.stripe.com/settings/billing/quote). """ return cast( "Quote", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["Quote.CreateParams"] ) -> "Quote": """ A quote models prices and services for a customer. Default options for header, description, footer, and expires_at can be set in the dashboard via the [quote template](https://dashboard.stripe.com/settings/billing/quote). """ return cast( "Quote", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def _cls_finalize_quote( cls, quote: str, **params: Unpack["Quote.FinalizeQuoteParams"] ) -> "Quote": """ Finalizes the quote. """ return cast( "Quote", cls._static_request( "post", "/v1/quotes/{quote}/finalize".format(quote=sanitize_id(quote)), params=params, ), ) @overload @staticmethod def finalize_quote( quote: str, **params: Unpack["Quote.FinalizeQuoteParams"] ) -> "Quote": """ Finalizes the quote. """ ... @overload def finalize_quote( self, **params: Unpack["Quote.FinalizeQuoteParams"] ) -> "Quote": """ Finalizes the quote. """ ... @class_method_variant("_cls_finalize_quote") def finalize_quote( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Quote.FinalizeQuoteParams"] ) -> "Quote": """ Finalizes the quote. """ return cast( "Quote", self._request( "post", "/v1/quotes/{quote}/finalize".format( quote=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_finalize_quote_async( cls, quote: str, **params: Unpack["Quote.FinalizeQuoteParams"] ) -> "Quote": """ Finalizes the quote. """ return cast( "Quote", await cls._static_request_async( "post", "/v1/quotes/{quote}/finalize".format(quote=sanitize_id(quote)), params=params, ), ) @overload @staticmethod async def finalize_quote_async( quote: str, **params: Unpack["Quote.FinalizeQuoteParams"] ) -> "Quote": """ Finalizes the quote. """ ... @overload async def finalize_quote_async( self, **params: Unpack["Quote.FinalizeQuoteParams"] ) -> "Quote": """ Finalizes the quote. """ ... @class_method_variant("_cls_finalize_quote_async") async def finalize_quote_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Quote.FinalizeQuoteParams"] ) -> "Quote": """ Finalizes the quote. """ return cast( "Quote", await self._request_async( "post", "/v1/quotes/{quote}/finalize".format( quote=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def list(cls, **params: Unpack["Quote.ListParams"]) -> ListObject["Quote"]: """ Returns a list of your quotes. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["Quote.ListParams"] ) -> ListObject["Quote"]: """ Returns a list of your quotes. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def _cls_list_computed_upfront_line_items( cls, quote: str, **params: Unpack["Quote.ListComputedUpfrontLineItemsParams"], ) -> ListObject["LineItem"]: """ When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. """ return cast( ListObject["LineItem"], cls._static_request( "get", "/v1/quotes/{quote}/computed_upfront_line_items".format( quote=sanitize_id(quote) ), params=params, ), ) @overload @staticmethod def list_computed_upfront_line_items( quote: str, **params: Unpack["Quote.ListComputedUpfrontLineItemsParams"], ) -> ListObject["LineItem"]: """ When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. """ ... @overload def list_computed_upfront_line_items( self, **params: Unpack["Quote.ListComputedUpfrontLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. """ ... @class_method_variant("_cls_list_computed_upfront_line_items") def list_computed_upfront_line_items( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Quote.ListComputedUpfrontLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. """ return cast( ListObject["LineItem"], self._request( "get", "/v1/quotes/{quote}/computed_upfront_line_items".format( quote=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_list_computed_upfront_line_items_async( cls, quote: str, **params: Unpack["Quote.ListComputedUpfrontLineItemsParams"], ) -> ListObject["LineItem"]: """ When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. """ return cast( ListObject["LineItem"], await cls._static_request_async( "get", "/v1/quotes/{quote}/computed_upfront_line_items".format( quote=sanitize_id(quote) ), params=params, ), ) @overload @staticmethod async def list_computed_upfront_line_items_async( quote: str, **params: Unpack["Quote.ListComputedUpfrontLineItemsParams"], ) -> ListObject["LineItem"]: """ When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. """ ... @overload async def list_computed_upfront_line_items_async( self, **params: Unpack["Quote.ListComputedUpfrontLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. """ ... @class_method_variant("_cls_list_computed_upfront_line_items_async") async def list_computed_upfront_line_items_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Quote.ListComputedUpfrontLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. """ return cast( ListObject["LineItem"], await self._request_async( "get", "/v1/quotes/{quote}/computed_upfront_line_items".format( quote=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def _cls_list_line_items( cls, quote: str, **params: Unpack["Quote.ListLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ return cast( ListObject["LineItem"], cls._static_request( "get", "/v1/quotes/{quote}/line_items".format( quote=sanitize_id(quote) ), params=params, ), ) @overload @staticmethod def list_line_items( quote: str, **params: Unpack["Quote.ListLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ ... @overload def list_line_items( self, **params: Unpack["Quote.ListLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ ... @class_method_variant("_cls_list_line_items") def list_line_items( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Quote.ListLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ return cast( ListObject["LineItem"], self._request( "get", "/v1/quotes/{quote}/line_items".format( quote=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_list_line_items_async( cls, quote: str, **params: Unpack["Quote.ListLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ return cast( ListObject["LineItem"], await cls._static_request_async( "get", "/v1/quotes/{quote}/line_items".format( quote=sanitize_id(quote) ), params=params, ), ) @overload @staticmethod async def list_line_items_async( quote: str, **params: Unpack["Quote.ListLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ ... @overload async def list_line_items_async( self, **params: Unpack["Quote.ListLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ ... @class_method_variant("_cls_list_line_items_async") async def list_line_items_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Quote.ListLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ return cast( ListObject["LineItem"], await self._request_async( "get", "/v1/quotes/{quote}/line_items".format( quote=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def modify( cls, id: str, **params: Unpack["Quote.ModifyParams"] ) -> "Quote": """ A quote models prices and services for a customer. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Quote", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["Quote.ModifyParams"] ) -> "Quote": """ A quote models prices and services for a customer. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Quote", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def _cls_pdf(cls, quote: str, **params: Unpack["Quote.PdfParams"]) -> Any: """ Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.corp.stripe.com/quotes/overview#quote_pdf) """ return cast( Any, cls._static_request_stream( "get", "/v1/quotes/{quote}/pdf".format(quote=sanitize_id(quote)), params=params, base_address="files", ), ) @overload @staticmethod def pdf(quote: str, **params: Unpack["Quote.PdfParams"]) -> Any: """ Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.corp.stripe.com/quotes/overview#quote_pdf) """ ... @overload def pdf(self, **params: Unpack["Quote.PdfParams"]) -> Any: """ Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.corp.stripe.com/quotes/overview#quote_pdf) """ ... @class_method_variant("_cls_pdf") def pdf( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Quote.PdfParams"] ) -> Any: """ Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.corp.stripe.com/quotes/overview#quote_pdf) """ return cast( Any, self._request_stream( "get", "/v1/quotes/{quote}/pdf".format( quote=sanitize_id(self.get("id")) ), params=params, base_address="files", ), ) @classmethod async def _cls_pdf_async( cls, quote: str, **params: Unpack["Quote.PdfParams"] ) -> Any: """ Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.corp.stripe.com/quotes/overview#quote_pdf) """ return cast( Any, await cls._static_request_stream_async( "get", "/v1/quotes/{quote}/pdf".format(quote=sanitize_id(quote)), params=params, base_address="files", ), ) @overload @staticmethod async def pdf_async( quote: str, **params: Unpack["Quote.PdfParams"] ) -> Any: """ Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.corp.stripe.com/quotes/overview#quote_pdf) """ ... @overload async def pdf_async(self, **params: Unpack["Quote.PdfParams"]) -> Any: """ Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.corp.stripe.com/quotes/overview#quote_pdf) """ ... @class_method_variant("_cls_pdf_async") async def pdf_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Quote.PdfParams"] ) -> Any: """ Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.corp.stripe.com/quotes/overview#quote_pdf) """ return cast( Any, await self._request_stream_async( "get", "/v1/quotes/{quote}/pdf".format( quote=sanitize_id(self.get("id")) ), params=params, base_address="files", ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["Quote.RetrieveParams"] ) -> "Quote": """ Retrieves the quote with the given ID. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["Quote.RetrieveParams"] ) -> "Quote": """ Retrieves the quote with the given ID. """ instance = cls(id, **params) await instance.refresh_async() return instance _inner_class_types = { "automatic_tax": AutomaticTax, "computed": Computed, "from_quote": FromQuote, "invoice_settings": InvoiceSettings, "status_transitions": StatusTransitions, "subscription_data": SubscriptionData, "total_details": TotalDetails, "transfer_data": TransferData, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_quote_computed_upfront_line_items_service.py0000644000175100001770000000646314637354563025316 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._line_item import LineItem from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict class QuoteComputedUpfrontLineItemsService(StripeService): class ListParams(TypedDict): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ def list( self, quote: str, params: "QuoteComputedUpfrontLineItemsService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[LineItem]: """ When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. """ return cast( ListObject[LineItem], self._request( "get", "/v1/quotes/{quote}/computed_upfront_line_items".format( quote=sanitize_id(quote), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, quote: str, params: "QuoteComputedUpfrontLineItemsService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[LineItem]: """ When retrieving a quote, there is an includable [computed.upfront.line_items](https://stripe.com/docs/api/quotes/object#quote_object-computed-upfront-line_items) property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of upfront line items. """ return cast( ListObject[LineItem], await self._request_async( "get", "/v1/quotes/{quote}/computed_upfront_line_items".format( quote=sanitize_id(quote), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_quote_line_item_service.py0000644000175100001770000000600314637354563021444 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._line_item import LineItem from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict class QuoteLineItemService(StripeService): class ListParams(TypedDict): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ def list( self, quote: str, params: "QuoteLineItemService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[LineItem]: """ When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ return cast( ListObject[LineItem], self._request( "get", "/v1/quotes/{quote}/line_items".format( quote=sanitize_id(quote), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, quote: str, params: "QuoteLineItemService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[LineItem]: """ When retrieving a quote, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ return cast( ListObject[LineItem], await self._request_async( "get", "/v1/quotes/{quote}/line_items".format( quote=sanitize_id(quote), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_quote_service.py0000644000175100001770000011506614637354563017431 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._quote import Quote from stripe._quote_computed_upfront_line_items_service import ( QuoteComputedUpfrontLineItemsService, ) from stripe._quote_line_item_service import QuoteLineItemService from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import Any, Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class QuoteService(StripeService): def __init__(self, requestor): super().__init__(requestor) self.line_items = QuoteLineItemService(self._requestor) self.computed_upfront_line_items = ( QuoteComputedUpfrontLineItemsService( self._requestor, ) ) class AcceptParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CancelParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CreateParams(TypedDict): application_fee_amount: NotRequired["Literal['']|int"] """ The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. There cannot be any line items with recurring prices when using this field. """ application_fee_percent: NotRequired["Literal['']|float"] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. There must be at least 1 line item with a recurring price to use this field. """ automatic_tax: NotRequired["QuoteService.CreateParamsAutomaticTax"] """ Settings for automatic tax lookup for this quote and resulting invoices and subscriptions. """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or at invoice finalization using the default payment method attached to the subscription or customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`. """ customer: NotRequired[str] """ The customer for which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed. """ default_tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates that will apply to any line item that does not have `tax_rates` set. """ description: NotRequired["Literal['']|str"] """ A description that will be displayed on the quote PDF. If no value is passed, the default description configured in your [quote template settings](https://dashboard.stripe.com/settings/billing/quote) will be used. """ discounts: NotRequired[ "Literal['']|List[QuoteService.CreateParamsDiscount]" ] """ The discounts applied to the quote. You can only set up to one discount. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ expires_at: NotRequired[int] """ A future timestamp on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch. If no value is passed, the default expiration date configured in your [quote template settings](https://dashboard.stripe.com/settings/billing/quote) will be used. """ footer: NotRequired["Literal['']|str"] """ A footer that will be displayed on the quote PDF. If no value is passed, the default footer configured in your [quote template settings](https://dashboard.stripe.com/settings/billing/quote) will be used. """ from_quote: NotRequired["QuoteService.CreateParamsFromQuote"] """ Clone an existing quote. The new quote will be created in `status=draft`. When using this parameter, you cannot specify any other parameters except for `expires_at`. """ header: NotRequired["Literal['']|str"] """ A header that will be displayed on the quote PDF. If no value is passed, the default header configured in your [quote template settings](https://dashboard.stripe.com/settings/billing/quote) will be used. """ invoice_settings: NotRequired[ "QuoteService.CreateParamsInvoiceSettings" ] """ All invoices will be billed using the specified settings. """ line_items: NotRequired[List["QuoteService.CreateParamsLineItem"]] """ A list of line items the customer is being quoted for. Each line item includes information about the product, the quantity, and the resulting cost. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ on_behalf_of: NotRequired["Literal['']|str"] """ The account on behalf of which to charge. """ subscription_data: NotRequired[ "QuoteService.CreateParamsSubscriptionData" ] """ When creating a subscription or subscription schedule, the specified configuration data will be used. There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. A subscription schedule is created if `subscription_data[effective_date]` is present and in the future, otherwise a subscription is created. """ test_clock: NotRequired[str] """ ID of the test clock to attach to the quote. """ transfer_data: NotRequired[ "Literal['']|QuoteService.CreateParamsTransferData" ] """ The data with which to automatically create a Transfer for each of the invoices. """ class CreateParamsAutomaticTax(TypedDict): enabled: bool """ Controls whether Stripe will automatically compute tax on the resulting invoices or subscriptions as well as the quote itself. """ liability: NotRequired[ "QuoteService.CreateParamsAutomaticTaxLiability" ] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ class CreateParamsAutomaticTaxLiability(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class CreateParamsDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class CreateParamsFromQuote(TypedDict): is_revision: NotRequired[bool] """ Whether this quote is a revision of the previous quote. """ quote: str """ The `id` of the quote that will be cloned. """ class CreateParamsInvoiceSettings(TypedDict): days_until_due: NotRequired[int] """ Number of days within which a customer must pay the invoice generated by this quote. This value will be `null` for quotes where `collection_method=charge_automatically`. """ issuer: NotRequired["QuoteService.CreateParamsInvoiceSettingsIssuer"] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ class CreateParamsInvoiceSettingsIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class CreateParamsLineItem(TypedDict): discounts: NotRequired[ "Literal['']|List[QuoteService.CreateParamsLineItemDiscount]" ] """ The discounts applied to this line item. """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired["QuoteService.CreateParamsLineItemPriceData"] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ The quantity of the line item. """ tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates which apply to the line item. When set, the `default_tax_rates` on the quote do not apply to this line item. """ class CreateParamsLineItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class CreateParamsLineItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ recurring: NotRequired[ "QuoteService.CreateParamsLineItemPriceDataRecurring" ] """ The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class CreateParamsLineItemPriceDataRecurring(TypedDict): interval: Literal["day", "month", "week", "year"] """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class CreateParamsSubscriptionData(TypedDict): description: NotRequired[str] """ The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ effective_date: NotRequired[ "Literal['']|Literal['current_period_end']|int" ] """ When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on the subscription or subscription schedule when the quote is accepted. If a recurring price is included in `line_items`, this field will be passed to the resulting subscription's `metadata` field. If `subscription_data.effective_date` is used, this field will be passed to the resulting subscription schedule's `phases.metadata` field. Unlike object-level metadata, this field is declarative. Updates will clear prior values. """ trial_period_days: NotRequired["Literal['']|int"] """ Integer representing the number of trial period days before the customer is charged for the first time. """ class CreateParamsTransferData(TypedDict): amount: NotRequired[int] """ The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field. """ amount_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. There must be at least 1 line item with a recurring price to use this field. """ destination: str """ ID of an existing, connected Stripe account. """ class FinalizeQuoteParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ expires_at: NotRequired[int] """ A future timestamp on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch. """ class ListParams(TypedDict): customer: NotRequired[str] """ The ID of the customer whose quotes will be retrieved. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[Literal["accepted", "canceled", "draft", "open"]] """ The status of the quote. """ test_clock: NotRequired[str] """ Provides a list of quotes that are associated with the specified test clock. The response will not include quotes with test clocks if this and the customer parameter is not set. """ class PdfParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): application_fee_amount: NotRequired["Literal['']|int"] """ The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. There cannot be any line items with recurring prices when using this field. """ application_fee_percent: NotRequired["Literal['']|float"] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. There must be at least 1 line item with a recurring price to use this field. """ automatic_tax: NotRequired["QuoteService.UpdateParamsAutomaticTax"] """ Settings for automatic tax lookup for this quote and resulting invoices and subscriptions. """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay invoices at the end of the subscription cycle or at invoice finalization using the default payment method attached to the subscription or customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`. """ customer: NotRequired[str] """ The customer for which this quote belongs to. A customer is required before finalizing the quote. Once specified, it cannot be changed. """ default_tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates that will apply to any line item that does not have `tax_rates` set. """ description: NotRequired["Literal['']|str"] """ A description that will be displayed on the quote PDF. """ discounts: NotRequired[ "Literal['']|List[QuoteService.UpdateParamsDiscount]" ] """ The discounts applied to the quote. You can only set up to one discount. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ expires_at: NotRequired[int] """ A future timestamp on which the quote will be canceled if in `open` or `draft` status. Measured in seconds since the Unix epoch. """ footer: NotRequired["Literal['']|str"] """ A footer that will be displayed on the quote PDF. """ header: NotRequired["Literal['']|str"] """ A header that will be displayed on the quote PDF. """ invoice_settings: NotRequired[ "QuoteService.UpdateParamsInvoiceSettings" ] """ All invoices will be billed using the specified settings. """ line_items: NotRequired[List["QuoteService.UpdateParamsLineItem"]] """ A list of line items the customer is being quoted for. Each line item includes information about the product, the quantity, and the resulting cost. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ on_behalf_of: NotRequired["Literal['']|str"] """ The account on behalf of which to charge. """ subscription_data: NotRequired[ "QuoteService.UpdateParamsSubscriptionData" ] """ When creating a subscription or subscription schedule, the specified configuration data will be used. There must be at least one line item with a recurring price for a subscription or subscription schedule to be created. A subscription schedule is created if `subscription_data[effective_date]` is present and in the future, otherwise a subscription is created. """ transfer_data: NotRequired[ "Literal['']|QuoteService.UpdateParamsTransferData" ] """ The data with which to automatically create a Transfer for each of the invoices. """ class UpdateParamsAutomaticTax(TypedDict): enabled: bool """ Controls whether Stripe will automatically compute tax on the resulting invoices or subscriptions as well as the quote itself. """ liability: NotRequired[ "QuoteService.UpdateParamsAutomaticTaxLiability" ] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ class UpdateParamsAutomaticTaxLiability(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class UpdateParamsDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class UpdateParamsInvoiceSettings(TypedDict): days_until_due: NotRequired[int] """ Number of days within which a customer must pay the invoice generated by this quote. This value will be `null` for quotes where `collection_method=charge_automatically`. """ issuer: NotRequired["QuoteService.UpdateParamsInvoiceSettingsIssuer"] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ class UpdateParamsInvoiceSettingsIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class UpdateParamsLineItem(TypedDict): discounts: NotRequired[ "Literal['']|List[QuoteService.UpdateParamsLineItemDiscount]" ] """ The discounts applied to this line item. """ id: NotRequired[str] """ The ID of an existing line item on the quote. """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired["QuoteService.UpdateParamsLineItemPriceData"] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ The quantity of the line item. """ tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates which apply to the line item. When set, the `default_tax_rates` on the quote do not apply to this line item. """ class UpdateParamsLineItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class UpdateParamsLineItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ recurring: NotRequired[ "QuoteService.UpdateParamsLineItemPriceDataRecurring" ] """ The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class UpdateParamsLineItemPriceDataRecurring(TypedDict): interval: Literal["day", "month", "week", "year"] """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class UpdateParamsSubscriptionData(TypedDict): description: NotRequired["Literal['']|str"] """ The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ effective_date: NotRequired[ "Literal['']|Literal['current_period_end']|int" ] """ When creating a new subscription, the date of which the subscription schedule will start after the quote is accepted. When updating a subscription, the date of which the subscription will be updated using a subscription schedule. The special value `current_period_end` can be provided to update a subscription at the end of its current period. The `effective_date` is ignored if it is in the past when the quote is accepted. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that will set metadata on the subscription or subscription schedule when the quote is accepted. If a recurring price is included in `line_items`, this field will be passed to the resulting subscription's `metadata` field. If `subscription_data.effective_date` is used, this field will be passed to the resulting subscription schedule's `phases.metadata` field. Unlike object-level metadata, this field is declarative. Updates will clear prior values. """ trial_period_days: NotRequired["Literal['']|int"] """ Integer representing the number of trial period days before the customer is charged for the first time. """ class UpdateParamsTransferData(TypedDict): amount: NotRequired[int] """ The amount that will be transferred automatically when the invoice is paid. If no amount is set, the full amount is transferred. There cannot be any line items with recurring prices when using this field. """ amount_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. There must be at least 1 line item with a recurring price to use this field. """ destination: str """ ID of an existing, connected Stripe account. """ def list( self, params: "QuoteService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Quote]: """ Returns a list of your quotes. """ return cast( ListObject[Quote], self._request( "get", "/v1/quotes", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "QuoteService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Quote]: """ Returns a list of your quotes. """ return cast( ListObject[Quote], await self._request_async( "get", "/v1/quotes", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "QuoteService.CreateParams" = {}, options: RequestOptions = {}, ) -> Quote: """ A quote models prices and services for a customer. Default options for header, description, footer, and expires_at can be set in the dashboard via the [quote template](https://dashboard.stripe.com/settings/billing/quote). """ return cast( Quote, self._request( "post", "/v1/quotes", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "QuoteService.CreateParams" = {}, options: RequestOptions = {}, ) -> Quote: """ A quote models prices and services for a customer. Default options for header, description, footer, and expires_at can be set in the dashboard via the [quote template](https://dashboard.stripe.com/settings/billing/quote). """ return cast( Quote, await self._request_async( "post", "/v1/quotes", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, quote: str, params: "QuoteService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Quote: """ Retrieves the quote with the given ID. """ return cast( Quote, self._request( "get", "/v1/quotes/{quote}".format(quote=sanitize_id(quote)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, quote: str, params: "QuoteService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Quote: """ Retrieves the quote with the given ID. """ return cast( Quote, await self._request_async( "get", "/v1/quotes/{quote}".format(quote=sanitize_id(quote)), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, quote: str, params: "QuoteService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Quote: """ A quote models prices and services for a customer. """ return cast( Quote, self._request( "post", "/v1/quotes/{quote}".format(quote=sanitize_id(quote)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, quote: str, params: "QuoteService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Quote: """ A quote models prices and services for a customer. """ return cast( Quote, await self._request_async( "post", "/v1/quotes/{quote}".format(quote=sanitize_id(quote)), api_mode="V1", base_address="api", params=params, options=options, ), ) def accept( self, quote: str, params: "QuoteService.AcceptParams" = {}, options: RequestOptions = {}, ) -> Quote: """ Accepts the specified quote. """ return cast( Quote, self._request( "post", "/v1/quotes/{quote}/accept".format(quote=sanitize_id(quote)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def accept_async( self, quote: str, params: "QuoteService.AcceptParams" = {}, options: RequestOptions = {}, ) -> Quote: """ Accepts the specified quote. """ return cast( Quote, await self._request_async( "post", "/v1/quotes/{quote}/accept".format(quote=sanitize_id(quote)), api_mode="V1", base_address="api", params=params, options=options, ), ) def cancel( self, quote: str, params: "QuoteService.CancelParams" = {}, options: RequestOptions = {}, ) -> Quote: """ Cancels the quote. """ return cast( Quote, self._request( "post", "/v1/quotes/{quote}/cancel".format(quote=sanitize_id(quote)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def cancel_async( self, quote: str, params: "QuoteService.CancelParams" = {}, options: RequestOptions = {}, ) -> Quote: """ Cancels the quote. """ return cast( Quote, await self._request_async( "post", "/v1/quotes/{quote}/cancel".format(quote=sanitize_id(quote)), api_mode="V1", base_address="api", params=params, options=options, ), ) def finalize_quote( self, quote: str, params: "QuoteService.FinalizeQuoteParams" = {}, options: RequestOptions = {}, ) -> Quote: """ Finalizes the quote. """ return cast( Quote, self._request( "post", "/v1/quotes/{quote}/finalize".format(quote=sanitize_id(quote)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def finalize_quote_async( self, quote: str, params: "QuoteService.FinalizeQuoteParams" = {}, options: RequestOptions = {}, ) -> Quote: """ Finalizes the quote. """ return cast( Quote, await self._request_async( "post", "/v1/quotes/{quote}/finalize".format(quote=sanitize_id(quote)), api_mode="V1", base_address="api", params=params, options=options, ), ) def pdf( self, quote: str, params: "QuoteService.PdfParams" = {}, options: RequestOptions = {}, ) -> Any: """ Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.corp.stripe.com/quotes/overview#quote_pdf) """ return cast( Any, self._request_stream( "get", "/v1/quotes/{quote}/pdf".format(quote=sanitize_id(quote)), api_mode="V1", base_address="files", params=params, options=options, ), ) async def pdf_async( self, quote: str, params: "QuoteService.PdfParams" = {}, options: RequestOptions = {}, ) -> Any: """ Download the PDF for a finalized quote. Explanation for special handling can be found [here](https://docs.corp.stripe.com/quotes/overview#quote_pdf) """ return cast( Any, await self._request_stream_async( "get", "/v1/quotes/{quote}/pdf".format(quote=sanitize_id(quote)), api_mode="V1", base_address="files", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_radar_service.py0000644000175100001770000000120114637354563017346 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_service import StripeService from stripe.radar._early_fraud_warning_service import EarlyFraudWarningService from stripe.radar._value_list_item_service import ValueListItemService from stripe.radar._value_list_service import ValueListService class RadarService(StripeService): def __init__(self, requestor): super().__init__(requestor) self.early_fraud_warnings = EarlyFraudWarningService(self._requestor) self.value_lists = ValueListService(self._requestor) self.value_list_items = ValueListItemService(self._requestor) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_refund.py0000644000175100001770000007774214637354563016047 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._test_helpers import APIResourceTestHelpers from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, NotRequired, Type, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._balance_transaction import BalanceTransaction from stripe._charge import Charge from stripe._payment_intent import PaymentIntent from stripe._reversal import Reversal class Refund( CreateableAPIResource["Refund"], ListableAPIResource["Refund"], UpdateableAPIResource["Refund"], ): """ Refund objects allow you to refund a previously created charge that isn't refunded yet. Funds are refunded to the credit or debit card that's initially charged. Related guide: [Refunds](https://stripe.com/docs/refunds) """ OBJECT_NAME: ClassVar[Literal["refund"]] = "refund" class DestinationDetails(StripeObject): class Affirm(StripeObject): pass class AfterpayClearpay(StripeObject): pass class Alipay(StripeObject): pass class AmazonPay(StripeObject): pass class AuBankTransfer(StripeObject): pass class Blik(StripeObject): reference: Optional[str] """ The reference assigned to the refund. """ reference_status: Optional[str] """ Status of the reference on the refund. This can be `pending`, `available` or `unavailable`. """ class BrBankTransfer(StripeObject): reference: Optional[str] """ The reference assigned to the refund. """ reference_status: Optional[str] """ Status of the reference on the refund. This can be `pending`, `available` or `unavailable`. """ class Card(StripeObject): reference: Optional[str] """ Value of the reference number assigned to the refund. """ reference_status: Optional[str] """ Status of the reference number on the refund. This can be `pending`, `available` or `unavailable`. """ reference_type: Optional[str] """ Type of the reference number assigned to the refund. """ type: Literal["pending", "refund", "reversal"] """ The type of refund. This can be `refund`, `reversal`, or `pending`. """ class Cashapp(StripeObject): pass class CustomerCashBalance(StripeObject): pass class Eps(StripeObject): pass class EuBankTransfer(StripeObject): reference: Optional[str] """ The reference assigned to the refund. """ reference_status: Optional[str] """ Status of the reference on the refund. This can be `pending`, `available` or `unavailable`. """ class GbBankTransfer(StripeObject): reference: Optional[str] """ The reference assigned to the refund. """ reference_status: Optional[str] """ Status of the reference on the refund. This can be `pending`, `available` or `unavailable`. """ class Giropay(StripeObject): pass class Grabpay(StripeObject): pass class JpBankTransfer(StripeObject): reference: Optional[str] """ The reference assigned to the refund. """ reference_status: Optional[str] """ Status of the reference on the refund. This can be `pending`, `available` or `unavailable`. """ class Klarna(StripeObject): pass class Multibanco(StripeObject): reference: Optional[str] """ The reference assigned to the refund. """ reference_status: Optional[str] """ Status of the reference on the refund. This can be `pending`, `available` or `unavailable`. """ class MxBankTransfer(StripeObject): reference: Optional[str] """ The reference assigned to the refund. """ reference_status: Optional[str] """ Status of the reference on the refund. This can be `pending`, `available` or `unavailable`. """ class P24(StripeObject): reference: Optional[str] """ The reference assigned to the refund. """ reference_status: Optional[str] """ Status of the reference on the refund. This can be `pending`, `available` or `unavailable`. """ class Paynow(StripeObject): pass class Paypal(StripeObject): pass class Pix(StripeObject): pass class Revolut(StripeObject): pass class Sofort(StripeObject): pass class Swish(StripeObject): reference: Optional[str] """ The reference assigned to the refund. """ reference_status: Optional[str] """ Status of the reference on the refund. This can be `pending`, `available` or `unavailable`. """ class ThBankTransfer(StripeObject): reference: Optional[str] """ The reference assigned to the refund. """ reference_status: Optional[str] """ Status of the reference on the refund. This can be `pending`, `available` or `unavailable`. """ class UsBankTransfer(StripeObject): reference: Optional[str] """ The reference assigned to the refund. """ reference_status: Optional[str] """ Status of the reference on the refund. This can be `pending`, `available` or `unavailable`. """ class WechatPay(StripeObject): pass class Zip(StripeObject): pass affirm: Optional[Affirm] afterpay_clearpay: Optional[AfterpayClearpay] alipay: Optional[Alipay] amazon_pay: Optional[AmazonPay] au_bank_transfer: Optional[AuBankTransfer] blik: Optional[Blik] br_bank_transfer: Optional[BrBankTransfer] card: Optional[Card] cashapp: Optional[Cashapp] customer_cash_balance: Optional[CustomerCashBalance] eps: Optional[Eps] eu_bank_transfer: Optional[EuBankTransfer] gb_bank_transfer: Optional[GbBankTransfer] giropay: Optional[Giropay] grabpay: Optional[Grabpay] jp_bank_transfer: Optional[JpBankTransfer] klarna: Optional[Klarna] multibanco: Optional[Multibanco] mx_bank_transfer: Optional[MxBankTransfer] p24: Optional[P24] paynow: Optional[Paynow] paypal: Optional[Paypal] pix: Optional[Pix] revolut: Optional[Revolut] sofort: Optional[Sofort] swish: Optional[Swish] th_bank_transfer: Optional[ThBankTransfer] type: str """ The type of transaction-specific details of the payment method used in the refund (e.g., `card`). An additional hash is included on `destination_details` with a name matching this value. It contains information specific to the refund transaction. """ us_bank_transfer: Optional[UsBankTransfer] wechat_pay: Optional[WechatPay] zip: Optional[Zip] _inner_class_types = { "affirm": Affirm, "afterpay_clearpay": AfterpayClearpay, "alipay": Alipay, "amazon_pay": AmazonPay, "au_bank_transfer": AuBankTransfer, "blik": Blik, "br_bank_transfer": BrBankTransfer, "card": Card, "cashapp": Cashapp, "customer_cash_balance": CustomerCashBalance, "eps": Eps, "eu_bank_transfer": EuBankTransfer, "gb_bank_transfer": GbBankTransfer, "giropay": Giropay, "grabpay": Grabpay, "jp_bank_transfer": JpBankTransfer, "klarna": Klarna, "multibanco": Multibanco, "mx_bank_transfer": MxBankTransfer, "p24": P24, "paynow": Paynow, "paypal": Paypal, "pix": Pix, "revolut": Revolut, "sofort": Sofort, "swish": Swish, "th_bank_transfer": ThBankTransfer, "us_bank_transfer": UsBankTransfer, "wechat_pay": WechatPay, "zip": Zip, } class NextAction(StripeObject): class DisplayDetails(StripeObject): class EmailSent(StripeObject): email_sent_at: int """ The timestamp when the email was sent. """ email_sent_to: str """ The recipient's email address. """ email_sent: EmailSent expires_at: int """ The expiry timestamp. """ _inner_class_types = {"email_sent": EmailSent} display_details: Optional[DisplayDetails] """ Contains the refund details. """ type: str """ Type of the next action to perform. """ _inner_class_types = {"display_details": DisplayDetails} class CancelParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CreateParams(RequestOptions): amount: NotRequired[int] charge: NotRequired[str] """ The identifier of the charge to refund. """ currency: NotRequired[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). """ customer: NotRequired[str] """ Customer whose customer balance to refund from. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ instructions_email: NotRequired[str] """ For payment methods without native refund support (e.g., Konbini, PromptPay), use this email from the customer to receive refund instructions. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ origin: NotRequired[Literal["customer_balance"]] """ Origin of the refund """ payment_intent: NotRequired[str] """ The identifier of the PaymentIntent to refund. """ reason: NotRequired[ Literal["duplicate", "fraudulent", "requested_by_customer"] ] """ String indicating the reason for the refund. If set, possible values are `duplicate`, `fraudulent`, and `requested_by_customer`. If you believe the charge to be fraudulent, specifying `fraudulent` as the reason will add the associated card and email to your [block lists](https://stripe.com/docs/radar/lists), and will also help us improve our fraud detection algorithms. """ refund_application_fee: NotRequired[bool] """ Boolean indicating whether the application fee should be refunded when refunding this charge. If a full charge refund is given, the full application fee will be refunded. Otherwise, the application fee will be refunded in an amount proportional to the amount of the charge refunded. An application fee can be refunded only by the application that created the charge. """ reverse_transfer: NotRequired[bool] """ Boolean indicating whether the transfer should be reversed when refunding this charge. The transfer will be reversed proportionally to the amount being refunded (either the entire or partial amount). A transfer can be reversed only by the application that created the charge. """ class ExpireParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ListParams(RequestOptions): charge: NotRequired[str] """ Only return refunds for the charge specified by this charge ID. """ created: NotRequired["Refund.ListParamsCreated|int"] """ Only return refunds that were created during the given date interval. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ payment_intent: NotRequired[str] """ Only return refunds for the PaymentIntent specified by this ID. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ amount: int """ Amount, in cents (or local equivalent). """ balance_transaction: Optional[ExpandableField["BalanceTransaction"]] """ Balance transaction that describes the impact on your account balance. """ charge: Optional[ExpandableField["Charge"]] """ ID of the charge that's refunded. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ 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. You can use this for displaying to users (available on non-card refunds only). """ destination_details: Optional[DestinationDetails] failure_balance_transaction: Optional[ ExpandableField["BalanceTransaction"] ] """ After the refund fails, this balance transaction describes the adjustment made on your account balance that reverses the initial balance transaction. """ failure_reason: Optional[str] """ Provides the reason for the refund failure. Possible values are: `lost_or_stolen_card`, `expired_or_canceled_card`, `charge_for_pending_refund_disputed`, `insufficient_funds`, `declined`, `merchant_request`, or `unknown`. """ id: str """ Unique identifier for the object. """ instructions_email: Optional[str] """ For payment methods without native refund support (for example, Konbini, PromptPay), provide an email address for the customer to receive refund instructions. """ metadata: Optional[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ next_action: Optional[NextAction] object: Literal["refund"] """ String representing the object's type. Objects of the same type share the same value. """ payment_intent: Optional[ExpandableField["PaymentIntent"]] """ ID of the PaymentIntent that's refunded. """ reason: Optional[ Literal[ "duplicate", "expired_uncaptured_charge", "fraudulent", "requested_by_customer", ] ] """ Reason for the refund, which is either user-provided (`duplicate`, `fraudulent`, or `requested_by_customer`) or generated by Stripe internally (`expired_uncaptured_charge`). """ receipt_number: Optional[str] """ This is the transaction number that appears on email receipts sent for this refund. """ source_transfer_reversal: Optional[ExpandableField["Reversal"]] """ The transfer reversal that's associated with the refund. Only present if the charge came from another Stripe account. """ status: Optional[str] """ Status of the refund. This can be `pending`, `requires_action`, `succeeded`, `failed`, or `canceled`. Learn more about [failed refunds](https://stripe.com/docs/refunds#failed-refunds). """ transfer_reversal: Optional[ExpandableField["Reversal"]] """ This refers to the transfer reversal object if the accompanying transfer reverses. This is only applicable if the charge was created using the destination parameter. """ @classmethod def _cls_cancel( cls, refund: str, **params: Unpack["Refund.CancelParams"] ) -> "Refund": """ Cancels a refund with a status of requires_action. You can't cancel refunds in other states. Only refunds for payment methods that require customer action can enter the requires_action state. """ return cast( "Refund", cls._static_request( "post", "/v1/refunds/{refund}/cancel".format( refund=sanitize_id(refund) ), params=params, ), ) @overload @staticmethod def cancel( refund: str, **params: Unpack["Refund.CancelParams"] ) -> "Refund": """ Cancels a refund with a status of requires_action. You can't cancel refunds in other states. Only refunds for payment methods that require customer action can enter the requires_action state. """ ... @overload def cancel(self, **params: Unpack["Refund.CancelParams"]) -> "Refund": """ Cancels a refund with a status of requires_action. You can't cancel refunds in other states. Only refunds for payment methods that require customer action can enter the requires_action state. """ ... @class_method_variant("_cls_cancel") def cancel( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Refund.CancelParams"] ) -> "Refund": """ Cancels a refund with a status of requires_action. You can't cancel refunds in other states. Only refunds for payment methods that require customer action can enter the requires_action state. """ return cast( "Refund", self._request( "post", "/v1/refunds/{refund}/cancel".format( refund=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_cancel_async( cls, refund: str, **params: Unpack["Refund.CancelParams"] ) -> "Refund": """ Cancels a refund with a status of requires_action. You can't cancel refunds in other states. Only refunds for payment methods that require customer action can enter the requires_action state. """ return cast( "Refund", await cls._static_request_async( "post", "/v1/refunds/{refund}/cancel".format( refund=sanitize_id(refund) ), params=params, ), ) @overload @staticmethod async def cancel_async( refund: str, **params: Unpack["Refund.CancelParams"] ) -> "Refund": """ Cancels a refund with a status of requires_action. You can't cancel refunds in other states. Only refunds for payment methods that require customer action can enter the requires_action state. """ ... @overload async def cancel_async( self, **params: Unpack["Refund.CancelParams"] ) -> "Refund": """ Cancels a refund with a status of requires_action. You can't cancel refunds in other states. Only refunds for payment methods that require customer action can enter the requires_action state. """ ... @class_method_variant("_cls_cancel_async") async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Refund.CancelParams"] ) -> "Refund": """ Cancels a refund with a status of requires_action. You can't cancel refunds in other states. Only refunds for payment methods that require customer action can enter the requires_action state. """ return cast( "Refund", await self._request_async( "post", "/v1/refunds/{refund}/cancel".format( refund=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def create(cls, **params: Unpack["Refund.CreateParams"]) -> "Refund": """ When you create a new refund, you must specify a Charge or a PaymentIntent object on which to create it. Creating a new refund will refund a charge that has previously been created but not yet refunded. Funds will be refunded to the credit or debit card that was originally charged. You can optionally refund only part of a charge. You can do so multiple times, until the entire charge has been refunded. Once entirely refunded, a charge can't be refunded again. This method will raise an error when called on an already-refunded charge, or when trying to refund more money than is left on a charge. """ return cast( "Refund", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["Refund.CreateParams"] ) -> "Refund": """ When you create a new refund, you must specify a Charge or a PaymentIntent object on which to create it. Creating a new refund will refund a charge that has previously been created but not yet refunded. Funds will be refunded to the credit or debit card that was originally charged. You can optionally refund only part of a charge. You can do so multiple times, until the entire charge has been refunded. Once entirely refunded, a charge can't be refunded again. This method will raise an error when called on an already-refunded charge, or when trying to refund more money than is left on a charge. """ return cast( "Refund", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def list( cls, **params: Unpack["Refund.ListParams"] ) -> ListObject["Refund"]: """ Returns a list of all refunds you created. We return the refunds in sorted order, with the most recent refunds appearing first The 10 most recent refunds are always available by default on the Charge object. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["Refund.ListParams"] ) -> ListObject["Refund"]: """ Returns a list of all refunds you created. We return the refunds in sorted order, with the most recent refunds appearing first The 10 most recent refunds are always available by default on the Charge object. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def modify( cls, id: str, **params: Unpack["Refund.ModifyParams"] ) -> "Refund": """ Updates the refund that you specify by setting the values of the passed parameters. Any parameters that you don't provide remain unchanged. This request only accepts metadata as an argument. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Refund", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["Refund.ModifyParams"] ) -> "Refund": """ Updates the refund that you specify by setting the values of the passed parameters. Any parameters that you don't provide remain unchanged. This request only accepts metadata as an argument. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Refund", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["Refund.RetrieveParams"] ) -> "Refund": """ Retrieves the details of an existing refund. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["Refund.RetrieveParams"] ) -> "Refund": """ Retrieves the details of an existing refund. """ instance = cls(id, **params) await instance.refresh_async() return instance class TestHelpers(APIResourceTestHelpers["Refund"]): _resource_cls: Type["Refund"] @classmethod def _cls_expire( cls, refund: str, **params: Unpack["Refund.ExpireParams"] ) -> "Refund": """ Expire a refund with a status of requires_action. """ return cast( "Refund", cls._static_request( "post", "/v1/test_helpers/refunds/{refund}/expire".format( refund=sanitize_id(refund) ), params=params, ), ) @overload @staticmethod def expire( refund: str, **params: Unpack["Refund.ExpireParams"] ) -> "Refund": """ Expire a refund with a status of requires_action. """ ... @overload def expire(self, **params: Unpack["Refund.ExpireParams"]) -> "Refund": """ Expire a refund with a status of requires_action. """ ... @class_method_variant("_cls_expire") def expire( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Refund.ExpireParams"] ) -> "Refund": """ Expire a refund with a status of requires_action. """ return cast( "Refund", self.resource._request( "post", "/v1/test_helpers/refunds/{refund}/expire".format( refund=sanitize_id(self.resource.get("id")) ), params=params, ), ) @classmethod async def _cls_expire_async( cls, refund: str, **params: Unpack["Refund.ExpireParams"] ) -> "Refund": """ Expire a refund with a status of requires_action. """ return cast( "Refund", await cls._static_request_async( "post", "/v1/test_helpers/refunds/{refund}/expire".format( refund=sanitize_id(refund) ), params=params, ), ) @overload @staticmethod async def expire_async( refund: str, **params: Unpack["Refund.ExpireParams"] ) -> "Refund": """ Expire a refund with a status of requires_action. """ ... @overload async def expire_async( self, **params: Unpack["Refund.ExpireParams"] ) -> "Refund": """ Expire a refund with a status of requires_action. """ ... @class_method_variant("_cls_expire_async") async def expire_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Refund.ExpireParams"] ) -> "Refund": """ Expire a refund with a status of requires_action. """ return cast( "Refund", await self.resource._request_async( "post", "/v1/test_helpers/refunds/{refund}/expire".format( refund=sanitize_id(self.resource.get("id")) ), params=params, ), ) @property def test_helpers(self): return self.TestHelpers(self) _inner_class_types = { "destination_details": DestinationDetails, "next_action": NextAction, } Refund.TestHelpers._resource_cls = Refund ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_refund_service.py0000644000175100001770000003305014637354563017547 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._refund import Refund from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class RefundService(StripeService): class CancelParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CreateParams(TypedDict): amount: NotRequired[int] charge: NotRequired[str] """ The identifier of the charge to refund. """ currency: NotRequired[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). """ customer: NotRequired[str] """ Customer whose customer balance to refund from. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ instructions_email: NotRequired[str] """ For payment methods without native refund support (e.g., Konbini, PromptPay), use this email from the customer to receive refund instructions. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ origin: NotRequired[Literal["customer_balance"]] """ Origin of the refund """ payment_intent: NotRequired[str] """ The identifier of the PaymentIntent to refund. """ reason: NotRequired[ Literal["duplicate", "fraudulent", "requested_by_customer"] ] """ String indicating the reason for the refund. If set, possible values are `duplicate`, `fraudulent`, and `requested_by_customer`. If you believe the charge to be fraudulent, specifying `fraudulent` as the reason will add the associated card and email to your [block lists](https://stripe.com/docs/radar/lists), and will also help us improve our fraud detection algorithms. """ refund_application_fee: NotRequired[bool] """ Boolean indicating whether the application fee should be refunded when refunding this charge. If a full charge refund is given, the full application fee will be refunded. Otherwise, the application fee will be refunded in an amount proportional to the amount of the charge refunded. An application fee can be refunded only by the application that created the charge. """ reverse_transfer: NotRequired[bool] """ Boolean indicating whether the transfer should be reversed when refunding this charge. The transfer will be reversed proportionally to the amount being refunded (either the entire or partial amount). A transfer can be reversed only by the application that created the charge. """ class ListParams(TypedDict): charge: NotRequired[str] """ Only return refunds for the charge specified by this charge ID. """ created: NotRequired["RefundService.ListParamsCreated|int"] """ Only return refunds that were created during the given date interval. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ payment_intent: NotRequired[str] """ Only return refunds for the PaymentIntent specified by this ID. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ def list( self, params: "RefundService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Refund]: """ Returns a list of all refunds you created. We return the refunds in sorted order, with the most recent refunds appearing first The 10 most recent refunds are always available by default on the Charge object. """ return cast( ListObject[Refund], self._request( "get", "/v1/refunds", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "RefundService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Refund]: """ Returns a list of all refunds you created. We return the refunds in sorted order, with the most recent refunds appearing first The 10 most recent refunds are always available by default on the Charge object. """ return cast( ListObject[Refund], await self._request_async( "get", "/v1/refunds", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "RefundService.CreateParams" = {}, options: RequestOptions = {}, ) -> Refund: """ When you create a new refund, you must specify a Charge or a PaymentIntent object on which to create it. Creating a new refund will refund a charge that has previously been created but not yet refunded. Funds will be refunded to the credit or debit card that was originally charged. You can optionally refund only part of a charge. You can do so multiple times, until the entire charge has been refunded. Once entirely refunded, a charge can't be refunded again. This method will raise an error when called on an already-refunded charge, or when trying to refund more money than is left on a charge. """ return cast( Refund, self._request( "post", "/v1/refunds", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "RefundService.CreateParams" = {}, options: RequestOptions = {}, ) -> Refund: """ When you create a new refund, you must specify a Charge or a PaymentIntent object on which to create it. Creating a new refund will refund a charge that has previously been created but not yet refunded. Funds will be refunded to the credit or debit card that was originally charged. You can optionally refund only part of a charge. You can do so multiple times, until the entire charge has been refunded. Once entirely refunded, a charge can't be refunded again. This method will raise an error when called on an already-refunded charge, or when trying to refund more money than is left on a charge. """ return cast( Refund, await self._request_async( "post", "/v1/refunds", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, refund: str, params: "RefundService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Refund: """ Retrieves the details of an existing refund. """ return cast( Refund, self._request( "get", "/v1/refunds/{refund}".format(refund=sanitize_id(refund)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, refund: str, params: "RefundService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Refund: """ Retrieves the details of an existing refund. """ return cast( Refund, await self._request_async( "get", "/v1/refunds/{refund}".format(refund=sanitize_id(refund)), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, refund: str, params: "RefundService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Refund: """ Updates the refund that you specify by setting the values of the passed parameters. Any parameters that you don't provide remain unchanged. This request only accepts metadata as an argument. """ return cast( Refund, self._request( "post", "/v1/refunds/{refund}".format(refund=sanitize_id(refund)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, refund: str, params: "RefundService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Refund: """ Updates the refund that you specify by setting the values of the passed parameters. Any parameters that you don't provide remain unchanged. This request only accepts metadata as an argument. """ return cast( Refund, await self._request_async( "post", "/v1/refunds/{refund}".format(refund=sanitize_id(refund)), api_mode="V1", base_address="api", params=params, options=options, ), ) def cancel( self, refund: str, params: "RefundService.CancelParams" = {}, options: RequestOptions = {}, ) -> Refund: """ Cancels a refund with a status of requires_action. You can't cancel refunds in other states. Only refunds for payment methods that require customer action can enter the requires_action state. """ return cast( Refund, self._request( "post", "/v1/refunds/{refund}/cancel".format( refund=sanitize_id(refund), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def cancel_async( self, refund: str, params: "RefundService.CancelParams" = {}, options: RequestOptions = {}, ) -> Refund: """ Cancels a refund with a status of requires_action. You can't cancel refunds in other states. Only refunds for payment methods that require customer action can enter the requires_action state. """ return cast( Refund, await self._request_async( "post", "/v1/refunds/{refund}/cancel".format( refund=sanitize_id(refund), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_reporting_service.py0000644000175100001770000000074214637354563020277 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_service import StripeService from stripe.reporting._report_run_service import ReportRunService from stripe.reporting._report_type_service import ReportTypeService class ReportingService(StripeService): def __init__(self, requestor): super().__init__(requestor) self.report_runs = ReportRunService(self._requestor) self.report_types = ReportTypeService(self._requestor) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_request_metrics.py0000644000175100001770000000111114637354563017753 0ustar00runnerdockerfrom typing import List, Optional class RequestMetrics(object): def __init__( self, request_id, request_duration_ms, usage: Optional[List[str]] = [], ): self.request_id = request_id self.request_duration_ms = request_duration_ms self.usage = usage def payload(self): ret = { "request_id": self.request_id, "request_duration_ms": self.request_duration_ms, } if self.usage is not None and len(self.usage) > 0: ret["usage"] = self.usage return ret ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_request_options.py0000644000175100001770000000421614637354563020011 0ustar00runnerdockerfrom stripe._requestor_options import RequestorOptions from typing import Mapping, Optional, Dict, Tuple, Any from typing_extensions import NotRequired, TypedDict class RequestOptions(TypedDict): api_key: NotRequired["str|None"] stripe_version: NotRequired["str|None"] stripe_account: NotRequired["str|None"] max_network_retries: NotRequired["int|None"] idempotency_key: NotRequired["str|None"] headers: NotRequired["Mapping[str, str]|None"] def merge_options( requestor: RequestorOptions, request: Optional[RequestOptions], ) -> RequestOptions: """ Merge a client and request object, giving precedence to the values from the request object. """ if request is None: return { "api_key": requestor.api_key, "stripe_account": requestor.stripe_account, "stripe_version": requestor.stripe_version, "max_network_retries": requestor.max_network_retries, "idempotency_key": None, "headers": None, } return { "api_key": request.get("api_key") or requestor.api_key, "stripe_account": request.get("stripe_account") or requestor.stripe_account, "stripe_version": request.get("stripe_version") or requestor.stripe_version, "max_network_retries": request.get("max_network_retries") if request.get("max_network_retries") is not None else requestor.max_network_retries, "idempotency_key": request.get("idempotency_key"), "headers": request.get("headers"), } def extract_options_from_dict( d: Optional[Mapping[str, Any]], ) -> Tuple[RequestOptions, Dict[str, Any]]: """ Extracts a RequestOptions object from a dict, and returns a tuple of the RequestOptions object and the remaining dict. """ if not d: return {}, {} options: RequestOptions = {} d_copy = dict(d) for key in [ "api_key", "stripe_version", "stripe_account", "max_network_retries", "idempotency_key", "headers", ]: if key in d_copy: options[key] = d_copy.pop(key) return options, d_copy ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_requestor_options.py0000644000175100001770000000435514637354563020356 0ustar00runnerdocker# using global variables import stripe # noqa: IMP101 from stripe._base_address import BaseAddresses from typing import Optional class RequestorOptions(object): api_key: Optional[str] stripe_account: Optional[str] stripe_version: Optional[str] base_addresses: BaseAddresses max_network_retries: Optional[int] def __init__( self, api_key: Optional[str] = None, stripe_account: Optional[str] = None, stripe_version: Optional[str] = None, base_addresses: BaseAddresses = {}, max_network_retries: Optional[int] = None, ): self.api_key = api_key self.stripe_account = stripe_account self.stripe_version = stripe_version self.base_addresses = {} # Base addresses can be unset (for correct merging). # If they are not set, then we will use default API bases defined on stripe. if base_addresses.get("api"): self.base_addresses["api"] = base_addresses.get("api") if base_addresses.get("connect") is not None: self.base_addresses["connect"] = base_addresses.get("connect") if base_addresses.get("files") is not None: self.base_addresses["files"] = base_addresses.get("files") self.max_network_retries = max_network_retries def to_dict(self): """ Returns a dict representation of the object. """ return { "api_key": self.api_key, "stripe_account": self.stripe_account, "stripe_version": self.stripe_version, "base_addresses": self.base_addresses, "max_network_retries": self.max_network_retries, } class _GlobalRequestorOptions(RequestorOptions): def __init__(self): pass @property def base_addresses(self): return { "api": stripe.api_base, "connect": stripe.connect_api_base, "files": stripe.upload_api_base, } @property def api_key(self): return stripe.api_key @property def stripe_version(self): return stripe.api_version @property def stripe_account(self): return None @property def max_network_retries(self): return stripe.max_network_retries ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_reserve_transaction.py0000644000175100001770000000157614637354563020634 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject from typing import ClassVar, Optional from typing_extensions import Literal class ReserveTransaction(StripeObject): OBJECT_NAME: ClassVar[Literal["reserve_transaction"]] = ( "reserve_transaction" ) amount: int 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. """ id: str """ Unique identifier for the object. """ object: Literal["reserve_transaction"] """ String representing the object's type. Objects of the same type share the same value. """ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_reversal.py0000644000175100001770000000740614637354563016375 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._expandable_field import ExpandableField from stripe._transfer import Transfer from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import sanitize_id from typing import ClassVar, Dict, Optional from typing_extensions import Literal, TYPE_CHECKING if TYPE_CHECKING: from stripe._balance_transaction import BalanceTransaction from stripe._refund import Refund class Reversal(UpdateableAPIResource["Reversal"]): """ [Stripe Connect](https://stripe.com/docs/connect) platforms can reverse transfers made to a connected account, either entirely or partially, and can also specify whether to refund any related application fees. Transfer reversals add to the platform's balance and subtract from the destination account's balance. Reversing a transfer that was made for a [destination charge](https://stripe.com/docs/connect/destination-charges) is allowed only up to the amount of the charge. It is possible to reverse a [transfer_group](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) transfer only if the destination account has enough balance to cover the reversal. Related guide: [Reverse transfers](https://stripe.com/docs/connect/separate-charges-and-transfers#reverse-transfers) """ OBJECT_NAME: ClassVar[Literal["transfer_reversal"]] = "transfer_reversal" amount: int """ Amount, in cents (or local equivalent). """ balance_transaction: Optional[ExpandableField["BalanceTransaction"]] """ Balance transaction that describes the impact on your account balance. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ 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). """ destination_payment_refund: Optional[ExpandableField["Refund"]] """ Linked payment refund for the transfer reversal. """ id: str """ Unique identifier for the object. """ metadata: Optional[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ object: Literal["transfer_reversal"] """ String representing the object's type. Objects of the same type share the same value. """ source_refund: Optional[ExpandableField["Refund"]] """ ID of the refund responsible for the transfer reversal. """ transfer: ExpandableField["Transfer"] """ ID of the transfer that was reversed. """ def instance_url(self): token = self.id transfer = self.transfer if isinstance(transfer, Transfer): transfer = transfer.id base = Transfer.class_url() cust_extn = sanitize_id(transfer) extn = sanitize_id(token) return "%s/%s/reversals/%s" % (base, cust_extn, extn) @classmethod def modify(cls, sid, **params): raise NotImplementedError( "Can't modify a reversal without a transfer ID. " "Use stripe.Transfer.modify_reversal('transfer_id', 'reversal_id', ...) " "(see https://stripe.com/docs/api/transfer_reversals/update)." ) @classmethod def retrieve(cls, id, **params): raise NotImplementedError( "Can't retrieve a reversal without a transfer ID. " "Use stripe.Transfer.retrieve_reversal('transfer_id', 'reversal_id') " "(see https://stripe.com/docs/api/transfer_reversals/retrieve)." ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_review.py0000644000175100001770000002630314637354563016050 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, List, Optional, cast, overload from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._charge import Charge from stripe._payment_intent import PaymentIntent class Review(ListableAPIResource["Review"]): """ Reviews can be used to supplement automated fraud detection with human expertise. Learn more about [Radar](https://stripe.com/radar) and reviewing payments [here](https://stripe.com/docs/radar/reviews). """ OBJECT_NAME: ClassVar[Literal["review"]] = "review" class IpAddressLocation(StripeObject): city: Optional[str] """ The city where the payment originated. """ country: Optional[str] """ Two-letter ISO code representing the country where the payment originated. """ latitude: Optional[float] """ The geographic latitude where the payment originated. """ longitude: Optional[float] """ The geographic longitude where the payment originated. """ region: Optional[str] """ The state/county/province/region where the payment originated. """ class Session(StripeObject): browser: Optional[str] """ The browser used in this browser session (e.g., `Chrome`). """ device: Optional[str] """ Information about the device used for the browser session (e.g., `Samsung SM-G930T`). """ platform: Optional[str] """ The platform for the browser session (e.g., `Macintosh`). """ version: Optional[str] """ The version for the browser session (e.g., `61.0.3163.100`). """ class ApproveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ListParams(RequestOptions): created: NotRequired["Review.ListParamsCreated|int"] """ Only return reviews that were created during the given date interval. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ billing_zip: Optional[str] """ The ZIP or postal code of the card used, if applicable. """ charge: Optional[ExpandableField["Charge"]] """ The charge associated with this review. """ closed_reason: Optional[ Literal[ "approved", "disputed", "redacted", "refunded", "refunded_as_fraud" ] ] """ The reason the review was closed, or null if it has not yet been closed. One of `approved`, `refunded`, `refunded_as_fraud`, `disputed`, or `redacted`. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ id: str """ Unique identifier for the object. """ ip_address: Optional[str] """ The IP address where the payment originated. """ ip_address_location: Optional[IpAddressLocation] """ Information related to the location of the payment. Note that this information is an approximation and attempts to locate the nearest population center - it should not be used to determine a specific address. """ 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["review"] """ String representing the object's type. Objects of the same type share the same value. """ open: bool """ If `true`, the review needs action. """ opened_reason: Literal["manual", "rule"] """ The reason the review was opened. One of `rule` or `manual`. """ payment_intent: Optional[ExpandableField["PaymentIntent"]] """ The PaymentIntent ID associated with this review, if one exists. """ reason: str """ The reason the review is currently open or closed. One of `rule`, `manual`, `approved`, `refunded`, `refunded_as_fraud`, `disputed`, or `redacted`. """ session: Optional[Session] """ Information related to the browsing session of the user who initiated the payment. """ @classmethod def _cls_approve( cls, review: str, **params: Unpack["Review.ApproveParams"] ) -> "Review": """ Approves a Review object, closing it and removing it from the list of reviews. """ return cast( "Review", cls._static_request( "post", "/v1/reviews/{review}/approve".format( review=sanitize_id(review) ), params=params, ), ) @overload @staticmethod def approve( review: str, **params: Unpack["Review.ApproveParams"] ) -> "Review": """ Approves a Review object, closing it and removing it from the list of reviews. """ ... @overload def approve(self, **params: Unpack["Review.ApproveParams"]) -> "Review": """ Approves a Review object, closing it and removing it from the list of reviews. """ ... @class_method_variant("_cls_approve") def approve( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Review.ApproveParams"] ) -> "Review": """ Approves a Review object, closing it and removing it from the list of reviews. """ return cast( "Review", self._request( "post", "/v1/reviews/{review}/approve".format( review=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_approve_async( cls, review: str, **params: Unpack["Review.ApproveParams"] ) -> "Review": """ Approves a Review object, closing it and removing it from the list of reviews. """ return cast( "Review", await cls._static_request_async( "post", "/v1/reviews/{review}/approve".format( review=sanitize_id(review) ), params=params, ), ) @overload @staticmethod async def approve_async( review: str, **params: Unpack["Review.ApproveParams"] ) -> "Review": """ Approves a Review object, closing it and removing it from the list of reviews. """ ... @overload async def approve_async( self, **params: Unpack["Review.ApproveParams"] ) -> "Review": """ Approves a Review object, closing it and removing it from the list of reviews. """ ... @class_method_variant("_cls_approve_async") async def approve_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Review.ApproveParams"] ) -> "Review": """ Approves a Review object, closing it and removing it from the list of reviews. """ return cast( "Review", await self._request_async( "post", "/v1/reviews/{review}/approve".format( review=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def list( cls, **params: Unpack["Review.ListParams"] ) -> ListObject["Review"]: """ Returns a list of Review objects that have open set to true. The objects are sorted in descending order by creation date, with the most recently created object appearing first. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["Review.ListParams"] ) -> ListObject["Review"]: """ Returns a list of Review objects that have open set to true. The objects are sorted in descending order by creation date, with the most recently created object appearing first. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def retrieve( cls, id: str, **params: Unpack["Review.RetrieveParams"] ) -> "Review": """ Retrieves a Review object. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["Review.RetrieveParams"] ) -> "Review": """ Retrieves a Review object. """ instance = cls(id, **params) await instance.refresh_async() return instance _inner_class_types = { "ip_address_location": IpAddressLocation, "session": Session, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_review_service.py0000644000175100001770000001400114637354563017560 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._review import Review from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict class ReviewService(StripeService): class ApproveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ListParams(TypedDict): created: NotRequired["ReviewService.ListParamsCreated|int"] """ Only return reviews that were created during the given date interval. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def list( self, params: "ReviewService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Review]: """ Returns a list of Review objects that have open set to true. The objects are sorted in descending order by creation date, with the most recently created object appearing first. """ return cast( ListObject[Review], self._request( "get", "/v1/reviews", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "ReviewService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Review]: """ Returns a list of Review objects that have open set to true. The objects are sorted in descending order by creation date, with the most recently created object appearing first. """ return cast( ListObject[Review], await self._request_async( "get", "/v1/reviews", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, review: str, params: "ReviewService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Review: """ Retrieves a Review object. """ return cast( Review, self._request( "get", "/v1/reviews/{review}".format(review=sanitize_id(review)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, review: str, params: "ReviewService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Review: """ Retrieves a Review object. """ return cast( Review, await self._request_async( "get", "/v1/reviews/{review}".format(review=sanitize_id(review)), api_mode="V1", base_address="api", params=params, options=options, ), ) def approve( self, review: str, params: "ReviewService.ApproveParams" = {}, options: RequestOptions = {}, ) -> Review: """ Approves a Review object, closing it and removing it from the list of reviews. """ return cast( Review, self._request( "post", "/v1/reviews/{review}/approve".format( review=sanitize_id(review), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def approve_async( self, review: str, params: "ReviewService.ApproveParams" = {}, options: RequestOptions = {}, ) -> Review: """ Approves a Review object, closing it and removing it from the list of reviews. """ return cast( Review, await self._request_async( "post", "/v1/reviews/{review}/approve".format( review=sanitize_id(review), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_search_result_object.py0000644000175100001770000001305314637354563020736 0ustar00runnerdocker# pyright: strict from typing_extensions import Self, Unpack from typing import ( Generic, List, TypeVar, cast, Any, Mapping, Iterator, AsyncIterator, Optional, ) from stripe._api_requestor import ( _APIRequestor, # pyright: ignore[reportPrivateUsage] ) from stripe._stripe_object import StripeObject from stripe import _util import warnings from stripe._request_options import RequestOptions, extract_options_from_dict from stripe._any_iterator import AnyIterator T = TypeVar("T", bound=StripeObject) class SearchResultObject(StripeObject, Generic[T]): OBJECT_NAME = "search_result" data: List[StripeObject] has_more: bool next_page: str def _search(self, **params: Mapping[str, Any]) -> Self: with warnings.catch_warnings(): warnings.simplefilter("ignore", DeprecationWarning) return self.search( # pyright: ignore[reportDeprecated] **params, ) def _get_url_for_search(self) -> str: url = self.get("url") if not isinstance(url, str): raise ValueError( 'Cannot call .list on a list object without a string "url" property' ) return url @_util.deprecated( "This will be removed in a future version of stripe-python. Please call the `search` method on the corresponding resource directly, instead of the generic search on SearchResultObject." ) def search(self, **params: Mapping[str, Any]) -> Self: return cast( Self, self._request( "get", self._get_url_for_search(), params=params, base_address="api", api_mode="V1", ), ) async def _search_async(self, **params: Mapping[str, Any]) -> Self: return cast( Self, await self._request_async( "get", self._get_url_for_search(), params=params, base_address="api", api_mode="V1", ), ) def __getitem__(self, k: str) -> T: if isinstance(k, str): # pyright: ignore return super(SearchResultObject, self).__getitem__(k) else: raise KeyError( "You tried to access the %s index, but SearchResultObject types " "only support string keys. (HINT: Search calls return an object " "with a 'data' (which is the data array). You likely want to " "call .data[%s])" % (repr(k), repr(k)) ) # Pyright doesn't like this because SearchResultObject inherits from StripeObject inherits from Dict[str, Any] # and so it wants the type of __iter__ to agree with __iter__ from Dict[str, Any] # But we are iterating through "data", which is a List[T]. def __iter__(self) -> Iterator[T]: # pyright: ignore return getattr(self, "data", []).__iter__() def __len__(self) -> int: return getattr(self, "data", []).__len__() def _auto_paging_iter(self) -> Iterator[T]: page = self while True: for item in page: yield item page = page.next_search_result_page() if page.is_empty: break def auto_paging_iter(self) -> AnyIterator[T]: return AnyIterator( self._auto_paging_iter(), self._auto_paging_iter_async() ) async def _auto_paging_iter_async(self) -> AsyncIterator[T]: page = self while True: for item in page: yield item page = await page.next_search_result_page_async() if page.is_empty: break @classmethod def _empty_search_result( cls, **params: Unpack[RequestOptions], ) -> Self: return cls._construct_from( values={"data": [], "has_more": False, "next_page": None}, last_response=None, requestor=_APIRequestor._global_with_options( # pyright: ignore[reportPrivateUsage] **params, ), api_mode="V1", ) @property def is_empty(self) -> bool: return not self.data def _get_filters_for_next_page( self, params: RequestOptions ) -> Mapping[str, Any]: params_with_filters = dict(self._retrieve_params) params_with_filters.update({"page": self.next_page}) params_with_filters.update(params) return params_with_filters def _maybe_empty_result(self, params: RequestOptions) -> Optional[Self]: if not self.has_more: options, _ = extract_options_from_dict(params) return self._empty_search_result( api_key=options.get("api_key"), stripe_version=options.get("stripe_version"), stripe_account=options.get("stripe_account"), ) return None def next_search_result_page( self, **params: Unpack[RequestOptions] ) -> Self: empty = self._maybe_empty_result(params) return ( empty if empty is not None else self._search( **self._get_filters_for_next_page(params), ) ) async def next_search_result_page_async( self, **params: Unpack[RequestOptions] ) -> Self: empty = self._maybe_empty_result(params) return ( empty if empty is not None else await self._search_async( **self._get_filters_for_next_page(params), ) ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_searchable_api_resource.py0000644000175100001770000000246514637354563021403 0ustar00runnerdockerfrom stripe._api_resource import APIResource from stripe._search_result_object import SearchResultObject from typing import TypeVar from typing_extensions import TYPE_CHECKING if TYPE_CHECKING: from stripe._stripe_object import StripeObject T = TypeVar("T", bound="StripeObject") class SearchableAPIResource(APIResource[T]): @classmethod def _search(cls, search_url, **params): ret = cls._static_request( "get", search_url, params=params, ) if not isinstance(ret, SearchResultObject): raise TypeError( "Expected search result from API, got %s" % (type(ret).__name__,) ) return ret @classmethod async def _search_async(cls, search_url, **params): ret = await cls._static_request_async( "get", search_url, params=params, ) if not isinstance(ret, SearchResultObject): raise TypeError( "Expected search result from API, got %s" % (type(ret).__name__,) ) return ret @classmethod def search(cls, *args, **kwargs): raise NotImplementedError @classmethod def search_auto_paging_iter(cls, *args, **kwargs): raise NotImplementedError ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_setup_attempt.py0000644000175100001770000010567114637354563017453 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from typing import ClassVar, List, Optional, Union from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._account import Account from stripe._application import Application from stripe._bank_account import BankAccount from stripe._card import Card as CardResource from stripe._customer import Customer from stripe._mandate import Mandate from stripe._payment_intent import PaymentIntent from stripe._payment_method import PaymentMethod from stripe._setup_intent import SetupIntent from stripe._source import Source class SetupAttempt(ListableAPIResource["SetupAttempt"]): """ A SetupAttempt describes one attempted confirmation of a SetupIntent, whether that confirmation is successful or unsuccessful. You can use SetupAttempts to inspect details of a specific attempt at setting up a payment method using a SetupIntent. """ OBJECT_NAME: ClassVar[Literal["setup_attempt"]] = "setup_attempt" class PaymentMethodDetails(StripeObject): class AcssDebit(StripeObject): pass class AmazonPay(StripeObject): pass class AuBecsDebit(StripeObject): pass class BacsDebit(StripeObject): pass class Bancontact(StripeObject): bank_code: Optional[str] """ Bank code of bank associated with the bank account. """ bank_name: Optional[str] """ Name of the bank associated with the bank account. """ bic: Optional[str] """ Bank Identifier Code of the bank associated with the bank account. """ generated_sepa_debit: Optional[ExpandableField["PaymentMethod"]] """ The ID of the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. """ generated_sepa_debit_mandate: Optional[ExpandableField["Mandate"]] """ The mandate for the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. """ iban_last4: Optional[str] """ Last four characters of the IBAN. """ preferred_language: Optional[Literal["de", "en", "fr", "nl"]] """ Preferred language of the Bancontact authorization page that the customer is redirected to. Can be one of `en`, `de`, `fr`, or `nl` """ verified_name: Optional[str] """ Owner's verified full name. Values are verified or provided by Bancontact directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ class Boleto(StripeObject): pass class Card(StripeObject): class Checks(StripeObject): address_line1_check: Optional[str] """ If a address line1 was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. """ address_postal_code_check: Optional[str] """ If a address postal code was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. """ cvc_check: Optional[str] """ If a CVC was provided, results of the check, one of `pass`, `fail`, `unavailable`, or `unchecked`. """ class ThreeDSecure(StripeObject): authentication_flow: Optional[ Literal["challenge", "frictionless"] ] """ For authenticated transactions: how the customer was authenticated by the issuing bank. """ electronic_commerce_indicator: Optional[ Literal["01", "02", "05", "06", "07"] ] """ The Electronic Commerce Indicator (ECI). A protocol-level field indicating what degree of authentication was performed. """ result: Optional[ Literal[ "attempt_acknowledged", "authenticated", "exempted", "failed", "not_supported", "processing_error", ] ] """ Indicates the outcome of 3D Secure authentication. """ result_reason: Optional[ Literal[ "abandoned", "bypassed", "canceled", "card_not_enrolled", "network_not_supported", "protocol_error", "rejected", ] ] """ Additional information about why 3D Secure succeeded or failed based on the `result`. """ transaction_id: Optional[str] """ The 3D Secure 1 XID or 3D Secure 2 Directory Server Transaction ID (dsTransId) for this payment. """ version: Optional[Literal["1.0.2", "2.1.0", "2.2.0"]] """ The version of 3D Secure that was used. """ class Wallet(StripeObject): class ApplePay(StripeObject): pass class GooglePay(StripeObject): pass apple_pay: Optional[ApplePay] google_pay: Optional[GooglePay] type: Literal["apple_pay", "google_pay", "link"] """ The type of the card wallet, one of `apple_pay`, `google_pay`, or `link`. An additional hash is included on the Wallet subhash with a name matching this value. It contains additional information specific to the card wallet type. """ _inner_class_types = { "apple_pay": ApplePay, "google_pay": GooglePay, } brand: Optional[str] """ Card brand. Can be `amex`, `diners`, `discover`, `eftpos_au`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ checks: Optional[Checks] """ Check results by Card networks on Card address and CVC at the time of authorization """ country: Optional[str] """ Two-letter ISO code representing the country of the card. You could use this attribute to get a sense of the international breakdown of cards you've collected. """ description: Optional[str] """ A high-level description of the type of cards issued in this range. (For internal use only and not typically available in standard API requests.) """ exp_month: Optional[int] """ Two-digit number representing the card's expiration month. """ exp_year: Optional[int] """ Four-digit number representing the card's expiration year. """ fingerprint: Optional[str] """ Uniquely identifies this particular card number. You can use this attribute to check whether two customers who've signed up with you are using the same card number, for example. For payment methods that tokenize card information (Apple Pay, Google Pay), the tokenized number might be provided instead of the underlying card number. *As of May 1, 2021, card fingerprint in India for Connect changed to allow two fingerprints for the same card---one for India and one for the rest of the world.* """ funding: Optional[str] """ Card funding type. Can be `credit`, `debit`, `prepaid`, or `unknown`. """ iin: Optional[str] """ Issuer identification number of the card. (For internal use only and not typically available in standard API requests.) """ issuer: Optional[str] """ The name of the card's issuing bank. (For internal use only and not typically available in standard API requests.) """ last4: Optional[str] """ The last four digits of the card. """ network: Optional[str] """ Identifies which network this charge was processed on. Can be `amex`, `cartes_bancaires`, `diners`, `discover`, `eftpos_au`, `interac`, `jcb`, `mastercard`, `unionpay`, `visa`, or `unknown`. """ three_d_secure: Optional[ThreeDSecure] """ Populated if this authorization used 3D Secure authentication. """ wallet: Optional[Wallet] """ If this Card is part of a card wallet, this contains the details of the card wallet. """ _inner_class_types = { "checks": Checks, "three_d_secure": ThreeDSecure, "wallet": Wallet, } class CardPresent(StripeObject): class Offline(StripeObject): stored_at: Optional[int] """ Time at which the payment was collected while offline """ generated_card: Optional[ExpandableField["PaymentMethod"]] """ The ID of the Card PaymentMethod which was generated by this SetupAttempt. """ offline: Optional[Offline] """ Details about payments collected offline. """ _inner_class_types = {"offline": Offline} class Cashapp(StripeObject): pass class Ideal(StripeObject): bank: Optional[ Literal[ "abn_amro", "asn_bank", "bunq", "handelsbanken", "ing", "knab", "moneyou", "n26", "nn", "rabobank", "regiobank", "revolut", "sns_bank", "triodos_bank", "van_lanschot", "yoursafe", ] ] """ The customer's bank. Can be one of `abn_amro`, `asn_bank`, `bunq`, `handelsbanken`, `ing`, `knab`, `moneyou`, `n26`, `nn`, `rabobank`, `regiobank`, `revolut`, `sns_bank`, `triodos_bank`, `van_lanschot`, or `yoursafe`. """ bic: Optional[ Literal[ "ABNANL2A", "ASNBNL21", "BITSNL2A", "BUNQNL2A", "FVLBNL22", "HANDNL2A", "INGBNL2A", "KNABNL2H", "MOYONL21", "NNBANL2G", "NTSBDEB1", "RABONL2U", "RBRBNL21", "REVOIE23", "REVOLT21", "SNSBNL2A", "TRIONL2U", ] ] """ The Bank Identifier Code of the customer's bank. """ generated_sepa_debit: Optional[ExpandableField["PaymentMethod"]] """ The ID of the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. """ generated_sepa_debit_mandate: Optional[ExpandableField["Mandate"]] """ The mandate for the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. """ iban_last4: Optional[str] """ Last four characters of the IBAN. """ verified_name: Optional[str] """ Owner's verified full name. Values are verified or provided by iDEAL directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ class Klarna(StripeObject): pass class Link(StripeObject): pass class Paypal(StripeObject): pass class RevolutPay(StripeObject): pass class SepaDebit(StripeObject): pass class Sofort(StripeObject): bank_code: Optional[str] """ Bank code of bank associated with the bank account. """ bank_name: Optional[str] """ Name of the bank associated with the bank account. """ bic: Optional[str] """ Bank Identifier Code of the bank associated with the bank account. """ generated_sepa_debit: Optional[ExpandableField["PaymentMethod"]] """ The ID of the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. """ generated_sepa_debit_mandate: Optional[ExpandableField["Mandate"]] """ The mandate for the SEPA Direct Debit PaymentMethod which was generated by this SetupAttempt. """ iban_last4: Optional[str] """ Last four characters of the IBAN. """ preferred_language: Optional[Literal["de", "en", "fr", "nl"]] """ Preferred language of the Sofort authorization page that the customer is redirected to. Can be one of `en`, `de`, `fr`, or `nl` """ verified_name: Optional[str] """ Owner's verified full name. Values are verified or provided by Sofort directly (if supported) at the time of authorization or settlement. They cannot be set or mutated. """ class UsBankAccount(StripeObject): pass acss_debit: Optional[AcssDebit] amazon_pay: Optional[AmazonPay] au_becs_debit: Optional[AuBecsDebit] bacs_debit: Optional[BacsDebit] bancontact: Optional[Bancontact] boleto: Optional[Boleto] card: Optional[Card] card_present: Optional[CardPresent] cashapp: Optional[Cashapp] ideal: Optional[Ideal] klarna: Optional[Klarna] link: Optional[Link] paypal: Optional[Paypal] revolut_pay: Optional[RevolutPay] sepa_debit: Optional[SepaDebit] sofort: Optional[Sofort] type: str """ The type of the payment method used in the SetupIntent (e.g., `card`). An additional hash is included on `payment_method_details` with a name matching this value. It contains confirmation-specific information for the payment method. """ us_bank_account: Optional[UsBankAccount] _inner_class_types = { "acss_debit": AcssDebit, "amazon_pay": AmazonPay, "au_becs_debit": AuBecsDebit, "bacs_debit": BacsDebit, "bancontact": Bancontact, "boleto": Boleto, "card": Card, "card_present": CardPresent, "cashapp": Cashapp, "ideal": Ideal, "klarna": Klarna, "link": Link, "paypal": Paypal, "revolut_pay": RevolutPay, "sepa_debit": SepaDebit, "sofort": Sofort, "us_bank_account": UsBankAccount, } class SetupError(StripeObject): charge: Optional[str] """ For card errors, the ID of the failed charge. """ code: Optional[ Literal[ "account_closed", "account_country_invalid_address", "account_error_country_change_requires_additional_steps", "account_information_mismatch", "account_invalid", "account_number_invalid", "acss_debit_session_incomplete", "alipay_upgrade_required", "amount_too_large", "amount_too_small", "api_key_expired", "application_fees_not_allowed", "authentication_required", "balance_insufficient", "balance_invalid_parameter", "bank_account_bad_routing_numbers", "bank_account_declined", "bank_account_exists", "bank_account_restricted", "bank_account_unusable", "bank_account_unverified", "bank_account_verification_failed", "billing_invalid_mandate", "billing_policy_remote_function_response_invalid", "billing_policy_remote_function_timeout", "billing_policy_remote_function_unexpected_status_code", "billing_policy_remote_function_unreachable", "bitcoin_upgrade_required", "capture_charge_authorization_expired", "capture_unauthorized_payment", "card_decline_rate_limit_exceeded", "card_declined", "cardholder_phone_number_required", "charge_already_captured", "charge_already_refunded", "charge_disputed", "charge_exceeds_source_limit", "charge_expired_for_capture", "charge_invalid_parameter", "charge_not_refundable", "clearing_code_unsupported", "country_code_invalid", "country_unsupported", "coupon_expired", "customer_max_payment_methods", "customer_max_subscriptions", "customer_tax_location_invalid", "debit_not_authorized", "email_invalid", "expired_card", "financial_connections_account_inactive", "financial_connections_no_successful_transaction_refresh", "forwarding_api_inactive", "forwarding_api_invalid_parameter", "forwarding_api_upstream_connection_error", "forwarding_api_upstream_connection_timeout", "idempotency_key_in_use", "incorrect_address", "incorrect_cvc", "incorrect_number", "incorrect_zip", "instant_payouts_config_disabled", "instant_payouts_currency_disabled", "instant_payouts_limit_exceeded", "instant_payouts_unsupported", "insufficient_funds", "intent_invalid_state", "intent_verification_method_missing", "invalid_card_type", "invalid_characters", "invalid_charge_amount", "invalid_cvc", "invalid_expiry_month", "invalid_expiry_year", "invalid_number", "invalid_source_usage", "invalid_tax_location", "invoice_no_customer_line_items", "invoice_no_payment_method_types", "invoice_no_subscription_line_items", "invoice_not_editable", "invoice_on_behalf_of_not_editable", "invoice_payment_intent_requires_action", "invoice_upcoming_none", "livemode_mismatch", "lock_timeout", "missing", "no_account", "not_allowed_on_standard_account", "out_of_inventory", "ownership_declaration_not_allowed", "parameter_invalid_empty", "parameter_invalid_integer", "parameter_invalid_string_blank", "parameter_invalid_string_empty", "parameter_missing", "parameter_unknown", "parameters_exclusive", "payment_intent_action_required", "payment_intent_authentication_failure", "payment_intent_incompatible_payment_method", "payment_intent_invalid_parameter", "payment_intent_konbini_rejected_confirmation_number", "payment_intent_mandate_invalid", "payment_intent_payment_attempt_expired", "payment_intent_payment_attempt_failed", "payment_intent_unexpected_state", "payment_method_bank_account_already_verified", "payment_method_bank_account_blocked", "payment_method_billing_details_address_missing", "payment_method_configuration_failures", "payment_method_currency_mismatch", "payment_method_customer_decline", "payment_method_invalid_parameter", "payment_method_invalid_parameter_testmode", "payment_method_microdeposit_failed", "payment_method_microdeposit_verification_amounts_invalid", "payment_method_microdeposit_verification_amounts_mismatch", "payment_method_microdeposit_verification_attempts_exceeded", "payment_method_microdeposit_verification_descriptor_code_mismatch", "payment_method_microdeposit_verification_timeout", "payment_method_not_available", "payment_method_provider_decline", "payment_method_provider_timeout", "payment_method_unactivated", "payment_method_unexpected_state", "payment_method_unsupported_type", "payout_reconciliation_not_ready", "payouts_limit_exceeded", "payouts_not_allowed", "platform_account_required", "platform_api_key_expired", "postal_code_invalid", "processing_error", "product_inactive", "progressive_onboarding_limit_exceeded", "rate_limit", "refer_to_customer", "refund_disputed_payment", "resource_already_exists", "resource_missing", "return_intent_already_processed", "routing_number_invalid", "secret_key_required", "sepa_unsupported_account", "setup_attempt_failed", "setup_intent_authentication_failure", "setup_intent_invalid_parameter", "setup_intent_mandate_invalid", "setup_intent_setup_attempt_expired", "setup_intent_unexpected_state", "shipping_address_invalid", "shipping_calculation_failed", "sku_inactive", "state_unsupported", "status_transition_invalid", "stripe_tax_inactive", "tax_id_invalid", "taxes_calculation_failed", "terminal_location_country_unsupported", "terminal_reader_busy", "terminal_reader_hardware_fault", "terminal_reader_invalid_location_for_payment", "terminal_reader_offline", "terminal_reader_timeout", "testmode_charges_only", "tls_version_unsupported", "token_already_used", "token_card_network_invalid", "token_in_use", "transfer_source_balance_parameters_mismatch", "transfers_not_allowed", "url_invalid", ] ] """ For some errors that could be handled programmatically, a short string indicating the [error code](https://stripe.com/docs/error-codes) reported. """ decline_code: Optional[str] """ For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](https://stripe.com/docs/declines#issuer-declines) if they provide one. """ doc_url: Optional[str] """ A URL to more information about the [error code](https://stripe.com/docs/error-codes) reported. """ message: Optional[str] """ A human-readable message providing more details about the error. For card errors, these messages can be shown to your users. """ param: Optional[str] """ If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field. """ payment_intent: Optional["PaymentIntent"] """ A PaymentIntent guides you through the process of collecting a payment from your customer. We recommend that you create exactly one PaymentIntent for each order or customer session in your system. You can reference the PaymentIntent later to see the history of payment attempts for a particular session. A PaymentIntent transitions through [multiple statuses](https://stripe.com/docs/payments/intents#intent-statuses) throughout its lifetime as it interfaces with Stripe.js to perform authentication flows and ultimately creates at most one successful charge. Related guide: [Payment Intents API](https://stripe.com/docs/payments/payment-intents) """ payment_method: Optional["PaymentMethod"] """ PaymentMethod objects represent your customer's payment instruments. You can use them with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or save them to Customer objects to store instrument details for future payments. Related guides: [Payment Methods](https://stripe.com/docs/payments/payment-methods) and [More Payment Scenarios](https://stripe.com/docs/payments/more-payment-scenarios). """ payment_method_type: Optional[str] """ If the error is specific to the type of payment method, the payment method type that had a problem. This field is only populated for invoice-related errors. """ request_log_url: Optional[str] """ A URL to the request log entry in your dashboard. """ setup_intent: Optional["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://stripe.com/docs/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. The SetupIntent transitions through multiple [statuses](https://docs.stripe.com/payments/intents#intent-statuses) as it guides you through the setup process. Successful SetupIntents result in payment credentials that are optimized for future payments. 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://stripe.com/docs/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://stripe.com/docs/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. Related guide: [Setup Intents API](https://docs.stripe.com/payments/setup-intents) """ source: Optional[ Union["Account", "BankAccount", "CardResource", "Source"] ] type: Literal[ "api_error", "card_error", "idempotency_error", "invalid_request_error", ] """ The type of error returned. One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error` """ class ListParams(RequestOptions): created: NotRequired["SetupAttempt.ListParamsCreated|int"] """ A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp or a dictionary with a number of different query options. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ setup_intent: str """ Only return SetupAttempts created by the SetupIntent specified by this ID. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ application: Optional[ExpandableField["Application"]] """ The value of [application](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-application) on the SetupIntent at the time of this confirmation. """ attach_to_self: Optional[bool] """ If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. It can only be used for this Stripe Account's own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ customer: Optional[ExpandableField["Customer"]] """ The value of [customer](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-customer) on the SetupIntent at the time of this confirmation. """ flow_directions: Optional[List[Literal["inbound", "outbound"]]] """ Indicates the directions of money movement for which this payment method is intended to be used. Include `inbound` if you intend to use the payment method as the origin to pull funds from. Include `outbound` if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes. """ id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ object: Literal["setup_attempt"] """ String representing the object's type. Objects of the same type share the same value. """ on_behalf_of: Optional[ExpandableField["Account"]] """ The value of [on_behalf_of](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-on_behalf_of) on the SetupIntent at the time of this confirmation. """ payment_method: ExpandableField["PaymentMethod"] """ ID of the payment method used with this SetupAttempt. """ payment_method_details: PaymentMethodDetails setup_error: Optional[SetupError] """ The error encountered during this attempt to confirm the SetupIntent, if any. """ setup_intent: ExpandableField["SetupIntent"] """ ID of the SetupIntent that this attempt belongs to. """ status: str """ Status of this SetupAttempt, one of `requires_confirmation`, `requires_action`, `processing`, `succeeded`, `failed`, or `abandoned`. """ usage: str """ The value of [usage](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-usage) on the SetupIntent at the time of this confirmation, one of `off_session` or `on_session`. """ @classmethod def list( cls, **params: Unpack["SetupAttempt.ListParams"] ) -> ListObject["SetupAttempt"]: """ Returns a list of SetupAttempts that associate with a provided SetupIntent. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["SetupAttempt.ListParams"] ) -> ListObject["SetupAttempt"]: """ Returns a list of SetupAttempts that associate with a provided SetupIntent. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result _inner_class_types = { "payment_method_details": PaymentMethodDetails, "setup_error": SetupError, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_setup_attempt_service.py0000644000175100001770000000663114637354563021167 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._setup_attempt import SetupAttempt from stripe._stripe_service import StripeService from typing import List, cast from typing_extensions import NotRequired, TypedDict class SetupAttemptService(StripeService): class ListParams(TypedDict): created: NotRequired["SetupAttemptService.ListParamsCreated|int"] """ A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp or a dictionary with a number of different query options. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ setup_intent: str """ Only return SetupAttempts created by the SetupIntent specified by this ID. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ def list( self, params: "SetupAttemptService.ListParams", options: RequestOptions = {}, ) -> ListObject[SetupAttempt]: """ Returns a list of SetupAttempts that associate with a provided SetupIntent. """ return cast( ListObject[SetupAttempt], self._request( "get", "/v1/setup_attempts", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "SetupAttemptService.ListParams", options: RequestOptions = {}, ) -> ListObject[SetupAttempt]: """ Returns a list of SetupAttempts that associate with a provided SetupIntent. """ return cast( ListObject[SetupAttempt], await self._request_async( "get", "/v1/setup_attempts", api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_setup_intent.py0000644000175100001770000055056214637354563017301 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import Any, ClassVar, Dict, List, Optional, Union, cast, overload from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._account import Account from stripe._application import Application from stripe._bank_account import BankAccount from stripe._card import Card as CardResource from stripe._customer import Customer from stripe._mandate import Mandate from stripe._payment_intent import PaymentIntent from stripe._payment_method import PaymentMethod from stripe._setup_attempt import SetupAttempt from stripe._source import Source class SetupIntent( CreateableAPIResource["SetupIntent"], ListableAPIResource["SetupIntent"], UpdateableAPIResource["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://stripe.com/docs/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. The SetupIntent transitions through multiple [statuses](https://docs.stripe.com/payments/intents#intent-statuses) as it guides you through the setup process. Successful SetupIntents result in payment credentials that are optimized for future payments. 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://stripe.com/docs/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://stripe.com/docs/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. Related guide: [Setup Intents API](https://docs.stripe.com/payments/setup-intents) """ OBJECT_NAME: ClassVar[Literal["setup_intent"]] = "setup_intent" class AutomaticPaymentMethods(StripeObject): allow_redirects: Optional[Literal["always", "never"]] """ Controls whether this SetupIntent will accept redirect-based payment methods. Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. To [confirm](https://stripe.com/docs/api/setup_intents/confirm) this SetupIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the setup. """ enabled: Optional[bool] """ Automatically calculates compatible payment methods """ class LastSetupError(StripeObject): charge: Optional[str] """ For card errors, the ID of the failed charge. """ code: Optional[ Literal[ "account_closed", "account_country_invalid_address", "account_error_country_change_requires_additional_steps", "account_information_mismatch", "account_invalid", "account_number_invalid", "acss_debit_session_incomplete", "alipay_upgrade_required", "amount_too_large", "amount_too_small", "api_key_expired", "application_fees_not_allowed", "authentication_required", "balance_insufficient", "balance_invalid_parameter", "bank_account_bad_routing_numbers", "bank_account_declined", "bank_account_exists", "bank_account_restricted", "bank_account_unusable", "bank_account_unverified", "bank_account_verification_failed", "billing_invalid_mandate", "billing_policy_remote_function_response_invalid", "billing_policy_remote_function_timeout", "billing_policy_remote_function_unexpected_status_code", "billing_policy_remote_function_unreachable", "bitcoin_upgrade_required", "capture_charge_authorization_expired", "capture_unauthorized_payment", "card_decline_rate_limit_exceeded", "card_declined", "cardholder_phone_number_required", "charge_already_captured", "charge_already_refunded", "charge_disputed", "charge_exceeds_source_limit", "charge_expired_for_capture", "charge_invalid_parameter", "charge_not_refundable", "clearing_code_unsupported", "country_code_invalid", "country_unsupported", "coupon_expired", "customer_max_payment_methods", "customer_max_subscriptions", "customer_tax_location_invalid", "debit_not_authorized", "email_invalid", "expired_card", "financial_connections_account_inactive", "financial_connections_no_successful_transaction_refresh", "forwarding_api_inactive", "forwarding_api_invalid_parameter", "forwarding_api_upstream_connection_error", "forwarding_api_upstream_connection_timeout", "idempotency_key_in_use", "incorrect_address", "incorrect_cvc", "incorrect_number", "incorrect_zip", "instant_payouts_config_disabled", "instant_payouts_currency_disabled", "instant_payouts_limit_exceeded", "instant_payouts_unsupported", "insufficient_funds", "intent_invalid_state", "intent_verification_method_missing", "invalid_card_type", "invalid_characters", "invalid_charge_amount", "invalid_cvc", "invalid_expiry_month", "invalid_expiry_year", "invalid_number", "invalid_source_usage", "invalid_tax_location", "invoice_no_customer_line_items", "invoice_no_payment_method_types", "invoice_no_subscription_line_items", "invoice_not_editable", "invoice_on_behalf_of_not_editable", "invoice_payment_intent_requires_action", "invoice_upcoming_none", "livemode_mismatch", "lock_timeout", "missing", "no_account", "not_allowed_on_standard_account", "out_of_inventory", "ownership_declaration_not_allowed", "parameter_invalid_empty", "parameter_invalid_integer", "parameter_invalid_string_blank", "parameter_invalid_string_empty", "parameter_missing", "parameter_unknown", "parameters_exclusive", "payment_intent_action_required", "payment_intent_authentication_failure", "payment_intent_incompatible_payment_method", "payment_intent_invalid_parameter", "payment_intent_konbini_rejected_confirmation_number", "payment_intent_mandate_invalid", "payment_intent_payment_attempt_expired", "payment_intent_payment_attempt_failed", "payment_intent_unexpected_state", "payment_method_bank_account_already_verified", "payment_method_bank_account_blocked", "payment_method_billing_details_address_missing", "payment_method_configuration_failures", "payment_method_currency_mismatch", "payment_method_customer_decline", "payment_method_invalid_parameter", "payment_method_invalid_parameter_testmode", "payment_method_microdeposit_failed", "payment_method_microdeposit_verification_amounts_invalid", "payment_method_microdeposit_verification_amounts_mismatch", "payment_method_microdeposit_verification_attempts_exceeded", "payment_method_microdeposit_verification_descriptor_code_mismatch", "payment_method_microdeposit_verification_timeout", "payment_method_not_available", "payment_method_provider_decline", "payment_method_provider_timeout", "payment_method_unactivated", "payment_method_unexpected_state", "payment_method_unsupported_type", "payout_reconciliation_not_ready", "payouts_limit_exceeded", "payouts_not_allowed", "platform_account_required", "platform_api_key_expired", "postal_code_invalid", "processing_error", "product_inactive", "progressive_onboarding_limit_exceeded", "rate_limit", "refer_to_customer", "refund_disputed_payment", "resource_already_exists", "resource_missing", "return_intent_already_processed", "routing_number_invalid", "secret_key_required", "sepa_unsupported_account", "setup_attempt_failed", "setup_intent_authentication_failure", "setup_intent_invalid_parameter", "setup_intent_mandate_invalid", "setup_intent_setup_attempt_expired", "setup_intent_unexpected_state", "shipping_address_invalid", "shipping_calculation_failed", "sku_inactive", "state_unsupported", "status_transition_invalid", "stripe_tax_inactive", "tax_id_invalid", "taxes_calculation_failed", "terminal_location_country_unsupported", "terminal_reader_busy", "terminal_reader_hardware_fault", "terminal_reader_invalid_location_for_payment", "terminal_reader_offline", "terminal_reader_timeout", "testmode_charges_only", "tls_version_unsupported", "token_already_used", "token_card_network_invalid", "token_in_use", "transfer_source_balance_parameters_mismatch", "transfers_not_allowed", "url_invalid", ] ] """ For some errors that could be handled programmatically, a short string indicating the [error code](https://stripe.com/docs/error-codes) reported. """ decline_code: Optional[str] """ For card errors resulting from a card issuer decline, a short string indicating the [card issuer's reason for the decline](https://stripe.com/docs/declines#issuer-declines) if they provide one. """ doc_url: Optional[str] """ A URL to more information about the [error code](https://stripe.com/docs/error-codes) reported. """ message: Optional[str] """ A human-readable message providing more details about the error. For card errors, these messages can be shown to your users. """ param: Optional[str] """ If the error is parameter-specific, the parameter related to the error. For example, you can use this to display a message near the correct form field. """ payment_intent: Optional["PaymentIntent"] """ A PaymentIntent guides you through the process of collecting a payment from your customer. We recommend that you create exactly one PaymentIntent for each order or customer session in your system. You can reference the PaymentIntent later to see the history of payment attempts for a particular session. A PaymentIntent transitions through [multiple statuses](https://stripe.com/docs/payments/intents#intent-statuses) throughout its lifetime as it interfaces with Stripe.js to perform authentication flows and ultimately creates at most one successful charge. Related guide: [Payment Intents API](https://stripe.com/docs/payments/payment-intents) """ payment_method: Optional["PaymentMethod"] """ PaymentMethod objects represent your customer's payment instruments. You can use them with [PaymentIntents](https://stripe.com/docs/payments/payment-intents) to collect payments or save them to Customer objects to store instrument details for future payments. Related guides: [Payment Methods](https://stripe.com/docs/payments/payment-methods) and [More Payment Scenarios](https://stripe.com/docs/payments/more-payment-scenarios). """ payment_method_type: Optional[str] """ If the error is specific to the type of payment method, the payment method type that had a problem. This field is only populated for invoice-related errors. """ request_log_url: Optional[str] """ A URL to the request log entry in your dashboard. """ setup_intent: Optional["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://stripe.com/docs/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. The SetupIntent transitions through multiple [statuses](https://docs.stripe.com/payments/intents#intent-statuses) as it guides you through the setup process. Successful SetupIntents result in payment credentials that are optimized for future payments. 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://stripe.com/docs/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://stripe.com/docs/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. Related guide: [Setup Intents API](https://docs.stripe.com/payments/setup-intents) """ source: Optional[ Union["Account", "BankAccount", "CardResource", "Source"] ] type: Literal[ "api_error", "card_error", "idempotency_error", "invalid_request_error", ] """ The type of error returned. One of `api_error`, `card_error`, `idempotency_error`, or `invalid_request_error` """ class NextAction(StripeObject): class CashappHandleRedirectOrDisplayQrCode(StripeObject): class QrCode(StripeObject): expires_at: int """ The date (unix timestamp) when the QR code expires. """ image_url_png: str """ The image_url_png string used to render QR code """ image_url_svg: str """ The image_url_svg string used to render QR code """ hosted_instructions_url: str """ The URL to the hosted Cash App Pay instructions page, which allows customers to view the QR code, and supports QR code refreshing on expiration. """ mobile_auth_url: str """ The url for mobile redirect based auth """ qr_code: QrCode _inner_class_types = {"qr_code": QrCode} class RedirectToUrl(StripeObject): return_url: Optional[str] """ If the customer does not exit their browser while authenticating, they will be redirected to this specified URL after completion. """ url: Optional[str] """ The URL you must redirect your customer to in order to authenticate. """ class VerifyWithMicrodeposits(StripeObject): arrival_date: int """ The timestamp when the microdeposits are expected to land. """ hosted_verification_url: str """ The URL for the hosted verification page, which allows customers to verify their bank account. """ microdeposit_type: Optional[Literal["amounts", "descriptor_code"]] """ The type of the microdeposit sent to the customer. Used to distinguish between different verification methods. """ cashapp_handle_redirect_or_display_qr_code: Optional[ CashappHandleRedirectOrDisplayQrCode ] redirect_to_url: Optional[RedirectToUrl] type: str """ Type of the next action to perform, one of `redirect_to_url`, `use_stripe_sdk`, `alipay_handle_redirect`, `oxxo_display_details`, or `verify_with_microdeposits`. """ use_stripe_sdk: Optional[Dict[str, Any]] """ When confirming a SetupIntent with Stripe.js, Stripe.js depends on the contents of this dictionary to invoke authentication flows. The shape of the contents is subject to change and is only intended to be used by Stripe.js. """ verify_with_microdeposits: Optional[VerifyWithMicrodeposits] _inner_class_types = { "cashapp_handle_redirect_or_display_qr_code": CashappHandleRedirectOrDisplayQrCode, "redirect_to_url": RedirectToUrl, "verify_with_microdeposits": VerifyWithMicrodeposits, } class PaymentMethodConfigurationDetails(StripeObject): id: str """ ID of the payment method configuration used. """ parent: Optional[str] """ ID of the parent payment method configuration used. """ class PaymentMethodOptions(StripeObject): class AcssDebit(StripeObject): class MandateOptions(StripeObject): custom_mandate_url: Optional[str] """ A URL for custom mandate text """ default_for: Optional[List[Literal["invoice", "subscription"]]] """ List of Stripe products where this mandate can be selected automatically. """ interval_description: Optional[str] """ Description of the interval. Only required if the 'payment_schedule' parameter is 'interval' or 'combined'. """ payment_schedule: Optional[ Literal["combined", "interval", "sporadic"] ] """ Payment schedule for the mandate. """ transaction_type: Optional[Literal["business", "personal"]] """ Transaction type of the mandate. """ currency: Optional[Literal["cad", "usd"]] """ Currency supported by the bank account """ mandate_options: Optional[MandateOptions] verification_method: Optional[ Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. """ _inner_class_types = {"mandate_options": MandateOptions} class AmazonPay(StripeObject): pass class Card(StripeObject): class MandateOptions(StripeObject): amount: int """ Amount to be charged for future payments. """ amount_type: Literal["fixed", "maximum"] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ 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] """ A description of the mandate or subscription that is meant to be displayed to the customer. """ end_date: Optional[int] """ End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. """ interval: Literal["day", "month", "sporadic", "week", "year"] """ Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. """ interval_count: Optional[int] """ The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. """ reference: str """ Unique identifier for the mandate or subscription. """ start_date: int """ Start date of the mandate or subscription. Start date should not be lesser than yesterday. """ supported_types: Optional[List[Literal["india"]]] """ Specifies the type of mandates supported. Possible values are `india`. """ mandate_options: Optional[MandateOptions] """ Configuration options for setting up an eMandate for cards issued in India. """ network: Optional[ Literal[ "amex", "cartes_bancaires", "diners", "discover", "eftpos_au", "interac", "jcb", "mastercard", "unionpay", "unknown", "visa", ] ] """ Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the setup intent. Can be only set confirm-time. """ request_three_d_secure: Optional[ Literal["any", "automatic", "challenge"] ] """ 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://stripe.com/docs/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://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ _inner_class_types = {"mandate_options": MandateOptions} class CardPresent(StripeObject): pass class Link(StripeObject): persistent_token: Optional[str] """ [Deprecated] This is a legacy parameter that no longer has any function. """ class Paypal(StripeObject): billing_agreement_id: Optional[str] """ The PayPal Billing Agreement ID (BAID). This is an ID generated by PayPal which represents the mandate between the merchant and the customer. """ class SepaDebit(StripeObject): class MandateOptions(StripeObject): pass mandate_options: Optional[MandateOptions] _inner_class_types = {"mandate_options": MandateOptions} class UsBankAccount(StripeObject): class FinancialConnections(StripeObject): class Filters(StripeObject): account_subcategories: Optional[ List[Literal["checking", "savings"]] ] """ The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`. """ filters: Optional[Filters] permissions: Optional[ List[ Literal[ "balances", "ownership", "payment_method", "transactions", ] ] ] """ The list of permissions to request. The `payment_method` permission must be included. """ prefetch: Optional[ List[Literal["balances", "ownership", "transactions"]] ] """ Data features requested to be retrieved upon account creation. """ return_url: Optional[str] """ For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. """ _inner_class_types = {"filters": Filters} class MandateOptions(StripeObject): collection_method: Optional[Literal["paper"]] """ Mandate collection method """ financial_connections: Optional[FinancialConnections] mandate_options: Optional[MandateOptions] verification_method: Optional[ Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. """ _inner_class_types = { "financial_connections": FinancialConnections, "mandate_options": MandateOptions, } acss_debit: Optional[AcssDebit] amazon_pay: Optional[AmazonPay] card: Optional[Card] card_present: Optional[CardPresent] link: Optional[Link] paypal: Optional[Paypal] sepa_debit: Optional[SepaDebit] us_bank_account: Optional[UsBankAccount] _inner_class_types = { "acss_debit": AcssDebit, "amazon_pay": AmazonPay, "card": Card, "card_present": CardPresent, "link": Link, "paypal": Paypal, "sepa_debit": SepaDebit, "us_bank_account": UsBankAccount, } class CancelParams(RequestOptions): cancellation_reason: NotRequired[ Literal["abandoned", "duplicate", "requested_by_customer"] ] """ Reason for canceling this SetupIntent. Possible values are: `abandoned`, `requested_by_customer`, or `duplicate` """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ConfirmParams(RequestOptions): confirmation_token: NotRequired[str] """ ID of the ConfirmationToken used to confirm this SetupIntent. If the provided ConfirmationToken contains properties that are also being provided in this request, such as `payment_method`, then the values in this request will take precedence. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ mandate_data: NotRequired[ "Literal['']|SetupIntent.ConfirmParamsMandateData" ] payment_method: NotRequired[str] """ ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent. """ payment_method_data: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodData" ] """ When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method) value in the SetupIntent. """ payment_method_options: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodOptions" ] """ Payment method-specific configuration for this SetupIntent. """ return_url: NotRequired[str] """ The URL to redirect your customer back to after they authenticate on the payment method's app or site. If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. This parameter is only used for cards and other redirect-based payment methods. """ use_stripe_sdk: NotRequired[bool] """ Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. """ class ConfirmParamsMandateData(TypedDict): customer_acceptance: NotRequired[ "SetupIntent.ConfirmParamsMandateDataCustomerAcceptance" ] """ This hash contains details about the customer acceptance of the Mandate. """ class ConfirmParamsMandateDataCustomerAcceptance(TypedDict): accepted_at: NotRequired[int] """ The time at which the customer accepted the Mandate. """ offline: NotRequired[ "SetupIntent.ConfirmParamsMandateDataCustomerAcceptanceOffline" ] """ If this is a Mandate accepted offline, this hash contains details about the offline acceptance. """ online: NotRequired[ "SetupIntent.ConfirmParamsMandateDataCustomerAcceptanceOnline" ] """ If this is a Mandate accepted online, this hash contains details about the online acceptance. """ type: Literal["offline", "online"] """ The type of customer acceptance information included with the Mandate. One of `online` or `offline`. """ class ConfirmParamsMandateDataCustomerAcceptanceOffline(TypedDict): pass class ConfirmParamsMandateDataCustomerAcceptanceOnline(TypedDict): ip_address: NotRequired[str] """ The IP address from which the Mandate was accepted by the customer. """ user_agent: NotRequired[str] """ The user agent of the browser from which the Mandate was accepted by the customer. """ class ConfirmParamsPaymentMethodData(TypedDict): acss_debit: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodDataAcssDebit" ] """ If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. """ affirm: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataAffirm"] """ If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. """ afterpay_clearpay: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodDataAfterpayClearpay" ] """ If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. """ alipay: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataAlipay"] """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ allow_redisplay: NotRequired[ Literal["always", "limited", "unspecified"] ] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ amazon_pay: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodDataAmazonPay" ] """ If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. """ au_becs_debit: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodDataAuBecsDebit" ] """ If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. """ bacs_debit: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodDataBacsDebit" ] """ If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. """ bancontact: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodDataBancontact" ] """ If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. """ billing_details: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodDataBillingDetails" ] """ Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. """ blik: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataBlik"] """ If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. """ boleto: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataBoleto"] """ If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. """ cashapp: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodDataCashapp" ] """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ customer_balance: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodDataCustomerBalance" ] """ If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. """ eps: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataEps"] """ If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. """ fpx: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataFpx"] """ If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. """ giropay: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodDataGiropay" ] """ If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. """ grabpay: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodDataGrabpay" ] """ If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ ideal: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataIdeal"] """ If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. """ interac_present: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodDataInteracPresent" ] """ If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. """ klarna: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataKlarna"] """ If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. """ konbini: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodDataKonbini" ] """ If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. """ link: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataLink"] """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ mobilepay: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodDataMobilepay" ] """ If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. """ multibanco: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodDataMultibanco" ] """ If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. """ oxxo: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataOxxo"] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. """ p24: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataP24"] """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ paynow: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataPaynow"] """ If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. """ paypal: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataPaypal"] """ If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. """ pix: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataPix"] """ If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. """ promptpay: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodDataPromptpay" ] """ If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. """ radar_options: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodDataRadarOptions" ] """ Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. """ revolut_pay: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodDataRevolutPay" ] """ If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. """ sepa_debit: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodDataSepaDebit" ] """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ sofort: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataSofort"] """ If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. """ swish: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataSwish"] """ If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. """ twint: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataTwint"] """ If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. """ type: Literal[ "acss_debit", "affirm", "afterpay_clearpay", "alipay", "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", "blik", "boleto", "cashapp", "customer_balance", "eps", "fpx", "giropay", "grabpay", "ideal", "klarna", "konbini", "link", "mobilepay", "multibanco", "oxxo", "p24", "paynow", "paypal", "pix", "promptpay", "revolut_pay", "sepa_debit", "sofort", "swish", "twint", "us_bank_account", "wechat_pay", "zip", ] """ The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. """ us_bank_account: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodDataUsBankAccount" ] """ If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. """ wechat_pay: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodDataWechatPay" ] """ If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. """ zip: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataZip"] """ If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. """ class ConfirmParamsPaymentMethodDataAcssDebit(TypedDict): account_number: str """ Customer's bank account number. """ institution_number: str """ Institution number of the customer's bank. """ transit_number: str """ Transit number of the customer's bank. """ class ConfirmParamsPaymentMethodDataAffirm(TypedDict): pass class ConfirmParamsPaymentMethodDataAfterpayClearpay(TypedDict): pass class ConfirmParamsPaymentMethodDataAlipay(TypedDict): pass class ConfirmParamsPaymentMethodDataAmazonPay(TypedDict): pass class ConfirmParamsPaymentMethodDataAuBecsDebit(TypedDict): account_number: str """ The account number for the bank account. """ bsb_number: str """ Bank-State-Branch number of the bank account. """ class ConfirmParamsPaymentMethodDataBacsDebit(TypedDict): account_number: NotRequired[str] """ Account number of the bank account that the funds will be debited from. """ sort_code: NotRequired[str] """ Sort code of the bank account. (e.g., `10-20-30`) """ class ConfirmParamsPaymentMethodDataBancontact(TypedDict): pass class ConfirmParamsPaymentMethodDataBillingDetails(TypedDict): address: NotRequired[ "Literal['']|SetupIntent.ConfirmParamsPaymentMethodDataBillingDetailsAddress" ] """ Billing address. """ email: NotRequired["Literal['']|str"] """ Email address. """ name: NotRequired["Literal['']|str"] """ Full name. """ phone: NotRequired["Literal['']|str"] """ Billing phone number (including extension). """ class ConfirmParamsPaymentMethodDataBillingDetailsAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class ConfirmParamsPaymentMethodDataBlik(TypedDict): pass class ConfirmParamsPaymentMethodDataBoleto(TypedDict): tax_id: str """ The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) """ class ConfirmParamsPaymentMethodDataCashapp(TypedDict): pass class ConfirmParamsPaymentMethodDataCustomerBalance(TypedDict): pass class ConfirmParamsPaymentMethodDataEps(TypedDict): bank: NotRequired[ Literal[ "arzte_und_apotheker_bank", "austrian_anadi_bank_ag", "bank_austria", "bankhaus_carl_spangler", "bankhaus_schelhammer_und_schattera_ag", "bawag_psk_ag", "bks_bank_ag", "brull_kallmus_bank_ag", "btv_vier_lander_bank", "capital_bank_grawe_gruppe_ag", "deutsche_bank_ag", "dolomitenbank", "easybank_ag", "erste_bank_und_sparkassen", "hypo_alpeadriabank_international_ag", "hypo_bank_burgenland_aktiengesellschaft", "hypo_noe_lb_fur_niederosterreich_u_wien", "hypo_oberosterreich_salzburg_steiermark", "hypo_tirol_bank_ag", "hypo_vorarlberg_bank_ag", "marchfelder_bank", "oberbank_ag", "raiffeisen_bankengruppe_osterreich", "schoellerbank_ag", "sparda_bank_wien", "volksbank_gruppe", "volkskreditbank_ag", "vr_bank_braunau", ] ] """ The customer's bank. """ class ConfirmParamsPaymentMethodDataFpx(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type for FPX transaction """ bank: Literal[ "affin_bank", "agrobank", "alliance_bank", "ambank", "bank_islam", "bank_muamalat", "bank_of_china", "bank_rakyat", "bsn", "cimb", "deutsche_bank", "hong_leong_bank", "hsbc", "kfh", "maybank2e", "maybank2u", "ocbc", "pb_enterprise", "public_bank", "rhb", "standard_chartered", "uob", ] """ The customer's bank. """ class ConfirmParamsPaymentMethodDataGiropay(TypedDict): pass class ConfirmParamsPaymentMethodDataGrabpay(TypedDict): pass class ConfirmParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ Literal[ "abn_amro", "asn_bank", "bunq", "handelsbanken", "ing", "knab", "moneyou", "n26", "nn", "rabobank", "regiobank", "revolut", "sns_bank", "triodos_bank", "van_lanschot", "yoursafe", ] ] """ The customer's bank. """ class ConfirmParamsPaymentMethodDataInteracPresent(TypedDict): pass class ConfirmParamsPaymentMethodDataKlarna(TypedDict): dob: NotRequired["SetupIntent.ConfirmParamsPaymentMethodDataKlarnaDob"] """ Customer's date of birth """ class ConfirmParamsPaymentMethodDataKlarnaDob(TypedDict): day: int """ The day of birth, between 1 and 31. """ month: int """ The month of birth, between 1 and 12. """ year: int """ The four-digit year of birth. """ class ConfirmParamsPaymentMethodDataKonbini(TypedDict): pass class ConfirmParamsPaymentMethodDataLink(TypedDict): pass class ConfirmParamsPaymentMethodDataMobilepay(TypedDict): pass class ConfirmParamsPaymentMethodDataMultibanco(TypedDict): pass class ConfirmParamsPaymentMethodDataOxxo(TypedDict): pass class ConfirmParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ Literal[ "alior_bank", "bank_millennium", "bank_nowy_bfg_sa", "bank_pekao_sa", "banki_spbdzielcze", "blik", "bnp_paribas", "boz", "citi_handlowy", "credit_agricole", "envelobank", "etransfer_pocztowy24", "getin_bank", "ideabank", "ing", "inteligo", "mbank_mtransfer", "nest_przelew", "noble_pay", "pbac_z_ipko", "plus_bank", "santander_przelew24", "tmobile_usbugi_bankowe", "toyota_bank", "velobank", "volkswagen_bank", ] ] """ The customer's bank. """ class ConfirmParamsPaymentMethodDataPaynow(TypedDict): pass class ConfirmParamsPaymentMethodDataPaypal(TypedDict): pass class ConfirmParamsPaymentMethodDataPix(TypedDict): pass class ConfirmParamsPaymentMethodDataPromptpay(TypedDict): pass class ConfirmParamsPaymentMethodDataRadarOptions(TypedDict): session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ class ConfirmParamsPaymentMethodDataRevolutPay(TypedDict): pass class ConfirmParamsPaymentMethodDataSepaDebit(TypedDict): iban: str """ IBAN of the bank account. """ class ConfirmParamsPaymentMethodDataSofort(TypedDict): country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] """ Two-letter ISO code representing the country the bank account is located in. """ class ConfirmParamsPaymentMethodDataSwish(TypedDict): pass class ConfirmParamsPaymentMethodDataTwint(TypedDict): pass class ConfirmParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type: individual or company. """ account_number: NotRequired[str] """ Account number of the bank account. """ account_type: NotRequired[Literal["checking", "savings"]] """ Account type: checkings or savings. Defaults to checking if omitted. """ financial_connections_account: NotRequired[str] """ The ID of a Financial Connections Account to use as a payment method. """ routing_number: NotRequired[str] """ Routing number of the bank account. """ class ConfirmParamsPaymentMethodDataWechatPay(TypedDict): pass class ConfirmParamsPaymentMethodDataZip(TypedDict): pass class ConfirmParamsPaymentMethodOptions(TypedDict): acss_debit: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodOptionsAcssDebit" ] """ If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options. """ amazon_pay: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodOptionsAmazonPay" ] """ If this is a `amazon_pay` SetupIntent, this sub-hash contains details about the AmazonPay payment method options. """ card: NotRequired["SetupIntent.ConfirmParamsPaymentMethodOptionsCard"] """ Configuration for any card setup attempted on this SetupIntent. """ card_present: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodOptionsCardPresent" ] """ If this is a `card_present` PaymentMethod, this sub-hash contains details about the card-present payment method options. """ link: NotRequired["SetupIntent.ConfirmParamsPaymentMethodOptionsLink"] """ If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. """ paypal: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodOptionsPaypal" ] """ If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. """ sepa_debit: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodOptionsSepaDebit" ] """ If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options. """ us_bank_account: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodOptionsUsBankAccount" ] """ If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options. """ class ConfirmParamsPaymentMethodOptionsAcssDebit(TypedDict): currency: NotRequired[Literal["cad", "usd"]] """ 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). """ mandate_options: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodOptionsAcssDebitMandateOptions" ] """ Additional fields for Mandate creation """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. """ class ConfirmParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): custom_mandate_url: NotRequired["Literal['']|str"] """ A URL for custom mandate text to render during confirmation step. The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. """ default_for: NotRequired[List[Literal["invoice", "subscription"]]] """ List of Stripe products where this mandate can be selected automatically. """ interval_description: NotRequired[str] """ Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. """ payment_schedule: NotRequired[ Literal["combined", "interval", "sporadic"] ] """ Payment schedule for the mandate. """ transaction_type: NotRequired[Literal["business", "personal"]] """ Transaction type of the mandate. """ class ConfirmParamsPaymentMethodOptionsAmazonPay(TypedDict): pass class ConfirmParamsPaymentMethodOptionsCard(TypedDict): mandate_options: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodOptionsCardMandateOptions" ] """ Configuration options for setting up an eMandate for cards issued in India. """ moto: NotRequired[bool] """ When specified, this parameter signals that a card has been collected as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This parameter can only be provided during confirmation. """ network: NotRequired[ Literal[ "amex", "cartes_bancaires", "diners", "discover", "eftpos_au", "interac", "jcb", "mastercard", "unionpay", "unknown", "visa", ] ] """ Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the SetupIntent. Can be only set confirm-time. """ request_three_d_secure: NotRequired[ Literal["any", "automatic", "challenge"] ] """ 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://stripe.com/docs/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://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ three_d_secure: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodOptionsCardThreeDSecure" ] """ If 3D Secure authentication was performed with a third-party provider, the authentication details to use for this setup. """ class ConfirmParamsPaymentMethodOptionsCardMandateOptions(TypedDict): amount: int """ Amount to be charged for future payments. """ amount_type: Literal["fixed", "maximum"] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ currency: str """ Currency in which future payments will be charged. 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] """ A description of the mandate or subscription that is meant to be displayed to the customer. """ end_date: NotRequired[int] """ End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. """ interval: Literal["day", "month", "sporadic", "week", "year"] """ Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. """ interval_count: NotRequired[int] """ The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. """ reference: str """ Unique identifier for the mandate or subscription. """ start_date: int """ Start date of the mandate or subscription. Start date should not be lesser than yesterday. """ supported_types: NotRequired[List[Literal["india"]]] """ Specifies the type of mandates supported. Possible values are `india`. """ class ConfirmParamsPaymentMethodOptionsCardPresent(TypedDict): pass class ConfirmParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): ares_trans_status: NotRequired[ Literal["A", "C", "I", "N", "R", "U", "Y"] ] """ The `transStatus` returned from the card Issuer's ACS in the ARes. """ cryptogram: NotRequired[str] """ The cryptogram, also known as the "authentication value" (AAV, CAVV or AEVV). This value is 20 bytes, base64-encoded into a 28-character string. (Most 3D Secure providers will return the base64-encoded version, which is what you should specify here.) """ electronic_commerce_indicator: NotRequired[ Literal["01", "02", "05", "06", "07"] ] """ The Electronic Commerce Indicator (ECI) is returned by your 3D Secure provider and indicates what degree of authentication was performed. """ network_options: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions" ] """ Network specific 3DS fields. Network specific arguments require an explicit card brand choice. The parameter `payment_method_options.card.network`` must be populated accordingly """ requestor_challenge_indicator: NotRequired[str] """ The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. """ transaction_id: NotRequired[str] """ For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server Transaction ID (dsTransID). """ version: NotRequired[Literal["1.0.2", "2.1.0", "2.2.0"]] """ The version of 3D Secure that was performed. """ class ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions( TypedDict, ): cartes_bancaires: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires" ] """ Cartes Bancaires-specific 3DS fields. """ class ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires( TypedDict, ): cb_avalgo: Literal["0", "1", "2", "3", "4", "A"] """ The cryptogram calculation algorithm used by the card Issuer's ACS to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. messageExtension: CB-AVALGO """ cb_exemption: NotRequired[str] """ The exemption indicator returned from Cartes Bancaires in the ARes. message extension: CB-EXEMPTION; string (4 characters) This is a 3 byte bitmap (low significant byte first and most significant bit first) that has been Base64 encoded """ cb_score: NotRequired[int] """ The risk score returned from Cartes Bancaires in the ARes. message extension: CB-SCORE; numeric value 0-99 """ class ConfirmParamsPaymentMethodOptionsLink(TypedDict): persistent_token: NotRequired[str] """ [Deprecated] This is a legacy parameter that no longer has any function. """ class ConfirmParamsPaymentMethodOptionsPaypal(TypedDict): billing_agreement_id: NotRequired[str] """ The PayPal Billing Agreement ID (BAID). This is an ID generated by PayPal which represents the mandate between the merchant and the customer. """ class ConfirmParamsPaymentMethodOptionsSepaDebit(TypedDict): mandate_options: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodOptionsSepaDebitMandateOptions" ] """ Additional fields for Mandate creation """ class ConfirmParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): pass class ConfirmParamsPaymentMethodOptionsUsBankAccount(TypedDict): financial_connections: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections" ] """ Additional fields for Financial Connections Session creation """ mandate_options: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodOptionsUsBankAccountMandateOptions" ] """ Additional fields for Mandate creation """ networks: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodOptionsUsBankAccountNetworks" ] """ Additional fields for network related functions """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. """ class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): filters: NotRequired[ "SetupIntent.ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" ] """ Provide filters for the linked accounts that the customer can select for the payment method """ permissions: NotRequired[ List[ Literal[ "balances", "ownership", "payment_method", "transactions" ] ] ] """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ List[Literal["balances", "ownership", "transactions"]] ] """ List of data features that you would like to retrieve upon account creation. """ return_url: NotRequired[str] """ For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. """ class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( TypedDict, ): account_subcategories: NotRequired[ List[Literal["checking", "savings"]] ] """ The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. """ class ConfirmParamsPaymentMethodOptionsUsBankAccountMandateOptions( TypedDict, ): collection_method: NotRequired["Literal['']|Literal['paper']"] """ The method used to collect offline mandate customer acceptance. """ class ConfirmParamsPaymentMethodOptionsUsBankAccountNetworks(TypedDict): requested: NotRequired[List[Literal["ach", "us_domestic_wire"]]] """ Triggers validations to run across the selected networks """ class CreateParams(RequestOptions): attach_to_self: NotRequired[bool] """ If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. It can only be used for this Stripe Account's own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. """ automatic_payment_methods: NotRequired[ "SetupIntent.CreateParamsAutomaticPaymentMethods" ] """ When you enable this parameter, this SetupIntent accepts payment methods that you enable in the Dashboard and that are compatible with its other parameters. """ confirm: NotRequired[bool] """ Set to `true` to attempt to confirm this SetupIntent immediately. This parameter defaults to `false`. If a card is the attached payment method, you can provide a `return_url` in case further authentication is necessary. """ confirmation_token: NotRequired[str] """ ID of the ConfirmationToken used to confirm this SetupIntent. If the provided ConfirmationToken contains properties that are also being provided in this request, such as `payment_method`, then the values in this request will take precedence. """ customer: NotRequired[str] """ ID of the Customer this SetupIntent belongs to, if one exists. If present, the SetupIntent's payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent. """ description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ flow_directions: NotRequired[List[Literal["inbound", "outbound"]]] """ Indicates the directions of money movement for which this payment method is intended to be used. Include `inbound` if you intend to use the payment method as the origin to pull funds from. Include `outbound` if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes. """ mandate_data: NotRequired[ "Literal['']|SetupIntent.CreateParamsMandateData" ] """ This hash contains details about the mandate to create. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/setup_intents/create#create_setup_intent-confirm). """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ on_behalf_of: NotRequired[str] """ The Stripe account ID created for this SetupIntent. """ payment_method: NotRequired[str] """ ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent. """ payment_method_configuration: NotRequired[str] """ The ID of the payment method configuration to use with this SetupIntent. """ payment_method_data: NotRequired[ "SetupIntent.CreateParamsPaymentMethodData" ] """ When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method) value in the SetupIntent. """ payment_method_options: NotRequired[ "SetupIntent.CreateParamsPaymentMethodOptions" ] """ Payment method-specific configuration for this SetupIntent. """ payment_method_types: NotRequired[List[str]] """ The list of payment method types (for example, card) that this SetupIntent can use. If you don't provide this, it defaults to ["card"]. """ return_url: NotRequired[str] """ The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. To redirect to a mobile application, you can alternatively supply an application URI scheme. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/setup_intents/create#create_setup_intent-confirm). """ single_use: NotRequired["SetupIntent.CreateParamsSingleUse"] """ If you populate this hash, this SetupIntent generates a `single_use` mandate after successful completion. """ usage: NotRequired[Literal["off_session", "on_session"]] """ Indicates how the payment method is intended to be used in the future. If not provided, this value defaults to `off_session`. """ use_stripe_sdk: NotRequired[bool] """ Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. """ class CreateParamsAutomaticPaymentMethods(TypedDict): allow_redirects: NotRequired[Literal["always", "never"]] """ Controls whether this SetupIntent will accept redirect-based payment methods. Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. To [confirm](https://stripe.com/docs/api/setup_intents/confirm) this SetupIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the setup. """ enabled: bool """ Whether this feature is enabled. """ class CreateParamsMandateData(TypedDict): customer_acceptance: ( "SetupIntent.CreateParamsMandateDataCustomerAcceptance" ) """ This hash contains details about the customer acceptance of the Mandate. """ class CreateParamsMandateDataCustomerAcceptance(TypedDict): accepted_at: NotRequired[int] """ The time at which the customer accepted the Mandate. """ offline: NotRequired[ "SetupIntent.CreateParamsMandateDataCustomerAcceptanceOffline" ] """ If this is a Mandate accepted offline, this hash contains details about the offline acceptance. """ online: NotRequired[ "SetupIntent.CreateParamsMandateDataCustomerAcceptanceOnline" ] """ If this is a Mandate accepted online, this hash contains details about the online acceptance. """ type: Literal["offline", "online"] """ The type of customer acceptance information included with the Mandate. One of `online` or `offline`. """ class CreateParamsMandateDataCustomerAcceptanceOffline(TypedDict): pass class CreateParamsMandateDataCustomerAcceptanceOnline(TypedDict): ip_address: str """ The IP address from which the Mandate was accepted by the customer. """ user_agent: str """ The user agent of the browser from which the Mandate was accepted by the customer. """ class CreateParamsPaymentMethodData(TypedDict): acss_debit: NotRequired[ "SetupIntent.CreateParamsPaymentMethodDataAcssDebit" ] """ If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. """ affirm: NotRequired["SetupIntent.CreateParamsPaymentMethodDataAffirm"] """ If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. """ afterpay_clearpay: NotRequired[ "SetupIntent.CreateParamsPaymentMethodDataAfterpayClearpay" ] """ If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. """ alipay: NotRequired["SetupIntent.CreateParamsPaymentMethodDataAlipay"] """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ allow_redisplay: NotRequired[ Literal["always", "limited", "unspecified"] ] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ amazon_pay: NotRequired[ "SetupIntent.CreateParamsPaymentMethodDataAmazonPay" ] """ If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. """ au_becs_debit: NotRequired[ "SetupIntent.CreateParamsPaymentMethodDataAuBecsDebit" ] """ If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. """ bacs_debit: NotRequired[ "SetupIntent.CreateParamsPaymentMethodDataBacsDebit" ] """ If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. """ bancontact: NotRequired[ "SetupIntent.CreateParamsPaymentMethodDataBancontact" ] """ If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. """ billing_details: NotRequired[ "SetupIntent.CreateParamsPaymentMethodDataBillingDetails" ] """ Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. """ blik: NotRequired["SetupIntent.CreateParamsPaymentMethodDataBlik"] """ If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. """ boleto: NotRequired["SetupIntent.CreateParamsPaymentMethodDataBoleto"] """ If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. """ cashapp: NotRequired[ "SetupIntent.CreateParamsPaymentMethodDataCashapp" ] """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ customer_balance: NotRequired[ "SetupIntent.CreateParamsPaymentMethodDataCustomerBalance" ] """ If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. """ eps: NotRequired["SetupIntent.CreateParamsPaymentMethodDataEps"] """ If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. """ fpx: NotRequired["SetupIntent.CreateParamsPaymentMethodDataFpx"] """ If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. """ giropay: NotRequired[ "SetupIntent.CreateParamsPaymentMethodDataGiropay" ] """ If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. """ grabpay: NotRequired[ "SetupIntent.CreateParamsPaymentMethodDataGrabpay" ] """ If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ ideal: NotRequired["SetupIntent.CreateParamsPaymentMethodDataIdeal"] """ If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. """ interac_present: NotRequired[ "SetupIntent.CreateParamsPaymentMethodDataInteracPresent" ] """ If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. """ klarna: NotRequired["SetupIntent.CreateParamsPaymentMethodDataKlarna"] """ If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. """ konbini: NotRequired[ "SetupIntent.CreateParamsPaymentMethodDataKonbini" ] """ If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. """ link: NotRequired["SetupIntent.CreateParamsPaymentMethodDataLink"] """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ mobilepay: NotRequired[ "SetupIntent.CreateParamsPaymentMethodDataMobilepay" ] """ If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. """ multibanco: NotRequired[ "SetupIntent.CreateParamsPaymentMethodDataMultibanco" ] """ If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. """ oxxo: NotRequired["SetupIntent.CreateParamsPaymentMethodDataOxxo"] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. """ p24: NotRequired["SetupIntent.CreateParamsPaymentMethodDataP24"] """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ paynow: NotRequired["SetupIntent.CreateParamsPaymentMethodDataPaynow"] """ If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. """ paypal: NotRequired["SetupIntent.CreateParamsPaymentMethodDataPaypal"] """ If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. """ pix: NotRequired["SetupIntent.CreateParamsPaymentMethodDataPix"] """ If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. """ promptpay: NotRequired[ "SetupIntent.CreateParamsPaymentMethodDataPromptpay" ] """ If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. """ radar_options: NotRequired[ "SetupIntent.CreateParamsPaymentMethodDataRadarOptions" ] """ Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. """ revolut_pay: NotRequired[ "SetupIntent.CreateParamsPaymentMethodDataRevolutPay" ] """ If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. """ sepa_debit: NotRequired[ "SetupIntent.CreateParamsPaymentMethodDataSepaDebit" ] """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ sofort: NotRequired["SetupIntent.CreateParamsPaymentMethodDataSofort"] """ If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. """ swish: NotRequired["SetupIntent.CreateParamsPaymentMethodDataSwish"] """ If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. """ twint: NotRequired["SetupIntent.CreateParamsPaymentMethodDataTwint"] """ If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. """ type: Literal[ "acss_debit", "affirm", "afterpay_clearpay", "alipay", "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", "blik", "boleto", "cashapp", "customer_balance", "eps", "fpx", "giropay", "grabpay", "ideal", "klarna", "konbini", "link", "mobilepay", "multibanco", "oxxo", "p24", "paynow", "paypal", "pix", "promptpay", "revolut_pay", "sepa_debit", "sofort", "swish", "twint", "us_bank_account", "wechat_pay", "zip", ] """ The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. """ us_bank_account: NotRequired[ "SetupIntent.CreateParamsPaymentMethodDataUsBankAccount" ] """ If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. """ wechat_pay: NotRequired[ "SetupIntent.CreateParamsPaymentMethodDataWechatPay" ] """ If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. """ zip: NotRequired["SetupIntent.CreateParamsPaymentMethodDataZip"] """ If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. """ class CreateParamsPaymentMethodDataAcssDebit(TypedDict): account_number: str """ Customer's bank account number. """ institution_number: str """ Institution number of the customer's bank. """ transit_number: str """ Transit number of the customer's bank. """ class CreateParamsPaymentMethodDataAffirm(TypedDict): pass class CreateParamsPaymentMethodDataAfterpayClearpay(TypedDict): pass class CreateParamsPaymentMethodDataAlipay(TypedDict): pass class CreateParamsPaymentMethodDataAmazonPay(TypedDict): pass class CreateParamsPaymentMethodDataAuBecsDebit(TypedDict): account_number: str """ The account number for the bank account. """ bsb_number: str """ Bank-State-Branch number of the bank account. """ class CreateParamsPaymentMethodDataBacsDebit(TypedDict): account_number: NotRequired[str] """ Account number of the bank account that the funds will be debited from. """ sort_code: NotRequired[str] """ Sort code of the bank account. (e.g., `10-20-30`) """ class CreateParamsPaymentMethodDataBancontact(TypedDict): pass class CreateParamsPaymentMethodDataBillingDetails(TypedDict): address: NotRequired[ "Literal['']|SetupIntent.CreateParamsPaymentMethodDataBillingDetailsAddress" ] """ Billing address. """ email: NotRequired["Literal['']|str"] """ Email address. """ name: NotRequired["Literal['']|str"] """ Full name. """ phone: NotRequired["Literal['']|str"] """ Billing phone number (including extension). """ class CreateParamsPaymentMethodDataBillingDetailsAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsPaymentMethodDataBlik(TypedDict): pass class CreateParamsPaymentMethodDataBoleto(TypedDict): tax_id: str """ The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) """ class CreateParamsPaymentMethodDataCashapp(TypedDict): pass class CreateParamsPaymentMethodDataCustomerBalance(TypedDict): pass class CreateParamsPaymentMethodDataEps(TypedDict): bank: NotRequired[ Literal[ "arzte_und_apotheker_bank", "austrian_anadi_bank_ag", "bank_austria", "bankhaus_carl_spangler", "bankhaus_schelhammer_und_schattera_ag", "bawag_psk_ag", "bks_bank_ag", "brull_kallmus_bank_ag", "btv_vier_lander_bank", "capital_bank_grawe_gruppe_ag", "deutsche_bank_ag", "dolomitenbank", "easybank_ag", "erste_bank_und_sparkassen", "hypo_alpeadriabank_international_ag", "hypo_bank_burgenland_aktiengesellschaft", "hypo_noe_lb_fur_niederosterreich_u_wien", "hypo_oberosterreich_salzburg_steiermark", "hypo_tirol_bank_ag", "hypo_vorarlberg_bank_ag", "marchfelder_bank", "oberbank_ag", "raiffeisen_bankengruppe_osterreich", "schoellerbank_ag", "sparda_bank_wien", "volksbank_gruppe", "volkskreditbank_ag", "vr_bank_braunau", ] ] """ The customer's bank. """ class CreateParamsPaymentMethodDataFpx(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type for FPX transaction """ bank: Literal[ "affin_bank", "agrobank", "alliance_bank", "ambank", "bank_islam", "bank_muamalat", "bank_of_china", "bank_rakyat", "bsn", "cimb", "deutsche_bank", "hong_leong_bank", "hsbc", "kfh", "maybank2e", "maybank2u", "ocbc", "pb_enterprise", "public_bank", "rhb", "standard_chartered", "uob", ] """ The customer's bank. """ class CreateParamsPaymentMethodDataGiropay(TypedDict): pass class CreateParamsPaymentMethodDataGrabpay(TypedDict): pass class CreateParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ Literal[ "abn_amro", "asn_bank", "bunq", "handelsbanken", "ing", "knab", "moneyou", "n26", "nn", "rabobank", "regiobank", "revolut", "sns_bank", "triodos_bank", "van_lanschot", "yoursafe", ] ] """ The customer's bank. """ class CreateParamsPaymentMethodDataInteracPresent(TypedDict): pass class CreateParamsPaymentMethodDataKlarna(TypedDict): dob: NotRequired["SetupIntent.CreateParamsPaymentMethodDataKlarnaDob"] """ Customer's date of birth """ class CreateParamsPaymentMethodDataKlarnaDob(TypedDict): day: int """ The day of birth, between 1 and 31. """ month: int """ The month of birth, between 1 and 12. """ year: int """ The four-digit year of birth. """ class CreateParamsPaymentMethodDataKonbini(TypedDict): pass class CreateParamsPaymentMethodDataLink(TypedDict): pass class CreateParamsPaymentMethodDataMobilepay(TypedDict): pass class CreateParamsPaymentMethodDataMultibanco(TypedDict): pass class CreateParamsPaymentMethodDataOxxo(TypedDict): pass class CreateParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ Literal[ "alior_bank", "bank_millennium", "bank_nowy_bfg_sa", "bank_pekao_sa", "banki_spbdzielcze", "blik", "bnp_paribas", "boz", "citi_handlowy", "credit_agricole", "envelobank", "etransfer_pocztowy24", "getin_bank", "ideabank", "ing", "inteligo", "mbank_mtransfer", "nest_przelew", "noble_pay", "pbac_z_ipko", "plus_bank", "santander_przelew24", "tmobile_usbugi_bankowe", "toyota_bank", "velobank", "volkswagen_bank", ] ] """ The customer's bank. """ class CreateParamsPaymentMethodDataPaynow(TypedDict): pass class CreateParamsPaymentMethodDataPaypal(TypedDict): pass class CreateParamsPaymentMethodDataPix(TypedDict): pass class CreateParamsPaymentMethodDataPromptpay(TypedDict): pass class CreateParamsPaymentMethodDataRadarOptions(TypedDict): session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ class CreateParamsPaymentMethodDataRevolutPay(TypedDict): pass class CreateParamsPaymentMethodDataSepaDebit(TypedDict): iban: str """ IBAN of the bank account. """ class CreateParamsPaymentMethodDataSofort(TypedDict): country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] """ Two-letter ISO code representing the country the bank account is located in. """ class CreateParamsPaymentMethodDataSwish(TypedDict): pass class CreateParamsPaymentMethodDataTwint(TypedDict): pass class CreateParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type: individual or company. """ account_number: NotRequired[str] """ Account number of the bank account. """ account_type: NotRequired[Literal["checking", "savings"]] """ Account type: checkings or savings. Defaults to checking if omitted. """ financial_connections_account: NotRequired[str] """ The ID of a Financial Connections Account to use as a payment method. """ routing_number: NotRequired[str] """ Routing number of the bank account. """ class CreateParamsPaymentMethodDataWechatPay(TypedDict): pass class CreateParamsPaymentMethodDataZip(TypedDict): pass class CreateParamsPaymentMethodOptions(TypedDict): acss_debit: NotRequired[ "SetupIntent.CreateParamsPaymentMethodOptionsAcssDebit" ] """ If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options. """ amazon_pay: NotRequired[ "SetupIntent.CreateParamsPaymentMethodOptionsAmazonPay" ] """ If this is a `amazon_pay` SetupIntent, this sub-hash contains details about the AmazonPay payment method options. """ card: NotRequired["SetupIntent.CreateParamsPaymentMethodOptionsCard"] """ Configuration for any card setup attempted on this SetupIntent. """ card_present: NotRequired[ "SetupIntent.CreateParamsPaymentMethodOptionsCardPresent" ] """ If this is a `card_present` PaymentMethod, this sub-hash contains details about the card-present payment method options. """ link: NotRequired["SetupIntent.CreateParamsPaymentMethodOptionsLink"] """ If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. """ paypal: NotRequired[ "SetupIntent.CreateParamsPaymentMethodOptionsPaypal" ] """ If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. """ sepa_debit: NotRequired[ "SetupIntent.CreateParamsPaymentMethodOptionsSepaDebit" ] """ If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options. """ us_bank_account: NotRequired[ "SetupIntent.CreateParamsPaymentMethodOptionsUsBankAccount" ] """ If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options. """ class CreateParamsPaymentMethodOptionsAcssDebit(TypedDict): currency: NotRequired[Literal["cad", "usd"]] """ 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). """ mandate_options: NotRequired[ "SetupIntent.CreateParamsPaymentMethodOptionsAcssDebitMandateOptions" ] """ Additional fields for Mandate creation """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. """ class CreateParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): custom_mandate_url: NotRequired["Literal['']|str"] """ A URL for custom mandate text to render during confirmation step. The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. """ default_for: NotRequired[List[Literal["invoice", "subscription"]]] """ List of Stripe products where this mandate can be selected automatically. """ interval_description: NotRequired[str] """ Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. """ payment_schedule: NotRequired[ Literal["combined", "interval", "sporadic"] ] """ Payment schedule for the mandate. """ transaction_type: NotRequired[Literal["business", "personal"]] """ Transaction type of the mandate. """ class CreateParamsPaymentMethodOptionsAmazonPay(TypedDict): pass class CreateParamsPaymentMethodOptionsCard(TypedDict): mandate_options: NotRequired[ "SetupIntent.CreateParamsPaymentMethodOptionsCardMandateOptions" ] """ Configuration options for setting up an eMandate for cards issued in India. """ moto: NotRequired[bool] """ When specified, this parameter signals that a card has been collected as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This parameter can only be provided during confirmation. """ network: NotRequired[ Literal[ "amex", "cartes_bancaires", "diners", "discover", "eftpos_au", "interac", "jcb", "mastercard", "unionpay", "unknown", "visa", ] ] """ Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the SetupIntent. Can be only set confirm-time. """ request_three_d_secure: NotRequired[ Literal["any", "automatic", "challenge"] ] """ 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://stripe.com/docs/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://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ three_d_secure: NotRequired[ "SetupIntent.CreateParamsPaymentMethodOptionsCardThreeDSecure" ] """ If 3D Secure authentication was performed with a third-party provider, the authentication details to use for this setup. """ class CreateParamsPaymentMethodOptionsCardMandateOptions(TypedDict): amount: int """ Amount to be charged for future payments. """ amount_type: Literal["fixed", "maximum"] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ currency: str """ Currency in which future payments will be charged. 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] """ A description of the mandate or subscription that is meant to be displayed to the customer. """ end_date: NotRequired[int] """ End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. """ interval: Literal["day", "month", "sporadic", "week", "year"] """ Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. """ interval_count: NotRequired[int] """ The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. """ reference: str """ Unique identifier for the mandate or subscription. """ start_date: int """ Start date of the mandate or subscription. Start date should not be lesser than yesterday. """ supported_types: NotRequired[List[Literal["india"]]] """ Specifies the type of mandates supported. Possible values are `india`. """ class CreateParamsPaymentMethodOptionsCardPresent(TypedDict): pass class CreateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): ares_trans_status: NotRequired[ Literal["A", "C", "I", "N", "R", "U", "Y"] ] """ The `transStatus` returned from the card Issuer's ACS in the ARes. """ cryptogram: NotRequired[str] """ The cryptogram, also known as the "authentication value" (AAV, CAVV or AEVV). This value is 20 bytes, base64-encoded into a 28-character string. (Most 3D Secure providers will return the base64-encoded version, which is what you should specify here.) """ electronic_commerce_indicator: NotRequired[ Literal["01", "02", "05", "06", "07"] ] """ The Electronic Commerce Indicator (ECI) is returned by your 3D Secure provider and indicates what degree of authentication was performed. """ network_options: NotRequired[ "SetupIntent.CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions" ] """ Network specific 3DS fields. Network specific arguments require an explicit card brand choice. The parameter `payment_method_options.card.network`` must be populated accordingly """ requestor_challenge_indicator: NotRequired[str] """ The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. """ transaction_id: NotRequired[str] """ For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server Transaction ID (dsTransID). """ version: NotRequired[Literal["1.0.2", "2.1.0", "2.2.0"]] """ The version of 3D Secure that was performed. """ class CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions( TypedDict, ): cartes_bancaires: NotRequired[ "SetupIntent.CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires" ] """ Cartes Bancaires-specific 3DS fields. """ class CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires( TypedDict, ): cb_avalgo: Literal["0", "1", "2", "3", "4", "A"] """ The cryptogram calculation algorithm used by the card Issuer's ACS to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. messageExtension: CB-AVALGO """ cb_exemption: NotRequired[str] """ The exemption indicator returned from Cartes Bancaires in the ARes. message extension: CB-EXEMPTION; string (4 characters) This is a 3 byte bitmap (low significant byte first and most significant bit first) that has been Base64 encoded """ cb_score: NotRequired[int] """ The risk score returned from Cartes Bancaires in the ARes. message extension: CB-SCORE; numeric value 0-99 """ class CreateParamsPaymentMethodOptionsLink(TypedDict): persistent_token: NotRequired[str] """ [Deprecated] This is a legacy parameter that no longer has any function. """ class CreateParamsPaymentMethodOptionsPaypal(TypedDict): billing_agreement_id: NotRequired[str] """ The PayPal Billing Agreement ID (BAID). This is an ID generated by PayPal which represents the mandate between the merchant and the customer. """ class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): mandate_options: NotRequired[ "SetupIntent.CreateParamsPaymentMethodOptionsSepaDebitMandateOptions" ] """ Additional fields for Mandate creation """ class CreateParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): pass class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): financial_connections: NotRequired[ "SetupIntent.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections" ] """ Additional fields for Financial Connections Session creation """ mandate_options: NotRequired[ "SetupIntent.CreateParamsPaymentMethodOptionsUsBankAccountMandateOptions" ] """ Additional fields for Mandate creation """ networks: NotRequired[ "SetupIntent.CreateParamsPaymentMethodOptionsUsBankAccountNetworks" ] """ Additional fields for network related functions """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. """ class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): filters: NotRequired[ "SetupIntent.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" ] """ Provide filters for the linked accounts that the customer can select for the payment method """ permissions: NotRequired[ List[ Literal[ "balances", "ownership", "payment_method", "transactions" ] ] ] """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ List[Literal["balances", "ownership", "transactions"]] ] """ List of data features that you would like to retrieve upon account creation. """ return_url: NotRequired[str] """ For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. """ class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( TypedDict, ): account_subcategories: NotRequired[ List[Literal["checking", "savings"]] ] """ The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. """ class CreateParamsPaymentMethodOptionsUsBankAccountMandateOptions( TypedDict, ): collection_method: NotRequired["Literal['']|Literal['paper']"] """ The method used to collect offline mandate customer acceptance. """ class CreateParamsPaymentMethodOptionsUsBankAccountNetworks(TypedDict): requested: NotRequired[List[Literal["ach", "us_domestic_wire"]]] """ Triggers validations to run across the selected networks """ class CreateParamsSingleUse(TypedDict): amount: int """ Amount the customer is granting permission to collect later. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/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://stripe.com/docs/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). """ class ListParams(RequestOptions): attach_to_self: NotRequired[bool] """ If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. It can only be used for this Stripe Account's own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. """ created: NotRequired["SetupIntent.ListParamsCreated|int"] """ A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. """ customer: NotRequired[str] """ Only return SetupIntents for the customer specified by this customer ID. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ payment_method: NotRequired[str] """ Only return SetupIntents that associate with the specified payment method. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): attach_to_self: NotRequired[bool] """ If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. It can only be used for this Stripe Account's own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. """ customer: NotRequired[str] """ ID of the Customer this SetupIntent belongs to, if one exists. If present, the SetupIntent's payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent. """ description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ flow_directions: NotRequired[List[Literal["inbound", "outbound"]]] """ Indicates the directions of money movement for which this payment method is intended to be used. Include `inbound` if you intend to use the payment method as the origin to pull funds from. Include `outbound` if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ payment_method: NotRequired[str] """ ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent. """ payment_method_configuration: NotRequired[str] """ The ID of the payment method configuration to use with this SetupIntent. """ payment_method_data: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodData" ] """ When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method) value in the SetupIntent. """ payment_method_options: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodOptions" ] """ Payment method-specific configuration for this SetupIntent. """ payment_method_types: NotRequired[List[str]] """ The list of payment method types (for example, card) that this SetupIntent can set up. If you don't provide this array, it defaults to ["card"]. """ class ModifyParamsPaymentMethodData(TypedDict): acss_debit: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodDataAcssDebit" ] """ If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. """ affirm: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataAffirm"] """ If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. """ afterpay_clearpay: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodDataAfterpayClearpay" ] """ If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. """ alipay: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataAlipay"] """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ allow_redisplay: NotRequired[ Literal["always", "limited", "unspecified"] ] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ amazon_pay: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodDataAmazonPay" ] """ If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. """ au_becs_debit: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodDataAuBecsDebit" ] """ If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. """ bacs_debit: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodDataBacsDebit" ] """ If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. """ bancontact: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodDataBancontact" ] """ If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. """ billing_details: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodDataBillingDetails" ] """ Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. """ blik: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataBlik"] """ If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. """ boleto: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataBoleto"] """ If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. """ cashapp: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodDataCashapp" ] """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ customer_balance: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodDataCustomerBalance" ] """ If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. """ eps: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataEps"] """ If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. """ fpx: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataFpx"] """ If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. """ giropay: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodDataGiropay" ] """ If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. """ grabpay: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodDataGrabpay" ] """ If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ ideal: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataIdeal"] """ If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. """ interac_present: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodDataInteracPresent" ] """ If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. """ klarna: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataKlarna"] """ If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. """ konbini: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodDataKonbini" ] """ If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. """ link: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataLink"] """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ mobilepay: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodDataMobilepay" ] """ If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. """ multibanco: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodDataMultibanco" ] """ If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. """ oxxo: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataOxxo"] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. """ p24: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataP24"] """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ paynow: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataPaynow"] """ If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. """ paypal: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataPaypal"] """ If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. """ pix: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataPix"] """ If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. """ promptpay: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodDataPromptpay" ] """ If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. """ radar_options: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodDataRadarOptions" ] """ Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. """ revolut_pay: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodDataRevolutPay" ] """ If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. """ sepa_debit: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodDataSepaDebit" ] """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ sofort: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataSofort"] """ If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. """ swish: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataSwish"] """ If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. """ twint: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataTwint"] """ If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. """ type: Literal[ "acss_debit", "affirm", "afterpay_clearpay", "alipay", "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", "blik", "boleto", "cashapp", "customer_balance", "eps", "fpx", "giropay", "grabpay", "ideal", "klarna", "konbini", "link", "mobilepay", "multibanco", "oxxo", "p24", "paynow", "paypal", "pix", "promptpay", "revolut_pay", "sepa_debit", "sofort", "swish", "twint", "us_bank_account", "wechat_pay", "zip", ] """ The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. """ us_bank_account: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodDataUsBankAccount" ] """ If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. """ wechat_pay: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodDataWechatPay" ] """ If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. """ zip: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataZip"] """ If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. """ class ModifyParamsPaymentMethodDataAcssDebit(TypedDict): account_number: str """ Customer's bank account number. """ institution_number: str """ Institution number of the customer's bank. """ transit_number: str """ Transit number of the customer's bank. """ class ModifyParamsPaymentMethodDataAffirm(TypedDict): pass class ModifyParamsPaymentMethodDataAfterpayClearpay(TypedDict): pass class ModifyParamsPaymentMethodDataAlipay(TypedDict): pass class ModifyParamsPaymentMethodDataAmazonPay(TypedDict): pass class ModifyParamsPaymentMethodDataAuBecsDebit(TypedDict): account_number: str """ The account number for the bank account. """ bsb_number: str """ Bank-State-Branch number of the bank account. """ class ModifyParamsPaymentMethodDataBacsDebit(TypedDict): account_number: NotRequired[str] """ Account number of the bank account that the funds will be debited from. """ sort_code: NotRequired[str] """ Sort code of the bank account. (e.g., `10-20-30`) """ class ModifyParamsPaymentMethodDataBancontact(TypedDict): pass class ModifyParamsPaymentMethodDataBillingDetails(TypedDict): address: NotRequired[ "Literal['']|SetupIntent.ModifyParamsPaymentMethodDataBillingDetailsAddress" ] """ Billing address. """ email: NotRequired["Literal['']|str"] """ Email address. """ name: NotRequired["Literal['']|str"] """ Full name. """ phone: NotRequired["Literal['']|str"] """ Billing phone number (including extension). """ class ModifyParamsPaymentMethodDataBillingDetailsAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class ModifyParamsPaymentMethodDataBlik(TypedDict): pass class ModifyParamsPaymentMethodDataBoleto(TypedDict): tax_id: str """ The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) """ class ModifyParamsPaymentMethodDataCashapp(TypedDict): pass class ModifyParamsPaymentMethodDataCustomerBalance(TypedDict): pass class ModifyParamsPaymentMethodDataEps(TypedDict): bank: NotRequired[ Literal[ "arzte_und_apotheker_bank", "austrian_anadi_bank_ag", "bank_austria", "bankhaus_carl_spangler", "bankhaus_schelhammer_und_schattera_ag", "bawag_psk_ag", "bks_bank_ag", "brull_kallmus_bank_ag", "btv_vier_lander_bank", "capital_bank_grawe_gruppe_ag", "deutsche_bank_ag", "dolomitenbank", "easybank_ag", "erste_bank_und_sparkassen", "hypo_alpeadriabank_international_ag", "hypo_bank_burgenland_aktiengesellschaft", "hypo_noe_lb_fur_niederosterreich_u_wien", "hypo_oberosterreich_salzburg_steiermark", "hypo_tirol_bank_ag", "hypo_vorarlberg_bank_ag", "marchfelder_bank", "oberbank_ag", "raiffeisen_bankengruppe_osterreich", "schoellerbank_ag", "sparda_bank_wien", "volksbank_gruppe", "volkskreditbank_ag", "vr_bank_braunau", ] ] """ The customer's bank. """ class ModifyParamsPaymentMethodDataFpx(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type for FPX transaction """ bank: Literal[ "affin_bank", "agrobank", "alliance_bank", "ambank", "bank_islam", "bank_muamalat", "bank_of_china", "bank_rakyat", "bsn", "cimb", "deutsche_bank", "hong_leong_bank", "hsbc", "kfh", "maybank2e", "maybank2u", "ocbc", "pb_enterprise", "public_bank", "rhb", "standard_chartered", "uob", ] """ The customer's bank. """ class ModifyParamsPaymentMethodDataGiropay(TypedDict): pass class ModifyParamsPaymentMethodDataGrabpay(TypedDict): pass class ModifyParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ Literal[ "abn_amro", "asn_bank", "bunq", "handelsbanken", "ing", "knab", "moneyou", "n26", "nn", "rabobank", "regiobank", "revolut", "sns_bank", "triodos_bank", "van_lanschot", "yoursafe", ] ] """ The customer's bank. """ class ModifyParamsPaymentMethodDataInteracPresent(TypedDict): pass class ModifyParamsPaymentMethodDataKlarna(TypedDict): dob: NotRequired["SetupIntent.ModifyParamsPaymentMethodDataKlarnaDob"] """ Customer's date of birth """ class ModifyParamsPaymentMethodDataKlarnaDob(TypedDict): day: int """ The day of birth, between 1 and 31. """ month: int """ The month of birth, between 1 and 12. """ year: int """ The four-digit year of birth. """ class ModifyParamsPaymentMethodDataKonbini(TypedDict): pass class ModifyParamsPaymentMethodDataLink(TypedDict): pass class ModifyParamsPaymentMethodDataMobilepay(TypedDict): pass class ModifyParamsPaymentMethodDataMultibanco(TypedDict): pass class ModifyParamsPaymentMethodDataOxxo(TypedDict): pass class ModifyParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ Literal[ "alior_bank", "bank_millennium", "bank_nowy_bfg_sa", "bank_pekao_sa", "banki_spbdzielcze", "blik", "bnp_paribas", "boz", "citi_handlowy", "credit_agricole", "envelobank", "etransfer_pocztowy24", "getin_bank", "ideabank", "ing", "inteligo", "mbank_mtransfer", "nest_przelew", "noble_pay", "pbac_z_ipko", "plus_bank", "santander_przelew24", "tmobile_usbugi_bankowe", "toyota_bank", "velobank", "volkswagen_bank", ] ] """ The customer's bank. """ class ModifyParamsPaymentMethodDataPaynow(TypedDict): pass class ModifyParamsPaymentMethodDataPaypal(TypedDict): pass class ModifyParamsPaymentMethodDataPix(TypedDict): pass class ModifyParamsPaymentMethodDataPromptpay(TypedDict): pass class ModifyParamsPaymentMethodDataRadarOptions(TypedDict): session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ class ModifyParamsPaymentMethodDataRevolutPay(TypedDict): pass class ModifyParamsPaymentMethodDataSepaDebit(TypedDict): iban: str """ IBAN of the bank account. """ class ModifyParamsPaymentMethodDataSofort(TypedDict): country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] """ Two-letter ISO code representing the country the bank account is located in. """ class ModifyParamsPaymentMethodDataSwish(TypedDict): pass class ModifyParamsPaymentMethodDataTwint(TypedDict): pass class ModifyParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type: individual or company. """ account_number: NotRequired[str] """ Account number of the bank account. """ account_type: NotRequired[Literal["checking", "savings"]] """ Account type: checkings or savings. Defaults to checking if omitted. """ financial_connections_account: NotRequired[str] """ The ID of a Financial Connections Account to use as a payment method. """ routing_number: NotRequired[str] """ Routing number of the bank account. """ class ModifyParamsPaymentMethodDataWechatPay(TypedDict): pass class ModifyParamsPaymentMethodDataZip(TypedDict): pass class ModifyParamsPaymentMethodOptions(TypedDict): acss_debit: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodOptionsAcssDebit" ] """ If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options. """ amazon_pay: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodOptionsAmazonPay" ] """ If this is a `amazon_pay` SetupIntent, this sub-hash contains details about the AmazonPay payment method options. """ card: NotRequired["SetupIntent.ModifyParamsPaymentMethodOptionsCard"] """ Configuration for any card setup attempted on this SetupIntent. """ card_present: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodOptionsCardPresent" ] """ If this is a `card_present` PaymentMethod, this sub-hash contains details about the card-present payment method options. """ link: NotRequired["SetupIntent.ModifyParamsPaymentMethodOptionsLink"] """ If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. """ paypal: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodOptionsPaypal" ] """ If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. """ sepa_debit: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodOptionsSepaDebit" ] """ If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options. """ us_bank_account: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodOptionsUsBankAccount" ] """ If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options. """ class ModifyParamsPaymentMethodOptionsAcssDebit(TypedDict): currency: NotRequired[Literal["cad", "usd"]] """ 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). """ mandate_options: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodOptionsAcssDebitMandateOptions" ] """ Additional fields for Mandate creation """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. """ class ModifyParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): custom_mandate_url: NotRequired["Literal['']|str"] """ A URL for custom mandate text to render during confirmation step. The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. """ default_for: NotRequired[List[Literal["invoice", "subscription"]]] """ List of Stripe products where this mandate can be selected automatically. """ interval_description: NotRequired[str] """ Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. """ payment_schedule: NotRequired[ Literal["combined", "interval", "sporadic"] ] """ Payment schedule for the mandate. """ transaction_type: NotRequired[Literal["business", "personal"]] """ Transaction type of the mandate. """ class ModifyParamsPaymentMethodOptionsAmazonPay(TypedDict): pass class ModifyParamsPaymentMethodOptionsCard(TypedDict): mandate_options: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodOptionsCardMandateOptions" ] """ Configuration options for setting up an eMandate for cards issued in India. """ moto: NotRequired[bool] """ When specified, this parameter signals that a card has been collected as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This parameter can only be provided during confirmation. """ network: NotRequired[ Literal[ "amex", "cartes_bancaires", "diners", "discover", "eftpos_au", "interac", "jcb", "mastercard", "unionpay", "unknown", "visa", ] ] """ Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the SetupIntent. Can be only set confirm-time. """ request_three_d_secure: NotRequired[ Literal["any", "automatic", "challenge"] ] """ 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://stripe.com/docs/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://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ three_d_secure: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodOptionsCardThreeDSecure" ] """ If 3D Secure authentication was performed with a third-party provider, the authentication details to use for this setup. """ class ModifyParamsPaymentMethodOptionsCardMandateOptions(TypedDict): amount: int """ Amount to be charged for future payments. """ amount_type: Literal["fixed", "maximum"] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ currency: str """ Currency in which future payments will be charged. 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] """ A description of the mandate or subscription that is meant to be displayed to the customer. """ end_date: NotRequired[int] """ End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. """ interval: Literal["day", "month", "sporadic", "week", "year"] """ Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. """ interval_count: NotRequired[int] """ The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. """ reference: str """ Unique identifier for the mandate or subscription. """ start_date: int """ Start date of the mandate or subscription. Start date should not be lesser than yesterday. """ supported_types: NotRequired[List[Literal["india"]]] """ Specifies the type of mandates supported. Possible values are `india`. """ class ModifyParamsPaymentMethodOptionsCardPresent(TypedDict): pass class ModifyParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): ares_trans_status: NotRequired[ Literal["A", "C", "I", "N", "R", "U", "Y"] ] """ The `transStatus` returned from the card Issuer's ACS in the ARes. """ cryptogram: NotRequired[str] """ The cryptogram, also known as the "authentication value" (AAV, CAVV or AEVV). This value is 20 bytes, base64-encoded into a 28-character string. (Most 3D Secure providers will return the base64-encoded version, which is what you should specify here.) """ electronic_commerce_indicator: NotRequired[ Literal["01", "02", "05", "06", "07"] ] """ The Electronic Commerce Indicator (ECI) is returned by your 3D Secure provider and indicates what degree of authentication was performed. """ network_options: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions" ] """ Network specific 3DS fields. Network specific arguments require an explicit card brand choice. The parameter `payment_method_options.card.network`` must be populated accordingly """ requestor_challenge_indicator: NotRequired[str] """ The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. """ transaction_id: NotRequired[str] """ For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server Transaction ID (dsTransID). """ version: NotRequired[Literal["1.0.2", "2.1.0", "2.2.0"]] """ The version of 3D Secure that was performed. """ class ModifyParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions( TypedDict, ): cartes_bancaires: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires" ] """ Cartes Bancaires-specific 3DS fields. """ class ModifyParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires( TypedDict, ): cb_avalgo: Literal["0", "1", "2", "3", "4", "A"] """ The cryptogram calculation algorithm used by the card Issuer's ACS to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. messageExtension: CB-AVALGO """ cb_exemption: NotRequired[str] """ The exemption indicator returned from Cartes Bancaires in the ARes. message extension: CB-EXEMPTION; string (4 characters) This is a 3 byte bitmap (low significant byte first and most significant bit first) that has been Base64 encoded """ cb_score: NotRequired[int] """ The risk score returned from Cartes Bancaires in the ARes. message extension: CB-SCORE; numeric value 0-99 """ class ModifyParamsPaymentMethodOptionsLink(TypedDict): persistent_token: NotRequired[str] """ [Deprecated] This is a legacy parameter that no longer has any function. """ class ModifyParamsPaymentMethodOptionsPaypal(TypedDict): billing_agreement_id: NotRequired[str] """ The PayPal Billing Agreement ID (BAID). This is an ID generated by PayPal which represents the mandate between the merchant and the customer. """ class ModifyParamsPaymentMethodOptionsSepaDebit(TypedDict): mandate_options: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodOptionsSepaDebitMandateOptions" ] """ Additional fields for Mandate creation """ class ModifyParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): pass class ModifyParamsPaymentMethodOptionsUsBankAccount(TypedDict): financial_connections: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnections" ] """ Additional fields for Financial Connections Session creation """ mandate_options: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodOptionsUsBankAccountMandateOptions" ] """ Additional fields for Mandate creation """ networks: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodOptionsUsBankAccountNetworks" ] """ Additional fields for network related functions """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. """ class ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): filters: NotRequired[ "SetupIntent.ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" ] """ Provide filters for the linked accounts that the customer can select for the payment method """ permissions: NotRequired[ List[ Literal[ "balances", "ownership", "payment_method", "transactions" ] ] ] """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ List[Literal["balances", "ownership", "transactions"]] ] """ List of data features that you would like to retrieve upon account creation. """ return_url: NotRequired[str] """ For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. """ class ModifyParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( TypedDict, ): account_subcategories: NotRequired[ List[Literal["checking", "savings"]] ] """ The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. """ class ModifyParamsPaymentMethodOptionsUsBankAccountMandateOptions( TypedDict, ): collection_method: NotRequired["Literal['']|Literal['paper']"] """ The method used to collect offline mandate customer acceptance. """ class ModifyParamsPaymentMethodOptionsUsBankAccountNetworks(TypedDict): requested: NotRequired[List[Literal["ach", "us_domestic_wire"]]] """ Triggers validations to run across the selected networks """ class RetrieveParams(RequestOptions): client_secret: NotRequired[str] """ The client secret of the SetupIntent. We require this string if you use a publishable key to retrieve the SetupIntent. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class VerifyMicrodepositsParams(RequestOptions): amounts: NotRequired[List[int]] """ Two positive integers, in *cents*, equal to the values of the microdeposits sent to the bank account. """ descriptor_code: NotRequired[str] """ A six-character code starting with SM present in the microdeposit sent to the bank account. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ application: Optional[ExpandableField["Application"]] """ ID of the Connect application that created the SetupIntent. """ attach_to_self: Optional[bool] """ If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. It can only be used for this Stripe Account's own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. """ automatic_payment_methods: Optional[AutomaticPaymentMethods] """ Settings for dynamic payment methods compatible with this Setup Intent """ cancellation_reason: Optional[ Literal["abandoned", "duplicate", "requested_by_customer"] ] """ Reason for cancellation of this SetupIntent, one of `abandoned`, `requested_by_customer`, or `duplicate`. """ client_secret: Optional[str] """ The client secret of this SetupIntent. Used for client-side retrieval using a publishable key. The client secret can be used to complete payment setup from your frontend. It should not be stored, logged, or exposed to anyone other than the customer. Make sure that you have TLS enabled on any page that includes the client secret. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ customer: Optional[ExpandableField["Customer"]] """ ID of the Customer this SetupIntent belongs to, if one exists. If present, the SetupIntent's payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent. """ description: Optional[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ flow_directions: Optional[List[Literal["inbound", "outbound"]]] """ Indicates the directions of money movement for which this payment method is intended to be used. Include `inbound` if you intend to use the payment method as the origin to pull funds from. Include `outbound` if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes. """ id: str """ Unique identifier for the object. """ last_setup_error: Optional[LastSetupError] """ The error encountered in the previous SetupIntent confirmation. """ latest_attempt: Optional[ExpandableField["SetupAttempt"]] """ The most recent SetupAttempt for this SetupIntent. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ mandate: Optional[ExpandableField["Mandate"]] """ ID of the multi use Mandate generated by the SetupIntent. """ metadata: Optional[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ next_action: Optional[NextAction] """ If present, this property tells you what actions you need to take in order for your customer to continue payment setup. """ object: Literal["setup_intent"] """ String representing the object's type. Objects of the same type share the same value. """ on_behalf_of: Optional[ExpandableField["Account"]] """ The account (if any) for which the setup is intended. """ payment_method: Optional[ExpandableField["PaymentMethod"]] """ ID of the payment method used with this SetupIntent. """ payment_method_configuration_details: Optional[ PaymentMethodConfigurationDetails ] """ Information about the payment method configuration used for this Setup Intent. """ payment_method_options: Optional[PaymentMethodOptions] """ Payment method-specific configuration for this SetupIntent. """ payment_method_types: List[str] """ The list of payment method types (e.g. card) that this SetupIntent is allowed to set up. """ single_use_mandate: Optional[ExpandableField["Mandate"]] """ ID of the single_use Mandate generated by the SetupIntent. """ status: Literal[ "canceled", "processing", "requires_action", "requires_confirmation", "requires_payment_method", "succeeded", ] """ [Status](https://stripe.com/docs/payments/intents#intent-statuses) of this SetupIntent, one of `requires_payment_method`, `requires_confirmation`, `requires_action`, `processing`, `canceled`, or `succeeded`. """ usage: str """ Indicates how the payment method is intended to be used in the future. Use `on_session` if you intend to only reuse the payment method when the customer is in your checkout flow. Use `off_session` if your customer may or may not be in your checkout flow. If not provided, this value defaults to `off_session`. """ @classmethod def _cls_cancel( cls, intent: str, **params: Unpack["SetupIntent.CancelParams"] ) -> "SetupIntent": """ You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action. After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. You can't cancel the SetupIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. """ return cast( "SetupIntent", cls._static_request( "post", "/v1/setup_intents/{intent}/cancel".format( intent=sanitize_id(intent) ), params=params, ), ) @overload @staticmethod def cancel( intent: str, **params: Unpack["SetupIntent.CancelParams"] ) -> "SetupIntent": """ You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action. After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. You can't cancel the SetupIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. """ ... @overload def cancel( self, **params: Unpack["SetupIntent.CancelParams"] ) -> "SetupIntent": """ You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action. After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. You can't cancel the SetupIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. """ ... @class_method_variant("_cls_cancel") def cancel( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["SetupIntent.CancelParams"] ) -> "SetupIntent": """ You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action. After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. You can't cancel the SetupIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. """ return cast( "SetupIntent", self._request( "post", "/v1/setup_intents/{intent}/cancel".format( intent=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_cancel_async( cls, intent: str, **params: Unpack["SetupIntent.CancelParams"] ) -> "SetupIntent": """ You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action. After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. You can't cancel the SetupIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. """ return cast( "SetupIntent", await cls._static_request_async( "post", "/v1/setup_intents/{intent}/cancel".format( intent=sanitize_id(intent) ), params=params, ), ) @overload @staticmethod async def cancel_async( intent: str, **params: Unpack["SetupIntent.CancelParams"] ) -> "SetupIntent": """ You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action. After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. You can't cancel the SetupIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. """ ... @overload async def cancel_async( self, **params: Unpack["SetupIntent.CancelParams"] ) -> "SetupIntent": """ You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action. After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. You can't cancel the SetupIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. """ ... @class_method_variant("_cls_cancel_async") async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["SetupIntent.CancelParams"] ) -> "SetupIntent": """ You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action. After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. You can't cancel the SetupIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. """ return cast( "SetupIntent", await self._request_async( "post", "/v1/setup_intents/{intent}/cancel".format( intent=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def _cls_confirm( cls, intent: str, **params: Unpack["SetupIntent.ConfirmParams"] ) -> "SetupIntent": """ Confirm that your customer intends to set up the current or provided payment method. For example, you would confirm a SetupIntent when a customer hits the “Save” button on a payment method management page on your website. If the selected payment method does not require any additional steps from the customer, the SetupIntent will transition to the succeeded status. Otherwise, it will transition to the requires_action status and suggest additional actions via next_action. If setup fails, the SetupIntent will transition to the requires_payment_method status or the canceled status if the confirmation limit is reached. """ return cast( "SetupIntent", cls._static_request( "post", "/v1/setup_intents/{intent}/confirm".format( intent=sanitize_id(intent) ), params=params, ), ) @overload @staticmethod def confirm( intent: str, **params: Unpack["SetupIntent.ConfirmParams"] ) -> "SetupIntent": """ Confirm that your customer intends to set up the current or provided payment method. For example, you would confirm a SetupIntent when a customer hits the “Save” button on a payment method management page on your website. If the selected payment method does not require any additional steps from the customer, the SetupIntent will transition to the succeeded status. Otherwise, it will transition to the requires_action status and suggest additional actions via next_action. If setup fails, the SetupIntent will transition to the requires_payment_method status or the canceled status if the confirmation limit is reached. """ ... @overload def confirm( self, **params: Unpack["SetupIntent.ConfirmParams"] ) -> "SetupIntent": """ Confirm that your customer intends to set up the current or provided payment method. For example, you would confirm a SetupIntent when a customer hits the “Save” button on a payment method management page on your website. If the selected payment method does not require any additional steps from the customer, the SetupIntent will transition to the succeeded status. Otherwise, it will transition to the requires_action status and suggest additional actions via next_action. If setup fails, the SetupIntent will transition to the requires_payment_method status or the canceled status if the confirmation limit is reached. """ ... @class_method_variant("_cls_confirm") def confirm( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["SetupIntent.ConfirmParams"] ) -> "SetupIntent": """ Confirm that your customer intends to set up the current or provided payment method. For example, you would confirm a SetupIntent when a customer hits the “Save” button on a payment method management page on your website. If the selected payment method does not require any additional steps from the customer, the SetupIntent will transition to the succeeded status. Otherwise, it will transition to the requires_action status and suggest additional actions via next_action. If setup fails, the SetupIntent will transition to the requires_payment_method status or the canceled status if the confirmation limit is reached. """ return cast( "SetupIntent", self._request( "post", "/v1/setup_intents/{intent}/confirm".format( intent=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_confirm_async( cls, intent: str, **params: Unpack["SetupIntent.ConfirmParams"] ) -> "SetupIntent": """ Confirm that your customer intends to set up the current or provided payment method. For example, you would confirm a SetupIntent when a customer hits the “Save” button on a payment method management page on your website. If the selected payment method does not require any additional steps from the customer, the SetupIntent will transition to the succeeded status. Otherwise, it will transition to the requires_action status and suggest additional actions via next_action. If setup fails, the SetupIntent will transition to the requires_payment_method status or the canceled status if the confirmation limit is reached. """ return cast( "SetupIntent", await cls._static_request_async( "post", "/v1/setup_intents/{intent}/confirm".format( intent=sanitize_id(intent) ), params=params, ), ) @overload @staticmethod async def confirm_async( intent: str, **params: Unpack["SetupIntent.ConfirmParams"] ) -> "SetupIntent": """ Confirm that your customer intends to set up the current or provided payment method. For example, you would confirm a SetupIntent when a customer hits the “Save” button on a payment method management page on your website. If the selected payment method does not require any additional steps from the customer, the SetupIntent will transition to the succeeded status. Otherwise, it will transition to the requires_action status and suggest additional actions via next_action. If setup fails, the SetupIntent will transition to the requires_payment_method status or the canceled status if the confirmation limit is reached. """ ... @overload async def confirm_async( self, **params: Unpack["SetupIntent.ConfirmParams"] ) -> "SetupIntent": """ Confirm that your customer intends to set up the current or provided payment method. For example, you would confirm a SetupIntent when a customer hits the “Save” button on a payment method management page on your website. If the selected payment method does not require any additional steps from the customer, the SetupIntent will transition to the succeeded status. Otherwise, it will transition to the requires_action status and suggest additional actions via next_action. If setup fails, the SetupIntent will transition to the requires_payment_method status or the canceled status if the confirmation limit is reached. """ ... @class_method_variant("_cls_confirm_async") async def confirm_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["SetupIntent.ConfirmParams"] ) -> "SetupIntent": """ Confirm that your customer intends to set up the current or provided payment method. For example, you would confirm a SetupIntent when a customer hits the “Save” button on a payment method management page on your website. If the selected payment method does not require any additional steps from the customer, the SetupIntent will transition to the succeeded status. Otherwise, it will transition to the requires_action status and suggest additional actions via next_action. If setup fails, the SetupIntent will transition to the requires_payment_method status or the canceled status if the confirmation limit is reached. """ return cast( "SetupIntent", await self._request_async( "post", "/v1/setup_intents/{intent}/confirm".format( intent=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def create( cls, **params: Unpack["SetupIntent.CreateParams"] ) -> "SetupIntent": """ Creates a SetupIntent object. After you create the SetupIntent, attach a payment method and [confirm](https://stripe.com/docs/api/setup_intents/confirm) it to collect any required permissions to charge the payment method later. """ return cast( "SetupIntent", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["SetupIntent.CreateParams"] ) -> "SetupIntent": """ Creates a SetupIntent object. After you create the SetupIntent, attach a payment method and [confirm](https://stripe.com/docs/api/setup_intents/confirm) it to collect any required permissions to charge the payment method later. """ return cast( "SetupIntent", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def list( cls, **params: Unpack["SetupIntent.ListParams"] ) -> ListObject["SetupIntent"]: """ Returns a list of SetupIntents. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["SetupIntent.ListParams"] ) -> ListObject["SetupIntent"]: """ Returns a list of SetupIntents. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def modify( cls, id: str, **params: Unpack["SetupIntent.ModifyParams"] ) -> "SetupIntent": """ Updates a SetupIntent object. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "SetupIntent", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["SetupIntent.ModifyParams"] ) -> "SetupIntent": """ Updates a SetupIntent object. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "SetupIntent", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["SetupIntent.RetrieveParams"] ) -> "SetupIntent": """ Retrieves the details of a SetupIntent that has previously been created. Client-side retrieval using a publishable key is allowed when the client_secret is provided in the query string. When retrieved with a publishable key, only a subset of properties will be returned. Please refer to the [SetupIntent](https://stripe.com/docs/api#setup_intent_object) object reference for more details. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["SetupIntent.RetrieveParams"] ) -> "SetupIntent": """ Retrieves the details of a SetupIntent that has previously been created. Client-side retrieval using a publishable key is allowed when the client_secret is provided in the query string. When retrieved with a publishable key, only a subset of properties will be returned. Please refer to the [SetupIntent](https://stripe.com/docs/api#setup_intent_object) object reference for more details. """ instance = cls(id, **params) await instance.refresh_async() return instance @classmethod def _cls_verify_microdeposits( cls, intent: str, **params: Unpack["SetupIntent.VerifyMicrodepositsParams"], ) -> "SetupIntent": """ Verifies microdeposits on a SetupIntent object. """ return cast( "SetupIntent", cls._static_request( "post", "/v1/setup_intents/{intent}/verify_microdeposits".format( intent=sanitize_id(intent) ), params=params, ), ) @overload @staticmethod def verify_microdeposits( intent: str, **params: Unpack["SetupIntent.VerifyMicrodepositsParams"] ) -> "SetupIntent": """ Verifies microdeposits on a SetupIntent object. """ ... @overload def verify_microdeposits( self, **params: Unpack["SetupIntent.VerifyMicrodepositsParams"] ) -> "SetupIntent": """ Verifies microdeposits on a SetupIntent object. """ ... @class_method_variant("_cls_verify_microdeposits") def verify_microdeposits( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["SetupIntent.VerifyMicrodepositsParams"] ) -> "SetupIntent": """ Verifies microdeposits on a SetupIntent object. """ return cast( "SetupIntent", self._request( "post", "/v1/setup_intents/{intent}/verify_microdeposits".format( intent=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_verify_microdeposits_async( cls, intent: str, **params: Unpack["SetupIntent.VerifyMicrodepositsParams"], ) -> "SetupIntent": """ Verifies microdeposits on a SetupIntent object. """ return cast( "SetupIntent", await cls._static_request_async( "post", "/v1/setup_intents/{intent}/verify_microdeposits".format( intent=sanitize_id(intent) ), params=params, ), ) @overload @staticmethod async def verify_microdeposits_async( intent: str, **params: Unpack["SetupIntent.VerifyMicrodepositsParams"] ) -> "SetupIntent": """ Verifies microdeposits on a SetupIntent object. """ ... @overload async def verify_microdeposits_async( self, **params: Unpack["SetupIntent.VerifyMicrodepositsParams"] ) -> "SetupIntent": """ Verifies microdeposits on a SetupIntent object. """ ... @class_method_variant("_cls_verify_microdeposits_async") async def verify_microdeposits_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["SetupIntent.VerifyMicrodepositsParams"] ) -> "SetupIntent": """ Verifies microdeposits on a SetupIntent object. """ return cast( "SetupIntent", await self._request_async( "post", "/v1/setup_intents/{intent}/verify_microdeposits".format( intent=sanitize_id(self.get("id")) ), params=params, ), ) _inner_class_types = { "automatic_payment_methods": AutomaticPaymentMethods, "last_setup_error": LastSetupError, "next_action": NextAction, "payment_method_configuration_details": PaymentMethodConfigurationDetails, "payment_method_options": PaymentMethodOptions, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_setup_intent_service.py0000644000175100001770000042521214637354563021012 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._setup_intent import SetupIntent from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class SetupIntentService(StripeService): class CancelParams(TypedDict): cancellation_reason: NotRequired[ Literal["abandoned", "duplicate", "requested_by_customer"] ] """ Reason for canceling this SetupIntent. Possible values are: `abandoned`, `requested_by_customer`, or `duplicate` """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ConfirmParams(TypedDict): confirmation_token: NotRequired[str] """ ID of the ConfirmationToken used to confirm this SetupIntent. If the provided ConfirmationToken contains properties that are also being provided in this request, such as `payment_method`, then the values in this request will take precedence. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ mandate_data: NotRequired[ "Literal['']|SetupIntentService.ConfirmParamsMandateData" ] payment_method: NotRequired[str] """ ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent. """ payment_method_data: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodData" ] """ When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method) value in the SetupIntent. """ payment_method_options: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodOptions" ] """ Payment method-specific configuration for this SetupIntent. """ return_url: NotRequired[str] """ The URL to redirect your customer back to after they authenticate on the payment method's app or site. If you'd prefer to redirect to a mobile application, you can alternatively supply an application URI scheme. This parameter is only used for cards and other redirect-based payment methods. """ use_stripe_sdk: NotRequired[bool] """ Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. """ class ConfirmParamsMandateData(TypedDict): customer_acceptance: NotRequired[ "SetupIntentService.ConfirmParamsMandateDataCustomerAcceptance" ] """ This hash contains details about the customer acceptance of the Mandate. """ class ConfirmParamsMandateDataCustomerAcceptance(TypedDict): accepted_at: NotRequired[int] """ The time at which the customer accepted the Mandate. """ offline: NotRequired[ "SetupIntentService.ConfirmParamsMandateDataCustomerAcceptanceOffline" ] """ If this is a Mandate accepted offline, this hash contains details about the offline acceptance. """ online: NotRequired[ "SetupIntentService.ConfirmParamsMandateDataCustomerAcceptanceOnline" ] """ If this is a Mandate accepted online, this hash contains details about the online acceptance. """ type: Literal["offline", "online"] """ The type of customer acceptance information included with the Mandate. One of `online` or `offline`. """ class ConfirmParamsMandateDataCustomerAcceptanceOffline(TypedDict): pass class ConfirmParamsMandateDataCustomerAcceptanceOnline(TypedDict): ip_address: NotRequired[str] """ The IP address from which the Mandate was accepted by the customer. """ user_agent: NotRequired[str] """ The user agent of the browser from which the Mandate was accepted by the customer. """ class ConfirmParamsPaymentMethodData(TypedDict): acss_debit: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataAcssDebit" ] """ If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. """ affirm: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataAffirm" ] """ If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. """ afterpay_clearpay: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataAfterpayClearpay" ] """ If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. """ alipay: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataAlipay" ] """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ allow_redisplay: NotRequired[ Literal["always", "limited", "unspecified"] ] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ amazon_pay: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataAmazonPay" ] """ If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. """ au_becs_debit: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataAuBecsDebit" ] """ If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. """ bacs_debit: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataBacsDebit" ] """ If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. """ bancontact: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataBancontact" ] """ If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. """ billing_details: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataBillingDetails" ] """ Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. """ blik: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataBlik" ] """ If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. """ boleto: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataBoleto" ] """ If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. """ cashapp: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataCashapp" ] """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ customer_balance: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataCustomerBalance" ] """ If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. """ eps: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataEps" ] """ If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. """ fpx: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataFpx" ] """ If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. """ giropay: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataGiropay" ] """ If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. """ grabpay: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataGrabpay" ] """ If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ ideal: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataIdeal" ] """ If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. """ interac_present: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataInteracPresent" ] """ If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. """ klarna: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataKlarna" ] """ If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. """ konbini: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataKonbini" ] """ If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. """ link: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataLink" ] """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ mobilepay: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataMobilepay" ] """ If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. """ multibanco: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataMultibanco" ] """ If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. """ oxxo: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataOxxo" ] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. """ p24: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataP24" ] """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ paynow: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataPaynow" ] """ If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. """ paypal: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataPaypal" ] """ If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. """ pix: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataPix" ] """ If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. """ promptpay: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataPromptpay" ] """ If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. """ radar_options: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataRadarOptions" ] """ Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. """ revolut_pay: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataRevolutPay" ] """ If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. """ sepa_debit: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataSepaDebit" ] """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ sofort: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataSofort" ] """ If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. """ swish: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataSwish" ] """ If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. """ twint: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataTwint" ] """ If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. """ type: Literal[ "acss_debit", "affirm", "afterpay_clearpay", "alipay", "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", "blik", "boleto", "cashapp", "customer_balance", "eps", "fpx", "giropay", "grabpay", "ideal", "klarna", "konbini", "link", "mobilepay", "multibanco", "oxxo", "p24", "paynow", "paypal", "pix", "promptpay", "revolut_pay", "sepa_debit", "sofort", "swish", "twint", "us_bank_account", "wechat_pay", "zip", ] """ The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. """ us_bank_account: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataUsBankAccount" ] """ If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. """ wechat_pay: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataWechatPay" ] """ If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. """ zip: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataZip" ] """ If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. """ class ConfirmParamsPaymentMethodDataAcssDebit(TypedDict): account_number: str """ Customer's bank account number. """ institution_number: str """ Institution number of the customer's bank. """ transit_number: str """ Transit number of the customer's bank. """ class ConfirmParamsPaymentMethodDataAffirm(TypedDict): pass class ConfirmParamsPaymentMethodDataAfterpayClearpay(TypedDict): pass class ConfirmParamsPaymentMethodDataAlipay(TypedDict): pass class ConfirmParamsPaymentMethodDataAmazonPay(TypedDict): pass class ConfirmParamsPaymentMethodDataAuBecsDebit(TypedDict): account_number: str """ The account number for the bank account. """ bsb_number: str """ Bank-State-Branch number of the bank account. """ class ConfirmParamsPaymentMethodDataBacsDebit(TypedDict): account_number: NotRequired[str] """ Account number of the bank account that the funds will be debited from. """ sort_code: NotRequired[str] """ Sort code of the bank account. (e.g., `10-20-30`) """ class ConfirmParamsPaymentMethodDataBancontact(TypedDict): pass class ConfirmParamsPaymentMethodDataBillingDetails(TypedDict): address: NotRequired[ "Literal['']|SetupIntentService.ConfirmParamsPaymentMethodDataBillingDetailsAddress" ] """ Billing address. """ email: NotRequired["Literal['']|str"] """ Email address. """ name: NotRequired["Literal['']|str"] """ Full name. """ phone: NotRequired["Literal['']|str"] """ Billing phone number (including extension). """ class ConfirmParamsPaymentMethodDataBillingDetailsAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class ConfirmParamsPaymentMethodDataBlik(TypedDict): pass class ConfirmParamsPaymentMethodDataBoleto(TypedDict): tax_id: str """ The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) """ class ConfirmParamsPaymentMethodDataCashapp(TypedDict): pass class ConfirmParamsPaymentMethodDataCustomerBalance(TypedDict): pass class ConfirmParamsPaymentMethodDataEps(TypedDict): bank: NotRequired[ Literal[ "arzte_und_apotheker_bank", "austrian_anadi_bank_ag", "bank_austria", "bankhaus_carl_spangler", "bankhaus_schelhammer_und_schattera_ag", "bawag_psk_ag", "bks_bank_ag", "brull_kallmus_bank_ag", "btv_vier_lander_bank", "capital_bank_grawe_gruppe_ag", "deutsche_bank_ag", "dolomitenbank", "easybank_ag", "erste_bank_und_sparkassen", "hypo_alpeadriabank_international_ag", "hypo_bank_burgenland_aktiengesellschaft", "hypo_noe_lb_fur_niederosterreich_u_wien", "hypo_oberosterreich_salzburg_steiermark", "hypo_tirol_bank_ag", "hypo_vorarlberg_bank_ag", "marchfelder_bank", "oberbank_ag", "raiffeisen_bankengruppe_osterreich", "schoellerbank_ag", "sparda_bank_wien", "volksbank_gruppe", "volkskreditbank_ag", "vr_bank_braunau", ] ] """ The customer's bank. """ class ConfirmParamsPaymentMethodDataFpx(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type for FPX transaction """ bank: Literal[ "affin_bank", "agrobank", "alliance_bank", "ambank", "bank_islam", "bank_muamalat", "bank_of_china", "bank_rakyat", "bsn", "cimb", "deutsche_bank", "hong_leong_bank", "hsbc", "kfh", "maybank2e", "maybank2u", "ocbc", "pb_enterprise", "public_bank", "rhb", "standard_chartered", "uob", ] """ The customer's bank. """ class ConfirmParamsPaymentMethodDataGiropay(TypedDict): pass class ConfirmParamsPaymentMethodDataGrabpay(TypedDict): pass class ConfirmParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ Literal[ "abn_amro", "asn_bank", "bunq", "handelsbanken", "ing", "knab", "moneyou", "n26", "nn", "rabobank", "regiobank", "revolut", "sns_bank", "triodos_bank", "van_lanschot", "yoursafe", ] ] """ The customer's bank. """ class ConfirmParamsPaymentMethodDataInteracPresent(TypedDict): pass class ConfirmParamsPaymentMethodDataKlarna(TypedDict): dob: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodDataKlarnaDob" ] """ Customer's date of birth """ class ConfirmParamsPaymentMethodDataKlarnaDob(TypedDict): day: int """ The day of birth, between 1 and 31. """ month: int """ The month of birth, between 1 and 12. """ year: int """ The four-digit year of birth. """ class ConfirmParamsPaymentMethodDataKonbini(TypedDict): pass class ConfirmParamsPaymentMethodDataLink(TypedDict): pass class ConfirmParamsPaymentMethodDataMobilepay(TypedDict): pass class ConfirmParamsPaymentMethodDataMultibanco(TypedDict): pass class ConfirmParamsPaymentMethodDataOxxo(TypedDict): pass class ConfirmParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ Literal[ "alior_bank", "bank_millennium", "bank_nowy_bfg_sa", "bank_pekao_sa", "banki_spbdzielcze", "blik", "bnp_paribas", "boz", "citi_handlowy", "credit_agricole", "envelobank", "etransfer_pocztowy24", "getin_bank", "ideabank", "ing", "inteligo", "mbank_mtransfer", "nest_przelew", "noble_pay", "pbac_z_ipko", "plus_bank", "santander_przelew24", "tmobile_usbugi_bankowe", "toyota_bank", "velobank", "volkswagen_bank", ] ] """ The customer's bank. """ class ConfirmParamsPaymentMethodDataPaynow(TypedDict): pass class ConfirmParamsPaymentMethodDataPaypal(TypedDict): pass class ConfirmParamsPaymentMethodDataPix(TypedDict): pass class ConfirmParamsPaymentMethodDataPromptpay(TypedDict): pass class ConfirmParamsPaymentMethodDataRadarOptions(TypedDict): session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ class ConfirmParamsPaymentMethodDataRevolutPay(TypedDict): pass class ConfirmParamsPaymentMethodDataSepaDebit(TypedDict): iban: str """ IBAN of the bank account. """ class ConfirmParamsPaymentMethodDataSofort(TypedDict): country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] """ Two-letter ISO code representing the country the bank account is located in. """ class ConfirmParamsPaymentMethodDataSwish(TypedDict): pass class ConfirmParamsPaymentMethodDataTwint(TypedDict): pass class ConfirmParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type: individual or company. """ account_number: NotRequired[str] """ Account number of the bank account. """ account_type: NotRequired[Literal["checking", "savings"]] """ Account type: checkings or savings. Defaults to checking if omitted. """ financial_connections_account: NotRequired[str] """ The ID of a Financial Connections Account to use as a payment method. """ routing_number: NotRequired[str] """ Routing number of the bank account. """ class ConfirmParamsPaymentMethodDataWechatPay(TypedDict): pass class ConfirmParamsPaymentMethodDataZip(TypedDict): pass class ConfirmParamsPaymentMethodOptions(TypedDict): acss_debit: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodOptionsAcssDebit" ] """ If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options. """ amazon_pay: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodOptionsAmazonPay" ] """ If this is a `amazon_pay` SetupIntent, this sub-hash contains details about the AmazonPay payment method options. """ card: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodOptionsCard" ] """ Configuration for any card setup attempted on this SetupIntent. """ card_present: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodOptionsCardPresent" ] """ If this is a `card_present` PaymentMethod, this sub-hash contains details about the card-present payment method options. """ link: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodOptionsLink" ] """ If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. """ paypal: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodOptionsPaypal" ] """ If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. """ sepa_debit: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodOptionsSepaDebit" ] """ If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options. """ us_bank_account: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodOptionsUsBankAccount" ] """ If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options. """ class ConfirmParamsPaymentMethodOptionsAcssDebit(TypedDict): currency: NotRequired[Literal["cad", "usd"]] """ 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). """ mandate_options: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodOptionsAcssDebitMandateOptions" ] """ Additional fields for Mandate creation """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. """ class ConfirmParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): custom_mandate_url: NotRequired["Literal['']|str"] """ A URL for custom mandate text to render during confirmation step. The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. """ default_for: NotRequired[List[Literal["invoice", "subscription"]]] """ List of Stripe products where this mandate can be selected automatically. """ interval_description: NotRequired[str] """ Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. """ payment_schedule: NotRequired[ Literal["combined", "interval", "sporadic"] ] """ Payment schedule for the mandate. """ transaction_type: NotRequired[Literal["business", "personal"]] """ Transaction type of the mandate. """ class ConfirmParamsPaymentMethodOptionsAmazonPay(TypedDict): pass class ConfirmParamsPaymentMethodOptionsCard(TypedDict): mandate_options: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodOptionsCardMandateOptions" ] """ Configuration options for setting up an eMandate for cards issued in India. """ moto: NotRequired[bool] """ When specified, this parameter signals that a card has been collected as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This parameter can only be provided during confirmation. """ network: NotRequired[ Literal[ "amex", "cartes_bancaires", "diners", "discover", "eftpos_au", "interac", "jcb", "mastercard", "unionpay", "unknown", "visa", ] ] """ Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the SetupIntent. Can be only set confirm-time. """ request_three_d_secure: NotRequired[ Literal["any", "automatic", "challenge"] ] """ 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://stripe.com/docs/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://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ three_d_secure: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodOptionsCardThreeDSecure" ] """ If 3D Secure authentication was performed with a third-party provider, the authentication details to use for this setup. """ class ConfirmParamsPaymentMethodOptionsCardMandateOptions(TypedDict): amount: int """ Amount to be charged for future payments. """ amount_type: Literal["fixed", "maximum"] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ currency: str """ Currency in which future payments will be charged. 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] """ A description of the mandate or subscription that is meant to be displayed to the customer. """ end_date: NotRequired[int] """ End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. """ interval: Literal["day", "month", "sporadic", "week", "year"] """ Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. """ interval_count: NotRequired[int] """ The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. """ reference: str """ Unique identifier for the mandate or subscription. """ start_date: int """ Start date of the mandate or subscription. Start date should not be lesser than yesterday. """ supported_types: NotRequired[List[Literal["india"]]] """ Specifies the type of mandates supported. Possible values are `india`. """ class ConfirmParamsPaymentMethodOptionsCardPresent(TypedDict): pass class ConfirmParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): ares_trans_status: NotRequired[ Literal["A", "C", "I", "N", "R", "U", "Y"] ] """ The `transStatus` returned from the card Issuer's ACS in the ARes. """ cryptogram: NotRequired[str] """ The cryptogram, also known as the "authentication value" (AAV, CAVV or AEVV). This value is 20 bytes, base64-encoded into a 28-character string. (Most 3D Secure providers will return the base64-encoded version, which is what you should specify here.) """ electronic_commerce_indicator: NotRequired[ Literal["01", "02", "05", "06", "07"] ] """ The Electronic Commerce Indicator (ECI) is returned by your 3D Secure provider and indicates what degree of authentication was performed. """ network_options: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions" ] """ Network specific 3DS fields. Network specific arguments require an explicit card brand choice. The parameter `payment_method_options.card.network`` must be populated accordingly """ requestor_challenge_indicator: NotRequired[str] """ The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. """ transaction_id: NotRequired[str] """ For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server Transaction ID (dsTransID). """ version: NotRequired[Literal["1.0.2", "2.1.0", "2.2.0"]] """ The version of 3D Secure that was performed. """ class ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions( TypedDict, ): cartes_bancaires: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires" ] """ Cartes Bancaires-specific 3DS fields. """ class ConfirmParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires( TypedDict, ): cb_avalgo: Literal["0", "1", "2", "3", "4", "A"] """ The cryptogram calculation algorithm used by the card Issuer's ACS to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. messageExtension: CB-AVALGO """ cb_exemption: NotRequired[str] """ The exemption indicator returned from Cartes Bancaires in the ARes. message extension: CB-EXEMPTION; string (4 characters) This is a 3 byte bitmap (low significant byte first and most significant bit first) that has been Base64 encoded """ cb_score: NotRequired[int] """ The risk score returned from Cartes Bancaires in the ARes. message extension: CB-SCORE; numeric value 0-99 """ class ConfirmParamsPaymentMethodOptionsLink(TypedDict): persistent_token: NotRequired[str] """ [Deprecated] This is a legacy parameter that no longer has any function. """ class ConfirmParamsPaymentMethodOptionsPaypal(TypedDict): billing_agreement_id: NotRequired[str] """ The PayPal Billing Agreement ID (BAID). This is an ID generated by PayPal which represents the mandate between the merchant and the customer. """ class ConfirmParamsPaymentMethodOptionsSepaDebit(TypedDict): mandate_options: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodOptionsSepaDebitMandateOptions" ] """ Additional fields for Mandate creation """ class ConfirmParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): pass class ConfirmParamsPaymentMethodOptionsUsBankAccount(TypedDict): financial_connections: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections" ] """ Additional fields for Financial Connections Session creation """ mandate_options: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodOptionsUsBankAccountMandateOptions" ] """ Additional fields for Mandate creation """ networks: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodOptionsUsBankAccountNetworks" ] """ Additional fields for network related functions """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. """ class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): filters: NotRequired[ "SetupIntentService.ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" ] """ Provide filters for the linked accounts that the customer can select for the payment method """ permissions: NotRequired[ List[ Literal[ "balances", "ownership", "payment_method", "transactions" ] ] ] """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ List[Literal["balances", "ownership", "transactions"]] ] """ List of data features that you would like to retrieve upon account creation. """ return_url: NotRequired[str] """ For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. """ class ConfirmParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( TypedDict, ): account_subcategories: NotRequired[ List[Literal["checking", "savings"]] ] """ The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. """ class ConfirmParamsPaymentMethodOptionsUsBankAccountMandateOptions( TypedDict, ): collection_method: NotRequired["Literal['']|Literal['paper']"] """ The method used to collect offline mandate customer acceptance. """ class ConfirmParamsPaymentMethodOptionsUsBankAccountNetworks(TypedDict): requested: NotRequired[List[Literal["ach", "us_domestic_wire"]]] """ Triggers validations to run across the selected networks """ class CreateParams(TypedDict): attach_to_self: NotRequired[bool] """ If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. It can only be used for this Stripe Account's own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. """ automatic_payment_methods: NotRequired[ "SetupIntentService.CreateParamsAutomaticPaymentMethods" ] """ When you enable this parameter, this SetupIntent accepts payment methods that you enable in the Dashboard and that are compatible with its other parameters. """ confirm: NotRequired[bool] """ Set to `true` to attempt to confirm this SetupIntent immediately. This parameter defaults to `false`. If a card is the attached payment method, you can provide a `return_url` in case further authentication is necessary. """ confirmation_token: NotRequired[str] """ ID of the ConfirmationToken used to confirm this SetupIntent. If the provided ConfirmationToken contains properties that are also being provided in this request, such as `payment_method`, then the values in this request will take precedence. """ customer: NotRequired[str] """ ID of the Customer this SetupIntent belongs to, if one exists. If present, the SetupIntent's payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent. """ description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ flow_directions: NotRequired[List[Literal["inbound", "outbound"]]] """ Indicates the directions of money movement for which this payment method is intended to be used. Include `inbound` if you intend to use the payment method as the origin to pull funds from. Include `outbound` if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes. """ mandate_data: NotRequired[ "Literal['']|SetupIntentService.CreateParamsMandateData" ] """ This hash contains details about the mandate to create. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/setup_intents/create#create_setup_intent-confirm). """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ on_behalf_of: NotRequired[str] """ The Stripe account ID created for this SetupIntent. """ payment_method: NotRequired[str] """ ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent. """ payment_method_configuration: NotRequired[str] """ The ID of the payment method configuration to use with this SetupIntent. """ payment_method_data: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodData" ] """ When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method) value in the SetupIntent. """ payment_method_options: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodOptions" ] """ Payment method-specific configuration for this SetupIntent. """ payment_method_types: NotRequired[List[str]] """ The list of payment method types (for example, card) that this SetupIntent can use. If you don't provide this, it defaults to ["card"]. """ return_url: NotRequired[str] """ The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. To redirect to a mobile application, you can alternatively supply an application URI scheme. This parameter can only be used with [`confirm=true`](https://stripe.com/docs/api/setup_intents/create#create_setup_intent-confirm). """ single_use: NotRequired["SetupIntentService.CreateParamsSingleUse"] """ If you populate this hash, this SetupIntent generates a `single_use` mandate after successful completion. """ usage: NotRequired[Literal["off_session", "on_session"]] """ Indicates how the payment method is intended to be used in the future. If not provided, this value defaults to `off_session`. """ use_stripe_sdk: NotRequired[bool] """ Set to `true` when confirming server-side and using Stripe.js, iOS, or Android client-side SDKs to handle the next actions. """ class CreateParamsAutomaticPaymentMethods(TypedDict): allow_redirects: NotRequired[Literal["always", "never"]] """ Controls whether this SetupIntent will accept redirect-based payment methods. Redirect-based payment methods may require your customer to be redirected to a payment method's app or site for authentication or additional steps. To [confirm](https://stripe.com/docs/api/setup_intents/confirm) this SetupIntent, you may be required to provide a `return_url` to redirect customers back to your site after they authenticate or complete the setup. """ enabled: bool """ Whether this feature is enabled. """ class CreateParamsMandateData(TypedDict): customer_acceptance: ( "SetupIntentService.CreateParamsMandateDataCustomerAcceptance" ) """ This hash contains details about the customer acceptance of the Mandate. """ class CreateParamsMandateDataCustomerAcceptance(TypedDict): accepted_at: NotRequired[int] """ The time at which the customer accepted the Mandate. """ offline: NotRequired[ "SetupIntentService.CreateParamsMandateDataCustomerAcceptanceOffline" ] """ If this is a Mandate accepted offline, this hash contains details about the offline acceptance. """ online: NotRequired[ "SetupIntentService.CreateParamsMandateDataCustomerAcceptanceOnline" ] """ If this is a Mandate accepted online, this hash contains details about the online acceptance. """ type: Literal["offline", "online"] """ The type of customer acceptance information included with the Mandate. One of `online` or `offline`. """ class CreateParamsMandateDataCustomerAcceptanceOffline(TypedDict): pass class CreateParamsMandateDataCustomerAcceptanceOnline(TypedDict): ip_address: str """ The IP address from which the Mandate was accepted by the customer. """ user_agent: str """ The user agent of the browser from which the Mandate was accepted by the customer. """ class CreateParamsPaymentMethodData(TypedDict): acss_debit: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataAcssDebit" ] """ If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. """ affirm: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataAffirm" ] """ If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. """ afterpay_clearpay: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataAfterpayClearpay" ] """ If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. """ alipay: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataAlipay" ] """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ allow_redisplay: NotRequired[ Literal["always", "limited", "unspecified"] ] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ amazon_pay: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataAmazonPay" ] """ If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. """ au_becs_debit: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataAuBecsDebit" ] """ If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. """ bacs_debit: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataBacsDebit" ] """ If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. """ bancontact: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataBancontact" ] """ If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. """ billing_details: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataBillingDetails" ] """ Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. """ blik: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataBlik" ] """ If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. """ boleto: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataBoleto" ] """ If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. """ cashapp: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataCashapp" ] """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ customer_balance: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataCustomerBalance" ] """ If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. """ eps: NotRequired["SetupIntentService.CreateParamsPaymentMethodDataEps"] """ If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. """ fpx: NotRequired["SetupIntentService.CreateParamsPaymentMethodDataFpx"] """ If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. """ giropay: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataGiropay" ] """ If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. """ grabpay: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataGrabpay" ] """ If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ ideal: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataIdeal" ] """ If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. """ interac_present: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataInteracPresent" ] """ If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. """ klarna: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataKlarna" ] """ If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. """ konbini: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataKonbini" ] """ If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. """ link: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataLink" ] """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ mobilepay: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataMobilepay" ] """ If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. """ multibanco: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataMultibanco" ] """ If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. """ oxxo: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataOxxo" ] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. """ p24: NotRequired["SetupIntentService.CreateParamsPaymentMethodDataP24"] """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ paynow: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataPaynow" ] """ If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. """ paypal: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataPaypal" ] """ If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. """ pix: NotRequired["SetupIntentService.CreateParamsPaymentMethodDataPix"] """ If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. """ promptpay: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataPromptpay" ] """ If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. """ radar_options: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataRadarOptions" ] """ Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. """ revolut_pay: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataRevolutPay" ] """ If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. """ sepa_debit: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataSepaDebit" ] """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ sofort: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataSofort" ] """ If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. """ swish: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataSwish" ] """ If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. """ twint: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataTwint" ] """ If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. """ type: Literal[ "acss_debit", "affirm", "afterpay_clearpay", "alipay", "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", "blik", "boleto", "cashapp", "customer_balance", "eps", "fpx", "giropay", "grabpay", "ideal", "klarna", "konbini", "link", "mobilepay", "multibanco", "oxxo", "p24", "paynow", "paypal", "pix", "promptpay", "revolut_pay", "sepa_debit", "sofort", "swish", "twint", "us_bank_account", "wechat_pay", "zip", ] """ The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. """ us_bank_account: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataUsBankAccount" ] """ If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. """ wechat_pay: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataWechatPay" ] """ If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. """ zip: NotRequired["SetupIntentService.CreateParamsPaymentMethodDataZip"] """ If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. """ class CreateParamsPaymentMethodDataAcssDebit(TypedDict): account_number: str """ Customer's bank account number. """ institution_number: str """ Institution number of the customer's bank. """ transit_number: str """ Transit number of the customer's bank. """ class CreateParamsPaymentMethodDataAffirm(TypedDict): pass class CreateParamsPaymentMethodDataAfterpayClearpay(TypedDict): pass class CreateParamsPaymentMethodDataAlipay(TypedDict): pass class CreateParamsPaymentMethodDataAmazonPay(TypedDict): pass class CreateParamsPaymentMethodDataAuBecsDebit(TypedDict): account_number: str """ The account number for the bank account. """ bsb_number: str """ Bank-State-Branch number of the bank account. """ class CreateParamsPaymentMethodDataBacsDebit(TypedDict): account_number: NotRequired[str] """ Account number of the bank account that the funds will be debited from. """ sort_code: NotRequired[str] """ Sort code of the bank account. (e.g., `10-20-30`) """ class CreateParamsPaymentMethodDataBancontact(TypedDict): pass class CreateParamsPaymentMethodDataBillingDetails(TypedDict): address: NotRequired[ "Literal['']|SetupIntentService.CreateParamsPaymentMethodDataBillingDetailsAddress" ] """ Billing address. """ email: NotRequired["Literal['']|str"] """ Email address. """ name: NotRequired["Literal['']|str"] """ Full name. """ phone: NotRequired["Literal['']|str"] """ Billing phone number (including extension). """ class CreateParamsPaymentMethodDataBillingDetailsAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsPaymentMethodDataBlik(TypedDict): pass class CreateParamsPaymentMethodDataBoleto(TypedDict): tax_id: str """ The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) """ class CreateParamsPaymentMethodDataCashapp(TypedDict): pass class CreateParamsPaymentMethodDataCustomerBalance(TypedDict): pass class CreateParamsPaymentMethodDataEps(TypedDict): bank: NotRequired[ Literal[ "arzte_und_apotheker_bank", "austrian_anadi_bank_ag", "bank_austria", "bankhaus_carl_spangler", "bankhaus_schelhammer_und_schattera_ag", "bawag_psk_ag", "bks_bank_ag", "brull_kallmus_bank_ag", "btv_vier_lander_bank", "capital_bank_grawe_gruppe_ag", "deutsche_bank_ag", "dolomitenbank", "easybank_ag", "erste_bank_und_sparkassen", "hypo_alpeadriabank_international_ag", "hypo_bank_burgenland_aktiengesellschaft", "hypo_noe_lb_fur_niederosterreich_u_wien", "hypo_oberosterreich_salzburg_steiermark", "hypo_tirol_bank_ag", "hypo_vorarlberg_bank_ag", "marchfelder_bank", "oberbank_ag", "raiffeisen_bankengruppe_osterreich", "schoellerbank_ag", "sparda_bank_wien", "volksbank_gruppe", "volkskreditbank_ag", "vr_bank_braunau", ] ] """ The customer's bank. """ class CreateParamsPaymentMethodDataFpx(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type for FPX transaction """ bank: Literal[ "affin_bank", "agrobank", "alliance_bank", "ambank", "bank_islam", "bank_muamalat", "bank_of_china", "bank_rakyat", "bsn", "cimb", "deutsche_bank", "hong_leong_bank", "hsbc", "kfh", "maybank2e", "maybank2u", "ocbc", "pb_enterprise", "public_bank", "rhb", "standard_chartered", "uob", ] """ The customer's bank. """ class CreateParamsPaymentMethodDataGiropay(TypedDict): pass class CreateParamsPaymentMethodDataGrabpay(TypedDict): pass class CreateParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ Literal[ "abn_amro", "asn_bank", "bunq", "handelsbanken", "ing", "knab", "moneyou", "n26", "nn", "rabobank", "regiobank", "revolut", "sns_bank", "triodos_bank", "van_lanschot", "yoursafe", ] ] """ The customer's bank. """ class CreateParamsPaymentMethodDataInteracPresent(TypedDict): pass class CreateParamsPaymentMethodDataKlarna(TypedDict): dob: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodDataKlarnaDob" ] """ Customer's date of birth """ class CreateParamsPaymentMethodDataKlarnaDob(TypedDict): day: int """ The day of birth, between 1 and 31. """ month: int """ The month of birth, between 1 and 12. """ year: int """ The four-digit year of birth. """ class CreateParamsPaymentMethodDataKonbini(TypedDict): pass class CreateParamsPaymentMethodDataLink(TypedDict): pass class CreateParamsPaymentMethodDataMobilepay(TypedDict): pass class CreateParamsPaymentMethodDataMultibanco(TypedDict): pass class CreateParamsPaymentMethodDataOxxo(TypedDict): pass class CreateParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ Literal[ "alior_bank", "bank_millennium", "bank_nowy_bfg_sa", "bank_pekao_sa", "banki_spbdzielcze", "blik", "bnp_paribas", "boz", "citi_handlowy", "credit_agricole", "envelobank", "etransfer_pocztowy24", "getin_bank", "ideabank", "ing", "inteligo", "mbank_mtransfer", "nest_przelew", "noble_pay", "pbac_z_ipko", "plus_bank", "santander_przelew24", "tmobile_usbugi_bankowe", "toyota_bank", "velobank", "volkswagen_bank", ] ] """ The customer's bank. """ class CreateParamsPaymentMethodDataPaynow(TypedDict): pass class CreateParamsPaymentMethodDataPaypal(TypedDict): pass class CreateParamsPaymentMethodDataPix(TypedDict): pass class CreateParamsPaymentMethodDataPromptpay(TypedDict): pass class CreateParamsPaymentMethodDataRadarOptions(TypedDict): session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ class CreateParamsPaymentMethodDataRevolutPay(TypedDict): pass class CreateParamsPaymentMethodDataSepaDebit(TypedDict): iban: str """ IBAN of the bank account. """ class CreateParamsPaymentMethodDataSofort(TypedDict): country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] """ Two-letter ISO code representing the country the bank account is located in. """ class CreateParamsPaymentMethodDataSwish(TypedDict): pass class CreateParamsPaymentMethodDataTwint(TypedDict): pass class CreateParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type: individual or company. """ account_number: NotRequired[str] """ Account number of the bank account. """ account_type: NotRequired[Literal["checking", "savings"]] """ Account type: checkings or savings. Defaults to checking if omitted. """ financial_connections_account: NotRequired[str] """ The ID of a Financial Connections Account to use as a payment method. """ routing_number: NotRequired[str] """ Routing number of the bank account. """ class CreateParamsPaymentMethodDataWechatPay(TypedDict): pass class CreateParamsPaymentMethodDataZip(TypedDict): pass class CreateParamsPaymentMethodOptions(TypedDict): acss_debit: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodOptionsAcssDebit" ] """ If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options. """ amazon_pay: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodOptionsAmazonPay" ] """ If this is a `amazon_pay` SetupIntent, this sub-hash contains details about the AmazonPay payment method options. """ card: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodOptionsCard" ] """ Configuration for any card setup attempted on this SetupIntent. """ card_present: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodOptionsCardPresent" ] """ If this is a `card_present` PaymentMethod, this sub-hash contains details about the card-present payment method options. """ link: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodOptionsLink" ] """ If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. """ paypal: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodOptionsPaypal" ] """ If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. """ sepa_debit: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodOptionsSepaDebit" ] """ If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options. """ us_bank_account: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodOptionsUsBankAccount" ] """ If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options. """ class CreateParamsPaymentMethodOptionsAcssDebit(TypedDict): currency: NotRequired[Literal["cad", "usd"]] """ 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). """ mandate_options: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodOptionsAcssDebitMandateOptions" ] """ Additional fields for Mandate creation """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. """ class CreateParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): custom_mandate_url: NotRequired["Literal['']|str"] """ A URL for custom mandate text to render during confirmation step. The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. """ default_for: NotRequired[List[Literal["invoice", "subscription"]]] """ List of Stripe products where this mandate can be selected automatically. """ interval_description: NotRequired[str] """ Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. """ payment_schedule: NotRequired[ Literal["combined", "interval", "sporadic"] ] """ Payment schedule for the mandate. """ transaction_type: NotRequired[Literal["business", "personal"]] """ Transaction type of the mandate. """ class CreateParamsPaymentMethodOptionsAmazonPay(TypedDict): pass class CreateParamsPaymentMethodOptionsCard(TypedDict): mandate_options: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodOptionsCardMandateOptions" ] """ Configuration options for setting up an eMandate for cards issued in India. """ moto: NotRequired[bool] """ When specified, this parameter signals that a card has been collected as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This parameter can only be provided during confirmation. """ network: NotRequired[ Literal[ "amex", "cartes_bancaires", "diners", "discover", "eftpos_au", "interac", "jcb", "mastercard", "unionpay", "unknown", "visa", ] ] """ Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the SetupIntent. Can be only set confirm-time. """ request_three_d_secure: NotRequired[ Literal["any", "automatic", "challenge"] ] """ 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://stripe.com/docs/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://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ three_d_secure: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodOptionsCardThreeDSecure" ] """ If 3D Secure authentication was performed with a third-party provider, the authentication details to use for this setup. """ class CreateParamsPaymentMethodOptionsCardMandateOptions(TypedDict): amount: int """ Amount to be charged for future payments. """ amount_type: Literal["fixed", "maximum"] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ currency: str """ Currency in which future payments will be charged. 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] """ A description of the mandate or subscription that is meant to be displayed to the customer. """ end_date: NotRequired[int] """ End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. """ interval: Literal["day", "month", "sporadic", "week", "year"] """ Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. """ interval_count: NotRequired[int] """ The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. """ reference: str """ Unique identifier for the mandate or subscription. """ start_date: int """ Start date of the mandate or subscription. Start date should not be lesser than yesterday. """ supported_types: NotRequired[List[Literal["india"]]] """ Specifies the type of mandates supported. Possible values are `india`. """ class CreateParamsPaymentMethodOptionsCardPresent(TypedDict): pass class CreateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): ares_trans_status: NotRequired[ Literal["A", "C", "I", "N", "R", "U", "Y"] ] """ The `transStatus` returned from the card Issuer's ACS in the ARes. """ cryptogram: NotRequired[str] """ The cryptogram, also known as the "authentication value" (AAV, CAVV or AEVV). This value is 20 bytes, base64-encoded into a 28-character string. (Most 3D Secure providers will return the base64-encoded version, which is what you should specify here.) """ electronic_commerce_indicator: NotRequired[ Literal["01", "02", "05", "06", "07"] ] """ The Electronic Commerce Indicator (ECI) is returned by your 3D Secure provider and indicates what degree of authentication was performed. """ network_options: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions" ] """ Network specific 3DS fields. Network specific arguments require an explicit card brand choice. The parameter `payment_method_options.card.network`` must be populated accordingly """ requestor_challenge_indicator: NotRequired[str] """ The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. """ transaction_id: NotRequired[str] """ For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server Transaction ID (dsTransID). """ version: NotRequired[Literal["1.0.2", "2.1.0", "2.2.0"]] """ The version of 3D Secure that was performed. """ class CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions( TypedDict, ): cartes_bancaires: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires" ] """ Cartes Bancaires-specific 3DS fields. """ class CreateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires( TypedDict, ): cb_avalgo: Literal["0", "1", "2", "3", "4", "A"] """ The cryptogram calculation algorithm used by the card Issuer's ACS to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. messageExtension: CB-AVALGO """ cb_exemption: NotRequired[str] """ The exemption indicator returned from Cartes Bancaires in the ARes. message extension: CB-EXEMPTION; string (4 characters) This is a 3 byte bitmap (low significant byte first and most significant bit first) that has been Base64 encoded """ cb_score: NotRequired[int] """ The risk score returned from Cartes Bancaires in the ARes. message extension: CB-SCORE; numeric value 0-99 """ class CreateParamsPaymentMethodOptionsLink(TypedDict): persistent_token: NotRequired[str] """ [Deprecated] This is a legacy parameter that no longer has any function. """ class CreateParamsPaymentMethodOptionsPaypal(TypedDict): billing_agreement_id: NotRequired[str] """ The PayPal Billing Agreement ID (BAID). This is an ID generated by PayPal which represents the mandate between the merchant and the customer. """ class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): mandate_options: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodOptionsSepaDebitMandateOptions" ] """ Additional fields for Mandate creation """ class CreateParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): pass class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): financial_connections: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections" ] """ Additional fields for Financial Connections Session creation """ mandate_options: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodOptionsUsBankAccountMandateOptions" ] """ Additional fields for Mandate creation """ networks: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodOptionsUsBankAccountNetworks" ] """ Additional fields for network related functions """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. """ class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): filters: NotRequired[ "SetupIntentService.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" ] """ Provide filters for the linked accounts that the customer can select for the payment method """ permissions: NotRequired[ List[ Literal[ "balances", "ownership", "payment_method", "transactions" ] ] ] """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ List[Literal["balances", "ownership", "transactions"]] ] """ List of data features that you would like to retrieve upon account creation. """ return_url: NotRequired[str] """ For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. """ class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( TypedDict, ): account_subcategories: NotRequired[ List[Literal["checking", "savings"]] ] """ The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. """ class CreateParamsPaymentMethodOptionsUsBankAccountMandateOptions( TypedDict, ): collection_method: NotRequired["Literal['']|Literal['paper']"] """ The method used to collect offline mandate customer acceptance. """ class CreateParamsPaymentMethodOptionsUsBankAccountNetworks(TypedDict): requested: NotRequired[List[Literal["ach", "us_domestic_wire"]]] """ Triggers validations to run across the selected networks """ class CreateParamsSingleUse(TypedDict): amount: int """ Amount the customer is granting permission to collect later. A positive integer representing how much to charge in the [smallest currency unit](https://stripe.com/docs/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://stripe.com/docs/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). """ class ListParams(TypedDict): attach_to_self: NotRequired[bool] """ If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. It can only be used for this Stripe Account's own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. """ created: NotRequired["SetupIntentService.ListParamsCreated|int"] """ A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. """ customer: NotRequired[str] """ Only return SetupIntents for the customer specified by this customer ID. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ payment_method: NotRequired[str] """ Only return SetupIntents that associate with the specified payment method. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): client_secret: NotRequired[str] """ The client secret of the SetupIntent. We require this string if you use a publishable key to retrieve the SetupIntent. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): attach_to_self: NotRequired[bool] """ If present, the SetupIntent's payment method will be attached to the in-context Stripe Account. It can only be used for this Stripe Account's own money movement flows like InboundTransfer and OutboundTransfers. It cannot be set to true when setting up a PaymentMethod for a Customer, and defaults to false when attaching a PaymentMethod to a Customer. """ customer: NotRequired[str] """ ID of the Customer this SetupIntent belongs to, if one exists. If present, the SetupIntent's payment method will be attached to the Customer on successful setup. Payment methods attached to other Customers cannot be used with this SetupIntent. """ description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ flow_directions: NotRequired[List[Literal["inbound", "outbound"]]] """ Indicates the directions of money movement for which this payment method is intended to be used. Include `inbound` if you intend to use the payment method as the origin to pull funds from. Include `outbound` if you intend to use the payment method as the destination to send funds to. You can include both if you intend to use the payment method for both purposes. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ payment_method: NotRequired[str] """ ID of the payment method (a PaymentMethod, Card, or saved Source object) to attach to this SetupIntent. """ payment_method_configuration: NotRequired[str] """ The ID of the payment method configuration to use with this SetupIntent. """ payment_method_data: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodData" ] """ When included, this hash creates a PaymentMethod that is set as the [`payment_method`](https://stripe.com/docs/api/setup_intents/object#setup_intent_object-payment_method) value in the SetupIntent. """ payment_method_options: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodOptions" ] """ Payment method-specific configuration for this SetupIntent. """ payment_method_types: NotRequired[List[str]] """ The list of payment method types (for example, card) that this SetupIntent can set up. If you don't provide this array, it defaults to ["card"]. """ class UpdateParamsPaymentMethodData(TypedDict): acss_debit: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataAcssDebit" ] """ If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. """ affirm: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataAffirm" ] """ If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. """ afterpay_clearpay: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataAfterpayClearpay" ] """ If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. """ alipay: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataAlipay" ] """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ allow_redisplay: NotRequired[ Literal["always", "limited", "unspecified"] ] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ amazon_pay: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataAmazonPay" ] """ If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. """ au_becs_debit: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataAuBecsDebit" ] """ If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. """ bacs_debit: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataBacsDebit" ] """ If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. """ bancontact: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataBancontact" ] """ If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. """ billing_details: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataBillingDetails" ] """ Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. """ blik: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataBlik" ] """ If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. """ boleto: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataBoleto" ] """ If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. """ cashapp: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataCashapp" ] """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ customer_balance: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataCustomerBalance" ] """ If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. """ eps: NotRequired["SetupIntentService.UpdateParamsPaymentMethodDataEps"] """ If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. """ fpx: NotRequired["SetupIntentService.UpdateParamsPaymentMethodDataFpx"] """ If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. """ giropay: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataGiropay" ] """ If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. """ grabpay: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataGrabpay" ] """ If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ ideal: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataIdeal" ] """ If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. """ interac_present: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataInteracPresent" ] """ If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. """ klarna: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataKlarna" ] """ If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. """ konbini: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataKonbini" ] """ If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. """ link: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataLink" ] """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ mobilepay: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataMobilepay" ] """ If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. """ multibanco: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataMultibanco" ] """ If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. """ oxxo: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataOxxo" ] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. """ p24: NotRequired["SetupIntentService.UpdateParamsPaymentMethodDataP24"] """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ paynow: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataPaynow" ] """ If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. """ paypal: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataPaypal" ] """ If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. """ pix: NotRequired["SetupIntentService.UpdateParamsPaymentMethodDataPix"] """ If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. """ promptpay: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataPromptpay" ] """ If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. """ radar_options: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataRadarOptions" ] """ Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. """ revolut_pay: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataRevolutPay" ] """ If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. """ sepa_debit: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataSepaDebit" ] """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ sofort: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataSofort" ] """ If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. """ swish: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataSwish" ] """ If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. """ twint: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataTwint" ] """ If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. """ type: Literal[ "acss_debit", "affirm", "afterpay_clearpay", "alipay", "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", "blik", "boleto", "cashapp", "customer_balance", "eps", "fpx", "giropay", "grabpay", "ideal", "klarna", "konbini", "link", "mobilepay", "multibanco", "oxxo", "p24", "paynow", "paypal", "pix", "promptpay", "revolut_pay", "sepa_debit", "sofort", "swish", "twint", "us_bank_account", "wechat_pay", "zip", ] """ The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. """ us_bank_account: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataUsBankAccount" ] """ If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. """ wechat_pay: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataWechatPay" ] """ If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. """ zip: NotRequired["SetupIntentService.UpdateParamsPaymentMethodDataZip"] """ If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. """ class UpdateParamsPaymentMethodDataAcssDebit(TypedDict): account_number: str """ Customer's bank account number. """ institution_number: str """ Institution number of the customer's bank. """ transit_number: str """ Transit number of the customer's bank. """ class UpdateParamsPaymentMethodDataAffirm(TypedDict): pass class UpdateParamsPaymentMethodDataAfterpayClearpay(TypedDict): pass class UpdateParamsPaymentMethodDataAlipay(TypedDict): pass class UpdateParamsPaymentMethodDataAmazonPay(TypedDict): pass class UpdateParamsPaymentMethodDataAuBecsDebit(TypedDict): account_number: str """ The account number for the bank account. """ bsb_number: str """ Bank-State-Branch number of the bank account. """ class UpdateParamsPaymentMethodDataBacsDebit(TypedDict): account_number: NotRequired[str] """ Account number of the bank account that the funds will be debited from. """ sort_code: NotRequired[str] """ Sort code of the bank account. (e.g., `10-20-30`) """ class UpdateParamsPaymentMethodDataBancontact(TypedDict): pass class UpdateParamsPaymentMethodDataBillingDetails(TypedDict): address: NotRequired[ "Literal['']|SetupIntentService.UpdateParamsPaymentMethodDataBillingDetailsAddress" ] """ Billing address. """ email: NotRequired["Literal['']|str"] """ Email address. """ name: NotRequired["Literal['']|str"] """ Full name. """ phone: NotRequired["Literal['']|str"] """ Billing phone number (including extension). """ class UpdateParamsPaymentMethodDataBillingDetailsAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class UpdateParamsPaymentMethodDataBlik(TypedDict): pass class UpdateParamsPaymentMethodDataBoleto(TypedDict): tax_id: str """ The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) """ class UpdateParamsPaymentMethodDataCashapp(TypedDict): pass class UpdateParamsPaymentMethodDataCustomerBalance(TypedDict): pass class UpdateParamsPaymentMethodDataEps(TypedDict): bank: NotRequired[ Literal[ "arzte_und_apotheker_bank", "austrian_anadi_bank_ag", "bank_austria", "bankhaus_carl_spangler", "bankhaus_schelhammer_und_schattera_ag", "bawag_psk_ag", "bks_bank_ag", "brull_kallmus_bank_ag", "btv_vier_lander_bank", "capital_bank_grawe_gruppe_ag", "deutsche_bank_ag", "dolomitenbank", "easybank_ag", "erste_bank_und_sparkassen", "hypo_alpeadriabank_international_ag", "hypo_bank_burgenland_aktiengesellschaft", "hypo_noe_lb_fur_niederosterreich_u_wien", "hypo_oberosterreich_salzburg_steiermark", "hypo_tirol_bank_ag", "hypo_vorarlberg_bank_ag", "marchfelder_bank", "oberbank_ag", "raiffeisen_bankengruppe_osterreich", "schoellerbank_ag", "sparda_bank_wien", "volksbank_gruppe", "volkskreditbank_ag", "vr_bank_braunau", ] ] """ The customer's bank. """ class UpdateParamsPaymentMethodDataFpx(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type for FPX transaction """ bank: Literal[ "affin_bank", "agrobank", "alliance_bank", "ambank", "bank_islam", "bank_muamalat", "bank_of_china", "bank_rakyat", "bsn", "cimb", "deutsche_bank", "hong_leong_bank", "hsbc", "kfh", "maybank2e", "maybank2u", "ocbc", "pb_enterprise", "public_bank", "rhb", "standard_chartered", "uob", ] """ The customer's bank. """ class UpdateParamsPaymentMethodDataGiropay(TypedDict): pass class UpdateParamsPaymentMethodDataGrabpay(TypedDict): pass class UpdateParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ Literal[ "abn_amro", "asn_bank", "bunq", "handelsbanken", "ing", "knab", "moneyou", "n26", "nn", "rabobank", "regiobank", "revolut", "sns_bank", "triodos_bank", "van_lanschot", "yoursafe", ] ] """ The customer's bank. """ class UpdateParamsPaymentMethodDataInteracPresent(TypedDict): pass class UpdateParamsPaymentMethodDataKlarna(TypedDict): dob: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodDataKlarnaDob" ] """ Customer's date of birth """ class UpdateParamsPaymentMethodDataKlarnaDob(TypedDict): day: int """ The day of birth, between 1 and 31. """ month: int """ The month of birth, between 1 and 12. """ year: int """ The four-digit year of birth. """ class UpdateParamsPaymentMethodDataKonbini(TypedDict): pass class UpdateParamsPaymentMethodDataLink(TypedDict): pass class UpdateParamsPaymentMethodDataMobilepay(TypedDict): pass class UpdateParamsPaymentMethodDataMultibanco(TypedDict): pass class UpdateParamsPaymentMethodDataOxxo(TypedDict): pass class UpdateParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ Literal[ "alior_bank", "bank_millennium", "bank_nowy_bfg_sa", "bank_pekao_sa", "banki_spbdzielcze", "blik", "bnp_paribas", "boz", "citi_handlowy", "credit_agricole", "envelobank", "etransfer_pocztowy24", "getin_bank", "ideabank", "ing", "inteligo", "mbank_mtransfer", "nest_przelew", "noble_pay", "pbac_z_ipko", "plus_bank", "santander_przelew24", "tmobile_usbugi_bankowe", "toyota_bank", "velobank", "volkswagen_bank", ] ] """ The customer's bank. """ class UpdateParamsPaymentMethodDataPaynow(TypedDict): pass class UpdateParamsPaymentMethodDataPaypal(TypedDict): pass class UpdateParamsPaymentMethodDataPix(TypedDict): pass class UpdateParamsPaymentMethodDataPromptpay(TypedDict): pass class UpdateParamsPaymentMethodDataRadarOptions(TypedDict): session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ class UpdateParamsPaymentMethodDataRevolutPay(TypedDict): pass class UpdateParamsPaymentMethodDataSepaDebit(TypedDict): iban: str """ IBAN of the bank account. """ class UpdateParamsPaymentMethodDataSofort(TypedDict): country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] """ Two-letter ISO code representing the country the bank account is located in. """ class UpdateParamsPaymentMethodDataSwish(TypedDict): pass class UpdateParamsPaymentMethodDataTwint(TypedDict): pass class UpdateParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type: individual or company. """ account_number: NotRequired[str] """ Account number of the bank account. """ account_type: NotRequired[Literal["checking", "savings"]] """ Account type: checkings or savings. Defaults to checking if omitted. """ financial_connections_account: NotRequired[str] """ The ID of a Financial Connections Account to use as a payment method. """ routing_number: NotRequired[str] """ Routing number of the bank account. """ class UpdateParamsPaymentMethodDataWechatPay(TypedDict): pass class UpdateParamsPaymentMethodDataZip(TypedDict): pass class UpdateParamsPaymentMethodOptions(TypedDict): acss_debit: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodOptionsAcssDebit" ] """ If this is a `acss_debit` SetupIntent, this sub-hash contains details about the ACSS Debit payment method options. """ amazon_pay: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodOptionsAmazonPay" ] """ If this is a `amazon_pay` SetupIntent, this sub-hash contains details about the AmazonPay payment method options. """ card: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodOptionsCard" ] """ Configuration for any card setup attempted on this SetupIntent. """ card_present: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodOptionsCardPresent" ] """ If this is a `card_present` PaymentMethod, this sub-hash contains details about the card-present payment method options. """ link: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodOptionsLink" ] """ If this is a `link` PaymentMethod, this sub-hash contains details about the Link payment method options. """ paypal: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodOptionsPaypal" ] """ If this is a `paypal` PaymentMethod, this sub-hash contains details about the PayPal payment method options. """ sepa_debit: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodOptionsSepaDebit" ] """ If this is a `sepa_debit` SetupIntent, this sub-hash contains details about the SEPA Debit payment method options. """ us_bank_account: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodOptionsUsBankAccount" ] """ If this is a `us_bank_account` SetupIntent, this sub-hash contains details about the US bank account payment method options. """ class UpdateParamsPaymentMethodOptionsAcssDebit(TypedDict): currency: NotRequired[Literal["cad", "usd"]] """ 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). """ mandate_options: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodOptionsAcssDebitMandateOptions" ] """ Additional fields for Mandate creation """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. """ class UpdateParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): custom_mandate_url: NotRequired["Literal['']|str"] """ A URL for custom mandate text to render during confirmation step. The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. """ default_for: NotRequired[List[Literal["invoice", "subscription"]]] """ List of Stripe products where this mandate can be selected automatically. """ interval_description: NotRequired[str] """ Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. """ payment_schedule: NotRequired[ Literal["combined", "interval", "sporadic"] ] """ Payment schedule for the mandate. """ transaction_type: NotRequired[Literal["business", "personal"]] """ Transaction type of the mandate. """ class UpdateParamsPaymentMethodOptionsAmazonPay(TypedDict): pass class UpdateParamsPaymentMethodOptionsCard(TypedDict): mandate_options: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodOptionsCardMandateOptions" ] """ Configuration options for setting up an eMandate for cards issued in India. """ moto: NotRequired[bool] """ When specified, this parameter signals that a card has been collected as MOTO (Mail Order Telephone Order) and thus out of scope for SCA. This parameter can only be provided during confirmation. """ network: NotRequired[ Literal[ "amex", "cartes_bancaires", "diners", "discover", "eftpos_au", "interac", "jcb", "mastercard", "unionpay", "unknown", "visa", ] ] """ Selected network to process this SetupIntent on. Depends on the available networks of the card attached to the SetupIntent. Can be only set confirm-time. """ request_three_d_secure: NotRequired[ Literal["any", "automatic", "challenge"] ] """ 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://stripe.com/docs/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://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ three_d_secure: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodOptionsCardThreeDSecure" ] """ If 3D Secure authentication was performed with a third-party provider, the authentication details to use for this setup. """ class UpdateParamsPaymentMethodOptionsCardMandateOptions(TypedDict): amount: int """ Amount to be charged for future payments. """ amount_type: Literal["fixed", "maximum"] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ currency: str """ Currency in which future payments will be charged. 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] """ A description of the mandate or subscription that is meant to be displayed to the customer. """ end_date: NotRequired[int] """ End date of the mandate or subscription. If not provided, the mandate will be active until canceled. If provided, end date should be after start date. """ interval: Literal["day", "month", "sporadic", "week", "year"] """ Specifies payment frequency. One of `day`, `week`, `month`, `year`, or `sporadic`. """ interval_count: NotRequired[int] """ The number of intervals between payments. For example, `interval=month` and `interval_count=3` indicates one payment every three months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). This parameter is optional when `interval=sporadic`. """ reference: str """ Unique identifier for the mandate or subscription. """ start_date: int """ Start date of the mandate or subscription. Start date should not be lesser than yesterday. """ supported_types: NotRequired[List[Literal["india"]]] """ Specifies the type of mandates supported. Possible values are `india`. """ class UpdateParamsPaymentMethodOptionsCardPresent(TypedDict): pass class UpdateParamsPaymentMethodOptionsCardThreeDSecure(TypedDict): ares_trans_status: NotRequired[ Literal["A", "C", "I", "N", "R", "U", "Y"] ] """ The `transStatus` returned from the card Issuer's ACS in the ARes. """ cryptogram: NotRequired[str] """ The cryptogram, also known as the "authentication value" (AAV, CAVV or AEVV). This value is 20 bytes, base64-encoded into a 28-character string. (Most 3D Secure providers will return the base64-encoded version, which is what you should specify here.) """ electronic_commerce_indicator: NotRequired[ Literal["01", "02", "05", "06", "07"] ] """ The Electronic Commerce Indicator (ECI) is returned by your 3D Secure provider and indicates what degree of authentication was performed. """ network_options: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions" ] """ Network specific 3DS fields. Network specific arguments require an explicit card brand choice. The parameter `payment_method_options.card.network`` must be populated accordingly """ requestor_challenge_indicator: NotRequired[str] """ The challenge indicator (`threeDSRequestorChallengeInd`) which was requested in the AReq sent to the card Issuer's ACS. A string containing 2 digits from 01-99. """ transaction_id: NotRequired[str] """ For 3D Secure 1, the XID. For 3D Secure 2, the Directory Server Transaction ID (dsTransID). """ version: NotRequired[Literal["1.0.2", "2.1.0", "2.2.0"]] """ The version of 3D Secure that was performed. """ class UpdateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptions( TypedDict, ): cartes_bancaires: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires" ] """ Cartes Bancaires-specific 3DS fields. """ class UpdateParamsPaymentMethodOptionsCardThreeDSecureNetworkOptionsCartesBancaires( TypedDict, ): cb_avalgo: Literal["0", "1", "2", "3", "4", "A"] """ The cryptogram calculation algorithm used by the card Issuer's ACS to calculate the Authentication cryptogram. Also known as `cavvAlgorithm`. messageExtension: CB-AVALGO """ cb_exemption: NotRequired[str] """ The exemption indicator returned from Cartes Bancaires in the ARes. message extension: CB-EXEMPTION; string (4 characters) This is a 3 byte bitmap (low significant byte first and most significant bit first) that has been Base64 encoded """ cb_score: NotRequired[int] """ The risk score returned from Cartes Bancaires in the ARes. message extension: CB-SCORE; numeric value 0-99 """ class UpdateParamsPaymentMethodOptionsLink(TypedDict): persistent_token: NotRequired[str] """ [Deprecated] This is a legacy parameter that no longer has any function. """ class UpdateParamsPaymentMethodOptionsPaypal(TypedDict): billing_agreement_id: NotRequired[str] """ The PayPal Billing Agreement ID (BAID). This is an ID generated by PayPal which represents the mandate between the merchant and the customer. """ class UpdateParamsPaymentMethodOptionsSepaDebit(TypedDict): mandate_options: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodOptionsSepaDebitMandateOptions" ] """ Additional fields for Mandate creation """ class UpdateParamsPaymentMethodOptionsSepaDebitMandateOptions(TypedDict): pass class UpdateParamsPaymentMethodOptionsUsBankAccount(TypedDict): financial_connections: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnections" ] """ Additional fields for Financial Connections Session creation """ mandate_options: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodOptionsUsBankAccountMandateOptions" ] """ Additional fields for Mandate creation """ networks: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodOptionsUsBankAccountNetworks" ] """ Additional fields for network related functions """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. """ class UpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): filters: NotRequired[ "SetupIntentService.UpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" ] """ Provide filters for the linked accounts that the customer can select for the payment method """ permissions: NotRequired[ List[ Literal[ "balances", "ownership", "payment_method", "transactions" ] ] ] """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ List[Literal["balances", "ownership", "transactions"]] ] """ List of data features that you would like to retrieve upon account creation. """ return_url: NotRequired[str] """ For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. """ class UpdateParamsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( TypedDict, ): account_subcategories: NotRequired[ List[Literal["checking", "savings"]] ] """ The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. """ class UpdateParamsPaymentMethodOptionsUsBankAccountMandateOptions( TypedDict, ): collection_method: NotRequired["Literal['']|Literal['paper']"] """ The method used to collect offline mandate customer acceptance. """ class UpdateParamsPaymentMethodOptionsUsBankAccountNetworks(TypedDict): requested: NotRequired[List[Literal["ach", "us_domestic_wire"]]] """ Triggers validations to run across the selected networks """ class VerifyMicrodepositsParams(TypedDict): amounts: NotRequired[List[int]] """ Two positive integers, in *cents*, equal to the values of the microdeposits sent to the bank account. """ descriptor_code: NotRequired[str] """ A six-character code starting with SM present in the microdeposit sent to the bank account. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def list( self, params: "SetupIntentService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[SetupIntent]: """ Returns a list of SetupIntents. """ return cast( ListObject[SetupIntent], self._request( "get", "/v1/setup_intents", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "SetupIntentService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[SetupIntent]: """ Returns a list of SetupIntents. """ return cast( ListObject[SetupIntent], await self._request_async( "get", "/v1/setup_intents", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "SetupIntentService.CreateParams" = {}, options: RequestOptions = {}, ) -> SetupIntent: """ Creates a SetupIntent object. After you create the SetupIntent, attach a payment method and [confirm](https://stripe.com/docs/api/setup_intents/confirm) it to collect any required permissions to charge the payment method later. """ return cast( SetupIntent, self._request( "post", "/v1/setup_intents", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "SetupIntentService.CreateParams" = {}, options: RequestOptions = {}, ) -> SetupIntent: """ Creates a SetupIntent object. After you create the SetupIntent, attach a payment method and [confirm](https://stripe.com/docs/api/setup_intents/confirm) it to collect any required permissions to charge the payment method later. """ return cast( SetupIntent, await self._request_async( "post", "/v1/setup_intents", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, intent: str, params: "SetupIntentService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> SetupIntent: """ Retrieves the details of a SetupIntent that has previously been created. Client-side retrieval using a publishable key is allowed when the client_secret is provided in the query string. When retrieved with a publishable key, only a subset of properties will be returned. Please refer to the [SetupIntent](https://stripe.com/docs/api#setup_intent_object) object reference for more details. """ return cast( SetupIntent, self._request( "get", "/v1/setup_intents/{intent}".format( intent=sanitize_id(intent) ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, intent: str, params: "SetupIntentService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> SetupIntent: """ Retrieves the details of a SetupIntent that has previously been created. Client-side retrieval using a publishable key is allowed when the client_secret is provided in the query string. When retrieved with a publishable key, only a subset of properties will be returned. Please refer to the [SetupIntent](https://stripe.com/docs/api#setup_intent_object) object reference for more details. """ return cast( SetupIntent, await self._request_async( "get", "/v1/setup_intents/{intent}".format( intent=sanitize_id(intent) ), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, intent: str, params: "SetupIntentService.UpdateParams" = {}, options: RequestOptions = {}, ) -> SetupIntent: """ Updates a SetupIntent object. """ return cast( SetupIntent, self._request( "post", "/v1/setup_intents/{intent}".format( intent=sanitize_id(intent) ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, intent: str, params: "SetupIntentService.UpdateParams" = {}, options: RequestOptions = {}, ) -> SetupIntent: """ Updates a SetupIntent object. """ return cast( SetupIntent, await self._request_async( "post", "/v1/setup_intents/{intent}".format( intent=sanitize_id(intent) ), api_mode="V1", base_address="api", params=params, options=options, ), ) def cancel( self, intent: str, params: "SetupIntentService.CancelParams" = {}, options: RequestOptions = {}, ) -> SetupIntent: """ You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action. After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. You can't cancel the SetupIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. """ return cast( SetupIntent, self._request( "post", "/v1/setup_intents/{intent}/cancel".format( intent=sanitize_id(intent), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def cancel_async( self, intent: str, params: "SetupIntentService.CancelParams" = {}, options: RequestOptions = {}, ) -> SetupIntent: """ You can cancel a SetupIntent object when it's in one of these statuses: requires_payment_method, requires_confirmation, or requires_action. After you cancel it, setup is abandoned and any operations on the SetupIntent fail with an error. You can't cancel the SetupIntent for a Checkout Session. [Expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. """ return cast( SetupIntent, await self._request_async( "post", "/v1/setup_intents/{intent}/cancel".format( intent=sanitize_id(intent), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def confirm( self, intent: str, params: "SetupIntentService.ConfirmParams" = {}, options: RequestOptions = {}, ) -> SetupIntent: """ Confirm that your customer intends to set up the current or provided payment method. For example, you would confirm a SetupIntent when a customer hits the “Save” button on a payment method management page on your website. If the selected payment method does not require any additional steps from the customer, the SetupIntent will transition to the succeeded status. Otherwise, it will transition to the requires_action status and suggest additional actions via next_action. If setup fails, the SetupIntent will transition to the requires_payment_method status or the canceled status if the confirmation limit is reached. """ return cast( SetupIntent, self._request( "post", "/v1/setup_intents/{intent}/confirm".format( intent=sanitize_id(intent), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def confirm_async( self, intent: str, params: "SetupIntentService.ConfirmParams" = {}, options: RequestOptions = {}, ) -> SetupIntent: """ Confirm that your customer intends to set up the current or provided payment method. For example, you would confirm a SetupIntent when a customer hits the “Save” button on a payment method management page on your website. If the selected payment method does not require any additional steps from the customer, the SetupIntent will transition to the succeeded status. Otherwise, it will transition to the requires_action status and suggest additional actions via next_action. If setup fails, the SetupIntent will transition to the requires_payment_method status or the canceled status if the confirmation limit is reached. """ return cast( SetupIntent, await self._request_async( "post", "/v1/setup_intents/{intent}/confirm".format( intent=sanitize_id(intent), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def verify_microdeposits( self, intent: str, params: "SetupIntentService.VerifyMicrodepositsParams" = {}, options: RequestOptions = {}, ) -> SetupIntent: """ Verifies microdeposits on a SetupIntent object. """ return cast( SetupIntent, self._request( "post", "/v1/setup_intents/{intent}/verify_microdeposits".format( intent=sanitize_id(intent), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def verify_microdeposits_async( self, intent: str, params: "SetupIntentService.VerifyMicrodepositsParams" = {}, options: RequestOptions = {}, ) -> SetupIntent: """ Verifies microdeposits on a SetupIntent object. """ return cast( SetupIntent, await self._request_async( "post", "/v1/setup_intents/{intent}/verify_microdeposits".format( intent=sanitize_id(intent), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_shipping_rate.py0000644000175100001770000004105214637354563017401 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import sanitize_id from typing import ClassVar, Dict, List, Optional, cast from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._tax_code import TaxCode class ShippingRate( CreateableAPIResource["ShippingRate"], ListableAPIResource["ShippingRate"], UpdateableAPIResource["ShippingRate"], ): """ Shipping rates describe the price of shipping presented to your customers and applied to a purchase. For more information, see [Charge for shipping](https://stripe.com/docs/payments/during-payment/charge-shipping). """ OBJECT_NAME: ClassVar[Literal["shipping_rate"]] = "shipping_rate" class DeliveryEstimate(StripeObject): class Maximum(StripeObject): unit: Literal["business_day", "day", "hour", "month", "week"] """ A unit of time. """ value: int """ Must be greater than 0. """ class Minimum(StripeObject): unit: Literal["business_day", "day", "hour", "month", "week"] """ A unit of time. """ value: int """ Must be greater than 0. """ maximum: Optional[Maximum] """ The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. """ minimum: Optional[Minimum] """ The lower bound of the estimated range. If empty, represents no lower bound. """ _inner_class_types = {"maximum": Maximum, "minimum": Minimum} class FixedAmount(StripeObject): class CurrencyOptions(StripeObject): amount: int """ A non-negative integer in cents representing how much to charge. """ tax_behavior: Literal["exclusive", "inclusive", "unspecified"] """ Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. """ amount: int """ A non-negative integer in cents representing how much to charge. """ 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). """ currency_options: Optional[Dict[str, CurrencyOptions]] """ Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ _inner_class_types = {"currency_options": CurrencyOptions} _inner_class_dicts = ["currency_options"] class CreateParams(RequestOptions): delivery_estimate: NotRequired[ "ShippingRate.CreateParamsDeliveryEstimate" ] """ The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions. """ display_name: str """ The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ fixed_amount: NotRequired["ShippingRate.CreateParamsFixedAmount"] """ Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. """ tax_code: NotRequired[str] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`. """ type: NotRequired[Literal["fixed_amount"]] """ The type of calculation to use on the shipping rate. """ class CreateParamsDeliveryEstimate(TypedDict): maximum: NotRequired[ "ShippingRate.CreateParamsDeliveryEstimateMaximum" ] """ The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. """ minimum: NotRequired[ "ShippingRate.CreateParamsDeliveryEstimateMinimum" ] """ The lower bound of the estimated range. If empty, represents no lower bound. """ class CreateParamsDeliveryEstimateMaximum(TypedDict): unit: Literal["business_day", "day", "hour", "month", "week"] """ A unit of time. """ value: int """ Must be greater than 0. """ class CreateParamsDeliveryEstimateMinimum(TypedDict): unit: Literal["business_day", "day", "hour", "month", "week"] """ A unit of time. """ value: int """ Must be greater than 0. """ class CreateParamsFixedAmount(TypedDict): amount: int """ A non-negative integer in cents representing how much to charge. """ 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). """ currency_options: NotRequired[ Dict[str, "ShippingRate.CreateParamsFixedAmountCurrencyOptions"] ] """ Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ class CreateParamsFixedAmountCurrencyOptions(TypedDict): amount: int """ A non-negative integer in cents representing how much to charge. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. """ class ListParams(RequestOptions): active: NotRequired[bool] """ Only return shipping rates that are active or inactive. """ created: NotRequired["ShippingRate.ListParamsCreated|int"] """ A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. """ currency: NotRequired[str] """ Only return shipping rates for the given currency. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): active: NotRequired[bool] """ Whether the shipping rate can be used for new purchases. Defaults to `true`. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ fixed_amount: NotRequired["ShippingRate.ModifyParamsFixedAmount"] """ Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. """ class ModifyParamsFixedAmount(TypedDict): currency_options: NotRequired[ Dict[str, "ShippingRate.ModifyParamsFixedAmountCurrencyOptions"] ] """ Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ class ModifyParamsFixedAmountCurrencyOptions(TypedDict): amount: NotRequired[int] """ A non-negative integer in cents representing how much to charge. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ active: bool """ Whether the shipping rate can be used for new purchases. Defaults to `true`. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ delivery_estimate: Optional[DeliveryEstimate] """ The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions. """ display_name: Optional[str] """ The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions. """ fixed_amount: Optional[FixedAmount] id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ metadata: Dict[str, str] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ object: Literal["shipping_rate"] """ String representing the object's type. Objects of the same type share the same value. """ tax_behavior: Optional[Literal["exclusive", "inclusive", "unspecified"]] """ Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. """ tax_code: Optional[ExpandableField["TaxCode"]] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`. """ type: Literal["fixed_amount"] """ The type of calculation to use on the shipping rate. """ @classmethod def create( cls, **params: Unpack["ShippingRate.CreateParams"] ) -> "ShippingRate": """ Creates a new shipping rate object. """ return cast( "ShippingRate", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["ShippingRate.CreateParams"] ) -> "ShippingRate": """ Creates a new shipping rate object. """ return cast( "ShippingRate", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def list( cls, **params: Unpack["ShippingRate.ListParams"] ) -> ListObject["ShippingRate"]: """ Returns a list of your shipping rates. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["ShippingRate.ListParams"] ) -> ListObject["ShippingRate"]: """ Returns a list of your shipping rates. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def modify( cls, id: str, **params: Unpack["ShippingRate.ModifyParams"] ) -> "ShippingRate": """ Updates an existing shipping rate object. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "ShippingRate", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["ShippingRate.ModifyParams"] ) -> "ShippingRate": """ Updates an existing shipping rate object. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "ShippingRate", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["ShippingRate.RetrieveParams"] ) -> "ShippingRate": """ Returns the shipping rate object with the given ID. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["ShippingRate.RetrieveParams"] ) -> "ShippingRate": """ Returns the shipping rate object with the given ID. """ instance = cls(id, **params) await instance.refresh_async() return instance _inner_class_types = { "delivery_estimate": DeliveryEstimate, "fixed_amount": FixedAmount, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_shipping_rate_service.py0000644000175100001770000003272414637354563021127 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._shipping_rate import ShippingRate from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class ShippingRateService(StripeService): class CreateParams(TypedDict): delivery_estimate: NotRequired[ "ShippingRateService.CreateParamsDeliveryEstimate" ] """ The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions. """ display_name: str """ The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ fixed_amount: NotRequired[ "ShippingRateService.CreateParamsFixedAmount" ] """ Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. """ tax_code: NotRequired[str] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`. """ type: NotRequired[Literal["fixed_amount"]] """ The type of calculation to use on the shipping rate. """ class CreateParamsDeliveryEstimate(TypedDict): maximum: NotRequired[ "ShippingRateService.CreateParamsDeliveryEstimateMaximum" ] """ The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. """ minimum: NotRequired[ "ShippingRateService.CreateParamsDeliveryEstimateMinimum" ] """ The lower bound of the estimated range. If empty, represents no lower bound. """ class CreateParamsDeliveryEstimateMaximum(TypedDict): unit: Literal["business_day", "day", "hour", "month", "week"] """ A unit of time. """ value: int """ Must be greater than 0. """ class CreateParamsDeliveryEstimateMinimum(TypedDict): unit: Literal["business_day", "day", "hour", "month", "week"] """ A unit of time. """ value: int """ Must be greater than 0. """ class CreateParamsFixedAmount(TypedDict): amount: int """ A non-negative integer in cents representing how much to charge. """ 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). """ currency_options: NotRequired[ Dict[ str, "ShippingRateService.CreateParamsFixedAmountCurrencyOptions", ] ] """ Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ class CreateParamsFixedAmountCurrencyOptions(TypedDict): amount: int """ A non-negative integer in cents representing how much to charge. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. """ class ListParams(TypedDict): active: NotRequired[bool] """ Only return shipping rates that are active or inactive. """ created: NotRequired["ShippingRateService.ListParamsCreated|int"] """ A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. """ currency: NotRequired[str] """ Only return shipping rates for the given currency. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): active: NotRequired[bool] """ Whether the shipping rate can be used for new purchases. Defaults to `true`. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ fixed_amount: NotRequired[ "ShippingRateService.UpdateParamsFixedAmount" ] """ Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. """ class UpdateParamsFixedAmount(TypedDict): currency_options: NotRequired[ Dict[ str, "ShippingRateService.UpdateParamsFixedAmountCurrencyOptions", ] ] """ Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ class UpdateParamsFixedAmountCurrencyOptions(TypedDict): amount: NotRequired[int] """ A non-negative integer in cents representing how much to charge. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. """ def list( self, params: "ShippingRateService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[ShippingRate]: """ Returns a list of your shipping rates. """ return cast( ListObject[ShippingRate], self._request( "get", "/v1/shipping_rates", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "ShippingRateService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[ShippingRate]: """ Returns a list of your shipping rates. """ return cast( ListObject[ShippingRate], await self._request_async( "get", "/v1/shipping_rates", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "ShippingRateService.CreateParams", options: RequestOptions = {}, ) -> ShippingRate: """ Creates a new shipping rate object. """ return cast( ShippingRate, self._request( "post", "/v1/shipping_rates", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "ShippingRateService.CreateParams", options: RequestOptions = {}, ) -> ShippingRate: """ Creates a new shipping rate object. """ return cast( ShippingRate, await self._request_async( "post", "/v1/shipping_rates", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, shipping_rate_token: str, params: "ShippingRateService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> ShippingRate: """ Returns the shipping rate object with the given ID. """ return cast( ShippingRate, self._request( "get", "/v1/shipping_rates/{shipping_rate_token}".format( shipping_rate_token=sanitize_id(shipping_rate_token), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, shipping_rate_token: str, params: "ShippingRateService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> ShippingRate: """ Returns the shipping rate object with the given ID. """ return cast( ShippingRate, await self._request_async( "get", "/v1/shipping_rates/{shipping_rate_token}".format( shipping_rate_token=sanitize_id(shipping_rate_token), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, shipping_rate_token: str, params: "ShippingRateService.UpdateParams" = {}, options: RequestOptions = {}, ) -> ShippingRate: """ Updates an existing shipping rate object. """ return cast( ShippingRate, self._request( "post", "/v1/shipping_rates/{shipping_rate_token}".format( shipping_rate_token=sanitize_id(shipping_rate_token), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, shipping_rate_token: str, params: "ShippingRateService.UpdateParams" = {}, options: RequestOptions = {}, ) -> ShippingRate: """ Updates an existing shipping rate object. """ return cast( ShippingRate, await self._request_async( "post", "/v1/shipping_rates/{shipping_rate_token}".format( shipping_rate_token=sanitize_id(shipping_rate_token), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_sigma_service.py0000644000175100001770000000057114637354563017366 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_service import StripeService from stripe.sigma._scheduled_query_run_service import ScheduledQueryRunService class SigmaService(StripeService): def __init__(self, requestor): super().__init__(requestor) self.scheduled_query_runs = ScheduledQueryRunService(self._requestor) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_singleton_api_resource.py0000644000175100001770000000173714637354563021315 0ustar00runnerdockerfrom stripe._api_resource import APIResource from typing import TypeVar from stripe._stripe_object import StripeObject T = TypeVar("T", bound=StripeObject) # TODO(major): 1704 - Inline into Tax.Settings and Balance, and remove this class. class SingletonAPIResource(APIResource[T]): @classmethod def retrieve(cls, **params) -> T: return super(SingletonAPIResource, cls).retrieve(None, **params) @classmethod def class_url(cls): if cls == SingletonAPIResource: raise NotImplementedError( "SingletonAPIResource is an abstract class. You should " "perform actions on its subclasses (e.g. Balance)" ) # Namespaces are separated in object names with periods (.) and in URLs # with forward slashes (/), so replace the former with the latter. base = cls.OBJECT_NAME.replace(".", "/") return "/v1/%s" % (base,) def instance_url(self): return self.class_url() ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_source.py0000644000175100001770000015400614637354563016051 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._customer import Customer from stripe._error import InvalidRequestError from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._source_transaction import SourceTransaction class Source(CreateableAPIResource["Source"], UpdateableAPIResource["Source"]): """ `Source` objects allow you to accept a variety of payment methods. They represent a customer's payment instrument, and can be used with the Stripe API just like a `Card` object: once chargeable, they can be charged, or can be attached to customers. Stripe doesn't recommend using the deprecated [Sources API](https://stripe.com/docs/api/sources). We recommend that you adopt the [PaymentMethods API](https://stripe.com/docs/api/payment_methods). This newer API provides access to our latest features and payment method types. Related guides: [Sources API](https://stripe.com/docs/sources) and [Sources & Customers](https://stripe.com/docs/sources/customers). """ OBJECT_NAME: ClassVar[Literal["source"]] = "source" class AchCreditTransfer(StripeObject): account_number: Optional[str] bank_name: Optional[str] fingerprint: Optional[str] refund_account_holder_name: Optional[str] refund_account_holder_type: Optional[str] refund_routing_number: Optional[str] routing_number: Optional[str] swift_code: Optional[str] class AchDebit(StripeObject): bank_name: Optional[str] country: Optional[str] fingerprint: Optional[str] last4: Optional[str] routing_number: Optional[str] type: Optional[str] class AcssDebit(StripeObject): bank_address_city: Optional[str] bank_address_line_1: Optional[str] bank_address_line_2: Optional[str] bank_address_postal_code: Optional[str] bank_name: Optional[str] category: Optional[str] country: Optional[str] fingerprint: Optional[str] last4: Optional[str] routing_number: Optional[str] class Alipay(StripeObject): data_string: Optional[str] native_url: Optional[str] statement_descriptor: Optional[str] class AuBecsDebit(StripeObject): bsb_number: Optional[str] fingerprint: Optional[str] last4: Optional[str] class Bancontact(StripeObject): bank_code: Optional[str] bank_name: Optional[str] bic: Optional[str] iban_last4: Optional[str] preferred_language: Optional[str] statement_descriptor: Optional[str] class Card(StripeObject): address_line1_check: Optional[str] address_zip_check: Optional[str] brand: Optional[str] country: Optional[str] cvc_check: Optional[str] description: Optional[str] dynamic_last4: Optional[str] exp_month: Optional[int] exp_year: Optional[int] fingerprint: Optional[str] funding: Optional[str] iin: Optional[str] issuer: Optional[str] last4: Optional[str] name: Optional[str] three_d_secure: Optional[str] tokenization_method: Optional[str] class CardPresent(StripeObject): application_cryptogram: Optional[str] application_preferred_name: Optional[str] authorization_code: Optional[str] authorization_response_code: Optional[str] brand: Optional[str] country: Optional[str] cvm_type: Optional[str] data_type: Optional[str] dedicated_file_name: Optional[str] description: Optional[str] emv_auth_data: Optional[str] evidence_customer_signature: Optional[str] evidence_transaction_certificate: Optional[str] exp_month: Optional[int] exp_year: Optional[int] fingerprint: Optional[str] funding: Optional[str] iin: Optional[str] issuer: Optional[str] last4: Optional[str] pos_device_id: Optional[str] pos_entry_mode: Optional[str] read_method: Optional[str] reader: Optional[str] terminal_verification_results: Optional[str] transaction_status_information: Optional[str] class CodeVerification(StripeObject): attempts_remaining: int """ The number of attempts remaining to authenticate the source object with a verification code. """ status: str """ The status of the code verification, either `pending` (awaiting verification, `attempts_remaining` should be greater than 0), `succeeded` (successful verification) or `failed` (failed verification, cannot be verified anymore as `attempts_remaining` should be 0). """ class Eps(StripeObject): reference: Optional[str] statement_descriptor: Optional[str] class Giropay(StripeObject): bank_code: Optional[str] bank_name: Optional[str] bic: Optional[str] statement_descriptor: Optional[str] class Ideal(StripeObject): bank: Optional[str] bic: Optional[str] iban_last4: Optional[str] statement_descriptor: Optional[str] class Klarna(StripeObject): background_image_url: Optional[str] client_token: Optional[str] first_name: Optional[str] last_name: Optional[str] locale: Optional[str] logo_url: Optional[str] page_title: Optional[str] pay_later_asset_urls_descriptive: Optional[str] pay_later_asset_urls_standard: Optional[str] pay_later_name: Optional[str] pay_later_redirect_url: Optional[str] pay_now_asset_urls_descriptive: Optional[str] pay_now_asset_urls_standard: Optional[str] pay_now_name: Optional[str] pay_now_redirect_url: Optional[str] pay_over_time_asset_urls_descriptive: Optional[str] pay_over_time_asset_urls_standard: Optional[str] pay_over_time_name: Optional[str] pay_over_time_redirect_url: Optional[str] payment_method_categories: Optional[str] purchase_country: Optional[str] purchase_type: Optional[str] redirect_url: Optional[str] shipping_delay: Optional[int] shipping_first_name: Optional[str] shipping_last_name: Optional[str] class Multibanco(StripeObject): entity: Optional[str] reference: Optional[str] refund_account_holder_address_city: Optional[str] refund_account_holder_address_country: Optional[str] refund_account_holder_address_line1: Optional[str] refund_account_holder_address_line2: Optional[str] refund_account_holder_address_postal_code: Optional[str] refund_account_holder_address_state: Optional[str] refund_account_holder_name: Optional[str] refund_iban: Optional[str] class Owner(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 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State, county, province, or region. """ class VerifiedAddress(StripeObject): city: Optional[str] """ City, district, suburb, town, or village. """ country: Optional[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: Optional[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State, county, province, or region. """ address: Optional[Address] """ Owner's address. """ email: Optional[str] """ Owner's email address. """ name: Optional[str] """ Owner's full name. """ phone: Optional[str] """ Owner's phone number (including extension). """ verified_address: Optional[VerifiedAddress] """ Verified owner's address. Verified values are verified or provided by the payment method directly (and if supported) at the time of authorization or settlement. They cannot be set or mutated. """ verified_email: Optional[str] """ Verified owner's email address. Verified values are verified or provided by the payment method directly (and if supported) at the time of authorization or settlement. They cannot be set or mutated. """ verified_name: Optional[str] """ Verified owner's full name. Verified values are verified or provided by the payment method directly (and if supported) at the time of authorization or settlement. They cannot be set or mutated. """ verified_phone: Optional[str] """ Verified owner's phone number (including extension). Verified values are verified or provided by the payment method directly (and if supported) at the time of authorization or settlement. They cannot be set or mutated. """ _inner_class_types = { "address": Address, "verified_address": VerifiedAddress, } class P24(StripeObject): reference: Optional[str] class Receiver(StripeObject): address: Optional[str] """ The address of the receiver source. This is the value that should be communicated to the customer to send their funds to. """ amount_charged: int """ The total amount that was moved to your balance. This is almost always equal to the amount charged. In rare cases when customers deposit excess funds and we are unable to refund those, those funds get moved to your balance and show up in amount_charged as well. The amount charged is expressed in the source's currency. """ amount_received: int """ The total amount received by the receiver source. `amount_received = amount_returned + amount_charged` should be true for consumed sources unless customers deposit excess funds. The amount received is expressed in the source's currency. """ amount_returned: int """ The total amount that was returned to the customer. The amount returned is expressed in the source's currency. """ refund_attributes_method: str """ Type of refund attribute method, one of `email`, `manual`, or `none`. """ refund_attributes_status: str """ Type of refund attribute status, one of `missing`, `requested`, or `available`. """ class Redirect(StripeObject): failure_reason: Optional[str] """ The failure reason for the redirect, either `user_abort` (the customer aborted or dropped out of the redirect flow), `declined` (the authentication failed or the transaction was declined), or `processing_error` (the redirect failed due to a technical error). Present only if the redirect status is `failed`. """ return_url: str """ The URL you provide to redirect the customer to after they authenticated their payment. """ status: str """ The status of the redirect, either `pending` (ready to be used by your customer to authenticate the transaction), `succeeded` (succesful authentication, cannot be reused) or `not_required` (redirect should not be used) or `failed` (failed authentication, cannot be reused). """ url: str """ The URL provided to you to redirect a customer to as part of a `redirect` authentication flow. """ class SepaCreditTransfer(StripeObject): bank_name: Optional[str] bic: Optional[str] iban: Optional[str] refund_account_holder_address_city: Optional[str] refund_account_holder_address_country: Optional[str] refund_account_holder_address_line1: Optional[str] refund_account_holder_address_line2: Optional[str] refund_account_holder_address_postal_code: Optional[str] refund_account_holder_address_state: Optional[str] refund_account_holder_name: Optional[str] refund_iban: Optional[str] class SepaDebit(StripeObject): bank_code: Optional[str] branch_code: Optional[str] country: Optional[str] fingerprint: Optional[str] last4: Optional[str] mandate_reference: Optional[str] mandate_url: Optional[str] class Sofort(StripeObject): bank_code: Optional[str] bank_name: Optional[str] bic: Optional[str] country: Optional[str] iban_last4: Optional[str] preferred_language: Optional[str] statement_descriptor: Optional[str] class SourceOrder(StripeObject): class Item(StripeObject): amount: Optional[int] """ The amount (price) for this order item. """ currency: Optional[str] """ This currency of this order item. Required when `amount` is present. """ description: Optional[str] """ Human-readable description for this order item. """ parent: Optional[str] """ The ID of the associated object for this line item. Expandable if not null (e.g., expandable to a SKU). """ quantity: Optional[int] """ The quantity of this order item. When type is `sku`, this is the number of instances of the SKU to be ordered. """ type: Optional[str] """ The type of this order item. Must be `sku`, `tax`, or `shipping`. """ class Shipping(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 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State, county, province, or region. """ address: Optional[Address] carrier: Optional[str] """ The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. """ name: Optional[str] """ Recipient name. """ phone: Optional[str] """ Recipient phone (including extension). """ tracking_number: Optional[str] """ The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ _inner_class_types = {"address": Address} amount: int """ A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount for the order. """ 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). """ email: Optional[str] """ The email address of the customer placing the order. """ items: Optional[List[Item]] """ List of items constituting the order. """ shipping: Optional[Shipping] _inner_class_types = {"items": Item, "shipping": Shipping} class ThreeDSecure(StripeObject): address_line1_check: Optional[str] address_zip_check: Optional[str] authenticated: Optional[bool] brand: Optional[str] card: Optional[str] country: Optional[str] customer: Optional[str] cvc_check: Optional[str] description: Optional[str] dynamic_last4: Optional[str] exp_month: Optional[int] exp_year: Optional[int] fingerprint: Optional[str] funding: Optional[str] iin: Optional[str] issuer: Optional[str] last4: Optional[str] name: Optional[str] three_d_secure: Optional[str] tokenization_method: Optional[str] class Wechat(StripeObject): prepay_id: Optional[str] qr_code_url: Optional[str] statement_descriptor: Optional[str] class CreateParams(RequestOptions): amount: NotRequired[int] """ Amount associated with the source. This is the amount for which the source will be chargeable once ready. Required for `single_use` sources. Not supported for `receiver` type sources, where charge amount may not be specified until funds land. """ currency: NotRequired[str] """ Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) associated with the source. This is the currency for which the source will be chargeable once ready. """ customer: NotRequired[str] """ The `Customer` to whom the original source is attached to. Must be set when the original source is not a `Source` (e.g., `Card`). """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ flow: NotRequired[ Literal["code_verification", "none", "receiver", "redirect"] ] """ The authentication `flow` of the source to create. `flow` is one of `redirect`, `receiver`, `code_verification`, `none`. It is generally inferred unless a type supports multiple flows. """ mandate: NotRequired["Source.CreateParamsMandate"] """ Information about a mandate possibility attached to a source object (generally for bank debits) as well as its acceptance status. """ metadata: NotRequired[Dict[str, str]] original_source: NotRequired[str] """ The source to share. """ owner: NotRequired["Source.CreateParamsOwner"] """ Information about the owner of the payment instrument that may be used or required by particular source types. """ receiver: NotRequired["Source.CreateParamsReceiver"] """ Optional parameters for the receiver flow. Can be set only if the source is a receiver (`flow` is `receiver`). """ redirect: NotRequired["Source.CreateParamsRedirect"] """ Parameters required for the redirect flow. Required if the source is authenticated by a redirect (`flow` is `redirect`). """ source_order: NotRequired["Source.CreateParamsSourceOrder"] """ Information about the items and shipping associated with the source. Required for transactional credit (for example Klarna) sources before you can charge it. """ statement_descriptor: NotRequired[str] """ An arbitrary string to be displayed on your customer's statement. As an example, if your website is `RunClub` and the item you're charging for is a race ticket, you may want to specify a `statement_descriptor` of `RunClub 5K race ticket.` While many payment types will display this information, some may not display it at all. """ token: NotRequired[str] """ An optional token used to create the source. When passed, token properties will override source parameters. """ type: NotRequired[str] """ The `type` of the source to create. Required unless `customer` and `original_source` are specified (see the [Cloning card Sources](https://stripe.com/docs/sources/connect#cloning-card-sources) guide) """ usage: NotRequired[Literal["reusable", "single_use"]] class CreateParamsMandate(TypedDict): acceptance: NotRequired["Source.CreateParamsMandateAcceptance"] """ The parameters required to notify Stripe of a mandate acceptance or refusal by the customer. """ amount: NotRequired["Literal['']|int"] """ The amount specified by the mandate. (Leave null for a mandate covering all amounts) """ currency: NotRequired[str] """ The currency specified by the mandate. (Must match `currency` of the source) """ interval: NotRequired[Literal["one_time", "scheduled", "variable"]] """ The interval of debits permitted by the mandate. Either `one_time` (just permitting a single debit), `scheduled` (with debits on an agreed schedule or for clearly-defined events), or `variable`(for debits with any frequency) """ notification_method: NotRequired[ Literal[ "deprecated_none", "email", "manual", "none", "stripe_email" ] ] """ The method Stripe should use to notify the customer of upcoming debit instructions and/or mandate confirmation as required by the underlying debit network. Either `email` (an email is sent directly to the customer), `manual` (a `source.mandate_notification` event is sent to your webhooks endpoint and you should handle the notification) or `none` (the underlying debit network does not require any notification). """ class CreateParamsMandateAcceptance(TypedDict): date: NotRequired[int] """ The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer. """ ip: NotRequired[str] """ The IP address from which the mandate was accepted or refused by the customer. """ offline: NotRequired["Source.CreateParamsMandateAcceptanceOffline"] """ The parameters required to store a mandate accepted offline. Should only be set if `mandate[type]` is `offline` """ online: NotRequired["Source.CreateParamsMandateAcceptanceOnline"] """ The parameters required to store a mandate accepted online. Should only be set if `mandate[type]` is `online` """ status: Literal["accepted", "pending", "refused", "revoked"] """ The status of the mandate acceptance. Either `accepted` (the mandate was accepted) or `refused` (the mandate was refused). """ type: NotRequired[Literal["offline", "online"]] """ The type of acceptance information included with the mandate. Either `online` or `offline` """ user_agent: NotRequired[str] """ The user agent of the browser from which the mandate was accepted or refused by the customer. """ class CreateParamsMandateAcceptanceOffline(TypedDict): contact_email: str """ An email to contact you with if a copy of the mandate is requested, required if `type` is `offline`. """ class CreateParamsMandateAcceptanceOnline(TypedDict): date: NotRequired[int] """ The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer. """ ip: NotRequired[str] """ The IP address from which the mandate was accepted or refused by the customer. """ user_agent: NotRequired[str] """ The user agent of the browser from which the mandate was accepted or refused by the customer. """ class CreateParamsOwner(TypedDict): address: NotRequired["Source.CreateParamsOwnerAddress"] """ Owner's address. """ email: NotRequired[str] """ Owner's email address. """ name: NotRequired[str] """ Owner's full name. """ phone: NotRequired[str] """ Owner's phone number. """ class CreateParamsOwnerAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsReceiver(TypedDict): refund_attributes_method: NotRequired[ Literal["email", "manual", "none"] ] """ The method Stripe should use to request information needed to process a refund or mispayment. Either `email` (an email is sent directly to the customer) or `manual` (a `source.refund_attributes_required` event is sent to your webhooks endpoint). Refer to each payment method's documentation to learn which refund attributes may be required. """ class CreateParamsRedirect(TypedDict): return_url: str """ The URL you provide to redirect the customer back to you after they authenticated their payment. It can use your application URI scheme in the context of a mobile application. """ class CreateParamsSourceOrder(TypedDict): items: NotRequired[List["Source.CreateParamsSourceOrderItem"]] """ List of items constituting the order. """ shipping: NotRequired["Source.CreateParamsSourceOrderShipping"] """ Shipping address for the order. Required if any of the SKUs are for products that have `shippable` set to true. """ class CreateParamsSourceOrderItem(TypedDict): amount: NotRequired[int] currency: NotRequired[str] description: NotRequired[str] parent: NotRequired[str] """ The ID of the SKU being ordered. """ quantity: NotRequired[int] """ The quantity of this order item. When type is `sku`, this is the number of instances of the SKU to be ordered. """ type: NotRequired[Literal["discount", "shipping", "sku", "tax"]] class CreateParamsSourceOrderShipping(TypedDict): address: "Source.CreateParamsSourceOrderShippingAddress" """ Shipping address. """ carrier: NotRequired[str] """ The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. """ name: NotRequired[str] """ Recipient name. """ phone: NotRequired[str] """ Recipient phone (including extension). """ tracking_number: NotRequired[str] """ The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ class CreateParamsSourceOrderShippingAddress(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: str """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class ListSourceTransactionsParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ModifyParams(RequestOptions): amount: NotRequired[int] """ Amount associated with the source. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ mandate: NotRequired["Source.ModifyParamsMandate"] """ Information about a mandate possibility attached to a source object (generally for bank debits) as well as its acceptance status. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ owner: NotRequired["Source.ModifyParamsOwner"] """ Information about the owner of the payment instrument that may be used or required by particular source types. """ source_order: NotRequired["Source.ModifyParamsSourceOrder"] """ Information about the items and shipping associated with the source. Required for transactional credit (for example Klarna) sources before you can charge it. """ class ModifyParamsMandate(TypedDict): acceptance: NotRequired["Source.ModifyParamsMandateAcceptance"] """ The parameters required to notify Stripe of a mandate acceptance or refusal by the customer. """ amount: NotRequired["Literal['']|int"] """ The amount specified by the mandate. (Leave null for a mandate covering all amounts) """ currency: NotRequired[str] """ The currency specified by the mandate. (Must match `currency` of the source) """ interval: NotRequired[Literal["one_time", "scheduled", "variable"]] """ The interval of debits permitted by the mandate. Either `one_time` (just permitting a single debit), `scheduled` (with debits on an agreed schedule or for clearly-defined events), or `variable`(for debits with any frequency) """ notification_method: NotRequired[ Literal[ "deprecated_none", "email", "manual", "none", "stripe_email" ] ] """ The method Stripe should use to notify the customer of upcoming debit instructions and/or mandate confirmation as required by the underlying debit network. Either `email` (an email is sent directly to the customer), `manual` (a `source.mandate_notification` event is sent to your webhooks endpoint and you should handle the notification) or `none` (the underlying debit network does not require any notification). """ class ModifyParamsMandateAcceptance(TypedDict): date: NotRequired[int] """ The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer. """ ip: NotRequired[str] """ The IP address from which the mandate was accepted or refused by the customer. """ offline: NotRequired["Source.ModifyParamsMandateAcceptanceOffline"] """ The parameters required to store a mandate accepted offline. Should only be set if `mandate[type]` is `offline` """ online: NotRequired["Source.ModifyParamsMandateAcceptanceOnline"] """ The parameters required to store a mandate accepted online. Should only be set if `mandate[type]` is `online` """ status: Literal["accepted", "pending", "refused", "revoked"] """ The status of the mandate acceptance. Either `accepted` (the mandate was accepted) or `refused` (the mandate was refused). """ type: NotRequired[Literal["offline", "online"]] """ The type of acceptance information included with the mandate. Either `online` or `offline` """ user_agent: NotRequired[str] """ The user agent of the browser from which the mandate was accepted or refused by the customer. """ class ModifyParamsMandateAcceptanceOffline(TypedDict): contact_email: str """ An email to contact you with if a copy of the mandate is requested, required if `type` is `offline`. """ class ModifyParamsMandateAcceptanceOnline(TypedDict): date: NotRequired[int] """ The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer. """ ip: NotRequired[str] """ The IP address from which the mandate was accepted or refused by the customer. """ user_agent: NotRequired[str] """ The user agent of the browser from which the mandate was accepted or refused by the customer. """ class ModifyParamsOwner(TypedDict): address: NotRequired["Source.ModifyParamsOwnerAddress"] """ Owner's address. """ email: NotRequired[str] """ Owner's email address. """ name: NotRequired[str] """ Owner's full name. """ phone: NotRequired[str] """ Owner's phone number. """ class ModifyParamsOwnerAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class ModifyParamsSourceOrder(TypedDict): items: NotRequired[List["Source.ModifyParamsSourceOrderItem"]] """ List of items constituting the order. """ shipping: NotRequired["Source.ModifyParamsSourceOrderShipping"] """ Shipping address for the order. Required if any of the SKUs are for products that have `shippable` set to true. """ class ModifyParamsSourceOrderItem(TypedDict): amount: NotRequired[int] currency: NotRequired[str] description: NotRequired[str] parent: NotRequired[str] """ The ID of the SKU being ordered. """ quantity: NotRequired[int] """ The quantity of this order item. When type is `sku`, this is the number of instances of the SKU to be ordered. """ type: NotRequired[Literal["discount", "shipping", "sku", "tax"]] class ModifyParamsSourceOrderShipping(TypedDict): address: "Source.ModifyParamsSourceOrderShippingAddress" """ Shipping address. """ carrier: NotRequired[str] """ The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. """ name: NotRequired[str] """ Recipient name. """ phone: NotRequired[str] """ Recipient phone (including extension). """ tracking_number: NotRequired[str] """ The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ class ModifyParamsSourceOrderShippingAddress(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: str """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class RetrieveParams(RequestOptions): client_secret: NotRequired[str] """ The client secret of the source. Required if a publishable key is used to retrieve the source. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class VerifyParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ values: List[str] """ The values needed to verify the source. """ ach_credit_transfer: Optional[AchCreditTransfer] ach_debit: Optional[AchDebit] acss_debit: Optional[AcssDebit] alipay: Optional[Alipay] amount: Optional[int] """ A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the total amount associated with the source. This is the amount for which the source will be chargeable once ready. Required for `single_use` sources. """ au_becs_debit: Optional[AuBecsDebit] bancontact: Optional[Bancontact] card: Optional[Card] card_present: Optional[CardPresent] client_secret: str """ The client secret of the source. Used for client-side retrieval using a publishable key. """ code_verification: Optional[CodeVerification] created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ currency: Optional[str] """ Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) associated with the source. This is the currency for which the source will be chargeable once ready. Required for `single_use` sources. """ customer: Optional[str] """ The ID of the customer to which this source is attached. This will not be present when the source has not been attached to a customer. """ eps: Optional[Eps] flow: str """ The authentication `flow` of the source. `flow` is one of `redirect`, `receiver`, `code_verification`, `none`. """ giropay: Optional[Giropay] id: str """ Unique identifier for the object. """ ideal: Optional[Ideal] klarna: Optional[Klarna] livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ metadata: Optional[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ multibanco: Optional[Multibanco] object: Literal["source"] """ String representing the object's type. Objects of the same type share the same value. """ owner: Optional[Owner] """ Information about the owner of the payment instrument that may be used or required by particular source types. """ p24: Optional[P24] receiver: Optional[Receiver] redirect: Optional[Redirect] sepa_credit_transfer: Optional[SepaCreditTransfer] sepa_debit: Optional[SepaDebit] sofort: Optional[Sofort] source_order: Optional[SourceOrder] statement_descriptor: Optional[str] """ Extra information about a source. This will appear on your customer's statement every time you charge the source. """ status: str """ The status of the source, one of `canceled`, `chargeable`, `consumed`, `failed`, or `pending`. Only `chargeable` sources can be used to create a charge. """ three_d_secure: Optional[ThreeDSecure] type: Literal[ "ach_credit_transfer", "ach_debit", "acss_debit", "alipay", "au_becs_debit", "bancontact", "card", "card_present", "eps", "giropay", "ideal", "klarna", "multibanco", "p24", "sepa_credit_transfer", "sepa_debit", "sofort", "three_d_secure", "wechat", ] """ The `type` of the source. The `type` is a payment method, one of `ach_credit_transfer`, `ach_debit`, `alipay`, `bancontact`, `card`, `card_present`, `eps`, `giropay`, `ideal`, `multibanco`, `klarna`, `p24`, `sepa_debit`, `sofort`, `three_d_secure`, or `wechat`. An additional hash is included on the source with a name matching this value. It contains additional information specific to the [payment method](https://stripe.com/docs/sources) used. """ usage: Optional[str] """ Either `reusable` or `single_use`. Whether this source should be reusable or not. Some source types may or may not be reusable by construction, while others may leave the option at creation. If an incompatible value is passed, an error will be returned. """ wechat: Optional[Wechat] @classmethod def create(cls, **params: Unpack["Source.CreateParams"]) -> "Source": """ Creates a new source object. """ return cast( "Source", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["Source.CreateParams"] ) -> "Source": """ Creates a new source object. """ return cast( "Source", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def _cls_list_source_transactions( cls, source: str, **params: Unpack["Source.ListSourceTransactionsParams"], ) -> ListObject["SourceTransaction"]: """ List source transactions for a given source. """ return cast( ListObject["SourceTransaction"], cls._static_request( "get", "/v1/sources/{source}/source_transactions".format( source=sanitize_id(source) ), params=params, ), ) @overload @staticmethod def list_source_transactions( source: str, **params: Unpack["Source.ListSourceTransactionsParams"] ) -> ListObject["SourceTransaction"]: """ List source transactions for a given source. """ ... @overload def list_source_transactions( self, **params: Unpack["Source.ListSourceTransactionsParams"] ) -> ListObject["SourceTransaction"]: """ List source transactions for a given source. """ ... @class_method_variant("_cls_list_source_transactions") def list_source_transactions( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Source.ListSourceTransactionsParams"] ) -> ListObject["SourceTransaction"]: """ List source transactions for a given source. """ return cast( ListObject["SourceTransaction"], self._request( "get", "/v1/sources/{source}/source_transactions".format( source=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_list_source_transactions_async( cls, source: str, **params: Unpack["Source.ListSourceTransactionsParams"], ) -> ListObject["SourceTransaction"]: """ List source transactions for a given source. """ return cast( ListObject["SourceTransaction"], await cls._static_request_async( "get", "/v1/sources/{source}/source_transactions".format( source=sanitize_id(source) ), params=params, ), ) @overload @staticmethod async def list_source_transactions_async( source: str, **params: Unpack["Source.ListSourceTransactionsParams"] ) -> ListObject["SourceTransaction"]: """ List source transactions for a given source. """ ... @overload async def list_source_transactions_async( self, **params: Unpack["Source.ListSourceTransactionsParams"] ) -> ListObject["SourceTransaction"]: """ List source transactions for a given source. """ ... @class_method_variant("_cls_list_source_transactions_async") async def list_source_transactions_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Source.ListSourceTransactionsParams"] ) -> ListObject["SourceTransaction"]: """ List source transactions for a given source. """ return cast( ListObject["SourceTransaction"], await self._request_async( "get", "/v1/sources/{source}/source_transactions".format( source=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def modify( cls, id: str, **params: Unpack["Source.ModifyParams"] ) -> "Source": """ Updates the specified source by setting the values of the parameters passed. Any parameters not provided will be left unchanged. This request accepts the metadata and owner as arguments. It is also possible to update type specific information for selected payment methods. Please refer to our [payment method guides](https://stripe.com/docs/sources) for more detail. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Source", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["Source.ModifyParams"] ) -> "Source": """ Updates the specified source by setting the values of the parameters passed. Any parameters not provided will be left unchanged. This request accepts the metadata and owner as arguments. It is also possible to update type specific information for selected payment methods. Please refer to our [payment method guides](https://stripe.com/docs/sources) for more detail. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Source", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["Source.RetrieveParams"] ) -> "Source": """ Retrieves an existing source object. Supply the unique source ID from a source creation request and Stripe will return the corresponding up-to-date source object information. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["Source.RetrieveParams"] ) -> "Source": """ Retrieves an existing source object. Supply the unique source ID from a source creation request and Stripe will return the corresponding up-to-date source object information. """ instance = cls(id, **params) await instance.refresh_async() return instance @classmethod def _cls_verify( cls, source: str, **params: Unpack["Source.VerifyParams"] ) -> "Source": """ Verify a given source. """ return cast( "Source", cls._static_request( "post", "/v1/sources/{source}/verify".format( source=sanitize_id(source) ), params=params, ), ) @overload @staticmethod def verify( source: str, **params: Unpack["Source.VerifyParams"] ) -> "Source": """ Verify a given source. """ ... @overload def verify(self, **params: Unpack["Source.VerifyParams"]) -> "Source": """ Verify a given source. """ ... @class_method_variant("_cls_verify") def verify( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Source.VerifyParams"] ) -> "Source": """ Verify a given source. """ return cast( "Source", self._request( "post", "/v1/sources/{source}/verify".format( source=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_verify_async( cls, source: str, **params: Unpack["Source.VerifyParams"] ) -> "Source": """ Verify a given source. """ return cast( "Source", await cls._static_request_async( "post", "/v1/sources/{source}/verify".format( source=sanitize_id(source) ), params=params, ), ) @overload @staticmethod async def verify_async( source: str, **params: Unpack["Source.VerifyParams"] ) -> "Source": """ Verify a given source. """ ... @overload async def verify_async( self, **params: Unpack["Source.VerifyParams"] ) -> "Source": """ Verify a given source. """ ... @class_method_variant("_cls_verify_async") async def verify_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Source.VerifyParams"] ) -> "Source": """ Verify a given source. """ return cast( "Source", await self._request_async( "post", "/v1/sources/{source}/verify".format( source=sanitize_id(self.get("id")) ), params=params, ), ) def detach(self, **params) -> "Source": token = self.id if hasattr(self, "customer") and self.customer: extn = sanitize_id(token) customer = self.customer base = Customer.class_url() owner_extn = sanitize_id(customer) url = "%s/%s/sources/%s" % (base, owner_extn, extn) self._request_and_refresh("delete", url, params) return cast("Source", self) else: raise InvalidRequestError( "Source %s does not appear to be currently attached " "to a customer object." % token, "id", ) _inner_class_types = { "ach_credit_transfer": AchCreditTransfer, "ach_debit": AchDebit, "acss_debit": AcssDebit, "alipay": Alipay, "au_becs_debit": AuBecsDebit, "bancontact": Bancontact, "card": Card, "card_present": CardPresent, "code_verification": CodeVerification, "eps": Eps, "giropay": Giropay, "ideal": Ideal, "klarna": Klarna, "multibanco": Multibanco, "owner": Owner, "p24": P24, "receiver": Receiver, "redirect": Redirect, "sepa_credit_transfer": SepaCreditTransfer, "sepa_debit": SepaDebit, "sofort": Sofort, "source_order": SourceOrder, "three_d_secure": ThreeDSecure, "wechat": Wechat, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_source_mandate_notification.py0000644000175100001770000000703014637354563022302 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject from typing import ClassVar, Optional from typing_extensions import Literal, TYPE_CHECKING if TYPE_CHECKING: from stripe._source import Source class SourceMandateNotification(StripeObject): """ Source mandate notifications should be created when a notification related to a source mandate must be sent to the payer. They will trigger a webhook or deliver an email to the customer. """ OBJECT_NAME: ClassVar[Literal["source_mandate_notification"]] = ( "source_mandate_notification" ) class AcssDebit(StripeObject): statement_descriptor: Optional[str] """ The statement descriptor associate with the debit. """ class BacsDebit(StripeObject): last4: Optional[str] """ Last 4 digits of the account number associated with the debit. """ class SepaDebit(StripeObject): creditor_identifier: Optional[str] """ SEPA creditor ID. """ last4: Optional[str] """ Last 4 digits of the account number associated with the debit. """ mandate_reference: Optional[str] """ Mandate reference associated with the debit. """ acss_debit: Optional[AcssDebit] amount: Optional[int] """ A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the amount associated with the mandate notification. The amount is expressed in the currency of the underlying source. Required if the notification type is `debit_initiated`. """ bacs_debit: Optional[BacsDebit] created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ object: Literal["source_mandate_notification"] """ String representing the object's type. Objects of the same type share the same value. """ reason: str """ The reason of the mandate notification. Valid reasons are `mandate_confirmed` or `debit_initiated`. """ sepa_debit: Optional[SepaDebit] source: "Source" """ `Source` objects allow you to accept a variety of payment methods. They represent a customer's payment instrument, and can be used with the Stripe API just like a `Card` object: once chargeable, they can be charged, or can be attached to customers. Stripe doesn't recommend using the deprecated [Sources API](https://stripe.com/docs/api/sources). We recommend that you adopt the [PaymentMethods API](https://stripe.com/docs/api/payment_methods). This newer API provides access to our latest features and payment method types. Related guides: [Sources API](https://stripe.com/docs/sources) and [Sources & Customers](https://stripe.com/docs/sources/customers). """ status: str """ The status of the mandate notification. Valid statuses are `pending` or `submitted`. """ type: str """ The type of source this mandate notification is attached to. Should be the source type identifier code for the payment method, such as `three_d_secure`. """ _inner_class_types = { "acss_debit": AcssDebit, "bacs_debit": BacsDebit, "sepa_debit": SepaDebit, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_source_service.py0000644000175100001770000006742114637354563017575 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._account import Account from stripe._bank_account import BankAccount from stripe._card import Card from stripe._request_options import RequestOptions from stripe._source import Source from stripe._source_transaction_service import SourceTransactionService from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import Dict, List, Union, cast from typing_extensions import Literal, NotRequired, TypedDict class SourceService(StripeService): def __init__(self, requestor): super().__init__(requestor) self.transactions = SourceTransactionService(self._requestor) class CreateParams(TypedDict): amount: NotRequired[int] """ Amount associated with the source. This is the amount for which the source will be chargeable once ready. Required for `single_use` sources. Not supported for `receiver` type sources, where charge amount may not be specified until funds land. """ currency: NotRequired[str] """ Three-letter [ISO code for the currency](https://stripe.com/docs/currencies) associated with the source. This is the currency for which the source will be chargeable once ready. """ customer: NotRequired[str] """ The `Customer` to whom the original source is attached to. Must be set when the original source is not a `Source` (e.g., `Card`). """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ flow: NotRequired[ Literal["code_verification", "none", "receiver", "redirect"] ] """ The authentication `flow` of the source to create. `flow` is one of `redirect`, `receiver`, `code_verification`, `none`. It is generally inferred unless a type supports multiple flows. """ mandate: NotRequired["SourceService.CreateParamsMandate"] """ Information about a mandate possibility attached to a source object (generally for bank debits) as well as its acceptance status. """ metadata: NotRequired[Dict[str, str]] original_source: NotRequired[str] """ The source to share. """ owner: NotRequired["SourceService.CreateParamsOwner"] """ Information about the owner of the payment instrument that may be used or required by particular source types. """ receiver: NotRequired["SourceService.CreateParamsReceiver"] """ Optional parameters for the receiver flow. Can be set only if the source is a receiver (`flow` is `receiver`). """ redirect: NotRequired["SourceService.CreateParamsRedirect"] """ Parameters required for the redirect flow. Required if the source is authenticated by a redirect (`flow` is `redirect`). """ source_order: NotRequired["SourceService.CreateParamsSourceOrder"] """ Information about the items and shipping associated with the source. Required for transactional credit (for example Klarna) sources before you can charge it. """ statement_descriptor: NotRequired[str] """ An arbitrary string to be displayed on your customer's statement. As an example, if your website is `RunClub` and the item you're charging for is a race ticket, you may want to specify a `statement_descriptor` of `RunClub 5K race ticket.` While many payment types will display this information, some may not display it at all. """ token: NotRequired[str] """ An optional token used to create the source. When passed, token properties will override source parameters. """ type: NotRequired[str] """ The `type` of the source to create. Required unless `customer` and `original_source` are specified (see the [Cloning card Sources](https://stripe.com/docs/sources/connect#cloning-card-sources) guide) """ usage: NotRequired[Literal["reusable", "single_use"]] class CreateParamsMandate(TypedDict): acceptance: NotRequired["SourceService.CreateParamsMandateAcceptance"] """ The parameters required to notify Stripe of a mandate acceptance or refusal by the customer. """ amount: NotRequired["Literal['']|int"] """ The amount specified by the mandate. (Leave null for a mandate covering all amounts) """ currency: NotRequired[str] """ The currency specified by the mandate. (Must match `currency` of the source) """ interval: NotRequired[Literal["one_time", "scheduled", "variable"]] """ The interval of debits permitted by the mandate. Either `one_time` (just permitting a single debit), `scheduled` (with debits on an agreed schedule or for clearly-defined events), or `variable`(for debits with any frequency) """ notification_method: NotRequired[ Literal[ "deprecated_none", "email", "manual", "none", "stripe_email" ] ] """ The method Stripe should use to notify the customer of upcoming debit instructions and/or mandate confirmation as required by the underlying debit network. Either `email` (an email is sent directly to the customer), `manual` (a `source.mandate_notification` event is sent to your webhooks endpoint and you should handle the notification) or `none` (the underlying debit network does not require any notification). """ class CreateParamsMandateAcceptance(TypedDict): date: NotRequired[int] """ The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer. """ ip: NotRequired[str] """ The IP address from which the mandate was accepted or refused by the customer. """ offline: NotRequired[ "SourceService.CreateParamsMandateAcceptanceOffline" ] """ The parameters required to store a mandate accepted offline. Should only be set if `mandate[type]` is `offline` """ online: NotRequired[ "SourceService.CreateParamsMandateAcceptanceOnline" ] """ The parameters required to store a mandate accepted online. Should only be set if `mandate[type]` is `online` """ status: Literal["accepted", "pending", "refused", "revoked"] """ The status of the mandate acceptance. Either `accepted` (the mandate was accepted) or `refused` (the mandate was refused). """ type: NotRequired[Literal["offline", "online"]] """ The type of acceptance information included with the mandate. Either `online` or `offline` """ user_agent: NotRequired[str] """ The user agent of the browser from which the mandate was accepted or refused by the customer. """ class CreateParamsMandateAcceptanceOffline(TypedDict): contact_email: str """ An email to contact you with if a copy of the mandate is requested, required if `type` is `offline`. """ class CreateParamsMandateAcceptanceOnline(TypedDict): date: NotRequired[int] """ The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer. """ ip: NotRequired[str] """ The IP address from which the mandate was accepted or refused by the customer. """ user_agent: NotRequired[str] """ The user agent of the browser from which the mandate was accepted or refused by the customer. """ class CreateParamsOwner(TypedDict): address: NotRequired["SourceService.CreateParamsOwnerAddress"] """ Owner's address. """ email: NotRequired[str] """ Owner's email address. """ name: NotRequired[str] """ Owner's full name. """ phone: NotRequired[str] """ Owner's phone number. """ class CreateParamsOwnerAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsReceiver(TypedDict): refund_attributes_method: NotRequired[ Literal["email", "manual", "none"] ] """ The method Stripe should use to request information needed to process a refund or mispayment. Either `email` (an email is sent directly to the customer) or `manual` (a `source.refund_attributes_required` event is sent to your webhooks endpoint). Refer to each payment method's documentation to learn which refund attributes may be required. """ class CreateParamsRedirect(TypedDict): return_url: str """ The URL you provide to redirect the customer back to you after they authenticated their payment. It can use your application URI scheme in the context of a mobile application. """ class CreateParamsSourceOrder(TypedDict): items: NotRequired[List["SourceService.CreateParamsSourceOrderItem"]] """ List of items constituting the order. """ shipping: NotRequired["SourceService.CreateParamsSourceOrderShipping"] """ Shipping address for the order. Required if any of the SKUs are for products that have `shippable` set to true. """ class CreateParamsSourceOrderItem(TypedDict): amount: NotRequired[int] currency: NotRequired[str] description: NotRequired[str] parent: NotRequired[str] """ The ID of the SKU being ordered. """ quantity: NotRequired[int] """ The quantity of this order item. When type is `sku`, this is the number of instances of the SKU to be ordered. """ type: NotRequired[Literal["discount", "shipping", "sku", "tax"]] class CreateParamsSourceOrderShipping(TypedDict): address: "SourceService.CreateParamsSourceOrderShippingAddress" """ Shipping address. """ carrier: NotRequired[str] """ The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. """ name: NotRequired[str] """ Recipient name. """ phone: NotRequired[str] """ Recipient phone (including extension). """ tracking_number: NotRequired[str] """ The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ class CreateParamsSourceOrderShippingAddress(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: str """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class DetachParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveParams(TypedDict): client_secret: NotRequired[str] """ The client secret of the source. Required if a publishable key is used to retrieve the source. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): amount: NotRequired[int] """ Amount associated with the source. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ mandate: NotRequired["SourceService.UpdateParamsMandate"] """ Information about a mandate possibility attached to a source object (generally for bank debits) as well as its acceptance status. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ owner: NotRequired["SourceService.UpdateParamsOwner"] """ Information about the owner of the payment instrument that may be used or required by particular source types. """ source_order: NotRequired["SourceService.UpdateParamsSourceOrder"] """ Information about the items and shipping associated with the source. Required for transactional credit (for example Klarna) sources before you can charge it. """ class UpdateParamsMandate(TypedDict): acceptance: NotRequired["SourceService.UpdateParamsMandateAcceptance"] """ The parameters required to notify Stripe of a mandate acceptance or refusal by the customer. """ amount: NotRequired["Literal['']|int"] """ The amount specified by the mandate. (Leave null for a mandate covering all amounts) """ currency: NotRequired[str] """ The currency specified by the mandate. (Must match `currency` of the source) """ interval: NotRequired[Literal["one_time", "scheduled", "variable"]] """ The interval of debits permitted by the mandate. Either `one_time` (just permitting a single debit), `scheduled` (with debits on an agreed schedule or for clearly-defined events), or `variable`(for debits with any frequency) """ notification_method: NotRequired[ Literal[ "deprecated_none", "email", "manual", "none", "stripe_email" ] ] """ The method Stripe should use to notify the customer of upcoming debit instructions and/or mandate confirmation as required by the underlying debit network. Either `email` (an email is sent directly to the customer), `manual` (a `source.mandate_notification` event is sent to your webhooks endpoint and you should handle the notification) or `none` (the underlying debit network does not require any notification). """ class UpdateParamsMandateAcceptance(TypedDict): date: NotRequired[int] """ The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer. """ ip: NotRequired[str] """ The IP address from which the mandate was accepted or refused by the customer. """ offline: NotRequired[ "SourceService.UpdateParamsMandateAcceptanceOffline" ] """ The parameters required to store a mandate accepted offline. Should only be set if `mandate[type]` is `offline` """ online: NotRequired[ "SourceService.UpdateParamsMandateAcceptanceOnline" ] """ The parameters required to store a mandate accepted online. Should only be set if `mandate[type]` is `online` """ status: Literal["accepted", "pending", "refused", "revoked"] """ The status of the mandate acceptance. Either `accepted` (the mandate was accepted) or `refused` (the mandate was refused). """ type: NotRequired[Literal["offline", "online"]] """ The type of acceptance information included with the mandate. Either `online` or `offline` """ user_agent: NotRequired[str] """ The user agent of the browser from which the mandate was accepted or refused by the customer. """ class UpdateParamsMandateAcceptanceOffline(TypedDict): contact_email: str """ An email to contact you with if a copy of the mandate is requested, required if `type` is `offline`. """ class UpdateParamsMandateAcceptanceOnline(TypedDict): date: NotRequired[int] """ The Unix timestamp (in seconds) when the mandate was accepted or refused by the customer. """ ip: NotRequired[str] """ The IP address from which the mandate was accepted or refused by the customer. """ user_agent: NotRequired[str] """ The user agent of the browser from which the mandate was accepted or refused by the customer. """ class UpdateParamsOwner(TypedDict): address: NotRequired["SourceService.UpdateParamsOwnerAddress"] """ Owner's address. """ email: NotRequired[str] """ Owner's email address. """ name: NotRequired[str] """ Owner's full name. """ phone: NotRequired[str] """ Owner's phone number. """ class UpdateParamsOwnerAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class UpdateParamsSourceOrder(TypedDict): items: NotRequired[List["SourceService.UpdateParamsSourceOrderItem"]] """ List of items constituting the order. """ shipping: NotRequired["SourceService.UpdateParamsSourceOrderShipping"] """ Shipping address for the order. Required if any of the SKUs are for products that have `shippable` set to true. """ class UpdateParamsSourceOrderItem(TypedDict): amount: NotRequired[int] currency: NotRequired[str] description: NotRequired[str] parent: NotRequired[str] """ The ID of the SKU being ordered. """ quantity: NotRequired[int] """ The quantity of this order item. When type is `sku`, this is the number of instances of the SKU to be ordered. """ type: NotRequired[Literal["discount", "shipping", "sku", "tax"]] class UpdateParamsSourceOrderShipping(TypedDict): address: "SourceService.UpdateParamsSourceOrderShippingAddress" """ Shipping address. """ carrier: NotRequired[str] """ The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. """ name: NotRequired[str] """ Recipient name. """ phone: NotRequired[str] """ Recipient phone (including extension). """ tracking_number: NotRequired[str] """ The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ class UpdateParamsSourceOrderShippingAddress(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: str """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class VerifyParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ values: List[str] """ The values needed to verify the source. """ def detach( self, customer: str, id: str, params: "SourceService.DetachParams" = {}, options: RequestOptions = {}, ) -> Union[Account, BankAccount, Card, Source]: """ Delete a specified source for a given customer. """ return cast( Union[Account, BankAccount, Card, Source], self._request( "delete", "/v1/customers/{customer}/sources/{id}".format( customer=sanitize_id(customer), id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def detach_async( self, customer: str, id: str, params: "SourceService.DetachParams" = {}, options: RequestOptions = {}, ) -> Union[Account, BankAccount, Card, Source]: """ Delete a specified source for a given customer. """ return cast( Union[Account, BankAccount, Card, Source], await self._request_async( "delete", "/v1/customers/{customer}/sources/{id}".format( customer=sanitize_id(customer), id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, source: str, params: "SourceService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Source: """ Retrieves an existing source object. Supply the unique source ID from a source creation request and Stripe will return the corresponding up-to-date source object information. """ return cast( Source, self._request( "get", "/v1/sources/{source}".format(source=sanitize_id(source)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, source: str, params: "SourceService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Source: """ Retrieves an existing source object. Supply the unique source ID from a source creation request and Stripe will return the corresponding up-to-date source object information. """ return cast( Source, await self._request_async( "get", "/v1/sources/{source}".format(source=sanitize_id(source)), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, source: str, params: "SourceService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Source: """ Updates the specified source by setting the values of the parameters passed. Any parameters not provided will be left unchanged. This request accepts the metadata and owner as arguments. It is also possible to update type specific information for selected payment methods. Please refer to our [payment method guides](https://stripe.com/docs/sources) for more detail. """ return cast( Source, self._request( "post", "/v1/sources/{source}".format(source=sanitize_id(source)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, source: str, params: "SourceService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Source: """ Updates the specified source by setting the values of the parameters passed. Any parameters not provided will be left unchanged. This request accepts the metadata and owner as arguments. It is also possible to update type specific information for selected payment methods. Please refer to our [payment method guides](https://stripe.com/docs/sources) for more detail. """ return cast( Source, await self._request_async( "post", "/v1/sources/{source}".format(source=sanitize_id(source)), api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "SourceService.CreateParams" = {}, options: RequestOptions = {}, ) -> Source: """ Creates a new source object. """ return cast( Source, self._request( "post", "/v1/sources", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "SourceService.CreateParams" = {}, options: RequestOptions = {}, ) -> Source: """ Creates a new source object. """ return cast( Source, await self._request_async( "post", "/v1/sources", api_mode="V1", base_address="api", params=params, options=options, ), ) def verify( self, source: str, params: "SourceService.VerifyParams", options: RequestOptions = {}, ) -> Source: """ Verify a given source. """ return cast( Source, self._request( "post", "/v1/sources/{source}/verify".format( source=sanitize_id(source), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def verify_async( self, source: str, params: "SourceService.VerifyParams", options: RequestOptions = {}, ) -> Source: """ Verify a given source. """ return cast( Source, await self._request_async( "post", "/v1/sources/{source}/verify".format( source=sanitize_id(source), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_source_transaction.py0000644000175100001770000001246114637354563020454 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject from typing import ClassVar, Optional from typing_extensions import Literal class SourceTransaction(StripeObject): """ Some payment methods have no required amount that a customer must send. Customers can be instructed to send any amount, and it can be made up of multiple transactions. As such, sources can have multiple associated transactions. """ OBJECT_NAME: ClassVar[Literal["source_transaction"]] = "source_transaction" class AchCreditTransfer(StripeObject): customer_data: Optional[str] """ Customer data associated with the transfer. """ fingerprint: Optional[str] """ Bank account fingerprint associated with the transfer. """ last4: Optional[str] """ Last 4 digits of the account number associated with the transfer. """ routing_number: Optional[str] """ Routing number associated with the transfer. """ class ChfCreditTransfer(StripeObject): reference: Optional[str] """ Reference associated with the transfer. """ sender_address_country: Optional[str] """ Sender's country address. """ sender_address_line1: Optional[str] """ Sender's line 1 address. """ sender_iban: Optional[str] """ Sender's bank account IBAN. """ sender_name: Optional[str] """ Sender's name. """ class GbpCreditTransfer(StripeObject): fingerprint: Optional[str] """ Bank account fingerprint associated with the Stripe owned bank account receiving the transfer. """ funding_method: Optional[str] """ The credit transfer rails the sender used to push this transfer. The possible rails are: Faster Payments, BACS, CHAPS, and wire transfers. Currently only Faster Payments is supported. """ last4: Optional[str] """ Last 4 digits of sender account number associated with the transfer. """ reference: Optional[str] """ Sender entered arbitrary information about the transfer. """ sender_account_number: Optional[str] """ Sender account number associated with the transfer. """ sender_name: Optional[str] """ Sender name associated with the transfer. """ sender_sort_code: Optional[str] """ Sender sort code associated with the transfer. """ class PaperCheck(StripeObject): available_at: Optional[str] """ Time at which the deposited funds will be available for use. Measured in seconds since the Unix epoch. """ invoices: Optional[str] """ Comma-separated list of invoice IDs associated with the paper check. """ class SepaCreditTransfer(StripeObject): reference: Optional[str] """ Reference associated with the transfer. """ sender_iban: Optional[str] """ Sender's bank account IBAN. """ sender_name: Optional[str] """ Sender's name. """ ach_credit_transfer: Optional[AchCreditTransfer] amount: int """ A positive integer in the smallest currency unit (that is, 100 cents for $1.00, or 1 for ¥1, Japanese Yen being a zero-decimal currency) representing the amount your customer has pushed to the receiver. """ chf_credit_transfer: Optional[ChfCreditTransfer] created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ 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). """ gbp_credit_transfer: Optional[GbpCreditTransfer] id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ object: Literal["source_transaction"] """ String representing the object's type. Objects of the same type share the same value. """ paper_check: Optional[PaperCheck] sepa_credit_transfer: Optional[SepaCreditTransfer] source: str """ The ID of the source this transaction is attached to. """ status: str """ The status of the transaction, one of `succeeded`, `pending`, or `failed`. """ type: Literal[ "ach_credit_transfer", "ach_debit", "alipay", "bancontact", "card", "card_present", "eps", "giropay", "ideal", "klarna", "multibanco", "p24", "sepa_debit", "sofort", "three_d_secure", "wechat", ] """ The type of source this transaction is attached to. """ _inner_class_types = { "ach_credit_transfer": AchCreditTransfer, "chf_credit_transfer": ChfCreditTransfer, "gbp_credit_transfer": GbpCreditTransfer, "paper_check": PaperCheck, "sepa_credit_transfer": SepaCreditTransfer, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_source_transaction_service.py0000644000175100001770000000546114637354563022176 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._source_transaction import SourceTransaction from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict class SourceTransactionService(StripeService): class ListParams(TypedDict): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ def list( self, source: str, params: "SourceTransactionService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[SourceTransaction]: """ List source transactions for a given source. """ return cast( ListObject[SourceTransaction], self._request( "get", "/v1/sources/{source}/source_transactions".format( source=sanitize_id(source), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, source: str, params: "SourceTransactionService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[SourceTransaction]: """ List source transactions for a given source. """ return cast( ListObject[SourceTransaction], await self._request_async( "get", "/v1/sources/{source}/source_transactions".format( source=sanitize_id(source), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_stripe_client.py0000644000175100001770000003012414637354563017407 0ustar00runnerdocker# -*- coding: utf-8 -*- import json from collections import OrderedDict from stripe import ( DEFAULT_API_BASE, DEFAULT_CONNECT_API_BASE, DEFAULT_UPLOAD_API_BASE, ) from stripe._error import AuthenticationError from stripe._api_requestor import _APIRequestor from stripe._requestor_options import RequestorOptions, BaseAddresses from stripe._client_options import _ClientOptions from stripe._http_client import ( HTTPClient, new_default_http_client, new_http_client_async_fallback, ) from stripe._api_version import _ApiVersion from stripe._webhook import Webhook, WebhookSignature from stripe._event import Event from typing import Optional, Union, cast # Non-generated services from stripe._oauth_service import OAuthService # services: The beginning of the section generated from our OpenAPI spec from stripe._account_service import AccountService from stripe._account_link_service import AccountLinkService from stripe._account_session_service import AccountSessionService from stripe._apple_pay_domain_service import ApplePayDomainService from stripe._application_fee_service import ApplicationFeeService from stripe._apps_service import AppsService from stripe._balance_service import BalanceService from stripe._balance_transaction_service import BalanceTransactionService from stripe._billing_service import BillingService from stripe._billing_portal_service import BillingPortalService from stripe._charge_service import ChargeService from stripe._checkout_service import CheckoutService from stripe._climate_service import ClimateService from stripe._confirmation_token_service import ConfirmationTokenService from stripe._test_helpers_service import TestHelpersService from stripe._country_spec_service import CountrySpecService from stripe._coupon_service import CouponService from stripe._credit_note_service import CreditNoteService from stripe._customer_service import CustomerService from stripe._customer_session_service import CustomerSessionService from stripe._dispute_service import DisputeService from stripe._entitlements_service import EntitlementsService from stripe._ephemeral_key_service import EphemeralKeyService from stripe._event_service import EventService from stripe._exchange_rate_service import ExchangeRateService from stripe._file_service import FileService from stripe._file_link_service import FileLinkService from stripe._financial_connections_service import FinancialConnectionsService from stripe._forwarding_service import ForwardingService from stripe._identity_service import IdentityService from stripe._invoice_service import InvoiceService from stripe._invoice_item_service import InvoiceItemService from stripe._issuing_service import IssuingService from stripe._mandate_service import MandateService from stripe._payment_intent_service import PaymentIntentService from stripe._payment_link_service import PaymentLinkService from stripe._payment_method_service import PaymentMethodService from stripe._payment_method_configuration_service import ( PaymentMethodConfigurationService, ) from stripe._payment_method_domain_service import PaymentMethodDomainService from stripe._payout_service import PayoutService from stripe._plan_service import PlanService from stripe._price_service import PriceService from stripe._product_service import ProductService from stripe._promotion_code_service import PromotionCodeService from stripe._quote_service import QuoteService from stripe._radar_service import RadarService from stripe._refund_service import RefundService from stripe._reporting_service import ReportingService from stripe._review_service import ReviewService from stripe._sigma_service import SigmaService from stripe._setup_attempt_service import SetupAttemptService from stripe._setup_intent_service import SetupIntentService from stripe._shipping_rate_service import ShippingRateService from stripe._source_service import SourceService from stripe._subscription_service import SubscriptionService from stripe._subscription_item_service import SubscriptionItemService from stripe._subscription_schedule_service import SubscriptionScheduleService from stripe._tax_service import TaxService from stripe._tax_code_service import TaxCodeService from stripe._tax_id_service import TaxIdService from stripe._tax_rate_service import TaxRateService from stripe._terminal_service import TerminalService from stripe._token_service import TokenService from stripe._topup_service import TopupService from stripe._transfer_service import TransferService from stripe._treasury_service import TreasuryService from stripe._webhook_endpoint_service import WebhookEndpointService # services: The end of the section generated from our OpenAPI spec class StripeClient(object): def __init__( self, api_key: str, *, stripe_account: Optional[str] = None, stripe_version: Optional[str] = None, base_addresses: BaseAddresses = {}, client_id: Optional[str] = None, verify_ssl_certs: bool = True, proxy: Optional[str] = None, max_network_retries: Optional[int] = None, http_client: Optional[HTTPClient] = None, ): # The types forbid this, but let's give users without types a friendly error. if api_key is None: # pyright: ignore[reportUnnecessaryComparison] raise AuthenticationError( "No API key provided. (HINT: set your API key using " '"client = stripe.StripeClient()"). You can ' "generate API keys from the Stripe web interface. " "See https://stripe.com/api for details, or email " "support@stripe.com if you have any questions." ) if http_client and (proxy or verify_ssl_certs is not True): raise ValueError( "You cannot specify `proxy` or `verify_ssl_certs` when passing " "in a custom `http_client`. Please set these values on your " "custom `http_client` instead." ) # Default to stripe.DEFAULT_API_BASE, stripe.DEFAULT_CONNECT_API_BASE, # and stripe.DEFAULT_UPLOAD_API_BASE if not set in base_addresses. base_addresses = { "api": DEFAULT_API_BASE, "connect": DEFAULT_CONNECT_API_BASE, "files": DEFAULT_UPLOAD_API_BASE, **base_addresses, } requestor_options = RequestorOptions( api_key=api_key, stripe_account=stripe_account, stripe_version=stripe_version or _ApiVersion.CURRENT, base_addresses=base_addresses, max_network_retries=max_network_retries, ) if http_client is None: http_client = new_default_http_client( async_fallback_client=new_http_client_async_fallback( proxy=proxy, verify_ssl_certs=verify_ssl_certs ), proxy=proxy, verify_ssl_certs=verify_ssl_certs, ) self._requestor = _APIRequestor( options=requestor_options, client=http_client, ) self._options = _ClientOptions( client_id=client_id, proxy=proxy, verify_ssl_certs=verify_ssl_certs, ) self.oauth = OAuthService(self._requestor, self._options) # top-level services: The beginning of the section generated from our OpenAPI spec self.accounts = AccountService(self._requestor) self.account_links = AccountLinkService(self._requestor) self.account_sessions = AccountSessionService(self._requestor) self.apple_pay_domains = ApplePayDomainService(self._requestor) self.application_fees = ApplicationFeeService(self._requestor) self.apps = AppsService(self._requestor) self.balance = BalanceService(self._requestor) self.balance_transactions = BalanceTransactionService(self._requestor) self.billing = BillingService(self._requestor) self.billing_portal = BillingPortalService(self._requestor) self.charges = ChargeService(self._requestor) self.checkout = CheckoutService(self._requestor) self.climate = ClimateService(self._requestor) self.confirmation_tokens = ConfirmationTokenService(self._requestor) self.test_helpers = TestHelpersService(self._requestor) self.country_specs = CountrySpecService(self._requestor) self.coupons = CouponService(self._requestor) self.credit_notes = CreditNoteService(self._requestor) self.customers = CustomerService(self._requestor) self.customer_sessions = CustomerSessionService(self._requestor) self.disputes = DisputeService(self._requestor) self.entitlements = EntitlementsService(self._requestor) self.ephemeral_keys = EphemeralKeyService(self._requestor) self.events = EventService(self._requestor) self.exchange_rates = ExchangeRateService(self._requestor) self.files = FileService(self._requestor) self.file_links = FileLinkService(self._requestor) self.financial_connections = FinancialConnectionsService( self._requestor ) self.forwarding = ForwardingService(self._requestor) self.identity = IdentityService(self._requestor) self.invoices = InvoiceService(self._requestor) self.invoice_items = InvoiceItemService(self._requestor) self.issuing = IssuingService(self._requestor) self.mandates = MandateService(self._requestor) self.payment_intents = PaymentIntentService(self._requestor) self.payment_links = PaymentLinkService(self._requestor) self.payment_methods = PaymentMethodService(self._requestor) self.payment_method_configurations = PaymentMethodConfigurationService( self._requestor, ) self.payment_method_domains = PaymentMethodDomainService( self._requestor ) self.payouts = PayoutService(self._requestor) self.plans = PlanService(self._requestor) self.prices = PriceService(self._requestor) self.products = ProductService(self._requestor) self.promotion_codes = PromotionCodeService(self._requestor) self.quotes = QuoteService(self._requestor) self.radar = RadarService(self._requestor) self.refunds = RefundService(self._requestor) self.reporting = ReportingService(self._requestor) self.reviews = ReviewService(self._requestor) self.sigma = SigmaService(self._requestor) self.setup_attempts = SetupAttemptService(self._requestor) self.setup_intents = SetupIntentService(self._requestor) self.shipping_rates = ShippingRateService(self._requestor) self.sources = SourceService(self._requestor) self.subscriptions = SubscriptionService(self._requestor) self.subscription_items = SubscriptionItemService(self._requestor) self.subscription_schedules = SubscriptionScheduleService( self._requestor ) self.tax = TaxService(self._requestor) self.tax_codes = TaxCodeService(self._requestor) self.tax_ids = TaxIdService(self._requestor) self.tax_rates = TaxRateService(self._requestor) self.terminal = TerminalService(self._requestor) self.tokens = TokenService(self._requestor) self.topups = TopupService(self._requestor) self.transfers = TransferService(self._requestor) self.treasury = TreasuryService(self._requestor) self.webhook_endpoints = WebhookEndpointService(self._requestor) # top-level services: The end of the section generated from our OpenAPI spec def construct_event( self, payload: Union[bytes, str], sig_header: str, secret: str, tolerance: int = Webhook.DEFAULT_TOLERANCE, ) -> Event: if hasattr(payload, "decode"): payload = cast(bytes, payload).decode("utf-8") WebhookSignature.verify_header(payload, sig_header, secret, tolerance) data = json.loads(payload, object_pairs_hook=OrderedDict) event = Event._construct_from( values=data, requestor=self._requestor, api_mode="V1", ) return event ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_stripe_object.py0000644000175100001770000004746714637354563017421 0ustar00runnerdocker# pyright: strict import datetime import json from copy import deepcopy from typing_extensions import TYPE_CHECKING, Type, Literal, Self from typing import ( Any, Dict, List, Optional, Mapping, Set, Tuple, ClassVar, Union, cast, overload, ) # Used to break circular imports import stripe # noqa: IMP101 from stripe import _util from stripe._stripe_response import ( StripeResponse, StripeStreamResponse, StripeStreamResponseAsync, ) from stripe._encode import _encode_datetime # pyright: ignore from stripe._request_options import extract_options_from_dict from stripe._api_mode import ApiMode from stripe._base_address import BaseAddress if TYPE_CHECKING: from stripe import _APIRequestor # pyright: ignore[reportPrivateUsage] @overload def _compute_diff( current: Dict[str, Any], previous: Optional[Dict[str, Any]] ) -> Dict[str, Any]: ... @overload def _compute_diff( current: object, previous: Optional[Dict[str, Any]] ) -> object: ... def _compute_diff( current: object, previous: Optional[Dict[str, Any]] ) -> object: if isinstance(current, dict): current = cast(Dict[str, Any], current) previous = previous or {} diff = current.copy() for key in set(previous.keys()) - set(diff.keys()): diff[key] = "" return diff return current if current is not None else "" def _serialize_list( array: Optional[List[Any]], previous: List[Any] ) -> Dict[str, Any]: array = array or [] previous = previous or [] params: Dict[str, Any] = {} for i, v in enumerate(array): previous_item = previous[i] if len(previous) > i else None if hasattr(v, "serialize"): params[str(i)] = v.serialize(previous_item) else: params[str(i)] = _compute_diff(v, previous_item) return params class StripeObject(Dict[str, Any]): class _ReprJSONEncoder(json.JSONEncoder): def default(self, o: Any) -> Any: if isinstance(o, datetime.datetime): # pyright complains that _encode_datetime is "private", but it's # private to outsiders, not to stripe_object return _encode_datetime(o) return super(StripeObject._ReprJSONEncoder, self).default(o) _retrieve_params: Mapping[str, Any] _previous: Optional[Mapping[str, Any]] def __init__( self, id: Optional[str] = None, api_key: Optional[str] = None, stripe_version: Optional[str] = None, stripe_account: Optional[str] = None, last_response: Optional[StripeResponse] = None, *, _requestor: Optional["_APIRequestor"] = None, # TODO: is a more specific type possible here? **params: Any, ): super(StripeObject, self).__init__() self._unsaved_values: Set[str] = set() self._transient_values: Set[str] = set() self._last_response = last_response self._retrieve_params = params self._previous = None self._requestor = ( stripe._APIRequestor._global_with_options( # pyright: ignore[reportPrivateUsage] api_key=api_key, stripe_version=stripe_version, stripe_account=stripe_account, ) if _requestor is None else _requestor ) if id: self["id"] = id @property def api_key(self): return self._requestor.api_key @property def stripe_account(self): return self._requestor.stripe_account @property def stripe_version(self): return self._requestor.stripe_version @property def last_response(self) -> Optional[StripeResponse]: return self._last_response # StripeObject inherits from `dict` which has an update method, and this doesn't quite match # the full signature of the update method in MutableMapping. But we ignore. def update( # pyright: ignore self, update_dict: Mapping[str, Any] ) -> None: for k in update_dict: self._unsaved_values.add(k) return super(StripeObject, self).update(update_dict) if not TYPE_CHECKING: def __setattr__(self, k, v): if k in {"api_key", "stripe_account", "stripe_version"}: self._requestor = self._requestor._replace_options({k: v}) return None if k[0] == "_" or k in self.__dict__: return super(StripeObject, self).__setattr__(k, v) self[k] = v return None def __getattr__(self, k): if k[0] == "_": raise AttributeError(k) try: if k in self._field_remappings: k = self._field_remappings[k] return self[k] except KeyError as err: raise AttributeError(*err.args) def __delattr__(self, k): if k[0] == "_" or k in self.__dict__: return super(StripeObject, self).__delattr__(k) else: del self[k] def __setitem__(self, k: str, v: Any) -> None: if v == "": raise ValueError( "You cannot set %s to an empty string on this object. " "The empty string is treated specially in our requests. " "If you'd like to delete the property using the save() method on this object, you may set %s.%s=None. " "Alternatively, you can pass %s='' to delete the property when using a resource method such as modify()." % (k, str(self), k, k) ) # Allows for unpickling in Python 3.x if not hasattr(self, "_unsaved_values"): self._unsaved_values = set() self._unsaved_values.add(k) super(StripeObject, self).__setitem__(k, v) def __getitem__(self, k: str) -> Any: try: return super(StripeObject, self).__getitem__(k) except KeyError as err: if k in self._transient_values: raise KeyError( "%r. HINT: The %r attribute was set in the past." "It was then wiped when refreshing the object with " "the result returned by Stripe's API, probably as a " "result of a save(). The attributes currently " "available on this object are: %s" % (k, k, ", ".join(list(self.keys()))) ) else: raise err def __delitem__(self, k: str) -> None: super(StripeObject, self).__delitem__(k) # Allows for unpickling in Python 3.x if hasattr(self, "_unsaved_values") and k in self._unsaved_values: self._unsaved_values.remove(k) # Custom unpickling method that uses `update` to update the dictionary # without calling __setitem__, which would fail if any value is an empty # string def __setstate__(self, state: Dict[str, Any]) -> None: self.update(state) # Custom pickling method to ensure the instance is pickled as a custom # class and not as a dict, otherwise __setstate__ would not be called when # unpickling. def __reduce__(self) -> Tuple[Any, ...]: reduce_value = ( type(self), # callable ( # args self.get("id", None), self.api_key, self.stripe_version, self.stripe_account, ), dict(self), # state ) return reduce_value @classmethod def construct_from( cls, values: Dict[str, Any], key: Optional[str], stripe_version: Optional[str] = None, stripe_account: Optional[str] = None, last_response: Optional[StripeResponse] = None, *, api_mode: ApiMode = "V1", ) -> Self: return cls._construct_from( values=values, requestor=stripe._APIRequestor._global_with_options( # pyright: ignore[reportPrivateUsage] api_key=key, stripe_version=stripe_version, stripe_account=stripe_account, ), api_mode=api_mode, last_response=last_response, ) @classmethod def _construct_from( cls, *, values: Dict[str, Any], last_response: Optional[StripeResponse] = None, requestor: "_APIRequestor", api_mode: ApiMode, ) -> Self: instance = cls( values.get("id"), last_response=last_response, _requestor=requestor, ) instance._refresh_from( values=values, last_response=last_response, requestor=requestor, api_mode=api_mode, ) return instance def refresh_from( self, values: Dict[str, Any], api_key: Optional[str] = None, partial: Optional[bool] = False, stripe_version: Optional[str] = None, stripe_account: Optional[str] = None, last_response: Optional[StripeResponse] = None, *, api_mode: ApiMode = "V1", ) -> None: self._refresh_from( values=values, partial=partial, last_response=last_response, requestor=self._requestor._replace_options( # pyright: ignore[reportPrivateUsage] { "api_key": api_key, "stripe_version": stripe_version, "stripe_account": stripe_account, } ), api_mode=api_mode, ) def _refresh_from( self, *, values: Dict[str, Any], partial: Optional[bool] = False, last_response: Optional[StripeResponse] = None, requestor: Optional["_APIRequestor"] = None, api_mode: ApiMode, ) -> None: self._requestor = requestor or self._requestor self._last_response = last_response or getattr( values, "_last_response", None ) # Wipe old state before setting new. This is useful for e.g. # updating a customer, where there is no persistent card # parameter. Mark those values which don't persist as transient if partial: self._unsaved_values = self._unsaved_values - set(values) else: removed = set(self.keys()) - set(values) self._transient_values = self._transient_values | removed self._unsaved_values = set() self.clear() self._transient_values = self._transient_values - set(values) for k, v in values.items(): inner_class = self._get_inner_class_type(k) is_dict = self._get_inner_class_is_beneath_dict(k) if is_dict: obj = { k: None if v is None else cast( StripeObject, _util._convert_to_stripe_object( # pyright: ignore[reportPrivateUsage] resp=v, params=None, klass_=inner_class, requestor=self._requestor, api_mode=api_mode, ), ) for k, v in v.items() } else: obj = cast( Union[StripeObject, List[StripeObject]], _util._convert_to_stripe_object( # pyright: ignore[reportPrivateUsage] resp=v, params=None, klass_=inner_class, requestor=self._requestor, api_mode=api_mode, ), ) super(StripeObject, self).__setitem__(k, obj) self._previous = values @_util.deprecated( "This will be removed in a future version of stripe-python." ) def request( self, method: Literal["get", "post", "delete"], url: str, params: Optional[Dict[str, Any]] = None, *, base_address: BaseAddress = "api", api_mode: ApiMode = "V1", ) -> "StripeObject": return StripeObject._request( self, method, url, params=params, base_address=base_address, api_mode=api_mode, ) def _request( self, method: Literal["get", "post", "delete"], url: str, params: Optional[Mapping[str, Any]] = None, usage: Optional[List[str]] = None, *, base_address: BaseAddress, api_mode: ApiMode, ) -> "StripeObject": if params is None: params = self._retrieve_params request_options, request_params = extract_options_from_dict(params) return self._requestor.request( method, url, params=request_params, options=request_options, base_address=base_address, api_mode=api_mode, usage=usage, ) async def _request_async( self, method: Literal["get", "post", "delete"], url: str, params: Optional[Mapping[str, Any]] = None, usage: Optional[List[str]] = None, *, base_address: BaseAddress, api_mode: ApiMode, ) -> "StripeObject": if params is None: params = self._retrieve_params request_options, request_params = extract_options_from_dict(params) return await self._requestor.request_async( method, url, params=request_params, options=request_options, base_address=base_address, api_mode=api_mode, usage=usage, ) def _request_stream( self, method: str, url: str, params: Optional[Mapping[str, Any]] = None, *, base_address: BaseAddress = "api", api_mode: ApiMode = "V1", ) -> StripeStreamResponse: if params is None: params = self._retrieve_params request_options, request_params = extract_options_from_dict(params) return self._requestor.request_stream( method, url, params=request_params, options=request_options, base_address=base_address, api_mode=api_mode, ) async def _request_stream_async( self, method: str, url: str, params: Optional[Mapping[str, Any]] = None, *, base_address: BaseAddress = "api", api_mode: ApiMode = "V1", ) -> StripeStreamResponseAsync: if params is None: params = self._retrieve_params request_options, request_params = extract_options_from_dict(params) return await self._requestor.request_stream_async( method, url, params=request_params, options=request_options, base_address=base_address, api_mode=api_mode, ) def __repr__(self) -> str: ident_parts = [type(self).__name__] obj_str = self.get("object") if isinstance(obj_str, str): ident_parts.append(obj_str) if isinstance(self.get("id"), str): ident_parts.append("id=%s" % (self.get("id"),)) unicode_repr = "<%s at %s> JSON: %s" % ( " ".join(ident_parts), hex(id(self)), str(self), ) return unicode_repr def __str__(self) -> str: return json.dumps( self._to_dict_recursive(), sort_keys=True, indent=2, cls=self._ReprJSONEncoder, ) @_util.deprecated( "Deprecated. The public interface will be removed in a future version." ) def to_dict(self) -> Dict[str, Any]: return dict(self) def _to_dict_recursive(self) -> Dict[str, Any]: def maybe_to_dict_recursive( value: Optional[Union[StripeObject, Dict[str, Any]]], ) -> Optional[Dict[str, Any]]: if value is None: return None elif isinstance(value, StripeObject): return value._to_dict_recursive() else: return value return { key: list(map(maybe_to_dict_recursive, cast(List[Any], value))) if isinstance(value, list) else maybe_to_dict_recursive(value) for key, value in dict(self).items() } @_util.deprecated( "For internal stripe-python use only. The public interface will be removed in a future version." ) def to_dict_recursive(self) -> Dict[str, Any]: return self._to_dict_recursive() @property @_util.deprecated( "For internal stripe-python use only. The public interface will be removed in a future version." ) def stripe_id(self) -> Optional[str]: return getattr(self, "id") def serialize( self, previous: Optional[Mapping[str, Any]] ) -> Dict[str, Any]: params: Dict[str, Any] = {} unsaved_keys = self._unsaved_values or set() previous = previous or self._previous or {} for k, v in self.items(): if k == "id" or k.startswith("_"): continue elif isinstance(v, stripe.APIResource): continue elif hasattr(v, "serialize"): child = v.serialize(previous.get(k, None)) if child != {}: params[k] = child elif k in unsaved_keys: params[k] = _compute_diff(v, previous.get(k, None)) elif k == "additional_owners" and v is not None: params[k] = _serialize_list(v, previous.get(k, None)) return params # This class overrides __setitem__ to throw exceptions on inputs that it # doesn't like. This can cause problems when we try to copy an object # wholesale because some data that's returned from the API may not be valid # if it was set to be set manually. Here we override the class' copy # arguments so that we can bypass these possible exceptions on __setitem__. def __copy__(self) -> "StripeObject": copied = StripeObject( self.get("id"), self.api_key, stripe_version=self.stripe_version, stripe_account=self.stripe_account, ) copied._retrieve_params = self._retrieve_params for k, v in self.items(): # Call parent's __setitem__ to avoid checks that we've added in the # overridden version that can throw exceptions. super(StripeObject, copied).__setitem__(k, v) return copied # This class overrides __setitem__ to throw exceptions on inputs that it # doesn't like. This can cause problems when we try to copy an object # wholesale because some data that's returned from the API may not be valid # if it was set to be set manually. Here we override the class' copy # arguments so that we can bypass these possible exceptions on __setitem__. def __deepcopy__(self, memo: Dict[int, Any]) -> "StripeObject": copied = self.__copy__() memo[id(self)] = copied for k, v in self.items(): # Call parent's __setitem__ to avoid checks that we've added in the # overridden version that can throw exceptions. super(StripeObject, copied).__setitem__(k, deepcopy(v, memo)) return copied _field_remappings: ClassVar[Dict[str, str]] = {} _inner_class_types: ClassVar[Dict[str, Type["StripeObject"]]] = {} _inner_class_dicts: ClassVar[List[str]] = [] def _get_inner_class_type( self, field_name: str ) -> Optional[Type["StripeObject"]]: return self._inner_class_types.get(field_name) def _get_inner_class_is_beneath_dict(self, field_name: str): return field_name in self._inner_class_dicts ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_stripe_response.py0000644000175100001770000000332714637354563017774 0ustar00runnerdocker# pyright: strict from io import IOBase import json from collections import OrderedDict from typing import Mapping, Optional, AsyncIterable class StripeResponseBase(object): code: int headers: Mapping[str, str] def __init__(self, code: int, headers: Mapping[str, str]): self.code = code self.headers = headers @property def idempotency_key(self) -> Optional[str]: try: return self.headers["idempotency-key"] except KeyError: return None @property def request_id(self) -> Optional[str]: try: return self.headers["request-id"] except KeyError: return None class StripeResponse(StripeResponseBase): body: str data: object def __init__(self, body: str, code: int, headers: Mapping[str, str]): StripeResponseBase.__init__(self, code, headers) self.body = body self.data = json.loads(body, object_pairs_hook=OrderedDict) class StripeStreamResponse(StripeResponseBase): io: IOBase def __init__(self, io: IOBase, code: int, headers: Mapping[str, str]): StripeResponseBase.__init__(self, code, headers) self.io = io class StripeStreamResponseAsync(StripeResponseBase): _stream: AsyncIterable[bytes] def __init__( self, stream: AsyncIterable[bytes], code: int, headers: Mapping[str, str], ): StripeResponseBase.__init__(self, code, headers) self._stream = stream def stream(self) -> AsyncIterable[bytes]: return self._stream # TODO (MAJOR): rename this to `read_async` async def read(self) -> bytes: # noqa: ASY100 return b"".join([chunk async for chunk in self._stream]) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_stripe_service.py0000644000175100001770000000510314637354563017570 0ustar00runnerdockerfrom stripe._api_requestor import ( _APIRequestor, ) from stripe._stripe_response import ( StripeStreamResponse, StripeStreamResponseAsync, ) from stripe._stripe_object import StripeObject from stripe._request_options import RequestOptions from stripe._base_address import BaseAddress from stripe._api_mode import ApiMode from typing import Any, Mapping, Optional class StripeService(object): _requestor: _APIRequestor def __init__(self, requestor): self._requestor = requestor def _request( self, method: str, url: str, params: Optional[Mapping[str, Any]] = None, options: Optional[RequestOptions] = None, *, base_address: BaseAddress, api_mode: ApiMode, ) -> StripeObject: return self._requestor.request( method, url, params, options, base_address=base_address, api_mode=api_mode, usage=["stripe_client"], ) async def _request_async( self, method: str, url: str, params: Optional[Mapping[str, Any]] = None, options: Optional[RequestOptions] = None, *, base_address: BaseAddress, api_mode: ApiMode, ) -> StripeObject: return await self._requestor.request_async( method, url, params, options, base_address=base_address, api_mode=api_mode, usage=["stripe_client"], ) def _request_stream( self, method: str, url: str, params: Optional[Mapping[str, Any]] = None, options: Optional[RequestOptions] = None, *, base_address: BaseAddress, api_mode: ApiMode, ) -> StripeStreamResponse: return self._requestor.request_stream( method, url, params, options, base_address=base_address, api_mode=api_mode, usage=["stripe_client"], ) async def _request_stream_async( self, method: str, url: str, params: Optional[Mapping[str, Any]] = None, options: Optional[RequestOptions] = None, *, base_address: BaseAddress, api_mode: ApiMode, ) -> StripeStreamResponseAsync: return await self._requestor.request_stream_async( method, url, params, options, base_address=base_address, api_mode=api_mode, usage=["stripe_client"], ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_subscription.py0000644000175100001770000043511314637354563017276 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._deletable_api_resource import DeletableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._search_result_object import SearchResultObject from stripe._searchable_api_resource import SearchableAPIResource from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ( AsyncIterator, ClassVar, Dict, Iterator, List, Optional, Union, cast, overload, ) from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._account import Account from stripe._application import Application from stripe._bank_account import BankAccount from stripe._card import Card as CardResource from stripe._customer import Customer from stripe._discount import Discount from stripe._invoice import Invoice from stripe._payment_method import PaymentMethod from stripe._setup_intent import SetupIntent from stripe._source import Source from stripe._subscription_item import SubscriptionItem from stripe._subscription_schedule import SubscriptionSchedule from stripe._tax_id import TaxId from stripe._tax_rate import TaxRate from stripe.test_helpers._test_clock import TestClock class Subscription( CreateableAPIResource["Subscription"], DeletableAPIResource["Subscription"], ListableAPIResource["Subscription"], SearchableAPIResource["Subscription"], UpdateableAPIResource["Subscription"], ): """ Subscriptions allow you to charge a customer on a recurring basis. Related guide: [Creating subscriptions](https://stripe.com/docs/billing/subscriptions/creating) """ OBJECT_NAME: ClassVar[Literal["subscription"]] = "subscription" class AutomaticTax(StripeObject): class Liability(StripeObject): account: Optional[ExpandableField["Account"]] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced. """ enabled: bool """ Whether Stripe automatically computes tax on this subscription. """ liability: Optional[Liability] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ _inner_class_types = {"liability": Liability} class BillingCycleAnchorConfig(StripeObject): day_of_month: int """ The day of the month of the billing_cycle_anchor. """ hour: Optional[int] """ The hour of the day of the billing_cycle_anchor. """ minute: Optional[int] """ The minute of the hour of the billing_cycle_anchor. """ month: Optional[int] """ The month to start full cycle billing periods. """ second: Optional[int] """ The second of the minute of the billing_cycle_anchor. """ class BillingThresholds(StripeObject): amount_gte: Optional[int] """ Monetary threshold that triggers the subscription to create an invoice """ reset_billing_cycle_anchor: Optional[bool] """ Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. This value may not be `true` if the subscription contains items with plans that have `aggregate_usage=last_ever`. """ class CancellationDetails(StripeObject): comment: Optional[str] """ Additional comments about why the user canceled the subscription, if the subscription was canceled explicitly by the user. """ feedback: Optional[ Literal[ "customer_service", "low_quality", "missing_features", "other", "switched_service", "too_complex", "too_expensive", "unused", ] ] """ The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user. """ reason: Optional[ Literal[ "cancellation_requested", "payment_disputed", "payment_failed" ] ] """ Why this subscription was canceled. """ class InvoiceSettings(StripeObject): class Issuer(StripeObject): account: Optional[ExpandableField["Account"]] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced. """ account_tax_ids: Optional[List[ExpandableField["TaxId"]]] """ The account tax IDs associated with the subscription. Will be set on invoices generated by the subscription. """ issuer: Issuer _inner_class_types = {"issuer": Issuer} class PauseCollection(StripeObject): behavior: Literal["keep_as_draft", "mark_uncollectible", "void"] """ The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. """ resumes_at: Optional[int] """ The time after which the subscription will resume collecting payments. """ class PaymentSettings(StripeObject): class PaymentMethodOptions(StripeObject): class AcssDebit(StripeObject): class MandateOptions(StripeObject): transaction_type: Optional[Literal["business", "personal"]] """ Transaction type of the mandate. """ mandate_options: Optional[MandateOptions] verification_method: Optional[ Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. """ _inner_class_types = {"mandate_options": MandateOptions} class Bancontact(StripeObject): preferred_language: Literal["de", "en", "fr", "nl"] """ Preferred language of the Bancontact authorization page that the customer is redirected to. """ class Card(StripeObject): class MandateOptions(StripeObject): amount: Optional[int] """ Amount to be charged for future payments. """ amount_type: Optional[Literal["fixed", "maximum"]] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ description: Optional[str] """ A description of the mandate or subscription that is meant to be displayed to the customer. """ mandate_options: Optional[MandateOptions] network: Optional[ Literal[ "amex", "cartes_bancaires", "diners", "discover", "eftpos_au", "interac", "jcb", "mastercard", "unionpay", "unknown", "visa", ] ] """ Selected network to process this Subscription on. Depends on the available networks of the card attached to the Subscription. Can be only set confirm-time. """ request_three_d_secure: Optional[ Literal["any", "automatic", "challenge"] ] """ 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://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ _inner_class_types = {"mandate_options": MandateOptions} class CustomerBalance(StripeObject): class BankTransfer(StripeObject): class EuBankTransfer(StripeObject): country: Literal["BE", "DE", "ES", "FR", "IE", "NL"] """ The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. """ eu_bank_transfer: Optional[EuBankTransfer] type: Optional[str] """ The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. """ _inner_class_types = {"eu_bank_transfer": EuBankTransfer} bank_transfer: Optional[BankTransfer] funding_type: Optional[Literal["bank_transfer"]] """ The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. """ _inner_class_types = {"bank_transfer": BankTransfer} class Konbini(StripeObject): pass class SepaDebit(StripeObject): pass class UsBankAccount(StripeObject): class FinancialConnections(StripeObject): class Filters(StripeObject): account_subcategories: Optional[ List[Literal["checking", "savings"]] ] """ The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`. """ filters: Optional[Filters] permissions: Optional[ List[ Literal[ "balances", "ownership", "payment_method", "transactions", ] ] ] """ The list of permissions to request. The `payment_method` permission must be included. """ prefetch: Optional[ List[Literal["balances", "ownership", "transactions"]] ] """ Data features requested to be retrieved upon account creation. """ _inner_class_types = {"filters": Filters} financial_connections: Optional[FinancialConnections] verification_method: Optional[ Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. """ _inner_class_types = { "financial_connections": FinancialConnections, } acss_debit: Optional[AcssDebit] """ This sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to invoices created by the subscription. """ bancontact: Optional[Bancontact] """ This sub-hash contains details about the Bancontact payment method options to pass to invoices created by the subscription. """ card: Optional[Card] """ This sub-hash contains details about the Card payment method options to pass to invoices created by the subscription. """ customer_balance: Optional[CustomerBalance] """ This sub-hash contains details about the Bank transfer payment method options to pass to invoices created by the subscription. """ konbini: Optional[Konbini] """ This sub-hash contains details about the Konbini payment method options to pass to invoices created by the subscription. """ sepa_debit: Optional[SepaDebit] """ This sub-hash contains details about the SEPA Direct Debit payment method options to pass to invoices created by the subscription. """ us_bank_account: Optional[UsBankAccount] """ This sub-hash contains details about the ACH direct debit payment method options to pass to invoices created by the subscription. """ _inner_class_types = { "acss_debit": AcssDebit, "bancontact": Bancontact, "card": Card, "customer_balance": CustomerBalance, "konbini": Konbini, "sepa_debit": SepaDebit, "us_bank_account": UsBankAccount, } payment_method_options: Optional[PaymentMethodOptions] """ Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: Optional[ List[ Literal[ "ach_credit_transfer", "ach_debit", "acss_debit", "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", "boleto", "card", "cashapp", "customer_balance", "eps", "fpx", "giropay", "grabpay", "ideal", "konbini", "link", "p24", "paynow", "paypal", "promptpay", "revolut_pay", "sepa_credit_transfer", "sepa_debit", "sofort", "swish", "us_bank_account", "wechat_pay", ] ] ] """ The list of payment method types to provide to every invoice created by the subscription. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). """ save_default_payment_method: Optional[ Literal["off", "on_subscription"] ] """ Either `off`, or `on_subscription`. With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. """ _inner_class_types = {"payment_method_options": PaymentMethodOptions} class PendingInvoiceItemInterval(StripeObject): interval: Literal["day", "month", "week", "year"] """ Specifies invoicing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: int """ The number of intervals between invoices. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). """ class PendingUpdate(StripeObject): billing_cycle_anchor: Optional[int] """ 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. """ expires_at: int """ The point after which the changes reflected by this update will be discarded and no longer applied. """ subscription_items: Optional[List["SubscriptionItem"]] """ List of subscription items, each with an attached plan, that will be set if the update is applied. """ trial_end: Optional[int] """ Unix timestamp representing the end of the trial period the customer will get before being charged for the first time, if the update is applied. """ trial_from_plan: Optional[bool] """ Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. """ class TransferData(StripeObject): amount_percent: Optional[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. """ destination: ExpandableField["Account"] """ The account where funds from the payment will be transferred to upon payment success. """ class TrialSettings(StripeObject): class EndBehavior(StripeObject): missing_payment_method: Literal[ "cancel", "create_invoice", "pause" ] """ Indicates how the subscription should change when the trial ends if the user did not provide a payment method. """ end_behavior: EndBehavior """ Defines how a subscription behaves when a free trial ends. """ _inner_class_types = {"end_behavior": EndBehavior} class CancelParams(RequestOptions): cancellation_details: NotRequired[ "Subscription.CancelParamsCancellationDetails" ] """ Details about why this subscription was cancelled """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ invoice_now: NotRequired[bool] """ Will generate a final invoice that invoices for any un-invoiced metered usage and new/pending proration invoice items. Defaults to `true`. """ prorate: NotRequired[bool] """ Will generate a proration invoice item that credits remaining unused time until the subscription period end. Defaults to `false`. """ class CancelParamsCancellationDetails(TypedDict): comment: NotRequired["Literal['']|str"] """ Additional comments about why the user canceled the subscription, if the subscription was canceled explicitly by the user. """ feedback: NotRequired[ "Literal['']|Literal['customer_service', 'low_quality', 'missing_features', 'other', 'switched_service', 'too_complex', 'too_expensive', 'unused']" ] """ The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user. """ class CreateParams(RequestOptions): add_invoice_items: NotRequired[ List["Subscription.CreateParamsAddInvoiceItem"] ] """ A list of prices and quantities that will generate invoice items appended to the next invoice for this subscription. You may pass up to 20 items. """ application_fee_percent: NotRequired["Literal['']|float"] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). """ automatic_tax: NotRequired["Subscription.CreateParamsAutomaticTax"] """ Automatic tax settings for this subscription. We recommend you only include this parameter when the existing value is being changed. """ backdate_start_date: NotRequired[int] """ For new subscriptions, a past timestamp to backdate the subscription's start date to. If set, the first invoice will contain a proration for the timespan between the start date and the current time. Can be combined with trials and the billing cycle anchor. """ billing_cycle_anchor: NotRequired[int] """ A future timestamp in UTC format to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). The anchor is the reference point that aligns future billing cycle dates. It sets the day of week for `week` intervals, the day of month for `month` and `year` intervals, and the month of year for `year` intervals. """ billing_cycle_anchor_config: NotRequired[ "Subscription.CreateParamsBillingCycleAnchorConfig" ] """ Mutually exclusive with billing_cycle_anchor and only valid with monthly and yearly price intervals. When provided, the billing_cycle_anchor is set to the next occurence of the day_of_month at the hour, minute, and second UTC. """ billing_thresholds: NotRequired[ "Literal['']|Subscription.CreateParamsBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds. """ cancel_at: NotRequired[int] """ A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. """ cancel_at_period_end: NotRequired[bool] """ Boolean indicating whether this subscription should cancel at the end of the current period. """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`. """ coupon: NotRequired[str] """ The ID of the coupon to apply to this subscription. A coupon applied to a subscription will only affect invoices created for that particular subscription. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. """ currency: NotRequired[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). """ customer: str """ The identifier of the customer to subscribe. """ days_until_due: NotRequired[int] """ Number of days a customer has to pay invoices generated by this subscription. Valid only for subscriptions where `collection_method` is set to `send_invoice`. """ default_payment_method: NotRequired[str] """ ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over `default_source`. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). """ default_source: NotRequired[str] """ ID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If `default_payment_method` is also set, `default_payment_method` will take precedence. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). """ default_tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates that will apply to any subscription item that does not have `tax_rates` set. Invoices created will have their `default_tax_rates` populated from the subscription. """ description: NotRequired[str] """ The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ discounts: NotRequired[ "Literal['']|List[Subscription.CreateParamsDiscount]" ] """ The coupons to redeem into discounts for the subscription. If not specified or empty, inherits the discount from the subscription's customer. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ invoice_settings: NotRequired[ "Subscription.CreateParamsInvoiceSettings" ] """ All invoices will be billed using the specified settings. """ items: NotRequired[List["Subscription.CreateParamsItem"]] """ A list of up to 20 subscription items, each with an attached price. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ off_session: NotRequired[bool] """ Indicates if a customer is on or off-session while an invoice payment is attempted. """ on_behalf_of: NotRequired["Literal['']|str"] """ The account on behalf of which to charge, for each of the subscription's invoices. """ payment_behavior: NotRequired[ Literal[ "allow_incomplete", "default_incomplete", "error_if_incomplete", "pending_if_incomplete", ] ] """ Only applies to subscriptions with `collection_method=charge_automatically`. Use `allow_incomplete` to create Subscriptions with `status=incomplete` if the first invoice can't be paid. Creating Subscriptions with this status allows you to manage scenarios where additional customer actions are needed to pay a subscription's invoice. For example, SCA regulation may require 3DS authentication to complete payment. See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. This is the default behavior. Use `default_incomplete` to create Subscriptions with `status=incomplete` when the first invoice requires payment, otherwise start as active. Subscriptions transition to `status=active` when successfully confirming the PaymentIntent on the first invoice. This allows simpler management of scenarios where additional customer actions are needed to pay a subscription's invoice, such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method. If the PaymentIntent is not confirmed within 23 hours Subscriptions transition to `status=incomplete_expired`, which is a terminal state. Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's first invoice can't be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further customer action is needed, this parameter doesn't create a Subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. `pending_if_incomplete` is only used with updates and cannot be passed when creating a Subscription. Subscriptions with `collection_method=send_invoice` are automatically activated regardless of the first Invoice status. """ payment_settings: NotRequired[ "Subscription.CreateParamsPaymentSettings" ] """ Payment settings to pass to invoices created by the subscription. """ pending_invoice_item_interval: NotRequired[ "Literal['']|Subscription.CreateParamsPendingInvoiceItemInterval" ] """ Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval. """ promotion_code: NotRequired[str] """ The ID of a promotion code to apply to this subscription. A promotion code applied to a subscription will only affect invoices created for that particular subscription. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) resulting from the `billing_cycle_anchor`. If no value is passed, the default is `create_prorations`. """ transfer_data: NotRequired["Subscription.CreateParamsTransferData"] """ If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges. """ trial_end: NotRequired["Literal['now']|int"] """ Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. If set, trial_end will override the default trial period of the plan the customer is being subscribed to. The special value `now` can be provided to end the customer's trial immediately. Can be at most two years from `billing_cycle_anchor`. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. """ trial_from_plan: NotRequired[bool] """ Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. """ trial_period_days: NotRequired[int] """ Integer representing the number of trial period days before the customer is charged for the first time. This will always overwrite any trials that might apply via a subscribed plan. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. """ trial_settings: NotRequired["Subscription.CreateParamsTrialSettings"] """ Settings related to subscription trials. """ class CreateParamsAddInvoiceItem(TypedDict): discounts: NotRequired[ List["Subscription.CreateParamsAddInvoiceItemDiscount"] ] """ The coupons to redeem into discounts for the item. """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired[ "Subscription.CreateParamsAddInvoiceItemPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ Quantity for this item. Defaults to 1. """ tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. """ class CreateParamsAddInvoiceItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class CreateParamsAddInvoiceItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class CreateParamsAutomaticTax(TypedDict): enabled: bool """ Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. """ liability: NotRequired[ "Subscription.CreateParamsAutomaticTaxLiability" ] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ class CreateParamsAutomaticTaxLiability(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class CreateParamsBillingCycleAnchorConfig(TypedDict): day_of_month: int """ The day of the month the billing_cycle_anchor should be. Ranges from 1 to 31. """ hour: NotRequired[int] """ The hour of the day the billing_cycle_anchor should be. Ranges from 0 to 23. """ minute: NotRequired[int] """ The minute of the hour the billing_cycle_anchor should be. Ranges from 0 to 59. """ month: NotRequired[int] """ The month to start full cycle billing periods. Ranges from 1 to 12. """ second: NotRequired[int] """ The second of the minute the billing_cycle_anchor should be. Ranges from 0 to 59. """ class CreateParamsBillingThresholds(TypedDict): amount_gte: NotRequired[int] """ Monetary threshold that triggers the subscription to advance to a new billing period """ reset_billing_cycle_anchor: NotRequired[bool] """ Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. """ class CreateParamsDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class CreateParamsInvoiceSettings(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ The account tax IDs associated with the subscription. Will be set on invoices generated by the subscription. """ issuer: NotRequired["Subscription.CreateParamsInvoiceSettingsIssuer"] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ class CreateParamsInvoiceSettingsIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class CreateParamsItem(TypedDict): billing_thresholds: NotRequired[ "Literal['']|Subscription.CreateParamsItemBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ discounts: NotRequired[ "Literal['']|List[Subscription.CreateParamsItemDiscount]" ] """ The coupons to redeem into discounts for the subscription item. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ plan: NotRequired[str] """ Plan ID for this item, as a string. """ price: NotRequired[str] """ The ID of the price object. """ price_data: NotRequired["Subscription.CreateParamsItemPriceData"] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ quantity: NotRequired[int] """ Quantity for this item. """ tax_rates: NotRequired["Literal['']|List[str]"] """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ class CreateParamsItemBillingThresholds(TypedDict): usage_gte: int """ Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ class CreateParamsItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class CreateParamsItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ recurring: "Subscription.CreateParamsItemPriceDataRecurring" """ The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class CreateParamsItemPriceDataRecurring(TypedDict): interval: Literal["day", "month", "week", "year"] """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class CreateParamsPaymentSettings(TypedDict): payment_method_options: NotRequired[ "Subscription.CreateParamsPaymentSettingsPaymentMethodOptions" ] """ Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). """ save_default_payment_method: NotRequired[ Literal["off", "on_subscription"] ] """ Either `off`, or `on_subscription`. With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. """ class CreateParamsPaymentSettingsPaymentMethodOptions(TypedDict): acss_debit: NotRequired[ "Literal['']|Subscription.CreateParamsPaymentSettingsPaymentMethodOptionsAcssDebit" ] """ This sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice's PaymentIntent. """ bancontact: NotRequired[ "Literal['']|Subscription.CreateParamsPaymentSettingsPaymentMethodOptionsBancontact" ] """ This sub-hash contains details about the Bancontact payment method options to pass to the invoice's PaymentIntent. """ card: NotRequired[ "Literal['']|Subscription.CreateParamsPaymentSettingsPaymentMethodOptionsCard" ] """ This sub-hash contains details about the Card payment method options to pass to the invoice's PaymentIntent. """ customer_balance: NotRequired[ "Literal['']|Subscription.CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalance" ] """ This sub-hash contains details about the Bank transfer payment method options to pass to the invoice's PaymentIntent. """ konbini: NotRequired[ "Literal['']|Subscription.CreateParamsPaymentSettingsPaymentMethodOptionsKonbini" ] """ This sub-hash contains details about the Konbini payment method options to pass to the invoice's PaymentIntent. """ sepa_debit: NotRequired[ "Literal['']|Subscription.CreateParamsPaymentSettingsPaymentMethodOptionsSepaDebit" ] """ This sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice's PaymentIntent. """ us_bank_account: NotRequired[ "Literal['']|Subscription.CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccount" ] """ This sub-hash contains details about the ACH direct debit payment method options to pass to the invoice's PaymentIntent. """ class CreateParamsPaymentSettingsPaymentMethodOptionsAcssDebit(TypedDict): mandate_options: NotRequired[ "Subscription.CreateParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions" ] """ Additional fields for Mandate creation """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] """ Verification method for the intent """ class CreateParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions( TypedDict, ): transaction_type: NotRequired[Literal["business", "personal"]] """ Transaction type of the mandate. """ class CreateParamsPaymentSettingsPaymentMethodOptionsBancontact(TypedDict): preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] """ Preferred language of the Bancontact authorization page that the customer is redirected to. """ class CreateParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): mandate_options: NotRequired[ "Subscription.CreateParamsPaymentSettingsPaymentMethodOptionsCardMandateOptions" ] """ Configuration options for setting up an eMandate for cards issued in India. """ network: NotRequired[ Literal[ "amex", "cartes_bancaires", "diners", "discover", "eftpos_au", "interac", "jcb", "mastercard", "unionpay", "unknown", "visa", ] ] """ Selected network to process this Subscription on. Depends on the available networks of the card attached to the Subscription. Can be only set confirm-time. """ request_three_d_secure: NotRequired[ Literal["any", "automatic", "challenge"] ] """ 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://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ class CreateParamsPaymentSettingsPaymentMethodOptionsCardMandateOptions( TypedDict, ): amount: NotRequired[int] """ Amount to be charged for future payments. """ amount_type: NotRequired[Literal["fixed", "maximum"]] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ description: NotRequired[str] """ A description of the mandate or subscription that is meant to be displayed to the customer. """ class CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalance( TypedDict, ): bank_transfer: NotRequired[ "Subscription.CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer" ] """ Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. """ funding_type: NotRequired[str] """ The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. """ class CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer( TypedDict, ): eu_bank_transfer: NotRequired[ "Subscription.CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer" ] """ Configuration for eu_bank_transfer funding type. """ type: NotRequired[str] """ The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. """ class CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer( TypedDict, ): country: str """ The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. """ class CreateParamsPaymentSettingsPaymentMethodOptionsKonbini(TypedDict): pass class CreateParamsPaymentSettingsPaymentMethodOptionsSepaDebit(TypedDict): pass class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccount( TypedDict, ): financial_connections: NotRequired[ "Subscription.CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections" ] """ Additional fields for Financial Connections Session creation """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] """ Verification method for the intent """ class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): filters: NotRequired[ "Subscription.CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" ] """ Provide filters for the linked accounts that the customer can select for the payment method. """ permissions: NotRequired[ List[ Literal[ "balances", "ownership", "payment_method", "transactions" ] ] ] """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ List[Literal["balances", "ownership", "transactions"]] ] """ List of data features that you would like to retrieve upon account creation. """ class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( TypedDict, ): account_subcategories: NotRequired[ List[Literal["checking", "savings"]] ] """ The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. """ class CreateParamsPendingInvoiceItemInterval(TypedDict): interval: Literal["day", "month", "week", "year"] """ Specifies invoicing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: NotRequired[int] """ The number of intervals between invoices. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). """ class CreateParamsTransferData(TypedDict): amount_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. """ destination: str """ ID of an existing, connected Stripe account. """ class CreateParamsTrialSettings(TypedDict): end_behavior: "Subscription.CreateParamsTrialSettingsEndBehavior" """ Defines how the subscription should behave when the user's free trial ends. """ class CreateParamsTrialSettingsEndBehavior(TypedDict): missing_payment_method: Literal["cancel", "create_invoice", "pause"] """ Indicates how the subscription should change when the trial ends if the user did not provide a payment method. """ class DeleteDiscountParams(RequestOptions): pass class ListParams(RequestOptions): automatic_tax: NotRequired["Subscription.ListParamsAutomaticTax"] """ Filter subscriptions by their automatic tax settings. """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] """ The collection method of the subscriptions to retrieve. Either `charge_automatically` or `send_invoice`. """ created: NotRequired["Subscription.ListParamsCreated|int"] """ Only return subscriptions that were created during the given date interval. """ current_period_end: NotRequired[ "Subscription.ListParamsCurrentPeriodEnd|int" ] current_period_start: NotRequired[ "Subscription.ListParamsCurrentPeriodStart|int" ] customer: NotRequired[str] """ The ID of the customer whose subscriptions will be retrieved. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ plan: NotRequired[str] """ The ID of the plan whose subscriptions will be retrieved. """ price: NotRequired[str] """ Filter for subscriptions that contain this recurring price ID. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ Literal[ "active", "all", "canceled", "ended", "incomplete", "incomplete_expired", "past_due", "paused", "trialing", "unpaid", ] ] """ The status of the subscriptions to retrieve. Passing in a value of `canceled` will return all canceled subscriptions, including those belonging to deleted customers. Pass `ended` to find subscriptions that are canceled and subscriptions that are expired due to [incomplete payment](https://stripe.com/docs/billing/subscriptions/overview#subscription-statuses). Passing in a value of `all` will return subscriptions of all statuses. If no value is supplied, all subscriptions that have not been canceled are returned. """ test_clock: NotRequired[str] """ Filter for subscriptions that are associated with the specified test clock. The response will not include subscriptions with test clocks if this and the customer parameter is not set. """ class ListParamsAutomaticTax(TypedDict): enabled: bool """ Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsCurrentPeriodEnd(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsCurrentPeriodStart(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): add_invoice_items: NotRequired[ List["Subscription.ModifyParamsAddInvoiceItem"] ] """ A list of prices and quantities that will generate invoice items appended to the next invoice for this subscription. You may pass up to 20 items. """ application_fee_percent: NotRequired["Literal['']|float"] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). """ automatic_tax: NotRequired["Subscription.ModifyParamsAutomaticTax"] """ Automatic tax settings for this subscription. We recommend you only include this parameter when the existing value is being changed. """ billing_cycle_anchor: NotRequired[Literal["now", "unchanged"]] """ Either `now` or `unchanged`. Setting the value to `now` resets the subscription's billing cycle anchor to the current time (in UTC). For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ billing_thresholds: NotRequired[ "Literal['']|Subscription.ModifyParamsBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds. """ cancel_at: NotRequired["Literal['']|int"] """ A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. """ cancel_at_period_end: NotRequired[bool] """ Boolean indicating whether this subscription should cancel at the end of the current period. """ cancellation_details: NotRequired[ "Subscription.ModifyParamsCancellationDetails" ] """ Details about why this subscription was cancelled """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`. """ coupon: NotRequired[str] """ The ID of the coupon to apply to this subscription. A coupon applied to a subscription will only affect invoices created for that particular subscription. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. """ days_until_due: NotRequired[int] """ Number of days a customer has to pay invoices generated by this subscription. Valid only for subscriptions where `collection_method` is set to `send_invoice`. """ default_payment_method: NotRequired[str] """ ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over `default_source`. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). """ default_source: NotRequired["Literal['']|str"] """ ID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If `default_payment_method` is also set, `default_payment_method` will take precedence. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). """ default_tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates that will apply to any subscription item that does not have `tax_rates` set. Invoices created will have their `default_tax_rates` populated from the subscription. Pass an empty string to remove previously-defined tax rates. """ description: NotRequired["Literal['']|str"] """ The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ discounts: NotRequired[ "Literal['']|List[Subscription.ModifyParamsDiscount]" ] """ The coupons to redeem into discounts for the subscription. If not specified or empty, inherits the discount from the subscription's customer. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ invoice_settings: NotRequired[ "Subscription.ModifyParamsInvoiceSettings" ] """ All invoices will be billed using the specified settings. """ items: NotRequired[List["Subscription.ModifyParamsItem"]] """ A list of up to 20 subscription items, each with an attached price. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ off_session: NotRequired[bool] """ Indicates if a customer is on or off-session while an invoice payment is attempted. """ on_behalf_of: NotRequired["Literal['']|str"] """ The account on behalf of which to charge, for each of the subscription's invoices. """ pause_collection: NotRequired[ "Literal['']|Subscription.ModifyParamsPauseCollection" ] """ If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/billing/subscriptions/pause-payment). """ payment_behavior: NotRequired[ Literal[ "allow_incomplete", "default_incomplete", "error_if_incomplete", "pending_if_incomplete", ] ] """ Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. For example, SCA regulation may require 3DS authentication to complete payment. See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. This is the default behavior. Use `default_incomplete` to transition the subscription to `status=past_due` when payment is required and await explicit confirmation of the invoice's payment intent. This allows simpler management of scenarios where additional user actions are needed to pay a subscription's invoice. Such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method. Use `pending_if_incomplete` to update the subscription using [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates). When you use `pending_if_incomplete` you can only pass the parameters [supported by pending updates](https://stripe.com/docs/billing/pending-updates-reference#supported-attributes). Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. """ payment_settings: NotRequired[ "Subscription.ModifyParamsPaymentSettings" ] """ Payment settings to pass to invoices created by the subscription. """ pending_invoice_item_interval: NotRequired[ "Literal['']|Subscription.ModifyParamsPendingInvoiceItemInterval" ] """ Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval. """ promotion_code: NotRequired[str] """ The promotion code to apply to this subscription. A promotion code applied to a subscription will only affect invoices created for that particular subscription. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ proration_date: NotRequired[int] """ If set, the proration will be calculated as though the subscription was updated at the given time. This can be used to apply exactly the same proration that was previewed with [upcoming invoice](https://stripe.com/docs/api#upcoming_invoice) endpoint. It can also be used to implement custom proration logic, such as prorating by day instead of by second, by providing the time that you wish to use for proration calculations. """ transfer_data: NotRequired[ "Literal['']|Subscription.ModifyParamsTransferData" ] """ If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges. This will be unset if you POST an empty value. """ trial_end: NotRequired["Literal['now']|int"] """ Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. This will always overwrite any trials that might apply via a subscribed plan. If set, trial_end will override the default trial period of the plan the customer is being subscribed to. The special value `now` can be provided to end the customer's trial immediately. Can be at most two years from `billing_cycle_anchor`. """ trial_from_plan: NotRequired[bool] """ Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. """ trial_settings: NotRequired["Subscription.ModifyParamsTrialSettings"] """ Settings related to subscription trials. """ class ModifyParamsAddInvoiceItem(TypedDict): discounts: NotRequired[ List["Subscription.ModifyParamsAddInvoiceItemDiscount"] ] """ The coupons to redeem into discounts for the item. """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired[ "Subscription.ModifyParamsAddInvoiceItemPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ Quantity for this item. Defaults to 1. """ tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. """ class ModifyParamsAddInvoiceItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class ModifyParamsAddInvoiceItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class ModifyParamsAutomaticTax(TypedDict): enabled: bool """ Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. """ liability: NotRequired[ "Subscription.ModifyParamsAutomaticTaxLiability" ] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ class ModifyParamsAutomaticTaxLiability(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class ModifyParamsBillingThresholds(TypedDict): amount_gte: NotRequired[int] """ Monetary threshold that triggers the subscription to advance to a new billing period """ reset_billing_cycle_anchor: NotRequired[bool] """ Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. """ class ModifyParamsCancellationDetails(TypedDict): comment: NotRequired["Literal['']|str"] """ Additional comments about why the user canceled the subscription, if the subscription was canceled explicitly by the user. """ feedback: NotRequired[ "Literal['']|Literal['customer_service', 'low_quality', 'missing_features', 'other', 'switched_service', 'too_complex', 'too_expensive', 'unused']" ] """ The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user. """ class ModifyParamsDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class ModifyParamsInvoiceSettings(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ The account tax IDs associated with the subscription. Will be set on invoices generated by the subscription. """ issuer: NotRequired["Subscription.ModifyParamsInvoiceSettingsIssuer"] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ class ModifyParamsInvoiceSettingsIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class ModifyParamsItem(TypedDict): billing_thresholds: NotRequired[ "Literal['']|Subscription.ModifyParamsItemBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ clear_usage: NotRequired[bool] """ Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. """ deleted: NotRequired[bool] """ A flag that, if set to `true`, will delete the specified item. """ discounts: NotRequired[ "Literal['']|List[Subscription.ModifyParamsItemDiscount]" ] """ The coupons to redeem into discounts for the subscription item. """ id: NotRequired[str] """ Subscription item to update. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ plan: NotRequired[str] """ Plan ID for this item, as a string. """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ price_data: NotRequired["Subscription.ModifyParamsItemPriceData"] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ Quantity for this item. """ tax_rates: NotRequired["Literal['']|List[str]"] """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ class ModifyParamsItemBillingThresholds(TypedDict): usage_gte: int """ Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ class ModifyParamsItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class ModifyParamsItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ recurring: "Subscription.ModifyParamsItemPriceDataRecurring" """ The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class ModifyParamsItemPriceDataRecurring(TypedDict): interval: Literal["day", "month", "week", "year"] """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class ModifyParamsPauseCollection(TypedDict): behavior: Literal["keep_as_draft", "mark_uncollectible", "void"] """ The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. """ resumes_at: NotRequired[int] """ The time after which the subscription will resume collecting payments. """ class ModifyParamsPaymentSettings(TypedDict): payment_method_options: NotRequired[ "Subscription.ModifyParamsPaymentSettingsPaymentMethodOptions" ] """ Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). """ save_default_payment_method: NotRequired[ Literal["off", "on_subscription"] ] """ Either `off`, or `on_subscription`. With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. """ class ModifyParamsPaymentSettingsPaymentMethodOptions(TypedDict): acss_debit: NotRequired[ "Literal['']|Subscription.ModifyParamsPaymentSettingsPaymentMethodOptionsAcssDebit" ] """ This sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice's PaymentIntent. """ bancontact: NotRequired[ "Literal['']|Subscription.ModifyParamsPaymentSettingsPaymentMethodOptionsBancontact" ] """ This sub-hash contains details about the Bancontact payment method options to pass to the invoice's PaymentIntent. """ card: NotRequired[ "Literal['']|Subscription.ModifyParamsPaymentSettingsPaymentMethodOptionsCard" ] """ This sub-hash contains details about the Card payment method options to pass to the invoice's PaymentIntent. """ customer_balance: NotRequired[ "Literal['']|Subscription.ModifyParamsPaymentSettingsPaymentMethodOptionsCustomerBalance" ] """ This sub-hash contains details about the Bank transfer payment method options to pass to the invoice's PaymentIntent. """ konbini: NotRequired[ "Literal['']|Subscription.ModifyParamsPaymentSettingsPaymentMethodOptionsKonbini" ] """ This sub-hash contains details about the Konbini payment method options to pass to the invoice's PaymentIntent. """ sepa_debit: NotRequired[ "Literal['']|Subscription.ModifyParamsPaymentSettingsPaymentMethodOptionsSepaDebit" ] """ This sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice's PaymentIntent. """ us_bank_account: NotRequired[ "Literal['']|Subscription.ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccount" ] """ This sub-hash contains details about the ACH direct debit payment method options to pass to the invoice's PaymentIntent. """ class ModifyParamsPaymentSettingsPaymentMethodOptionsAcssDebit(TypedDict): mandate_options: NotRequired[ "Subscription.ModifyParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions" ] """ Additional fields for Mandate creation """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] """ Verification method for the intent """ class ModifyParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions( TypedDict, ): transaction_type: NotRequired[Literal["business", "personal"]] """ Transaction type of the mandate. """ class ModifyParamsPaymentSettingsPaymentMethodOptionsBancontact(TypedDict): preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] """ Preferred language of the Bancontact authorization page that the customer is redirected to. """ class ModifyParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): mandate_options: NotRequired[ "Subscription.ModifyParamsPaymentSettingsPaymentMethodOptionsCardMandateOptions" ] """ Configuration options for setting up an eMandate for cards issued in India. """ network: NotRequired[ Literal[ "amex", "cartes_bancaires", "diners", "discover", "eftpos_au", "interac", "jcb", "mastercard", "unionpay", "unknown", "visa", ] ] """ Selected network to process this Subscription on. Depends on the available networks of the card attached to the Subscription. Can be only set confirm-time. """ request_three_d_secure: NotRequired[ Literal["any", "automatic", "challenge"] ] """ 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://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ class ModifyParamsPaymentSettingsPaymentMethodOptionsCardMandateOptions( TypedDict, ): amount: NotRequired[int] """ Amount to be charged for future payments. """ amount_type: NotRequired[Literal["fixed", "maximum"]] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ description: NotRequired[str] """ A description of the mandate or subscription that is meant to be displayed to the customer. """ class ModifyParamsPaymentSettingsPaymentMethodOptionsCustomerBalance( TypedDict, ): bank_transfer: NotRequired[ "Subscription.ModifyParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer" ] """ Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. """ funding_type: NotRequired[str] """ The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. """ class ModifyParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer( TypedDict, ): eu_bank_transfer: NotRequired[ "Subscription.ModifyParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer" ] """ Configuration for eu_bank_transfer funding type. """ type: NotRequired[str] """ The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. """ class ModifyParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer( TypedDict, ): country: str """ The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. """ class ModifyParamsPaymentSettingsPaymentMethodOptionsKonbini(TypedDict): pass class ModifyParamsPaymentSettingsPaymentMethodOptionsSepaDebit(TypedDict): pass class ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccount( TypedDict, ): financial_connections: NotRequired[ "Subscription.ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections" ] """ Additional fields for Financial Connections Session creation """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] """ Verification method for the intent """ class ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): filters: NotRequired[ "Subscription.ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" ] """ Provide filters for the linked accounts that the customer can select for the payment method. """ permissions: NotRequired[ List[ Literal[ "balances", "ownership", "payment_method", "transactions" ] ] ] """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ List[Literal["balances", "ownership", "transactions"]] ] """ List of data features that you would like to retrieve upon account creation. """ class ModifyParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( TypedDict, ): account_subcategories: NotRequired[ List[Literal["checking", "savings"]] ] """ The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. """ class ModifyParamsPendingInvoiceItemInterval(TypedDict): interval: Literal["day", "month", "week", "year"] """ Specifies invoicing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: NotRequired[int] """ The number of intervals between invoices. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). """ class ModifyParamsTransferData(TypedDict): amount_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. """ destination: str """ ID of an existing, connected Stripe account. """ class ModifyParamsTrialSettings(TypedDict): end_behavior: "Subscription.ModifyParamsTrialSettingsEndBehavior" """ Defines how the subscription should behave when the user's free trial ends. """ class ModifyParamsTrialSettingsEndBehavior(TypedDict): missing_payment_method: Literal["cancel", "create_invoice", "pause"] """ Indicates how the subscription should change when the trial ends if the user did not provide a payment method. """ class ResumeParams(RequestOptions): billing_cycle_anchor: NotRequired[Literal["now", "unchanged"]] """ Either `now` or `unchanged`. Setting the value to `now` resets the subscription's billing cycle anchor to the current time (in UTC). Setting the value to `unchanged` advances the subscription's billing cycle anchor to the period that surrounds the current time. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ proration_date: NotRequired[int] """ If set, the proration will be calculated as though the subscription was resumed at the given time. This can be used to apply exactly the same proration that was previewed with [upcoming invoice](https://stripe.com/docs/api#retrieve_customer_invoice) endpoint. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class SearchParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ page: NotRequired[str] """ A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. """ query: str """ The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for subscriptions](https://stripe.com/docs/search#query-fields-for-subscriptions). """ application: Optional[ExpandableField["Application"]] """ ID of the Connect Application that created the subscription. """ application_fee_percent: Optional[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. """ automatic_tax: AutomaticTax billing_cycle_anchor: int """ The reference point that aligns future [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle) dates. It sets the day of week for `week` intervals, the day of month for `month` and `year` intervals, and the month of year for `year` intervals. The timestamp is in UTC format. """ billing_cycle_anchor_config: Optional[BillingCycleAnchorConfig] """ The fixed values used to calculate the `billing_cycle_anchor`. """ billing_thresholds: Optional[BillingThresholds] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period """ cancel_at: Optional[int] """ A date in the future at which the subscription will automatically get canceled """ cancel_at_period_end: bool """ If the subscription has been canceled with the `at_period_end` flag set to `true`, `cancel_at_period_end` on the subscription will be true. You can use this attribute to determine whether a subscription that has a status of active is scheduled to be canceled at the end of the current period. """ canceled_at: Optional[int] """ If the subscription has been canceled, the date of that cancellation. If the subscription was canceled with `cancel_at_period_end`, `canceled_at` will reflect the time of the most recent update request, not the end of the subscription period when the subscription is automatically moved to a canceled state. """ cancellation_details: Optional[CancellationDetails] """ Details about why this subscription was cancelled """ collection_method: Literal["charge_automatically", "send_invoice"] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ 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). """ current_period_end: int """ End of the current period that the subscription has been invoiced for. At the end of this period, a new invoice will be created. """ current_period_start: int """ Start of the current period that the subscription has been invoiced for. """ customer: ExpandableField["Customer"] """ ID of the customer who owns the subscription. """ days_until_due: Optional[int] """ Number of days a customer has to pay invoices generated by this subscription. This value will be `null` for subscriptions where `collection_method=charge_automatically`. """ default_payment_method: Optional[ExpandableField["PaymentMethod"]] """ ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over `default_source`. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). """ default_source: Optional[ ExpandableField[ Union["Account", "BankAccount", "CardResource", "Source"] ] ] """ ID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If `default_payment_method` is also set, `default_payment_method` will take precedence. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). """ default_tax_rates: Optional[List["TaxRate"]] """ The tax rates that will apply to any subscription item that does not have `tax_rates` set. Invoices created will have their `default_tax_rates` populated from the subscription. """ description: Optional[str] """ The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ discount: Optional["Discount"] """ Describes the current discount applied to this subscription, if there is one. When billing, a discount applied to a subscription overrides a discount applied on a customer-wide basis. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. """ discounts: List[ExpandableField["Discount"]] """ The discounts applied to the subscription. Subscription item discounts are applied before subscription discounts. Use `expand[]=discounts` to expand each discount. """ ended_at: Optional[int] """ If the subscription has ended, the date the subscription ended. """ id: str """ Unique identifier for the object. """ invoice_settings: InvoiceSettings items: ListObject["SubscriptionItem"] """ List of subscription items, each with an attached price. """ latest_invoice: Optional[ExpandableField["Invoice"]] """ The most recent invoice this subscription has generated. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ metadata: Dict[str, str] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ next_pending_invoice_item_invoice: Optional[int] """ Specifies the approximate timestamp on which any pending invoice items will be billed according to the schedule provided at `pending_invoice_item_interval`. """ object: Literal["subscription"] """ String representing the object's type. Objects of the same type share the same value. """ on_behalf_of: Optional[ExpandableField["Account"]] """ The account (if any) the charge was made on behalf of for charges associated with this subscription. See the Connect documentation for details. """ pause_collection: Optional[PauseCollection] """ If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/billing/subscriptions/pause-payment). """ payment_settings: Optional[PaymentSettings] """ Payment settings passed on to invoices created by the subscription. """ pending_invoice_item_interval: Optional[PendingInvoiceItemInterval] """ Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval. """ pending_setup_intent: Optional[ExpandableField["SetupIntent"]] """ You can use this [SetupIntent](https://stripe.com/docs/api/setup_intents) to collect user authentication when creating a subscription without immediate payment or updating a subscription's payment method, allowing you to optimize for off-session payments. Learn more in the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication#scenario-2). """ pending_update: Optional[PendingUpdate] """ If specified, [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates) that will be applied to the subscription once the `latest_invoice` has been paid. """ schedule: Optional[ExpandableField["SubscriptionSchedule"]] """ The schedule attached to the subscription """ start_date: int """ Date when the subscription was first created. The date might differ from the `created` date due to backdating. """ status: Literal[ "active", "canceled", "incomplete", "incomplete_expired", "past_due", "paused", "trialing", "unpaid", ] """ Possible values are `incomplete`, `incomplete_expired`, `trialing`, `active`, `past_due`, `canceled`, `unpaid`, or `paused`. For `collection_method=charge_automatically` a subscription moves into `incomplete` if the initial payment attempt fails. A subscription in this status can only have metadata and default_source updated. Once the first invoice is paid, the subscription moves into an `active` status. If the first invoice is not paid within 23 hours, the subscription transitions to `incomplete_expired`. This is a terminal status, the open invoice will be voided and no further invoices will be generated. A subscription that is currently in a trial period is `trialing` and moves to `active` when the trial period is over. A subscription can only enter a `paused` status [when a trial ends without a payment method](https://stripe.com/billing/subscriptions/trials#create-free-trials-without-payment). A `paused` subscription doesn't generate invoices and can be resumed after your customer adds their payment method. The `paused` status is different from [pausing collection](https://stripe.com/billing/subscriptions/pause-payment), which still generates invoices and leaves the subscription's status unchanged. If subscription `collection_method=charge_automatically`, it becomes `past_due` when payment is required but cannot be paid (due to failed payment or awaiting additional user actions). Once Stripe has exhausted all payment retry attempts, the subscription will become `canceled` or `unpaid` (depending on your subscriptions settings). If subscription `collection_method=send_invoice` it becomes `past_due` when its invoice is not paid by the due date, and `canceled` or `unpaid` if it is still not paid by an additional deadline after that. Note that when a subscription has a status of `unpaid`, no subsequent invoices will be attempted (invoices will be created, but then immediately automatically closed). After receiving updated payment information from a customer, you may choose to reopen and pay their closed invoices. """ test_clock: Optional[ExpandableField["TestClock"]] """ ID of the test clock this subscription belongs to. """ transfer_data: Optional[TransferData] """ The account (if any) the subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices. """ trial_end: Optional[int] """ If the subscription has a trial, the end of that trial. """ trial_settings: Optional[TrialSettings] """ Settings related to subscription trials. """ trial_start: Optional[int] """ If the subscription has a trial, the beginning of that trial. """ @classmethod def _cls_cancel( cls, subscription_exposed_id: str, **params: Unpack["Subscription.CancelParams"], ) -> "Subscription": """ Cancels a customer's subscription immediately. The customer will not be charged again for the subscription. Note, however, that any pending invoice items that you've created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed. By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all. """ return cast( "Subscription", cls._static_request( "delete", "/v1/subscriptions/{subscription_exposed_id}".format( subscription_exposed_id=sanitize_id( subscription_exposed_id ) ), params=params, ), ) @overload @staticmethod def cancel( subscription_exposed_id: str, **params: Unpack["Subscription.CancelParams"], ) -> "Subscription": """ Cancels a customer's subscription immediately. The customer will not be charged again for the subscription. Note, however, that any pending invoice items that you've created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed. By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all. """ ... @overload def cancel( self, **params: Unpack["Subscription.CancelParams"] ) -> "Subscription": """ Cancels a customer's subscription immediately. The customer will not be charged again for the subscription. Note, however, that any pending invoice items that you've created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed. By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all. """ ... @class_method_variant("_cls_cancel") def cancel( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Subscription.CancelParams"] ) -> "Subscription": """ Cancels a customer's subscription immediately. The customer will not be charged again for the subscription. Note, however, that any pending invoice items that you've created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed. By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all. """ return cast( "Subscription", self._request( "delete", "/v1/subscriptions/{subscription_exposed_id}".format( subscription_exposed_id=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_cancel_async( cls, subscription_exposed_id: str, **params: Unpack["Subscription.CancelParams"], ) -> "Subscription": """ Cancels a customer's subscription immediately. The customer will not be charged again for the subscription. Note, however, that any pending invoice items that you've created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed. By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all. """ return cast( "Subscription", await cls._static_request_async( "delete", "/v1/subscriptions/{subscription_exposed_id}".format( subscription_exposed_id=sanitize_id( subscription_exposed_id ) ), params=params, ), ) @overload @staticmethod async def cancel_async( subscription_exposed_id: str, **params: Unpack["Subscription.CancelParams"], ) -> "Subscription": """ Cancels a customer's subscription immediately. The customer will not be charged again for the subscription. Note, however, that any pending invoice items that you've created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed. By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all. """ ... @overload async def cancel_async( self, **params: Unpack["Subscription.CancelParams"] ) -> "Subscription": """ Cancels a customer's subscription immediately. The customer will not be charged again for the subscription. Note, however, that any pending invoice items that you've created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed. By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all. """ ... @class_method_variant("_cls_cancel_async") async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Subscription.CancelParams"] ) -> "Subscription": """ Cancels a customer's subscription immediately. The customer will not be charged again for the subscription. Note, however, that any pending invoice items that you've created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed. By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all. """ return cast( "Subscription", await self._request_async( "delete", "/v1/subscriptions/{subscription_exposed_id}".format( subscription_exposed_id=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def create( cls, **params: Unpack["Subscription.CreateParams"] ) -> "Subscription": """ Creates a new subscription on an existing customer. Each customer can have up to 500 active or scheduled subscriptions. When you create a subscription with collection_method=charge_automatically, the first invoice is finalized as part of the request. The payment_behavior parameter determines the exact behavior of the initial payment. To start subscriptions where the first invoice always begins in a draft status, use [subscription schedules](https://stripe.com/docs/billing/subscriptions/subscription-schedules#managing) instead. Schedules provide the flexibility to model more complex billing configurations that change over time. """ return cast( "Subscription", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["Subscription.CreateParams"] ) -> "Subscription": """ Creates a new subscription on an existing customer. Each customer can have up to 500 active or scheduled subscriptions. When you create a subscription with collection_method=charge_automatically, the first invoice is finalized as part of the request. The payment_behavior parameter determines the exact behavior of the initial payment. To start subscriptions where the first invoice always begins in a draft status, use [subscription schedules](https://stripe.com/docs/billing/subscriptions/subscription-schedules#managing) instead. Schedules provide the flexibility to model more complex billing configurations that change over time. """ return cast( "Subscription", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def _cls_delete_discount( cls, subscription_exposed_id: str, **params: Unpack["Subscription.DeleteDiscountParams"], ) -> "Discount": """ Removes the currently applied discount on a subscription. """ return cast( "Discount", cls._static_request( "delete", "/v1/subscriptions/{subscription_exposed_id}/discount".format( subscription_exposed_id=sanitize_id( subscription_exposed_id ) ), params=params, ), ) @overload @staticmethod def delete_discount( subscription_exposed_id: str, **params: Unpack["Subscription.DeleteDiscountParams"], ) -> "Discount": """ Removes the currently applied discount on a subscription. """ ... @overload def delete_discount( self, **params: Unpack["Subscription.DeleteDiscountParams"] ) -> "Discount": """ Removes the currently applied discount on a subscription. """ ... @class_method_variant("_cls_delete_discount") def delete_discount( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Subscription.DeleteDiscountParams"] ) -> "Discount": """ Removes the currently applied discount on a subscription. """ return cast( "Discount", self._request( "delete", "/v1/subscriptions/{subscription_exposed_id}/discount".format( subscription_exposed_id=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_delete_discount_async( cls, subscription_exposed_id: str, **params: Unpack["Subscription.DeleteDiscountParams"], ) -> "Discount": """ Removes the currently applied discount on a subscription. """ return cast( "Discount", await cls._static_request_async( "delete", "/v1/subscriptions/{subscription_exposed_id}/discount".format( subscription_exposed_id=sanitize_id( subscription_exposed_id ) ), params=params, ), ) @overload @staticmethod async def delete_discount_async( subscription_exposed_id: str, **params: Unpack["Subscription.DeleteDiscountParams"], ) -> "Discount": """ Removes the currently applied discount on a subscription. """ ... @overload async def delete_discount_async( self, **params: Unpack["Subscription.DeleteDiscountParams"] ) -> "Discount": """ Removes the currently applied discount on a subscription. """ ... @class_method_variant("_cls_delete_discount_async") async def delete_discount_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Subscription.DeleteDiscountParams"] ) -> "Discount": """ Removes the currently applied discount on a subscription. """ return cast( "Discount", await self._request_async( "delete", "/v1/subscriptions/{subscription_exposed_id}/discount".format( subscription_exposed_id=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def list( cls, **params: Unpack["Subscription.ListParams"] ) -> ListObject["Subscription"]: """ By default, returns a list of subscriptions that have not been canceled. In order to list canceled subscriptions, specify status=canceled. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["Subscription.ListParams"] ) -> ListObject["Subscription"]: """ By default, returns a list of subscriptions that have not been canceled. In order to list canceled subscriptions, specify status=canceled. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def modify( cls, id: str, **params: Unpack["Subscription.ModifyParams"] ) -> "Subscription": """ Updates an existing subscription to match the specified parameters. When changing prices or quantities, we optionally prorate the price we charge next month to make up for any price changes. To preview how the proration is calculated, use the [upcoming invoice](https://stripe.com/docs/api/invoices/upcoming) endpoint. By default, we prorate subscription changes. For example, if a customer signs up on May 1 for a 100 price, they'll be billed 100 immediately. If on May 15 they switch to a 200 price, then on June 1 they'll be billed 250 (200 for a renewal of her subscription, plus a 50 prorating adjustment for half of the previous month's 100 difference). Similarly, a downgrade generates a credit that is applied to the next invoice. We also prorate when you make quantity changes. Switching prices does not normally change the billing date or generate an immediate charge unless: The billing interval is changed (for example, from monthly to yearly). The subscription moves from free to paid, or paid to free. A trial starts or ends. In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date. If you want to charge for an upgrade immediately, pass proration_behavior as always_invoice to create prorations, automatically invoice the customer for those proration adjustments, and attempt to collect payment. If you pass create_prorations, the prorations are created but not automatically invoiced. If you want to bill the customer for the prorations before the subscription's renewal date, you need to manually [invoice the customer](https://stripe.com/docs/api/invoices/create). If you don't want to prorate, set the proration_behavior option to none. With this option, the customer is billed 100 on May 1 and 200 on June 1. Similarly, if you set proration_behavior to none when switching between different billing intervals (for example, from monthly to yearly), we don't generate any credits for the old subscription's unused time. We still reset the billing date and bill immediately for the new subscription. Updating the quantity on a subscription many times in an hour may result in [rate limiting. If you need to bill for a frequently changing quantity, consider integrating usage-based billing](https://stripe.com/docs/rate-limits) instead. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Subscription", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["Subscription.ModifyParams"] ) -> "Subscription": """ Updates an existing subscription to match the specified parameters. When changing prices or quantities, we optionally prorate the price we charge next month to make up for any price changes. To preview how the proration is calculated, use the [upcoming invoice](https://stripe.com/docs/api/invoices/upcoming) endpoint. By default, we prorate subscription changes. For example, if a customer signs up on May 1 for a 100 price, they'll be billed 100 immediately. If on May 15 they switch to a 200 price, then on June 1 they'll be billed 250 (200 for a renewal of her subscription, plus a 50 prorating adjustment for half of the previous month's 100 difference). Similarly, a downgrade generates a credit that is applied to the next invoice. We also prorate when you make quantity changes. Switching prices does not normally change the billing date or generate an immediate charge unless: The billing interval is changed (for example, from monthly to yearly). The subscription moves from free to paid, or paid to free. A trial starts or ends. In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date. If you want to charge for an upgrade immediately, pass proration_behavior as always_invoice to create prorations, automatically invoice the customer for those proration adjustments, and attempt to collect payment. If you pass create_prorations, the prorations are created but not automatically invoiced. If you want to bill the customer for the prorations before the subscription's renewal date, you need to manually [invoice the customer](https://stripe.com/docs/api/invoices/create). If you don't want to prorate, set the proration_behavior option to none. With this option, the customer is billed 100 on May 1 and 200 on June 1. Similarly, if you set proration_behavior to none when switching between different billing intervals (for example, from monthly to yearly), we don't generate any credits for the old subscription's unused time. We still reset the billing date and bill immediately for the new subscription. Updating the quantity on a subscription many times in an hour may result in [rate limiting. If you need to bill for a frequently changing quantity, consider integrating usage-based billing](https://stripe.com/docs/rate-limits) instead. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Subscription", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def _cls_resume( cls, subscription: str, **params: Unpack["Subscription.ResumeParams"] ) -> "Subscription": """ Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. If a resumption invoice is generated, it must be paid or marked uncollectible before the subscription will be unpaused. If payment succeeds the subscription will become active, and if payment fails the subscription will be past_due. The resumption invoice will void automatically if not paid by the expiration date. """ return cast( "Subscription", cls._static_request( "post", "/v1/subscriptions/{subscription}/resume".format( subscription=sanitize_id(subscription) ), params=params, ), ) @overload @staticmethod def resume( subscription: str, **params: Unpack["Subscription.ResumeParams"] ) -> "Subscription": """ Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. If a resumption invoice is generated, it must be paid or marked uncollectible before the subscription will be unpaused. If payment succeeds the subscription will become active, and if payment fails the subscription will be past_due. The resumption invoice will void automatically if not paid by the expiration date. """ ... @overload def resume( self, **params: Unpack["Subscription.ResumeParams"] ) -> "Subscription": """ Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. If a resumption invoice is generated, it must be paid or marked uncollectible before the subscription will be unpaused. If payment succeeds the subscription will become active, and if payment fails the subscription will be past_due. The resumption invoice will void automatically if not paid by the expiration date. """ ... @class_method_variant("_cls_resume") def resume( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Subscription.ResumeParams"] ) -> "Subscription": """ Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. If a resumption invoice is generated, it must be paid or marked uncollectible before the subscription will be unpaused. If payment succeeds the subscription will become active, and if payment fails the subscription will be past_due. The resumption invoice will void automatically if not paid by the expiration date. """ return cast( "Subscription", self._request( "post", "/v1/subscriptions/{subscription}/resume".format( subscription=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_resume_async( cls, subscription: str, **params: Unpack["Subscription.ResumeParams"] ) -> "Subscription": """ Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. If a resumption invoice is generated, it must be paid or marked uncollectible before the subscription will be unpaused. If payment succeeds the subscription will become active, and if payment fails the subscription will be past_due. The resumption invoice will void automatically if not paid by the expiration date. """ return cast( "Subscription", await cls._static_request_async( "post", "/v1/subscriptions/{subscription}/resume".format( subscription=sanitize_id(subscription) ), params=params, ), ) @overload @staticmethod async def resume_async( subscription: str, **params: Unpack["Subscription.ResumeParams"] ) -> "Subscription": """ Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. If a resumption invoice is generated, it must be paid or marked uncollectible before the subscription will be unpaused. If payment succeeds the subscription will become active, and if payment fails the subscription will be past_due. The resumption invoice will void automatically if not paid by the expiration date. """ ... @overload async def resume_async( self, **params: Unpack["Subscription.ResumeParams"] ) -> "Subscription": """ Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. If a resumption invoice is generated, it must be paid or marked uncollectible before the subscription will be unpaused. If payment succeeds the subscription will become active, and if payment fails the subscription will be past_due. The resumption invoice will void automatically if not paid by the expiration date. """ ... @class_method_variant("_cls_resume_async") async def resume_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Subscription.ResumeParams"] ) -> "Subscription": """ Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. If a resumption invoice is generated, it must be paid or marked uncollectible before the subscription will be unpaused. If payment succeeds the subscription will become active, and if payment fails the subscription will be past_due. The resumption invoice will void automatically if not paid by the expiration date. """ return cast( "Subscription", await self._request_async( "post", "/v1/subscriptions/{subscription}/resume".format( subscription=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["Subscription.RetrieveParams"] ) -> "Subscription": """ Retrieves the subscription with the given ID. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["Subscription.RetrieveParams"] ) -> "Subscription": """ Retrieves the subscription with the given ID. """ instance = cls(id, **params) await instance.refresh_async() return instance @classmethod def search( cls, *args, **kwargs: Unpack["Subscription.SearchParams"] ) -> SearchResultObject["Subscription"]: """ Search for subscriptions you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India. """ return cls._search( search_url="/v1/subscriptions/search", *args, **kwargs ) @classmethod async def search_async( cls, *args, **kwargs: Unpack["Subscription.SearchParams"] ) -> SearchResultObject["Subscription"]: """ Search for subscriptions you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India. """ return await cls._search_async( search_url="/v1/subscriptions/search", *args, **kwargs ) @classmethod def search_auto_paging_iter( cls, *args, **kwargs: Unpack["Subscription.SearchParams"] ) -> Iterator["Subscription"]: return cls.search(*args, **kwargs).auto_paging_iter() @classmethod async def search_auto_paging_iter_async( cls, *args, **kwargs: Unpack["Subscription.SearchParams"] ) -> AsyncIterator["Subscription"]: return (await cls.search_async(*args, **kwargs)).auto_paging_iter() _inner_class_types = { "automatic_tax": AutomaticTax, "billing_cycle_anchor_config": BillingCycleAnchorConfig, "billing_thresholds": BillingThresholds, "cancellation_details": CancellationDetails, "invoice_settings": InvoiceSettings, "pause_collection": PauseCollection, "payment_settings": PaymentSettings, "pending_invoice_item_interval": PendingInvoiceItemInterval, "pending_update": PendingUpdate, "transfer_data": TransferData, "trial_settings": TrialSettings, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_subscription_item.py0000644000175100001770000011377314637354563020321 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._deletable_api_resource import DeletableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._nested_resource_class_methods import nested_resource_class_methods from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._discount import Discount from stripe._plan import Plan from stripe._price import Price from stripe._tax_rate import TaxRate from stripe._usage_record import UsageRecord from stripe._usage_record_summary import UsageRecordSummary @nested_resource_class_methods("usage_record") @nested_resource_class_methods("usage_record_summary") class SubscriptionItem( CreateableAPIResource["SubscriptionItem"], DeletableAPIResource["SubscriptionItem"], ListableAPIResource["SubscriptionItem"], UpdateableAPIResource["SubscriptionItem"], ): """ Subscription items allow you to create customer subscriptions with more than one plan, making it easy to represent complex billing relationships. """ OBJECT_NAME: ClassVar[Literal["subscription_item"]] = "subscription_item" class BillingThresholds(StripeObject): usage_gte: Optional[int] """ Usage threshold that triggers the subscription to create an invoice """ class CreateParams(RequestOptions): billing_thresholds: NotRequired[ "Literal['']|SubscriptionItem.CreateParamsBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ discounts: NotRequired[ "Literal['']|List[SubscriptionItem.CreateParamsDiscount]" ] """ The coupons to redeem into discounts for the subscription item. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ payment_behavior: NotRequired[ Literal[ "allow_incomplete", "default_incomplete", "error_if_incomplete", "pending_if_incomplete", ] ] """ Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. For example, SCA regulation may require 3DS authentication to complete payment. See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. This is the default behavior. Use `default_incomplete` to transition the subscription to `status=past_due` when payment is required and await explicit confirmation of the invoice's payment intent. This allows simpler management of scenarios where additional user actions are needed to pay a subscription's invoice. Such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method. Use `pending_if_incomplete` to update the subscription using [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates). When you use `pending_if_incomplete` you can only pass the parameters [supported by pending updates](https://stripe.com/docs/billing/pending-updates-reference#supported-attributes). Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. """ plan: NotRequired[str] """ The identifier of the plan to add to the subscription. """ price: NotRequired[str] """ The ID of the price object. """ price_data: NotRequired["SubscriptionItem.CreateParamsPriceData"] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ proration_date: NotRequired[int] """ If set, the proration will be calculated as though the subscription was updated at the given time. This can be used to apply the same proration that was previewed with the [upcoming invoice](https://stripe.com/docs/api#retrieve_customer_invoice) endpoint. """ quantity: NotRequired[int] """ The quantity you'd like to apply to the subscription item you're creating. """ subscription: str """ The identifier of the subscription to modify. """ tax_rates: NotRequired["Literal['']|List[str]"] """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ class CreateParamsBillingThresholds(TypedDict): usage_gte: int """ Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ class CreateParamsDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class CreateParamsPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ recurring: "SubscriptionItem.CreateParamsPriceDataRecurring" """ The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class CreateParamsPriceDataRecurring(TypedDict): interval: Literal["day", "month", "week", "year"] """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class CreateUsageRecordParams(RequestOptions): action: NotRequired[Literal["increment", "set"]] """ Valid values are `increment` (default) or `set`. When using `increment` the specified `quantity` will be added to the usage at the specified timestamp. The `set` action will overwrite the usage quantity at that timestamp. If the subscription has [billing thresholds](https://stripe.com/docs/api/subscriptions/object#subscription_object-billing_thresholds), `increment` is the only allowed value. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ quantity: int """ The usage quantity for the specified timestamp. """ timestamp: NotRequired["Literal['now']|int"] """ The timestamp for the usage event. This timestamp must be within the current billing period of the subscription of the provided `subscription_item`, and must not be in the future. When passing `"now"`, Stripe records usage for the current time. Default is `"now"` if a value is not provided. """ class DeleteParams(RequestOptions): clear_usage: NotRequired[bool] """ Delete all usage for the given subscription item. Allowed only when the current plan's `usage_type` is `metered`. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ proration_date: NotRequired[int] """ If set, the proration will be calculated as though the subscription was updated at the given time. This can be used to apply the same proration that was previewed with the [upcoming invoice](https://stripe.com/docs/api#retrieve_customer_invoice) endpoint. """ class ListParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ subscription: str """ The ID of the subscription whose items will be retrieved. """ class ListUsageRecordSummariesParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ModifyParams(RequestOptions): billing_thresholds: NotRequired[ "Literal['']|SubscriptionItem.ModifyParamsBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ discounts: NotRequired[ "Literal['']|List[SubscriptionItem.ModifyParamsDiscount]" ] """ The coupons to redeem into discounts for the subscription item. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ off_session: NotRequired[bool] """ Indicates if a customer is on or off-session while an invoice payment is attempted. """ payment_behavior: NotRequired[ Literal[ "allow_incomplete", "default_incomplete", "error_if_incomplete", "pending_if_incomplete", ] ] """ Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. For example, SCA regulation may require 3DS authentication to complete payment. See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. This is the default behavior. Use `default_incomplete` to transition the subscription to `status=past_due` when payment is required and await explicit confirmation of the invoice's payment intent. This allows simpler management of scenarios where additional user actions are needed to pay a subscription's invoice. Such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method. Use `pending_if_incomplete` to update the subscription using [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates). When you use `pending_if_incomplete` you can only pass the parameters [supported by pending updates](https://stripe.com/docs/billing/pending-updates-reference#supported-attributes). Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. """ plan: NotRequired[str] """ The identifier of the new plan for this subscription item. """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ price_data: NotRequired["SubscriptionItem.ModifyParamsPriceData"] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ proration_date: NotRequired[int] """ If set, the proration will be calculated as though the subscription was updated at the given time. This can be used to apply the same proration that was previewed with the [upcoming invoice](https://stripe.com/docs/api#retrieve_customer_invoice) endpoint. """ quantity: NotRequired[int] """ The quantity you'd like to apply to the subscription item you're creating. """ tax_rates: NotRequired["Literal['']|List[str]"] """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ class ModifyParamsBillingThresholds(TypedDict): usage_gte: int """ Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ class ModifyParamsDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class ModifyParamsPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ recurring: "SubscriptionItem.ModifyParamsPriceDataRecurring" """ The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class ModifyParamsPriceDataRecurring(TypedDict): interval: Literal["day", "month", "week", "year"] """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ billing_thresholds: Optional[BillingThresholds] """ Define thresholds at which an invoice will be sent, and the related subscription advanced to a new billing period """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ discounts: List[ExpandableField["Discount"]] """ The discounts applied to the subscription item. Subscription item discounts are applied before subscription discounts. Use `expand[]=discounts` to expand each discount. """ id: str """ Unique identifier for the object. """ metadata: Dict[str, str] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ object: Literal["subscription_item"] """ String representing the object's type. Objects of the same type share the same value. """ plan: "Plan" """ You can now model subscriptions more flexibly using the [Prices API](https://stripe.com/docs/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://stripe.com/docs/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. Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription) and more about [products and prices](https://stripe.com/docs/products-prices/overview). """ price: "Price" """ Prices define the unit cost, currency, and (optional) billing cycle for both recurring and one-time purchases of products. [Products](https://stripe.com/docs/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. Related guides: [Set up a subscription](https://stripe.com/docs/billing/subscriptions/set-up-subscription), [create an invoice](https://stripe.com/docs/billing/invoices/create), and more about [products and prices](https://stripe.com/docs/products-prices/overview). """ quantity: Optional[int] """ The [quantity](https://stripe.com/docs/subscriptions/quantities) of the plan to which the customer should be subscribed. """ subscription: str """ The `subscription` this `subscription_item` belongs to. """ tax_rates: Optional[List["TaxRate"]] """ The tax rates which apply to this `subscription_item`. When set, the `default_tax_rates` on the subscription do not apply to this `subscription_item`. """ deleted: Optional[Literal[True]] """ Always true for a deleted object """ @classmethod def create( cls, **params: Unpack["SubscriptionItem.CreateParams"] ) -> "SubscriptionItem": """ Adds a new item to an existing subscription. No existing items will be changed or replaced. """ return cast( "SubscriptionItem", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["SubscriptionItem.CreateParams"] ) -> "SubscriptionItem": """ Adds a new item to an existing subscription. No existing items will be changed or replaced. """ return cast( "SubscriptionItem", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def _cls_delete( cls, sid: str, **params: Unpack["SubscriptionItem.DeleteParams"] ) -> "SubscriptionItem": """ Deletes an item from the subscription. Removing a subscription item from a subscription will not cancel the subscription. """ url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "SubscriptionItem", cls._static_request( "delete", url, params=params, ), ) @overload @staticmethod def delete( sid: str, **params: Unpack["SubscriptionItem.DeleteParams"] ) -> "SubscriptionItem": """ Deletes an item from the subscription. Removing a subscription item from a subscription will not cancel the subscription. """ ... @overload def delete( self, **params: Unpack["SubscriptionItem.DeleteParams"] ) -> "SubscriptionItem": """ Deletes an item from the subscription. Removing a subscription item from a subscription will not cancel the subscription. """ ... @class_method_variant("_cls_delete") def delete( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["SubscriptionItem.DeleteParams"] ) -> "SubscriptionItem": """ Deletes an item from the subscription. Removing a subscription item from a subscription will not cancel the subscription. """ return self._request_and_refresh( "delete", self.instance_url(), params=params, ) @classmethod async def _cls_delete_async( cls, sid: str, **params: Unpack["SubscriptionItem.DeleteParams"] ) -> "SubscriptionItem": """ Deletes an item from the subscription. Removing a subscription item from a subscription will not cancel the subscription. """ url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "SubscriptionItem", await cls._static_request_async( "delete", url, params=params, ), ) @overload @staticmethod async def delete_async( sid: str, **params: Unpack["SubscriptionItem.DeleteParams"] ) -> "SubscriptionItem": """ Deletes an item from the subscription. Removing a subscription item from a subscription will not cancel the subscription. """ ... @overload async def delete_async( self, **params: Unpack["SubscriptionItem.DeleteParams"] ) -> "SubscriptionItem": """ Deletes an item from the subscription. Removing a subscription item from a subscription will not cancel the subscription. """ ... @class_method_variant("_cls_delete_async") async def delete_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["SubscriptionItem.DeleteParams"] ) -> "SubscriptionItem": """ Deletes an item from the subscription. Removing a subscription item from a subscription will not cancel the subscription. """ return await self._request_and_refresh_async( "delete", self.instance_url(), params=params, ) @classmethod def list( cls, **params: Unpack["SubscriptionItem.ListParams"] ) -> ListObject["SubscriptionItem"]: """ Returns a list of your subscription items for a given subscription. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["SubscriptionItem.ListParams"] ) -> ListObject["SubscriptionItem"]: """ Returns a list of your subscription items for a given subscription. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def modify( cls, id: str, **params: Unpack["SubscriptionItem.ModifyParams"] ) -> "SubscriptionItem": """ Updates the plan or quantity of an item on a current subscription. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "SubscriptionItem", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["SubscriptionItem.ModifyParams"] ) -> "SubscriptionItem": """ Updates the plan or quantity of an item on a current subscription. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "SubscriptionItem", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["SubscriptionItem.RetrieveParams"] ) -> "SubscriptionItem": """ Retrieves the subscription item with the given ID. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["SubscriptionItem.RetrieveParams"] ) -> "SubscriptionItem": """ Retrieves the subscription item with the given ID. """ instance = cls(id, **params) await instance.refresh_async() return instance @classmethod def create_usage_record( cls, subscription_item: str, **params: Unpack["SubscriptionItem.CreateUsageRecordParams"], ) -> "UsageRecord": """ Creates a usage record for a specified subscription item and date, and fills it with a quantity. Usage records provide quantity information that Stripe uses to track how much a customer is using your service. With usage information and the pricing model set up by the [metered billing](https://stripe.com/docs/billing/subscriptions/metered-billing) plan, Stripe helps you send accurate invoices to your customers. The default calculation for usage is to add up all the quantity values of the usage records within a billing period. You can change this default behavior with the billing plan's aggregate_usage [parameter](https://stripe.com/docs/api/plans/create#create_plan-aggregate_usage). When there is more than one usage record with the same timestamp, Stripe adds the quantity values together. In most cases, this is the desired resolution, however, you can change this behavior with the action parameter. The default pricing model for metered billing is [per-unit pricing. For finer granularity, you can configure metered billing to have a tiered pricing](https://stripe.com/docs/api/plans/object#plan_object-billing_scheme) model. """ return cast( "UsageRecord", cls._static_request( "post", "/v1/subscription_items/{subscription_item}/usage_records".format( subscription_item=sanitize_id(subscription_item) ), params=params, ), ) @classmethod async def create_usage_record_async( cls, subscription_item: str, **params: Unpack["SubscriptionItem.CreateUsageRecordParams"], ) -> "UsageRecord": """ Creates a usage record for a specified subscription item and date, and fills it with a quantity. Usage records provide quantity information that Stripe uses to track how much a customer is using your service. With usage information and the pricing model set up by the [metered billing](https://stripe.com/docs/billing/subscriptions/metered-billing) plan, Stripe helps you send accurate invoices to your customers. The default calculation for usage is to add up all the quantity values of the usage records within a billing period. You can change this default behavior with the billing plan's aggregate_usage [parameter](https://stripe.com/docs/api/plans/create#create_plan-aggregate_usage). When there is more than one usage record with the same timestamp, Stripe adds the quantity values together. In most cases, this is the desired resolution, however, you can change this behavior with the action parameter. The default pricing model for metered billing is [per-unit pricing. For finer granularity, you can configure metered billing to have a tiered pricing](https://stripe.com/docs/api/plans/object#plan_object-billing_scheme) model. """ return cast( "UsageRecord", await cls._static_request_async( "post", "/v1/subscription_items/{subscription_item}/usage_records".format( subscription_item=sanitize_id(subscription_item) ), params=params, ), ) @classmethod def list_usage_record_summaries( cls, subscription_item: str, **params: Unpack["SubscriptionItem.ListUsageRecordSummariesParams"], ) -> ListObject["UsageRecordSummary"]: """ For the specified subscription item, returns a list of summary objects. Each object in the list provides usage information that's been summarized from multiple usage records and over a subscription billing period (e.g., 15 usage records in the month of September). The list is sorted in reverse-chronological order (newest first). The first list item represents the most current usage period that hasn't ended yet. Since new usage records can still be added, the returned summary information for the subscription item's ID should be seen as unstable until the subscription billing period ends. """ return cast( ListObject["UsageRecordSummary"], cls._static_request( "get", "/v1/subscription_items/{subscription_item}/usage_record_summaries".format( subscription_item=sanitize_id(subscription_item) ), params=params, ), ) @classmethod async def list_usage_record_summaries_async( cls, subscription_item: str, **params: Unpack["SubscriptionItem.ListUsageRecordSummariesParams"], ) -> ListObject["UsageRecordSummary"]: """ For the specified subscription item, returns a list of summary objects. Each object in the list provides usage information that's been summarized from multiple usage records and over a subscription billing period (e.g., 15 usage records in the month of September). The list is sorted in reverse-chronological order (newest first). The first list item represents the most current usage period that hasn't ended yet. Since new usage records can still be added, the returned summary information for the subscription item's ID should be seen as unstable until the subscription billing period ends. """ return cast( ListObject["UsageRecordSummary"], await cls._static_request_async( "get", "/v1/subscription_items/{subscription_item}/usage_record_summaries".format( subscription_item=sanitize_id(subscription_item) ), params=params, ), ) _inner_class_types = {"billing_thresholds": BillingThresholds} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_subscription_item_service.py0000644000175100001770000006153714637354563022041 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._subscription_item import SubscriptionItem from stripe._subscription_item_usage_record_service import ( SubscriptionItemUsageRecordService, ) from stripe._subscription_item_usage_record_summary_service import ( SubscriptionItemUsageRecordSummaryService, ) from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class SubscriptionItemService(StripeService): def __init__(self, requestor): super().__init__(requestor) self.usage_records = SubscriptionItemUsageRecordService( self._requestor ) self.usage_record_summaries = ( SubscriptionItemUsageRecordSummaryService( self._requestor, ) ) class CreateParams(TypedDict): billing_thresholds: NotRequired[ "Literal['']|SubscriptionItemService.CreateParamsBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ discounts: NotRequired[ "Literal['']|List[SubscriptionItemService.CreateParamsDiscount]" ] """ The coupons to redeem into discounts for the subscription item. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ payment_behavior: NotRequired[ Literal[ "allow_incomplete", "default_incomplete", "error_if_incomplete", "pending_if_incomplete", ] ] """ Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. For example, SCA regulation may require 3DS authentication to complete payment. See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. This is the default behavior. Use `default_incomplete` to transition the subscription to `status=past_due` when payment is required and await explicit confirmation of the invoice's payment intent. This allows simpler management of scenarios where additional user actions are needed to pay a subscription's invoice. Such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method. Use `pending_if_incomplete` to update the subscription using [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates). When you use `pending_if_incomplete` you can only pass the parameters [supported by pending updates](https://stripe.com/docs/billing/pending-updates-reference#supported-attributes). Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. """ plan: NotRequired[str] """ The identifier of the plan to add to the subscription. """ price: NotRequired[str] """ The ID of the price object. """ price_data: NotRequired[ "SubscriptionItemService.CreateParamsPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ proration_date: NotRequired[int] """ If set, the proration will be calculated as though the subscription was updated at the given time. This can be used to apply the same proration that was previewed with the [upcoming invoice](https://stripe.com/docs/api#retrieve_customer_invoice) endpoint. """ quantity: NotRequired[int] """ The quantity you'd like to apply to the subscription item you're creating. """ subscription: str """ The identifier of the subscription to modify. """ tax_rates: NotRequired["Literal['']|List[str]"] """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ class CreateParamsBillingThresholds(TypedDict): usage_gte: int """ Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ class CreateParamsDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class CreateParamsPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ recurring: "SubscriptionItemService.CreateParamsPriceDataRecurring" """ The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class CreateParamsPriceDataRecurring(TypedDict): interval: Literal["day", "month", "week", "year"] """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class DeleteParams(TypedDict): clear_usage: NotRequired[bool] """ Delete all usage for the given subscription item. Allowed only when the current plan's `usage_type` is `metered`. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ proration_date: NotRequired[int] """ If set, the proration will be calculated as though the subscription was updated at the given time. This can be used to apply the same proration that was previewed with the [upcoming invoice](https://stripe.com/docs/api#retrieve_customer_invoice) endpoint. """ class ListParams(TypedDict): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ subscription: str """ The ID of the subscription whose items will be retrieved. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): billing_thresholds: NotRequired[ "Literal['']|SubscriptionItemService.UpdateParamsBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ discounts: NotRequired[ "Literal['']|List[SubscriptionItemService.UpdateParamsDiscount]" ] """ The coupons to redeem into discounts for the subscription item. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ off_session: NotRequired[bool] """ Indicates if a customer is on or off-session while an invoice payment is attempted. """ payment_behavior: NotRequired[ Literal[ "allow_incomplete", "default_incomplete", "error_if_incomplete", "pending_if_incomplete", ] ] """ Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. For example, SCA regulation may require 3DS authentication to complete payment. See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. This is the default behavior. Use `default_incomplete` to transition the subscription to `status=past_due` when payment is required and await explicit confirmation of the invoice's payment intent. This allows simpler management of scenarios where additional user actions are needed to pay a subscription's invoice. Such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method. Use `pending_if_incomplete` to update the subscription using [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates). When you use `pending_if_incomplete` you can only pass the parameters [supported by pending updates](https://stripe.com/docs/billing/pending-updates-reference#supported-attributes). Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. """ plan: NotRequired[str] """ The identifier of the new plan for this subscription item. """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ price_data: NotRequired[ "SubscriptionItemService.UpdateParamsPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ proration_date: NotRequired[int] """ If set, the proration will be calculated as though the subscription was updated at the given time. This can be used to apply the same proration that was previewed with the [upcoming invoice](https://stripe.com/docs/api#retrieve_customer_invoice) endpoint. """ quantity: NotRequired[int] """ The quantity you'd like to apply to the subscription item you're creating. """ tax_rates: NotRequired["Literal['']|List[str]"] """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ class UpdateParamsBillingThresholds(TypedDict): usage_gte: int """ Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ class UpdateParamsDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class UpdateParamsPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ recurring: "SubscriptionItemService.UpdateParamsPriceDataRecurring" """ The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class UpdateParamsPriceDataRecurring(TypedDict): interval: Literal["day", "month", "week", "year"] """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ def delete( self, item: str, params: "SubscriptionItemService.DeleteParams" = {}, options: RequestOptions = {}, ) -> SubscriptionItem: """ Deletes an item from the subscription. Removing a subscription item from a subscription will not cancel the subscription. """ return cast( SubscriptionItem, self._request( "delete", "/v1/subscription_items/{item}".format(item=sanitize_id(item)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def delete_async( self, item: str, params: "SubscriptionItemService.DeleteParams" = {}, options: RequestOptions = {}, ) -> SubscriptionItem: """ Deletes an item from the subscription. Removing a subscription item from a subscription will not cancel the subscription. """ return cast( SubscriptionItem, await self._request_async( "delete", "/v1/subscription_items/{item}".format(item=sanitize_id(item)), api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, item: str, params: "SubscriptionItemService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> SubscriptionItem: """ Retrieves the subscription item with the given ID. """ return cast( SubscriptionItem, self._request( "get", "/v1/subscription_items/{item}".format(item=sanitize_id(item)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, item: str, params: "SubscriptionItemService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> SubscriptionItem: """ Retrieves the subscription item with the given ID. """ return cast( SubscriptionItem, await self._request_async( "get", "/v1/subscription_items/{item}".format(item=sanitize_id(item)), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, item: str, params: "SubscriptionItemService.UpdateParams" = {}, options: RequestOptions = {}, ) -> SubscriptionItem: """ Updates the plan or quantity of an item on a current subscription. """ return cast( SubscriptionItem, self._request( "post", "/v1/subscription_items/{item}".format(item=sanitize_id(item)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, item: str, params: "SubscriptionItemService.UpdateParams" = {}, options: RequestOptions = {}, ) -> SubscriptionItem: """ Updates the plan or quantity of an item on a current subscription. """ return cast( SubscriptionItem, await self._request_async( "post", "/v1/subscription_items/{item}".format(item=sanitize_id(item)), api_mode="V1", base_address="api", params=params, options=options, ), ) def list( self, params: "SubscriptionItemService.ListParams", options: RequestOptions = {}, ) -> ListObject[SubscriptionItem]: """ Returns a list of your subscription items for a given subscription. """ return cast( ListObject[SubscriptionItem], self._request( "get", "/v1/subscription_items", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "SubscriptionItemService.ListParams", options: RequestOptions = {}, ) -> ListObject[SubscriptionItem]: """ Returns a list of your subscription items for a given subscription. """ return cast( ListObject[SubscriptionItem], await self._request_async( "get", "/v1/subscription_items", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "SubscriptionItemService.CreateParams", options: RequestOptions = {}, ) -> SubscriptionItem: """ Adds a new item to an existing subscription. No existing items will be changed or replaced. """ return cast( SubscriptionItem, self._request( "post", "/v1/subscription_items", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "SubscriptionItemService.CreateParams", options: RequestOptions = {}, ) -> SubscriptionItem: """ Adds a new item to an existing subscription. No existing items will be changed or replaced. """ return cast( SubscriptionItem, await self._request_async( "post", "/v1/subscription_items", api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_subscription_item_usage_record_service.py0000644000175100001770000001226114637354563024551 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._usage_record import UsageRecord from stripe._util import sanitize_id from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict class SubscriptionItemUsageRecordService(StripeService): class CreateParams(TypedDict): action: NotRequired[Literal["increment", "set"]] """ Valid values are `increment` (default) or `set`. When using `increment` the specified `quantity` will be added to the usage at the specified timestamp. The `set` action will overwrite the usage quantity at that timestamp. If the subscription has [billing thresholds](https://stripe.com/docs/api/subscriptions/object#subscription_object-billing_thresholds), `increment` is the only allowed value. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ quantity: int """ The usage quantity for the specified timestamp. """ timestamp: NotRequired["Literal['now']|int"] """ The timestamp for the usage event. This timestamp must be within the current billing period of the subscription of the provided `subscription_item`, and must not be in the future. When passing `"now"`, Stripe records usage for the current time. Default is `"now"` if a value is not provided. """ def create( self, subscription_item: str, params: "SubscriptionItemUsageRecordService.CreateParams", options: RequestOptions = {}, ) -> UsageRecord: """ Creates a usage record for a specified subscription item and date, and fills it with a quantity. Usage records provide quantity information that Stripe uses to track how much a customer is using your service. With usage information and the pricing model set up by the [metered billing](https://stripe.com/docs/billing/subscriptions/metered-billing) plan, Stripe helps you send accurate invoices to your customers. The default calculation for usage is to add up all the quantity values of the usage records within a billing period. You can change this default behavior with the billing plan's aggregate_usage [parameter](https://stripe.com/docs/api/plans/create#create_plan-aggregate_usage). When there is more than one usage record with the same timestamp, Stripe adds the quantity values together. In most cases, this is the desired resolution, however, you can change this behavior with the action parameter. The default pricing model for metered billing is [per-unit pricing. For finer granularity, you can configure metered billing to have a tiered pricing](https://stripe.com/docs/api/plans/object#plan_object-billing_scheme) model. """ return cast( UsageRecord, self._request( "post", "/v1/subscription_items/{subscription_item}/usage_records".format( subscription_item=sanitize_id(subscription_item), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, subscription_item: str, params: "SubscriptionItemUsageRecordService.CreateParams", options: RequestOptions = {}, ) -> UsageRecord: """ Creates a usage record for a specified subscription item and date, and fills it with a quantity. Usage records provide quantity information that Stripe uses to track how much a customer is using your service. With usage information and the pricing model set up by the [metered billing](https://stripe.com/docs/billing/subscriptions/metered-billing) plan, Stripe helps you send accurate invoices to your customers. The default calculation for usage is to add up all the quantity values of the usage records within a billing period. You can change this default behavior with the billing plan's aggregate_usage [parameter](https://stripe.com/docs/api/plans/create#create_plan-aggregate_usage). When there is more than one usage record with the same timestamp, Stripe adds the quantity values together. In most cases, this is the desired resolution, however, you can change this behavior with the action parameter. The default pricing model for metered billing is [per-unit pricing. For finer granularity, you can configure metered billing to have a tiered pricing](https://stripe.com/docs/api/plans/object#plan_object-billing_scheme) model. """ return cast( UsageRecord, await self._request_async( "post", "/v1/subscription_items/{subscription_item}/usage_records".format( subscription_item=sanitize_id(subscription_item), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_subscription_item_usage_record_summary_service.py0000644000175100001770000001007314637354563026325 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._usage_record_summary import UsageRecordSummary from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict class SubscriptionItemUsageRecordSummaryService(StripeService): class ListParams(TypedDict): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ def list( self, subscription_item: str, params: "SubscriptionItemUsageRecordSummaryService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[UsageRecordSummary]: """ For the specified subscription item, returns a list of summary objects. Each object in the list provides usage information that's been summarized from multiple usage records and over a subscription billing period (e.g., 15 usage records in the month of September). The list is sorted in reverse-chronological order (newest first). The first list item represents the most current usage period that hasn't ended yet. Since new usage records can still be added, the returned summary information for the subscription item's ID should be seen as unstable until the subscription billing period ends. """ return cast( ListObject[UsageRecordSummary], self._request( "get", "/v1/subscription_items/{subscription_item}/usage_record_summaries".format( subscription_item=sanitize_id(subscription_item), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, subscription_item: str, params: "SubscriptionItemUsageRecordSummaryService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[UsageRecordSummary]: """ For the specified subscription item, returns a list of summary objects. Each object in the list provides usage information that's been summarized from multiple usage records and over a subscription billing period (e.g., 15 usage records in the month of September). The list is sorted in reverse-chronological order (newest first). The first list item represents the most current usage period that hasn't ended yet. Since new usage records can still be added, the returned summary information for the subscription item's ID should be seen as unstable until the subscription billing period ends. """ return cast( ListObject[UsageRecordSummary], await self._request_async( "get", "/v1/subscription_items/{subscription_item}/usage_record_summaries".format( subscription_item=sanitize_id(subscription_item), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_subscription_schedule.py0000644000175100001770000030311514637354563021146 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._account import Account from stripe._application import Application from stripe._coupon import Coupon from stripe._customer import Customer from stripe._discount import Discount as DiscountResource from stripe._payment_method import PaymentMethod from stripe._plan import Plan from stripe._price import Price from stripe._promotion_code import PromotionCode from stripe._subscription import Subscription from stripe._tax_id import TaxId from stripe._tax_rate import TaxRate from stripe.test_helpers._test_clock import TestClock class SubscriptionSchedule( CreateableAPIResource["SubscriptionSchedule"], ListableAPIResource["SubscriptionSchedule"], UpdateableAPIResource["SubscriptionSchedule"], ): """ A subscription schedule allows you to create and manage the lifecycle of a subscription by predefining expected changes. Related guide: [Subscription schedules](https://stripe.com/docs/billing/subscriptions/subscription-schedules) """ OBJECT_NAME: ClassVar[Literal["subscription_schedule"]] = ( "subscription_schedule" ) class CurrentPhase(StripeObject): end_date: int """ The end of this phase of the subscription schedule. """ start_date: int """ The start of this phase of the subscription schedule. """ class DefaultSettings(StripeObject): class AutomaticTax(StripeObject): class Liability(StripeObject): account: Optional[ExpandableField["Account"]] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced. """ enabled: bool """ Whether Stripe automatically computes tax on invoices created during this phase. """ liability: Optional[Liability] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ _inner_class_types = {"liability": Liability} class BillingThresholds(StripeObject): amount_gte: Optional[int] """ Monetary threshold that triggers the subscription to create an invoice """ reset_billing_cycle_anchor: Optional[bool] """ Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. This value may not be `true` if the subscription contains items with plans that have `aggregate_usage=last_ever`. """ class InvoiceSettings(StripeObject): class Issuer(StripeObject): account: Optional[ExpandableField["Account"]] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced. """ account_tax_ids: Optional[List[ExpandableField["TaxId"]]] """ The account tax IDs associated with the subscription schedule. Will be set on invoices generated by the subscription schedule. """ days_until_due: Optional[int] """ Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. """ issuer: Issuer _inner_class_types = {"issuer": Issuer} class TransferData(StripeObject): amount_percent: Optional[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. """ destination: ExpandableField["Account"] """ The account where funds from the payment will be transferred to upon payment success. """ application_fee_percent: Optional[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account during this phase of the schedule. """ automatic_tax: Optional[AutomaticTax] billing_cycle_anchor: Literal["automatic", "phase_start"] """ Possible values are `phase_start` or `automatic`. If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ billing_thresholds: Optional[BillingThresholds] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period """ collection_method: Optional[ Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. """ default_payment_method: Optional[ExpandableField["PaymentMethod"]] """ ID of the default payment method for the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. """ description: Optional[str] """ Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ invoice_settings: InvoiceSettings on_behalf_of: Optional[ExpandableField["Account"]] """ The account (if any) the charge was made on behalf of for charges associated with the schedule's subscription. See the Connect documentation for details. """ transfer_data: Optional[TransferData] """ The account (if any) the associated subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices. """ _inner_class_types = { "automatic_tax": AutomaticTax, "billing_thresholds": BillingThresholds, "invoice_settings": InvoiceSettings, "transfer_data": TransferData, } class Phase(StripeObject): class AddInvoiceItem(StripeObject): class Discount(StripeObject): coupon: Optional[ExpandableField["Coupon"]] """ ID of the coupon to create a new discount for. """ discount: Optional[ExpandableField["DiscountResource"]] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: Optional[ExpandableField["PromotionCode"]] """ ID of the promotion code to create a new discount for. """ discounts: List[Discount] """ The stackable discounts that will be applied to the item. """ price: ExpandableField["Price"] """ ID of the price used to generate the invoice item. """ quantity: Optional[int] """ The quantity of the invoice item. """ tax_rates: Optional[List["TaxRate"]] """ The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. """ _inner_class_types = {"discounts": Discount} class AutomaticTax(StripeObject): class Liability(StripeObject): account: Optional[ExpandableField["Account"]] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced. """ enabled: bool """ Whether Stripe automatically computes tax on invoices created during this phase. """ liability: Optional[Liability] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ _inner_class_types = {"liability": Liability} class BillingThresholds(StripeObject): amount_gte: Optional[int] """ Monetary threshold that triggers the subscription to create an invoice """ reset_billing_cycle_anchor: Optional[bool] """ Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. This value may not be `true` if the subscription contains items with plans that have `aggregate_usage=last_ever`. """ class Discount(StripeObject): coupon: Optional[ExpandableField["Coupon"]] """ ID of the coupon to create a new discount for. """ discount: Optional[ExpandableField["DiscountResource"]] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: Optional[ExpandableField["PromotionCode"]] """ ID of the promotion code to create a new discount for. """ class InvoiceSettings(StripeObject): class Issuer(StripeObject): account: Optional[ExpandableField["Account"]] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced. """ account_tax_ids: Optional[List[ExpandableField["TaxId"]]] """ The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule. """ days_until_due: Optional[int] """ Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. """ issuer: Optional[Issuer] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ _inner_class_types = {"issuer": Issuer} class Item(StripeObject): class BillingThresholds(StripeObject): usage_gte: Optional[int] """ Usage threshold that triggers the subscription to create an invoice """ class Discount(StripeObject): coupon: Optional[ExpandableField["Coupon"]] """ ID of the coupon to create a new discount for. """ discount: Optional[ExpandableField["DiscountResource"]] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: Optional[ExpandableField["PromotionCode"]] """ ID of the promotion code to create a new discount for. """ billing_thresholds: Optional[BillingThresholds] """ Define thresholds at which an invoice will be sent, and the related subscription advanced to a new billing period """ discounts: List[Discount] """ The discounts applied to the subscription item. Subscription item discounts are applied before subscription discounts. Use `expand[]=discounts` to expand each discount. """ metadata: Optional[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an item. Metadata on this item will update the underlying subscription item's `metadata` when the phase is entered. """ plan: ExpandableField["Plan"] """ ID of the plan to which the customer should be subscribed. """ price: ExpandableField["Price"] """ ID of the price to which the customer should be subscribed. """ quantity: Optional[int] """ Quantity of the plan to which the customer should be subscribed. """ tax_rates: Optional[List["TaxRate"]] """ The tax rates which apply to this `phase_item`. When set, the `default_tax_rates` on the phase do not apply to this `phase_item`. """ _inner_class_types = { "billing_thresholds": BillingThresholds, "discounts": Discount, } class TransferData(StripeObject): amount_percent: Optional[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. """ destination: ExpandableField["Account"] """ The account where funds from the payment will be transferred to upon payment success. """ add_invoice_items: List[AddInvoiceItem] """ A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. """ application_fee_percent: Optional[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account during this phase of the schedule. """ automatic_tax: Optional[AutomaticTax] billing_cycle_anchor: Optional[Literal["automatic", "phase_start"]] """ Possible values are `phase_start` or `automatic`. If `phase_start` then billing cycle anchor of the subscription is set to the start of the phase when entering the phase. If `automatic` then the billing cycle anchor is automatically modified as needed when entering the phase. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ billing_thresholds: Optional[BillingThresholds] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period """ collection_method: Optional[ Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. """ coupon: Optional[ExpandableField["Coupon"]] """ ID of the coupon to use during this phase of the subscription schedule. """ 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). """ default_payment_method: Optional[ExpandableField["PaymentMethod"]] """ ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. """ default_tax_rates: Optional[List["TaxRate"]] """ The default tax rates to apply to the subscription during this phase of the subscription schedule. """ description: Optional[str] """ Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ discounts: List[Discount] """ The stackable discounts that will be applied to the subscription on this phase. Subscription item discounts are applied before subscription discounts. """ end_date: int """ The end of this phase of the subscription schedule. """ invoice_settings: Optional[InvoiceSettings] """ The invoice settings applicable during this phase. """ items: List[Item] """ Subscription items to configure the subscription to during this phase of the subscription schedule. """ metadata: Optional[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered. Updating the underlying subscription's `metadata` directly will not affect the current phase's `metadata`. """ on_behalf_of: Optional[ExpandableField["Account"]] """ The account (if any) the charge was made on behalf of for charges associated with the schedule's subscription. See the Connect documentation for details. """ proration_behavior: Literal[ "always_invoice", "create_prorations", "none" ] """ If the subscription schedule will prorate when transitioning to this phase. Possible values are `create_prorations` and `none`. """ start_date: int """ The start of this phase of the subscription schedule. """ transfer_data: Optional[TransferData] """ The account (if any) the associated subscription's payments will be attributed to for tax reporting, and where funds from each payment will be transferred to for each of the subscription's invoices. """ trial_end: Optional[int] """ When the trial ends within the phase. """ _inner_class_types = { "add_invoice_items": AddInvoiceItem, "automatic_tax": AutomaticTax, "billing_thresholds": BillingThresholds, "discounts": Discount, "invoice_settings": InvoiceSettings, "items": Item, "transfer_data": TransferData, } class CancelParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ invoice_now: NotRequired[bool] """ If the subscription schedule is `active`, indicates if a final invoice will be generated that contains any un-invoiced metered usage and new/pending proration invoice items. Defaults to `true`. """ prorate: NotRequired[bool] """ If the subscription schedule is `active`, indicates if the cancellation should be prorated. Defaults to `true`. """ class CreateParams(RequestOptions): customer: NotRequired[str] """ The identifier of the customer to create the subscription schedule for. """ default_settings: NotRequired[ "SubscriptionSchedule.CreateParamsDefaultSettings" ] """ Object representing the subscription schedule's default settings. """ end_behavior: NotRequired[ Literal["cancel", "none", "release", "renew"] ] """ Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ from_subscription: NotRequired[str] """ Migrate an existing subscription to be managed by a subscription schedule. If this parameter is set, a subscription schedule will be created using the subscription's item(s), set to auto-renew using the subscription's interval. When using this parameter, other parameters (such as phase values) cannot be set. To create a subscription schedule with other modifications, we recommend making two separate API calls. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ phases: NotRequired[List["SubscriptionSchedule.CreateParamsPhase"]] """ List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. """ start_date: NotRequired["int|Literal['now']"] """ When the subscription schedule starts. We recommend using `now` so that it starts the subscription immediately. You can also use a Unix timestamp to backdate the subscription so that it starts on a past date, or set a future date for the subscription to start on. """ class CreateParamsDefaultSettings(TypedDict): application_fee_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). """ automatic_tax: NotRequired[ "SubscriptionSchedule.CreateParamsDefaultSettingsAutomaticTax" ] """ Default settings for automatic tax computation. """ billing_cycle_anchor: NotRequired[Literal["automatic", "phase_start"]] """ Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ billing_thresholds: NotRequired[ "Literal['']|SubscriptionSchedule.CreateParamsDefaultSettingsBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds. """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. """ default_payment_method: NotRequired[str] """ ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. """ description: NotRequired["Literal['']|str"] """ Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ invoice_settings: NotRequired[ "SubscriptionSchedule.CreateParamsDefaultSettingsInvoiceSettings" ] """ All invoices will be billed using the specified settings. """ on_behalf_of: NotRequired["Literal['']|str"] """ The account on behalf of which to charge, for each of the associated subscription's invoices. """ transfer_data: NotRequired[ "Literal['']|SubscriptionSchedule.CreateParamsDefaultSettingsTransferData" ] """ The data with which to automatically create a Transfer for each of the associated subscription's invoices. """ class CreateParamsDefaultSettingsAutomaticTax(TypedDict): enabled: bool """ Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. """ liability: NotRequired[ "SubscriptionSchedule.CreateParamsDefaultSettingsAutomaticTaxLiability" ] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ class CreateParamsDefaultSettingsAutomaticTaxLiability(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class CreateParamsDefaultSettingsBillingThresholds(TypedDict): amount_gte: NotRequired[int] """ Monetary threshold that triggers the subscription to advance to a new billing period """ reset_billing_cycle_anchor: NotRequired[bool] """ Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. """ class CreateParamsDefaultSettingsInvoiceSettings(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ The account tax IDs associated with the subscription schedule. Will be set on invoices generated by the subscription schedule. """ days_until_due: NotRequired[int] """ Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `collection_method=charge_automatically`. """ issuer: NotRequired[ "SubscriptionSchedule.CreateParamsDefaultSettingsInvoiceSettingsIssuer" ] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ class CreateParamsDefaultSettingsInvoiceSettingsIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class CreateParamsDefaultSettingsTransferData(TypedDict): amount_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. """ destination: str """ ID of an existing, connected Stripe account. """ class CreateParamsPhase(TypedDict): add_invoice_items: NotRequired[ List["SubscriptionSchedule.CreateParamsPhaseAddInvoiceItem"] ] """ A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items. """ application_fee_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). """ automatic_tax: NotRequired[ "SubscriptionSchedule.CreateParamsPhaseAutomaticTax" ] """ Automatic tax settings for this phase. """ billing_cycle_anchor: NotRequired[Literal["automatic", "phase_start"]] """ Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ billing_thresholds: NotRequired[ "Literal['']|SubscriptionSchedule.CreateParamsPhaseBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds. """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. """ coupon: NotRequired[str] """ The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. """ currency: NotRequired[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). """ default_payment_method: NotRequired[str] """ ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. """ default_tax_rates: NotRequired["Literal['']|List[str]"] """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase. """ description: NotRequired["Literal['']|str"] """ Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ discounts: NotRequired[ "Literal['']|List[SubscriptionSchedule.CreateParamsPhaseDiscount]" ] """ The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription's customer. Pass an empty string to avoid inheriting any discounts. """ end_date: NotRequired[int] """ The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set. """ invoice_settings: NotRequired[ "SubscriptionSchedule.CreateParamsPhaseInvoiceSettings" ] """ All invoices will be billed using the specified settings. """ items: List["SubscriptionSchedule.CreateParamsPhaseItem"] """ List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. """ iterations: NotRequired[int] """ Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. """ on_behalf_of: NotRequired[str] """ The account on behalf of which to charge, for each of the associated subscription's invoices. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase. """ transfer_data: NotRequired[ "SubscriptionSchedule.CreateParamsPhaseTransferData" ] """ The data with which to automatically create a Transfer for each of the associated subscription's invoices. """ trial: NotRequired[bool] """ If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. """ trial_end: NotRequired[int] """ Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial` """ class CreateParamsPhaseAddInvoiceItem(TypedDict): discounts: NotRequired[ List[ "SubscriptionSchedule.CreateParamsPhaseAddInvoiceItemDiscount" ] ] """ The coupons to redeem into discounts for the item. """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired[ "SubscriptionSchedule.CreateParamsPhaseAddInvoiceItemPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ Quantity for this item. Defaults to 1. """ tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. """ class CreateParamsPhaseAddInvoiceItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class CreateParamsPhaseAddInvoiceItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class CreateParamsPhaseAutomaticTax(TypedDict): enabled: bool """ Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. """ liability: NotRequired[ "SubscriptionSchedule.CreateParamsPhaseAutomaticTaxLiability" ] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ class CreateParamsPhaseAutomaticTaxLiability(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class CreateParamsPhaseBillingThresholds(TypedDict): amount_gte: NotRequired[int] """ Monetary threshold that triggers the subscription to advance to a new billing period """ reset_billing_cycle_anchor: NotRequired[bool] """ Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. """ class CreateParamsPhaseDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class CreateParamsPhaseInvoiceSettings(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule. """ days_until_due: NotRequired[int] """ Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. """ issuer: NotRequired[ "SubscriptionSchedule.CreateParamsPhaseInvoiceSettingsIssuer" ] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ class CreateParamsPhaseInvoiceSettingsIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class CreateParamsPhaseItem(TypedDict): billing_thresholds: NotRequired[ "Literal['']|SubscriptionSchedule.CreateParamsPhaseItemBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ discounts: NotRequired[ "Literal['']|List[SubscriptionSchedule.CreateParamsPhaseItemDiscount]" ] """ The coupons to redeem into discounts for the subscription item. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`. """ plan: NotRequired[str] """ The plan ID to subscribe to. You may specify the same ID in `plan` and `price`. """ price: NotRequired[str] """ The ID of the price object. """ price_data: NotRequired[ "SubscriptionSchedule.CreateParamsPhaseItemPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ quantity: NotRequired[int] """ Quantity for the given price. Can be set only if the price's `usage_type` is `licensed` and not `metered`. """ tax_rates: NotRequired["Literal['']|List[str]"] """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ class CreateParamsPhaseItemBillingThresholds(TypedDict): usage_gte: int """ Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ class CreateParamsPhaseItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class CreateParamsPhaseItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ recurring: ( "SubscriptionSchedule.CreateParamsPhaseItemPriceDataRecurring" ) """ The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class CreateParamsPhaseItemPriceDataRecurring(TypedDict): interval: Literal["day", "month", "week", "year"] """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class CreateParamsPhaseTransferData(TypedDict): amount_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. """ destination: str """ ID of an existing, connected Stripe account. """ class ListParams(RequestOptions): canceled_at: NotRequired[ "SubscriptionSchedule.ListParamsCanceledAt|int" ] """ Only return subscription schedules that were created canceled the given date interval. """ completed_at: NotRequired[ "SubscriptionSchedule.ListParamsCompletedAt|int" ] """ Only return subscription schedules that completed during the given date interval. """ created: NotRequired["SubscriptionSchedule.ListParamsCreated|int"] """ Only return subscription schedules that were created during the given date interval. """ customer: NotRequired[str] """ Only return subscription schedules for the given customer. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ released_at: NotRequired[ "SubscriptionSchedule.ListParamsReleasedAt|int" ] """ Only return subscription schedules that were released during the given date interval. """ scheduled: NotRequired[bool] """ Only return subscription schedules that have not started yet. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsCanceledAt(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsCompletedAt(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsReleasedAt(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): default_settings: NotRequired[ "SubscriptionSchedule.ModifyParamsDefaultSettings" ] """ Object representing the subscription schedule's default settings. """ end_behavior: NotRequired[ Literal["cancel", "none", "release", "renew"] ] """ Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ phases: NotRequired[List["SubscriptionSchedule.ModifyParamsPhase"]] """ List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. Note that past phases can be omitted. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ If the update changes the current phase, indicates whether the changes should be prorated. The default value is `create_prorations`. """ class ModifyParamsDefaultSettings(TypedDict): application_fee_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). """ automatic_tax: NotRequired[ "SubscriptionSchedule.ModifyParamsDefaultSettingsAutomaticTax" ] """ Default settings for automatic tax computation. """ billing_cycle_anchor: NotRequired[Literal["automatic", "phase_start"]] """ Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ billing_thresholds: NotRequired[ "Literal['']|SubscriptionSchedule.ModifyParamsDefaultSettingsBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds. """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. """ default_payment_method: NotRequired[str] """ ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. """ description: NotRequired["Literal['']|str"] """ Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ invoice_settings: NotRequired[ "SubscriptionSchedule.ModifyParamsDefaultSettingsInvoiceSettings" ] """ All invoices will be billed using the specified settings. """ on_behalf_of: NotRequired["Literal['']|str"] """ The account on behalf of which to charge, for each of the associated subscription's invoices. """ transfer_data: NotRequired[ "Literal['']|SubscriptionSchedule.ModifyParamsDefaultSettingsTransferData" ] """ The data with which to automatically create a Transfer for each of the associated subscription's invoices. """ class ModifyParamsDefaultSettingsAutomaticTax(TypedDict): enabled: bool """ Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. """ liability: NotRequired[ "SubscriptionSchedule.ModifyParamsDefaultSettingsAutomaticTaxLiability" ] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ class ModifyParamsDefaultSettingsAutomaticTaxLiability(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class ModifyParamsDefaultSettingsBillingThresholds(TypedDict): amount_gte: NotRequired[int] """ Monetary threshold that triggers the subscription to advance to a new billing period """ reset_billing_cycle_anchor: NotRequired[bool] """ Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. """ class ModifyParamsDefaultSettingsInvoiceSettings(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ The account tax IDs associated with the subscription schedule. Will be set on invoices generated by the subscription schedule. """ days_until_due: NotRequired[int] """ Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `collection_method=charge_automatically`. """ issuer: NotRequired[ "SubscriptionSchedule.ModifyParamsDefaultSettingsInvoiceSettingsIssuer" ] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ class ModifyParamsDefaultSettingsInvoiceSettingsIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class ModifyParamsDefaultSettingsTransferData(TypedDict): amount_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. """ destination: str """ ID of an existing, connected Stripe account. """ class ModifyParamsPhase(TypedDict): add_invoice_items: NotRequired[ List["SubscriptionSchedule.ModifyParamsPhaseAddInvoiceItem"] ] """ A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items. """ application_fee_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). """ automatic_tax: NotRequired[ "SubscriptionSchedule.ModifyParamsPhaseAutomaticTax" ] """ Automatic tax settings for this phase. """ billing_cycle_anchor: NotRequired[Literal["automatic", "phase_start"]] """ Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ billing_thresholds: NotRequired[ "Literal['']|SubscriptionSchedule.ModifyParamsPhaseBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds. """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. """ coupon: NotRequired[str] """ The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. """ currency: NotRequired[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). """ default_payment_method: NotRequired[str] """ ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. """ default_tax_rates: NotRequired["Literal['']|List[str]"] """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase. """ description: NotRequired["Literal['']|str"] """ Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ discounts: NotRequired[ "Literal['']|List[SubscriptionSchedule.ModifyParamsPhaseDiscount]" ] """ The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription's customer. Pass an empty string to avoid inheriting any discounts. """ end_date: NotRequired["int|Literal['now']"] """ The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set. """ invoice_settings: NotRequired[ "SubscriptionSchedule.ModifyParamsPhaseInvoiceSettings" ] """ All invoices will be billed using the specified settings. """ items: List["SubscriptionSchedule.ModifyParamsPhaseItem"] """ List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. """ iterations: NotRequired[int] """ Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. """ on_behalf_of: NotRequired[str] """ The account on behalf of which to charge, for each of the associated subscription's invoices. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase. """ start_date: NotRequired["int|Literal['now']"] """ The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase. """ transfer_data: NotRequired[ "SubscriptionSchedule.ModifyParamsPhaseTransferData" ] """ The data with which to automatically create a Transfer for each of the associated subscription's invoices. """ trial: NotRequired[bool] """ If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. """ trial_end: NotRequired["int|Literal['now']"] """ Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial` """ class ModifyParamsPhaseAddInvoiceItem(TypedDict): discounts: NotRequired[ List[ "SubscriptionSchedule.ModifyParamsPhaseAddInvoiceItemDiscount" ] ] """ The coupons to redeem into discounts for the item. """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired[ "SubscriptionSchedule.ModifyParamsPhaseAddInvoiceItemPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ Quantity for this item. Defaults to 1. """ tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. """ class ModifyParamsPhaseAddInvoiceItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class ModifyParamsPhaseAddInvoiceItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class ModifyParamsPhaseAutomaticTax(TypedDict): enabled: bool """ Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. """ liability: NotRequired[ "SubscriptionSchedule.ModifyParamsPhaseAutomaticTaxLiability" ] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ class ModifyParamsPhaseAutomaticTaxLiability(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class ModifyParamsPhaseBillingThresholds(TypedDict): amount_gte: NotRequired[int] """ Monetary threshold that triggers the subscription to advance to a new billing period """ reset_billing_cycle_anchor: NotRequired[bool] """ Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. """ class ModifyParamsPhaseDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class ModifyParamsPhaseInvoiceSettings(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule. """ days_until_due: NotRequired[int] """ Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. """ issuer: NotRequired[ "SubscriptionSchedule.ModifyParamsPhaseInvoiceSettingsIssuer" ] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ class ModifyParamsPhaseInvoiceSettingsIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class ModifyParamsPhaseItem(TypedDict): billing_thresholds: NotRequired[ "Literal['']|SubscriptionSchedule.ModifyParamsPhaseItemBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ discounts: NotRequired[ "Literal['']|List[SubscriptionSchedule.ModifyParamsPhaseItemDiscount]" ] """ The coupons to redeem into discounts for the subscription item. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`. """ plan: NotRequired[str] """ The plan ID to subscribe to. You may specify the same ID in `plan` and `price`. """ price: NotRequired[str] """ The ID of the price object. """ price_data: NotRequired[ "SubscriptionSchedule.ModifyParamsPhaseItemPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ quantity: NotRequired[int] """ Quantity for the given price. Can be set only if the price's `usage_type` is `licensed` and not `metered`. """ tax_rates: NotRequired["Literal['']|List[str]"] """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ class ModifyParamsPhaseItemBillingThresholds(TypedDict): usage_gte: int """ Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ class ModifyParamsPhaseItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class ModifyParamsPhaseItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ recurring: ( "SubscriptionSchedule.ModifyParamsPhaseItemPriceDataRecurring" ) """ The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class ModifyParamsPhaseItemPriceDataRecurring(TypedDict): interval: Literal["day", "month", "week", "year"] """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class ModifyParamsPhaseTransferData(TypedDict): amount_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. """ destination: str """ ID of an existing, connected Stripe account. """ class ReleaseParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ preserve_cancel_date: NotRequired[bool] """ Keep any cancellation on the subscription that the schedule has set """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ application: Optional[ExpandableField["Application"]] """ ID of the Connect Application that created the schedule. """ canceled_at: Optional[int] """ Time at which the subscription schedule was canceled. Measured in seconds since the Unix epoch. """ completed_at: Optional[int] """ Time at which the subscription schedule was completed. Measured in seconds since the Unix epoch. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ current_phase: Optional[CurrentPhase] """ Object representing the start and end dates for the current phase of the subscription schedule, if it is `active`. """ customer: ExpandableField["Customer"] """ ID of the customer who owns the subscription schedule. """ default_settings: DefaultSettings end_behavior: Literal["cancel", "none", "release", "renew"] """ Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription. """ id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ metadata: Optional[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ object: Literal["subscription_schedule"] """ String representing the object's type. Objects of the same type share the same value. """ phases: List[Phase] """ Configuration for the subscription schedule's phases. """ released_at: Optional[int] """ Time at which the subscription schedule was released. Measured in seconds since the Unix epoch. """ released_subscription: Optional[str] """ ID of the subscription once managed by the subscription schedule (if it is released). """ status: Literal[ "active", "canceled", "completed", "not_started", "released" ] """ The present status of the subscription schedule. Possible values are `not_started`, `active`, `completed`, `released`, and `canceled`. You can read more about the different states in our [behavior guide](https://stripe.com/docs/billing/subscriptions/subscription-schedules). """ subscription: Optional[ExpandableField["Subscription"]] """ ID of the subscription managed by the subscription schedule. """ test_clock: Optional[ExpandableField["TestClock"]] """ ID of the test clock this subscription schedule belongs to. """ @classmethod def _cls_cancel( cls, schedule: str, **params: Unpack["SubscriptionSchedule.CancelParams"], ) -> "SubscriptionSchedule": """ Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active. """ return cast( "SubscriptionSchedule", cls._static_request( "post", "/v1/subscription_schedules/{schedule}/cancel".format( schedule=sanitize_id(schedule) ), params=params, ), ) @overload @staticmethod def cancel( schedule: str, **params: Unpack["SubscriptionSchedule.CancelParams"] ) -> "SubscriptionSchedule": """ Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active. """ ... @overload def cancel( self, **params: Unpack["SubscriptionSchedule.CancelParams"] ) -> "SubscriptionSchedule": """ Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active. """ ... @class_method_variant("_cls_cancel") def cancel( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["SubscriptionSchedule.CancelParams"] ) -> "SubscriptionSchedule": """ Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active. """ return cast( "SubscriptionSchedule", self._request( "post", "/v1/subscription_schedules/{schedule}/cancel".format( schedule=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_cancel_async( cls, schedule: str, **params: Unpack["SubscriptionSchedule.CancelParams"], ) -> "SubscriptionSchedule": """ Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active. """ return cast( "SubscriptionSchedule", await cls._static_request_async( "post", "/v1/subscription_schedules/{schedule}/cancel".format( schedule=sanitize_id(schedule) ), params=params, ), ) @overload @staticmethod async def cancel_async( schedule: str, **params: Unpack["SubscriptionSchedule.CancelParams"] ) -> "SubscriptionSchedule": """ Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active. """ ... @overload async def cancel_async( self, **params: Unpack["SubscriptionSchedule.CancelParams"] ) -> "SubscriptionSchedule": """ Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active. """ ... @class_method_variant("_cls_cancel_async") async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["SubscriptionSchedule.CancelParams"] ) -> "SubscriptionSchedule": """ Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active. """ return cast( "SubscriptionSchedule", await self._request_async( "post", "/v1/subscription_schedules/{schedule}/cancel".format( schedule=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def create( cls, **params: Unpack["SubscriptionSchedule.CreateParams"] ) -> "SubscriptionSchedule": """ Creates a new subscription schedule object. Each customer can have up to 500 active or scheduled subscriptions. """ return cast( "SubscriptionSchedule", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["SubscriptionSchedule.CreateParams"] ) -> "SubscriptionSchedule": """ Creates a new subscription schedule object. Each customer can have up to 500 active or scheduled subscriptions. """ return cast( "SubscriptionSchedule", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def list( cls, **params: Unpack["SubscriptionSchedule.ListParams"] ) -> ListObject["SubscriptionSchedule"]: """ Retrieves the list of your subscription schedules. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["SubscriptionSchedule.ListParams"] ) -> ListObject["SubscriptionSchedule"]: """ Retrieves the list of your subscription schedules. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def modify( cls, id: str, **params: Unpack["SubscriptionSchedule.ModifyParams"] ) -> "SubscriptionSchedule": """ Updates an existing subscription schedule. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "SubscriptionSchedule", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["SubscriptionSchedule.ModifyParams"] ) -> "SubscriptionSchedule": """ Updates an existing subscription schedule. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "SubscriptionSchedule", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def _cls_release( cls, schedule: str, **params: Unpack["SubscriptionSchedule.ReleaseParams"], ) -> "SubscriptionSchedule": """ Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place. A schedule can only be released if its status is not_started or active. If the subscription schedule is currently associated with a subscription, releasing it will remove its subscription property and set the subscription's ID to the released_subscription property. """ return cast( "SubscriptionSchedule", cls._static_request( "post", "/v1/subscription_schedules/{schedule}/release".format( schedule=sanitize_id(schedule) ), params=params, ), ) @overload @staticmethod def release( schedule: str, **params: Unpack["SubscriptionSchedule.ReleaseParams"] ) -> "SubscriptionSchedule": """ Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place. A schedule can only be released if its status is not_started or active. If the subscription schedule is currently associated with a subscription, releasing it will remove its subscription property and set the subscription's ID to the released_subscription property. """ ... @overload def release( self, **params: Unpack["SubscriptionSchedule.ReleaseParams"] ) -> "SubscriptionSchedule": """ Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place. A schedule can only be released if its status is not_started or active. If the subscription schedule is currently associated with a subscription, releasing it will remove its subscription property and set the subscription's ID to the released_subscription property. """ ... @class_method_variant("_cls_release") def release( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["SubscriptionSchedule.ReleaseParams"] ) -> "SubscriptionSchedule": """ Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place. A schedule can only be released if its status is not_started or active. If the subscription schedule is currently associated with a subscription, releasing it will remove its subscription property and set the subscription's ID to the released_subscription property. """ return cast( "SubscriptionSchedule", self._request( "post", "/v1/subscription_schedules/{schedule}/release".format( schedule=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_release_async( cls, schedule: str, **params: Unpack["SubscriptionSchedule.ReleaseParams"], ) -> "SubscriptionSchedule": """ Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place. A schedule can only be released if its status is not_started or active. If the subscription schedule is currently associated with a subscription, releasing it will remove its subscription property and set the subscription's ID to the released_subscription property. """ return cast( "SubscriptionSchedule", await cls._static_request_async( "post", "/v1/subscription_schedules/{schedule}/release".format( schedule=sanitize_id(schedule) ), params=params, ), ) @overload @staticmethod async def release_async( schedule: str, **params: Unpack["SubscriptionSchedule.ReleaseParams"] ) -> "SubscriptionSchedule": """ Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place. A schedule can only be released if its status is not_started or active. If the subscription schedule is currently associated with a subscription, releasing it will remove its subscription property and set the subscription's ID to the released_subscription property. """ ... @overload async def release_async( self, **params: Unpack["SubscriptionSchedule.ReleaseParams"] ) -> "SubscriptionSchedule": """ Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place. A schedule can only be released if its status is not_started or active. If the subscription schedule is currently associated with a subscription, releasing it will remove its subscription property and set the subscription's ID to the released_subscription property. """ ... @class_method_variant("_cls_release_async") async def release_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["SubscriptionSchedule.ReleaseParams"] ) -> "SubscriptionSchedule": """ Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place. A schedule can only be released if its status is not_started or active. If the subscription schedule is currently associated with a subscription, releasing it will remove its subscription property and set the subscription's ID to the released_subscription property. """ return cast( "SubscriptionSchedule", await self._request_async( "post", "/v1/subscription_schedules/{schedule}/release".format( schedule=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["SubscriptionSchedule.RetrieveParams"] ) -> "SubscriptionSchedule": """ Retrieves the details of an existing subscription schedule. You only need to supply the unique subscription schedule identifier that was returned upon subscription schedule creation. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["SubscriptionSchedule.RetrieveParams"] ) -> "SubscriptionSchedule": """ Retrieves the details of an existing subscription schedule. You only need to supply the unique subscription schedule identifier that was returned upon subscription schedule creation. """ instance = cls(id, **params) await instance.refresh_async() return instance _inner_class_types = { "current_phase": CurrentPhase, "default_settings": DefaultSettings, "phases": Phase, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_subscription_schedule_service.py0000644000175100001770000021221314637354563022664 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._subscription_schedule import SubscriptionSchedule from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class SubscriptionScheduleService(StripeService): class CancelParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ invoice_now: NotRequired[bool] """ If the subscription schedule is `active`, indicates if a final invoice will be generated that contains any un-invoiced metered usage and new/pending proration invoice items. Defaults to `true`. """ prorate: NotRequired[bool] """ If the subscription schedule is `active`, indicates if the cancellation should be prorated. Defaults to `true`. """ class CreateParams(TypedDict): customer: NotRequired[str] """ The identifier of the customer to create the subscription schedule for. """ default_settings: NotRequired[ "SubscriptionScheduleService.CreateParamsDefaultSettings" ] """ Object representing the subscription schedule's default settings. """ end_behavior: NotRequired[ Literal["cancel", "none", "release", "renew"] ] """ Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ from_subscription: NotRequired[str] """ Migrate an existing subscription to be managed by a subscription schedule. If this parameter is set, a subscription schedule will be created using the subscription's item(s), set to auto-renew using the subscription's interval. When using this parameter, other parameters (such as phase values) cannot be set. To create a subscription schedule with other modifications, we recommend making two separate API calls. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ phases: NotRequired[ List["SubscriptionScheduleService.CreateParamsPhase"] ] """ List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. """ start_date: NotRequired["int|Literal['now']"] """ When the subscription schedule starts. We recommend using `now` so that it starts the subscription immediately. You can also use a Unix timestamp to backdate the subscription so that it starts on a past date, or set a future date for the subscription to start on. """ class CreateParamsDefaultSettings(TypedDict): application_fee_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). """ automatic_tax: NotRequired[ "SubscriptionScheduleService.CreateParamsDefaultSettingsAutomaticTax" ] """ Default settings for automatic tax computation. """ billing_cycle_anchor: NotRequired[Literal["automatic", "phase_start"]] """ Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ billing_thresholds: NotRequired[ "Literal['']|SubscriptionScheduleService.CreateParamsDefaultSettingsBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds. """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. """ default_payment_method: NotRequired[str] """ ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. """ description: NotRequired["Literal['']|str"] """ Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ invoice_settings: NotRequired[ "SubscriptionScheduleService.CreateParamsDefaultSettingsInvoiceSettings" ] """ All invoices will be billed using the specified settings. """ on_behalf_of: NotRequired["Literal['']|str"] """ The account on behalf of which to charge, for each of the associated subscription's invoices. """ transfer_data: NotRequired[ "Literal['']|SubscriptionScheduleService.CreateParamsDefaultSettingsTransferData" ] """ The data with which to automatically create a Transfer for each of the associated subscription's invoices. """ class CreateParamsDefaultSettingsAutomaticTax(TypedDict): enabled: bool """ Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. """ liability: NotRequired[ "SubscriptionScheduleService.CreateParamsDefaultSettingsAutomaticTaxLiability" ] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ class CreateParamsDefaultSettingsAutomaticTaxLiability(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class CreateParamsDefaultSettingsBillingThresholds(TypedDict): amount_gte: NotRequired[int] """ Monetary threshold that triggers the subscription to advance to a new billing period """ reset_billing_cycle_anchor: NotRequired[bool] """ Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. """ class CreateParamsDefaultSettingsInvoiceSettings(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ The account tax IDs associated with the subscription schedule. Will be set on invoices generated by the subscription schedule. """ days_until_due: NotRequired[int] """ Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `collection_method=charge_automatically`. """ issuer: NotRequired[ "SubscriptionScheduleService.CreateParamsDefaultSettingsInvoiceSettingsIssuer" ] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ class CreateParamsDefaultSettingsInvoiceSettingsIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class CreateParamsDefaultSettingsTransferData(TypedDict): amount_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. """ destination: str """ ID of an existing, connected Stripe account. """ class CreateParamsPhase(TypedDict): add_invoice_items: NotRequired[ List["SubscriptionScheduleService.CreateParamsPhaseAddInvoiceItem"] ] """ A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items. """ application_fee_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). """ automatic_tax: NotRequired[ "SubscriptionScheduleService.CreateParamsPhaseAutomaticTax" ] """ Automatic tax settings for this phase. """ billing_cycle_anchor: NotRequired[Literal["automatic", "phase_start"]] """ Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ billing_thresholds: NotRequired[ "Literal['']|SubscriptionScheduleService.CreateParamsPhaseBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds. """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. """ coupon: NotRequired[str] """ The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. """ currency: NotRequired[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). """ default_payment_method: NotRequired[str] """ ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. """ default_tax_rates: NotRequired["Literal['']|List[str]"] """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase. """ description: NotRequired["Literal['']|str"] """ Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ discounts: NotRequired[ "Literal['']|List[SubscriptionScheduleService.CreateParamsPhaseDiscount]" ] """ The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription's customer. Pass an empty string to avoid inheriting any discounts. """ end_date: NotRequired[int] """ The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set. """ invoice_settings: NotRequired[ "SubscriptionScheduleService.CreateParamsPhaseInvoiceSettings" ] """ All invoices will be billed using the specified settings. """ items: List["SubscriptionScheduleService.CreateParamsPhaseItem"] """ List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. """ iterations: NotRequired[int] """ Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. """ on_behalf_of: NotRequired[str] """ The account on behalf of which to charge, for each of the associated subscription's invoices. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase. """ transfer_data: NotRequired[ "SubscriptionScheduleService.CreateParamsPhaseTransferData" ] """ The data with which to automatically create a Transfer for each of the associated subscription's invoices. """ trial: NotRequired[bool] """ If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. """ trial_end: NotRequired[int] """ Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial` """ class CreateParamsPhaseAddInvoiceItem(TypedDict): discounts: NotRequired[ List[ "SubscriptionScheduleService.CreateParamsPhaseAddInvoiceItemDiscount" ] ] """ The coupons to redeem into discounts for the item. """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired[ "SubscriptionScheduleService.CreateParamsPhaseAddInvoiceItemPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ Quantity for this item. Defaults to 1. """ tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. """ class CreateParamsPhaseAddInvoiceItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class CreateParamsPhaseAddInvoiceItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class CreateParamsPhaseAutomaticTax(TypedDict): enabled: bool """ Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. """ liability: NotRequired[ "SubscriptionScheduleService.CreateParamsPhaseAutomaticTaxLiability" ] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ class CreateParamsPhaseAutomaticTaxLiability(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class CreateParamsPhaseBillingThresholds(TypedDict): amount_gte: NotRequired[int] """ Monetary threshold that triggers the subscription to advance to a new billing period """ reset_billing_cycle_anchor: NotRequired[bool] """ Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. """ class CreateParamsPhaseDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class CreateParamsPhaseInvoiceSettings(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule. """ days_until_due: NotRequired[int] """ Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. """ issuer: NotRequired[ "SubscriptionScheduleService.CreateParamsPhaseInvoiceSettingsIssuer" ] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ class CreateParamsPhaseInvoiceSettingsIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class CreateParamsPhaseItem(TypedDict): billing_thresholds: NotRequired[ "Literal['']|SubscriptionScheduleService.CreateParamsPhaseItemBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ discounts: NotRequired[ "Literal['']|List[SubscriptionScheduleService.CreateParamsPhaseItemDiscount]" ] """ The coupons to redeem into discounts for the subscription item. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`. """ plan: NotRequired[str] """ The plan ID to subscribe to. You may specify the same ID in `plan` and `price`. """ price: NotRequired[str] """ The ID of the price object. """ price_data: NotRequired[ "SubscriptionScheduleService.CreateParamsPhaseItemPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ quantity: NotRequired[int] """ Quantity for the given price. Can be set only if the price's `usage_type` is `licensed` and not `metered`. """ tax_rates: NotRequired["Literal['']|List[str]"] """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ class CreateParamsPhaseItemBillingThresholds(TypedDict): usage_gte: int """ Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ class CreateParamsPhaseItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class CreateParamsPhaseItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ recurring: "SubscriptionScheduleService.CreateParamsPhaseItemPriceDataRecurring" """ The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class CreateParamsPhaseItemPriceDataRecurring(TypedDict): interval: Literal["day", "month", "week", "year"] """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class CreateParamsPhaseTransferData(TypedDict): amount_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. """ destination: str """ ID of an existing, connected Stripe account. """ class ListParams(TypedDict): canceled_at: NotRequired[ "SubscriptionScheduleService.ListParamsCanceledAt|int" ] """ Only return subscription schedules that were created canceled the given date interval. """ completed_at: NotRequired[ "SubscriptionScheduleService.ListParamsCompletedAt|int" ] """ Only return subscription schedules that completed during the given date interval. """ created: NotRequired[ "SubscriptionScheduleService.ListParamsCreated|int" ] """ Only return subscription schedules that were created during the given date interval. """ customer: NotRequired[str] """ Only return subscription schedules for the given customer. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ released_at: NotRequired[ "SubscriptionScheduleService.ListParamsReleasedAt|int" ] """ Only return subscription schedules that were released during the given date interval. """ scheduled: NotRequired[bool] """ Only return subscription schedules that have not started yet. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsCanceledAt(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsCompletedAt(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsReleasedAt(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ReleaseParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ preserve_cancel_date: NotRequired[bool] """ Keep any cancellation on the subscription that the schedule has set """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): default_settings: NotRequired[ "SubscriptionScheduleService.UpdateParamsDefaultSettings" ] """ Object representing the subscription schedule's default settings. """ end_behavior: NotRequired[ Literal["cancel", "none", "release", "renew"] ] """ Behavior of the subscription schedule and underlying subscription when it ends. Possible values are `release` or `cancel` with the default being `release`. `release` will end the subscription schedule and keep the underlying subscription running. `cancel` will end the subscription schedule and cancel the underlying subscription. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ phases: NotRequired[ List["SubscriptionScheduleService.UpdateParamsPhase"] ] """ List representing phases of the subscription schedule. Each phase can be customized to have different durations, plans, and coupons. If there are multiple phases, the `end_date` of one phase will always equal the `start_date` of the next phase. Note that past phases can be omitted. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ If the update changes the current phase, indicates whether the changes should be prorated. The default value is `create_prorations`. """ class UpdateParamsDefaultSettings(TypedDict): application_fee_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). """ automatic_tax: NotRequired[ "SubscriptionScheduleService.UpdateParamsDefaultSettingsAutomaticTax" ] """ Default settings for automatic tax computation. """ billing_cycle_anchor: NotRequired[Literal["automatic", "phase_start"]] """ Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ billing_thresholds: NotRequired[ "Literal['']|SubscriptionScheduleService.UpdateParamsDefaultSettingsBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds. """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. """ default_payment_method: NotRequired[str] """ ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. """ description: NotRequired["Literal['']|str"] """ Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ invoice_settings: NotRequired[ "SubscriptionScheduleService.UpdateParamsDefaultSettingsInvoiceSettings" ] """ All invoices will be billed using the specified settings. """ on_behalf_of: NotRequired["Literal['']|str"] """ The account on behalf of which to charge, for each of the associated subscription's invoices. """ transfer_data: NotRequired[ "Literal['']|SubscriptionScheduleService.UpdateParamsDefaultSettingsTransferData" ] """ The data with which to automatically create a Transfer for each of the associated subscription's invoices. """ class UpdateParamsDefaultSettingsAutomaticTax(TypedDict): enabled: bool """ Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. """ liability: NotRequired[ "SubscriptionScheduleService.UpdateParamsDefaultSettingsAutomaticTaxLiability" ] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ class UpdateParamsDefaultSettingsAutomaticTaxLiability(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class UpdateParamsDefaultSettingsBillingThresholds(TypedDict): amount_gte: NotRequired[int] """ Monetary threshold that triggers the subscription to advance to a new billing period """ reset_billing_cycle_anchor: NotRequired[bool] """ Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. """ class UpdateParamsDefaultSettingsInvoiceSettings(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ The account tax IDs associated with the subscription schedule. Will be set on invoices generated by the subscription schedule. """ days_until_due: NotRequired[int] """ Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `collection_method=charge_automatically`. """ issuer: NotRequired[ "SubscriptionScheduleService.UpdateParamsDefaultSettingsInvoiceSettingsIssuer" ] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ class UpdateParamsDefaultSettingsInvoiceSettingsIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class UpdateParamsDefaultSettingsTransferData(TypedDict): amount_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. """ destination: str """ ID of an existing, connected Stripe account. """ class UpdateParamsPhase(TypedDict): add_invoice_items: NotRequired[ List["SubscriptionScheduleService.UpdateParamsPhaseAddInvoiceItem"] ] """ A list of prices and quantities that will generate invoice items appended to the next invoice for this phase. You may pass up to 20 items. """ application_fee_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). """ automatic_tax: NotRequired[ "SubscriptionScheduleService.UpdateParamsPhaseAutomaticTax" ] """ Automatic tax settings for this phase. """ billing_cycle_anchor: NotRequired[Literal["automatic", "phase_start"]] """ Can be set to `phase_start` to set the anchor to the start of the phase or `automatic` to automatically change it if needed. Cannot be set to `phase_start` if this phase specifies a trial. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ billing_thresholds: NotRequired[ "Literal['']|SubscriptionScheduleService.UpdateParamsPhaseBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds. """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay the underlying subscription at the end of each billing cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically` on creation. """ coupon: NotRequired[str] """ The ID of the coupon to apply to this phase of the subscription schedule. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. """ currency: NotRequired[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). """ default_payment_method: NotRequired[str] """ ID of the default payment method for the subscription schedule. It must belong to the customer associated with the subscription schedule. If not set, invoices will use the default payment method in the customer's invoice settings. """ default_tax_rates: NotRequired["Literal['']|List[str]"] """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will set the Subscription's [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates), which means they will be the Invoice's [`default_tax_rates`](https://stripe.com/docs/api/invoices/create#create_invoice-default_tax_rates) for any Invoices issued by the Subscription during this Phase. """ description: NotRequired["Literal['']|str"] """ Subscription description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ discounts: NotRequired[ "Literal['']|List[SubscriptionScheduleService.UpdateParamsPhaseDiscount]" ] """ The coupons to redeem into discounts for the schedule phase. If not specified, inherits the discount from the subscription's customer. Pass an empty string to avoid inheriting any discounts. """ end_date: NotRequired["int|Literal['now']"] """ The date at which this phase of the subscription schedule ends. If set, `iterations` must not be set. """ invoice_settings: NotRequired[ "SubscriptionScheduleService.UpdateParamsPhaseInvoiceSettings" ] """ All invoices will be billed using the specified settings. """ items: List["SubscriptionScheduleService.UpdateParamsPhaseItem"] """ List of configuration items, each with an attached price, to apply during this phase of the subscription schedule. """ iterations: NotRequired[int] """ Integer representing the multiplier applied to the price interval. For example, `iterations=2` applied to a price with `interval=month` and `interval_count=3` results in a phase of duration `2 * 3 months = 6 months`. If set, `end_date` must not be set. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a phase. Metadata on a schedule's phase will update the underlying subscription's `metadata` when the phase is entered, adding new keys and replacing existing keys in the subscription's `metadata`. Individual keys in the subscription's `metadata` can be unset by posting an empty value to them in the phase's `metadata`. To unset all keys in the subscription's `metadata`, update the subscription directly or unset every key individually from the phase's `metadata`. """ on_behalf_of: NotRequired[str] """ The account on behalf of which to charge, for each of the associated subscription's invoices. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ Whether the subscription schedule will create [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when transitioning to this phase. The default value is `create_prorations`. This setting controls prorations when a phase is started asynchronously and it is persisted as a field on the phase. It's different from the request-level [proration_behavior](https://stripe.com/docs/api/subscription_schedules/update#update_subscription_schedule-proration_behavior) parameter which controls what happens if the update request affects the billing configuration of the current phase. """ start_date: NotRequired["int|Literal['now']"] """ The date at which this phase of the subscription schedule starts or `now`. Must be set on the first phase. """ transfer_data: NotRequired[ "SubscriptionScheduleService.UpdateParamsPhaseTransferData" ] """ The data with which to automatically create a Transfer for each of the associated subscription's invoices. """ trial: NotRequired[bool] """ If set to true the entire phase is counted as a trial and the customer will not be charged for any fees. """ trial_end: NotRequired["int|Literal['now']"] """ Sets the phase to trialing from the start date to this date. Must be before the phase end date, can not be combined with `trial` """ class UpdateParamsPhaseAddInvoiceItem(TypedDict): discounts: NotRequired[ List[ "SubscriptionScheduleService.UpdateParamsPhaseAddInvoiceItemDiscount" ] ] """ The coupons to redeem into discounts for the item. """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired[ "SubscriptionScheduleService.UpdateParamsPhaseAddInvoiceItemPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ Quantity for this item. Defaults to 1. """ tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. """ class UpdateParamsPhaseAddInvoiceItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class UpdateParamsPhaseAddInvoiceItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class UpdateParamsPhaseAutomaticTax(TypedDict): enabled: bool """ Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. """ liability: NotRequired[ "SubscriptionScheduleService.UpdateParamsPhaseAutomaticTaxLiability" ] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ class UpdateParamsPhaseAutomaticTaxLiability(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class UpdateParamsPhaseBillingThresholds(TypedDict): amount_gte: NotRequired[int] """ Monetary threshold that triggers the subscription to advance to a new billing period """ reset_billing_cycle_anchor: NotRequired[bool] """ Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. """ class UpdateParamsPhaseDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class UpdateParamsPhaseInvoiceSettings(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ The account tax IDs associated with this phase of the subscription schedule. Will be set on invoices generated by this phase of the subscription schedule. """ days_until_due: NotRequired[int] """ Number of days within which a customer must pay invoices generated by this subscription schedule. This value will be `null` for subscription schedules where `billing=charge_automatically`. """ issuer: NotRequired[ "SubscriptionScheduleService.UpdateParamsPhaseInvoiceSettingsIssuer" ] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ class UpdateParamsPhaseInvoiceSettingsIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class UpdateParamsPhaseItem(TypedDict): billing_thresholds: NotRequired[ "Literal['']|SubscriptionScheduleService.UpdateParamsPhaseItemBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ discounts: NotRequired[ "Literal['']|List[SubscriptionScheduleService.UpdateParamsPhaseItemDiscount]" ] """ The coupons to redeem into discounts for the subscription item. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to a configuration item. Metadata on a configuration item will update the underlying subscription item's `metadata` when the phase is entered, adding new keys and replacing existing keys. Individual keys in the subscription item's `metadata` can be unset by posting an empty value to them in the configuration item's `metadata`. To unset all keys in the subscription item's `metadata`, update the subscription item directly or unset every key individually from the configuration item's `metadata`. """ plan: NotRequired[str] """ The plan ID to subscribe to. You may specify the same ID in `plan` and `price`. """ price: NotRequired[str] """ The ID of the price object. """ price_data: NotRequired[ "SubscriptionScheduleService.UpdateParamsPhaseItemPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ quantity: NotRequired[int] """ Quantity for the given price. Can be set only if the price's `usage_type` is `licensed` and not `metered`. """ tax_rates: NotRequired["Literal['']|List[str]"] """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ class UpdateParamsPhaseItemBillingThresholds(TypedDict): usage_gte: int """ Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ class UpdateParamsPhaseItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class UpdateParamsPhaseItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ recurring: "SubscriptionScheduleService.UpdateParamsPhaseItemPriceDataRecurring" """ The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class UpdateParamsPhaseItemPriceDataRecurring(TypedDict): interval: Literal["day", "month", "week", "year"] """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class UpdateParamsPhaseTransferData(TypedDict): amount_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. """ destination: str """ ID of an existing, connected Stripe account. """ def list( self, params: "SubscriptionScheduleService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[SubscriptionSchedule]: """ Retrieves the list of your subscription schedules. """ return cast( ListObject[SubscriptionSchedule], self._request( "get", "/v1/subscription_schedules", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "SubscriptionScheduleService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[SubscriptionSchedule]: """ Retrieves the list of your subscription schedules. """ return cast( ListObject[SubscriptionSchedule], await self._request_async( "get", "/v1/subscription_schedules", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "SubscriptionScheduleService.CreateParams" = {}, options: RequestOptions = {}, ) -> SubscriptionSchedule: """ Creates a new subscription schedule object. Each customer can have up to 500 active or scheduled subscriptions. """ return cast( SubscriptionSchedule, self._request( "post", "/v1/subscription_schedules", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "SubscriptionScheduleService.CreateParams" = {}, options: RequestOptions = {}, ) -> SubscriptionSchedule: """ Creates a new subscription schedule object. Each customer can have up to 500 active or scheduled subscriptions. """ return cast( SubscriptionSchedule, await self._request_async( "post", "/v1/subscription_schedules", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, schedule: str, params: "SubscriptionScheduleService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> SubscriptionSchedule: """ Retrieves the details of an existing subscription schedule. You only need to supply the unique subscription schedule identifier that was returned upon subscription schedule creation. """ return cast( SubscriptionSchedule, self._request( "get", "/v1/subscription_schedules/{schedule}".format( schedule=sanitize_id(schedule), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, schedule: str, params: "SubscriptionScheduleService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> SubscriptionSchedule: """ Retrieves the details of an existing subscription schedule. You only need to supply the unique subscription schedule identifier that was returned upon subscription schedule creation. """ return cast( SubscriptionSchedule, await self._request_async( "get", "/v1/subscription_schedules/{schedule}".format( schedule=sanitize_id(schedule), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, schedule: str, params: "SubscriptionScheduleService.UpdateParams" = {}, options: RequestOptions = {}, ) -> SubscriptionSchedule: """ Updates an existing subscription schedule. """ return cast( SubscriptionSchedule, self._request( "post", "/v1/subscription_schedules/{schedule}".format( schedule=sanitize_id(schedule), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, schedule: str, params: "SubscriptionScheduleService.UpdateParams" = {}, options: RequestOptions = {}, ) -> SubscriptionSchedule: """ Updates an existing subscription schedule. """ return cast( SubscriptionSchedule, await self._request_async( "post", "/v1/subscription_schedules/{schedule}".format( schedule=sanitize_id(schedule), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def cancel( self, schedule: str, params: "SubscriptionScheduleService.CancelParams" = {}, options: RequestOptions = {}, ) -> SubscriptionSchedule: """ Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active. """ return cast( SubscriptionSchedule, self._request( "post", "/v1/subscription_schedules/{schedule}/cancel".format( schedule=sanitize_id(schedule), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def cancel_async( self, schedule: str, params: "SubscriptionScheduleService.CancelParams" = {}, options: RequestOptions = {}, ) -> SubscriptionSchedule: """ Cancels a subscription schedule and its associated subscription immediately (if the subscription schedule has an active subscription). A subscription schedule can only be canceled if its status is not_started or active. """ return cast( SubscriptionSchedule, await self._request_async( "post", "/v1/subscription_schedules/{schedule}/cancel".format( schedule=sanitize_id(schedule), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def release( self, schedule: str, params: "SubscriptionScheduleService.ReleaseParams" = {}, options: RequestOptions = {}, ) -> SubscriptionSchedule: """ Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place. A schedule can only be released if its status is not_started or active. If the subscription schedule is currently associated with a subscription, releasing it will remove its subscription property and set the subscription's ID to the released_subscription property. """ return cast( SubscriptionSchedule, self._request( "post", "/v1/subscription_schedules/{schedule}/release".format( schedule=sanitize_id(schedule), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def release_async( self, schedule: str, params: "SubscriptionScheduleService.ReleaseParams" = {}, options: RequestOptions = {}, ) -> SubscriptionSchedule: """ Releases the subscription schedule immediately, which will stop scheduling of its phases, but leave any existing subscription in place. A schedule can only be released if its status is not_started or active. If the subscription schedule is currently associated with a subscription, releasing it will remove its subscription property and set the subscription's ID to the released_subscription property. """ return cast( SubscriptionSchedule, await self._request_async( "post", "/v1/subscription_schedules/{schedule}/release".format( schedule=sanitize_id(schedule), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_subscription_service.py0000644000175100001770000031102314637354563021007 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._discount import Discount from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._search_result_object import SearchResultObject from stripe._stripe_service import StripeService from stripe._subscription import Subscription from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class SubscriptionService(StripeService): class CancelParams(TypedDict): cancellation_details: NotRequired[ "SubscriptionService.CancelParamsCancellationDetails" ] """ Details about why this subscription was cancelled """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ invoice_now: NotRequired[bool] """ Will generate a final invoice that invoices for any un-invoiced metered usage and new/pending proration invoice items. Defaults to `true`. """ prorate: NotRequired[bool] """ Will generate a proration invoice item that credits remaining unused time until the subscription period end. Defaults to `false`. """ class CancelParamsCancellationDetails(TypedDict): comment: NotRequired["Literal['']|str"] """ Additional comments about why the user canceled the subscription, if the subscription was canceled explicitly by the user. """ feedback: NotRequired[ "Literal['']|Literal['customer_service', 'low_quality', 'missing_features', 'other', 'switched_service', 'too_complex', 'too_expensive', 'unused']" ] """ The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user. """ class CreateParams(TypedDict): add_invoice_items: NotRequired[ List["SubscriptionService.CreateParamsAddInvoiceItem"] ] """ A list of prices and quantities that will generate invoice items appended to the next invoice for this subscription. You may pass up to 20 items. """ application_fee_percent: NotRequired["Literal['']|float"] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). """ automatic_tax: NotRequired[ "SubscriptionService.CreateParamsAutomaticTax" ] """ Automatic tax settings for this subscription. We recommend you only include this parameter when the existing value is being changed. """ backdate_start_date: NotRequired[int] """ For new subscriptions, a past timestamp to backdate the subscription's start date to. If set, the first invoice will contain a proration for the timespan between the start date and the current time. Can be combined with trials and the billing cycle anchor. """ billing_cycle_anchor: NotRequired[int] """ A future timestamp in UTC format to anchor the subscription's [billing cycle](https://stripe.com/docs/subscriptions/billing-cycle). The anchor is the reference point that aligns future billing cycle dates. It sets the day of week for `week` intervals, the day of month for `month` and `year` intervals, and the month of year for `year` intervals. """ billing_cycle_anchor_config: NotRequired[ "SubscriptionService.CreateParamsBillingCycleAnchorConfig" ] """ Mutually exclusive with billing_cycle_anchor and only valid with monthly and yearly price intervals. When provided, the billing_cycle_anchor is set to the next occurence of the day_of_month at the hour, minute, and second UTC. """ billing_thresholds: NotRequired[ "Literal['']|SubscriptionService.CreateParamsBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds. """ cancel_at: NotRequired[int] """ A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. """ cancel_at_period_end: NotRequired[bool] """ Boolean indicating whether this subscription should cancel at the end of the current period. """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`. """ coupon: NotRequired[str] """ The ID of the coupon to apply to this subscription. A coupon applied to a subscription will only affect invoices created for that particular subscription. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. """ currency: NotRequired[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). """ customer: str """ The identifier of the customer to subscribe. """ days_until_due: NotRequired[int] """ Number of days a customer has to pay invoices generated by this subscription. Valid only for subscriptions where `collection_method` is set to `send_invoice`. """ default_payment_method: NotRequired[str] """ ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over `default_source`. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). """ default_source: NotRequired[str] """ ID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If `default_payment_method` is also set, `default_payment_method` will take precedence. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). """ default_tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates that will apply to any subscription item that does not have `tax_rates` set. Invoices created will have their `default_tax_rates` populated from the subscription. """ description: NotRequired[str] """ The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ discounts: NotRequired[ "Literal['']|List[SubscriptionService.CreateParamsDiscount]" ] """ The coupons to redeem into discounts for the subscription. If not specified or empty, inherits the discount from the subscription's customer. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ invoice_settings: NotRequired[ "SubscriptionService.CreateParamsInvoiceSettings" ] """ All invoices will be billed using the specified settings. """ items: NotRequired[List["SubscriptionService.CreateParamsItem"]] """ A list of up to 20 subscription items, each with an attached price. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ off_session: NotRequired[bool] """ Indicates if a customer is on or off-session while an invoice payment is attempted. """ on_behalf_of: NotRequired["Literal['']|str"] """ The account on behalf of which to charge, for each of the subscription's invoices. """ payment_behavior: NotRequired[ Literal[ "allow_incomplete", "default_incomplete", "error_if_incomplete", "pending_if_incomplete", ] ] """ Only applies to subscriptions with `collection_method=charge_automatically`. Use `allow_incomplete` to create Subscriptions with `status=incomplete` if the first invoice can't be paid. Creating Subscriptions with this status allows you to manage scenarios where additional customer actions are needed to pay a subscription's invoice. For example, SCA regulation may require 3DS authentication to complete payment. See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. This is the default behavior. Use `default_incomplete` to create Subscriptions with `status=incomplete` when the first invoice requires payment, otherwise start as active. Subscriptions transition to `status=active` when successfully confirming the PaymentIntent on the first invoice. This allows simpler management of scenarios where additional customer actions are needed to pay a subscription's invoice, such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method. If the PaymentIntent is not confirmed within 23 hours Subscriptions transition to `status=incomplete_expired`, which is a terminal state. Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's first invoice can't be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further customer action is needed, this parameter doesn't create a Subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. `pending_if_incomplete` is only used with updates and cannot be passed when creating a Subscription. Subscriptions with `collection_method=send_invoice` are automatically activated regardless of the first Invoice status. """ payment_settings: NotRequired[ "SubscriptionService.CreateParamsPaymentSettings" ] """ Payment settings to pass to invoices created by the subscription. """ pending_invoice_item_interval: NotRequired[ "Literal['']|SubscriptionService.CreateParamsPendingInvoiceItemInterval" ] """ Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval. """ promotion_code: NotRequired[str] """ The ID of a promotion code to apply to this subscription. A promotion code applied to a subscription will only affect invoices created for that particular subscription. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) resulting from the `billing_cycle_anchor`. If no value is passed, the default is `create_prorations`. """ transfer_data: NotRequired[ "SubscriptionService.CreateParamsTransferData" ] """ If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges. """ trial_end: NotRequired["Literal['now']|int"] """ Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. If set, trial_end will override the default trial period of the plan the customer is being subscribed to. The special value `now` can be provided to end the customer's trial immediately. Can be at most two years from `billing_cycle_anchor`. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. """ trial_from_plan: NotRequired[bool] """ Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. """ trial_period_days: NotRequired[int] """ Integer representing the number of trial period days before the customer is charged for the first time. This will always overwrite any trials that might apply via a subscribed plan. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. """ trial_settings: NotRequired[ "SubscriptionService.CreateParamsTrialSettings" ] """ Settings related to subscription trials. """ class CreateParamsAddInvoiceItem(TypedDict): discounts: NotRequired[ List["SubscriptionService.CreateParamsAddInvoiceItemDiscount"] ] """ The coupons to redeem into discounts for the item. """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired[ "SubscriptionService.CreateParamsAddInvoiceItemPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ Quantity for this item. Defaults to 1. """ tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. """ class CreateParamsAddInvoiceItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class CreateParamsAddInvoiceItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class CreateParamsAutomaticTax(TypedDict): enabled: bool """ Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. """ liability: NotRequired[ "SubscriptionService.CreateParamsAutomaticTaxLiability" ] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ class CreateParamsAutomaticTaxLiability(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class CreateParamsBillingCycleAnchorConfig(TypedDict): day_of_month: int """ The day of the month the billing_cycle_anchor should be. Ranges from 1 to 31. """ hour: NotRequired[int] """ The hour of the day the billing_cycle_anchor should be. Ranges from 0 to 23. """ minute: NotRequired[int] """ The minute of the hour the billing_cycle_anchor should be. Ranges from 0 to 59. """ month: NotRequired[int] """ The month to start full cycle billing periods. Ranges from 1 to 12. """ second: NotRequired[int] """ The second of the minute the billing_cycle_anchor should be. Ranges from 0 to 59. """ class CreateParamsBillingThresholds(TypedDict): amount_gte: NotRequired[int] """ Monetary threshold that triggers the subscription to advance to a new billing period """ reset_billing_cycle_anchor: NotRequired[bool] """ Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. """ class CreateParamsDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class CreateParamsInvoiceSettings(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ The account tax IDs associated with the subscription. Will be set on invoices generated by the subscription. """ issuer: NotRequired[ "SubscriptionService.CreateParamsInvoiceSettingsIssuer" ] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ class CreateParamsInvoiceSettingsIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class CreateParamsItem(TypedDict): billing_thresholds: NotRequired[ "Literal['']|SubscriptionService.CreateParamsItemBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ discounts: NotRequired[ "Literal['']|List[SubscriptionService.CreateParamsItemDiscount]" ] """ The coupons to redeem into discounts for the subscription item. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ plan: NotRequired[str] """ Plan ID for this item, as a string. """ price: NotRequired[str] """ The ID of the price object. """ price_data: NotRequired[ "SubscriptionService.CreateParamsItemPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. """ quantity: NotRequired[int] """ Quantity for this item. """ tax_rates: NotRequired["Literal['']|List[str]"] """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ class CreateParamsItemBillingThresholds(TypedDict): usage_gte: int """ Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ class CreateParamsItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class CreateParamsItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ recurring: "SubscriptionService.CreateParamsItemPriceDataRecurring" """ The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class CreateParamsItemPriceDataRecurring(TypedDict): interval: Literal["day", "month", "week", "year"] """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class CreateParamsPaymentSettings(TypedDict): payment_method_options: NotRequired[ "SubscriptionService.CreateParamsPaymentSettingsPaymentMethodOptions" ] """ Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). """ save_default_payment_method: NotRequired[ Literal["off", "on_subscription"] ] """ Either `off`, or `on_subscription`. With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. """ class CreateParamsPaymentSettingsPaymentMethodOptions(TypedDict): acss_debit: NotRequired[ "Literal['']|SubscriptionService.CreateParamsPaymentSettingsPaymentMethodOptionsAcssDebit" ] """ This sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice's PaymentIntent. """ bancontact: NotRequired[ "Literal['']|SubscriptionService.CreateParamsPaymentSettingsPaymentMethodOptionsBancontact" ] """ This sub-hash contains details about the Bancontact payment method options to pass to the invoice's PaymentIntent. """ card: NotRequired[ "Literal['']|SubscriptionService.CreateParamsPaymentSettingsPaymentMethodOptionsCard" ] """ This sub-hash contains details about the Card payment method options to pass to the invoice's PaymentIntent. """ customer_balance: NotRequired[ "Literal['']|SubscriptionService.CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalance" ] """ This sub-hash contains details about the Bank transfer payment method options to pass to the invoice's PaymentIntent. """ konbini: NotRequired[ "Literal['']|SubscriptionService.CreateParamsPaymentSettingsPaymentMethodOptionsKonbini" ] """ This sub-hash contains details about the Konbini payment method options to pass to the invoice's PaymentIntent. """ sepa_debit: NotRequired[ "Literal['']|SubscriptionService.CreateParamsPaymentSettingsPaymentMethodOptionsSepaDebit" ] """ This sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice's PaymentIntent. """ us_bank_account: NotRequired[ "Literal['']|SubscriptionService.CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccount" ] """ This sub-hash contains details about the ACH direct debit payment method options to pass to the invoice's PaymentIntent. """ class CreateParamsPaymentSettingsPaymentMethodOptionsAcssDebit(TypedDict): mandate_options: NotRequired[ "SubscriptionService.CreateParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions" ] """ Additional fields for Mandate creation """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] """ Verification method for the intent """ class CreateParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions( TypedDict, ): transaction_type: NotRequired[Literal["business", "personal"]] """ Transaction type of the mandate. """ class CreateParamsPaymentSettingsPaymentMethodOptionsBancontact(TypedDict): preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] """ Preferred language of the Bancontact authorization page that the customer is redirected to. """ class CreateParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): mandate_options: NotRequired[ "SubscriptionService.CreateParamsPaymentSettingsPaymentMethodOptionsCardMandateOptions" ] """ Configuration options for setting up an eMandate for cards issued in India. """ network: NotRequired[ Literal[ "amex", "cartes_bancaires", "diners", "discover", "eftpos_au", "interac", "jcb", "mastercard", "unionpay", "unknown", "visa", ] ] """ Selected network to process this Subscription on. Depends on the available networks of the card attached to the Subscription. Can be only set confirm-time. """ request_three_d_secure: NotRequired[ Literal["any", "automatic", "challenge"] ] """ 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://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ class CreateParamsPaymentSettingsPaymentMethodOptionsCardMandateOptions( TypedDict, ): amount: NotRequired[int] """ Amount to be charged for future payments. """ amount_type: NotRequired[Literal["fixed", "maximum"]] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ description: NotRequired[str] """ A description of the mandate or subscription that is meant to be displayed to the customer. """ class CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalance( TypedDict, ): bank_transfer: NotRequired[ "SubscriptionService.CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer" ] """ Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. """ funding_type: NotRequired[str] """ The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. """ class CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer( TypedDict, ): eu_bank_transfer: NotRequired[ "SubscriptionService.CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer" ] """ Configuration for eu_bank_transfer funding type. """ type: NotRequired[str] """ The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. """ class CreateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer( TypedDict, ): country: str """ The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. """ class CreateParamsPaymentSettingsPaymentMethodOptionsKonbini(TypedDict): pass class CreateParamsPaymentSettingsPaymentMethodOptionsSepaDebit(TypedDict): pass class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccount( TypedDict, ): financial_connections: NotRequired[ "SubscriptionService.CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections" ] """ Additional fields for Financial Connections Session creation """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] """ Verification method for the intent """ class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): filters: NotRequired[ "SubscriptionService.CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" ] """ Provide filters for the linked accounts that the customer can select for the payment method. """ permissions: NotRequired[ List[ Literal[ "balances", "ownership", "payment_method", "transactions" ] ] ] """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ List[Literal["balances", "ownership", "transactions"]] ] """ List of data features that you would like to retrieve upon account creation. """ class CreateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( TypedDict, ): account_subcategories: NotRequired[ List[Literal["checking", "savings"]] ] """ The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. """ class CreateParamsPendingInvoiceItemInterval(TypedDict): interval: Literal["day", "month", "week", "year"] """ Specifies invoicing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: NotRequired[int] """ The number of intervals between invoices. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). """ class CreateParamsTransferData(TypedDict): amount_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. """ destination: str """ ID of an existing, connected Stripe account. """ class CreateParamsTrialSettings(TypedDict): end_behavior: ( "SubscriptionService.CreateParamsTrialSettingsEndBehavior" ) """ Defines how the subscription should behave when the user's free trial ends. """ class CreateParamsTrialSettingsEndBehavior(TypedDict): missing_payment_method: Literal["cancel", "create_invoice", "pause"] """ Indicates how the subscription should change when the trial ends if the user did not provide a payment method. """ class DeleteDiscountParams(TypedDict): pass class ListParams(TypedDict): automatic_tax: NotRequired[ "SubscriptionService.ListParamsAutomaticTax" ] """ Filter subscriptions by their automatic tax settings. """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] """ The collection method of the subscriptions to retrieve. Either `charge_automatically` or `send_invoice`. """ created: NotRequired["SubscriptionService.ListParamsCreated|int"] """ Only return subscriptions that were created during the given date interval. """ current_period_end: NotRequired[ "SubscriptionService.ListParamsCurrentPeriodEnd|int" ] current_period_start: NotRequired[ "SubscriptionService.ListParamsCurrentPeriodStart|int" ] customer: NotRequired[str] """ The ID of the customer whose subscriptions will be retrieved. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ plan: NotRequired[str] """ The ID of the plan whose subscriptions will be retrieved. """ price: NotRequired[str] """ Filter for subscriptions that contain this recurring price ID. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ Literal[ "active", "all", "canceled", "ended", "incomplete", "incomplete_expired", "past_due", "paused", "trialing", "unpaid", ] ] """ The status of the subscriptions to retrieve. Passing in a value of `canceled` will return all canceled subscriptions, including those belonging to deleted customers. Pass `ended` to find subscriptions that are canceled and subscriptions that are expired due to [incomplete payment](https://stripe.com/docs/billing/subscriptions/overview#subscription-statuses). Passing in a value of `all` will return subscriptions of all statuses. If no value is supplied, all subscriptions that have not been canceled are returned. """ test_clock: NotRequired[str] """ Filter for subscriptions that are associated with the specified test clock. The response will not include subscriptions with test clocks if this and the customer parameter is not set. """ class ListParamsAutomaticTax(TypedDict): enabled: bool """ Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsCurrentPeriodEnd(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsCurrentPeriodStart(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ResumeParams(TypedDict): billing_cycle_anchor: NotRequired[Literal["now", "unchanged"]] """ Either `now` or `unchanged`. Setting the value to `now` resets the subscription's billing cycle anchor to the current time (in UTC). Setting the value to `unchanged` advances the subscription's billing cycle anchor to the period that surrounds the current time. For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ proration_date: NotRequired[int] """ If set, the proration will be calculated as though the subscription was resumed at the given time. This can be used to apply exactly the same proration that was previewed with [upcoming invoice](https://stripe.com/docs/api#retrieve_customer_invoice) endpoint. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class SearchParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ page: NotRequired[str] """ A cursor for pagination across multiple pages of results. Don't include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results. """ query: str """ The search query string. See [search query language](https://stripe.com/docs/search#search-query-language) and the list of supported [query fields for subscriptions](https://stripe.com/docs/search#query-fields-for-subscriptions). """ class UpdateParams(TypedDict): add_invoice_items: NotRequired[ List["SubscriptionService.UpdateParamsAddInvoiceItem"] ] """ A list of prices and quantities that will generate invoice items appended to the next invoice for this subscription. You may pass up to 20 items. """ application_fee_percent: NotRequired["Literal['']|float"] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. The request must be made by a platform account on a connected account in order to set an application fee percentage. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). """ automatic_tax: NotRequired[ "SubscriptionService.UpdateParamsAutomaticTax" ] """ Automatic tax settings for this subscription. We recommend you only include this parameter when the existing value is being changed. """ billing_cycle_anchor: NotRequired[Literal["now", "unchanged"]] """ Either `now` or `unchanged`. Setting the value to `now` resets the subscription's billing cycle anchor to the current time (in UTC). For more information, see the billing cycle [documentation](https://stripe.com/docs/billing/subscriptions/billing-cycle). """ billing_thresholds: NotRequired[ "Literal['']|SubscriptionService.UpdateParamsBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. Pass an empty string to remove previously-defined thresholds. """ cancel_at: NotRequired["Literal['']|int"] """ A timestamp at which the subscription should cancel. If set to a date before the current period ends, this will cause a proration if prorations have been enabled using `proration_behavior`. If set during a future period, this will always cause a proration for that period. """ cancel_at_period_end: NotRequired[bool] """ Boolean indicating whether this subscription should cancel at the end of the current period. """ cancellation_details: NotRequired[ "SubscriptionService.UpdateParamsCancellationDetails" ] """ Details about why this subscription was cancelled """ collection_method: NotRequired[ Literal["charge_automatically", "send_invoice"] ] """ Either `charge_automatically`, or `send_invoice`. When charging automatically, Stripe will attempt to pay this subscription at the end of the cycle using the default source attached to the customer. When sending an invoice, Stripe will email your customer an invoice with payment instructions and mark the subscription as `active`. Defaults to `charge_automatically`. """ coupon: NotRequired[str] """ The ID of the coupon to apply to this subscription. A coupon applied to a subscription will only affect invoices created for that particular subscription. This field has been deprecated and will be removed in a future API version. Use `discounts` instead. """ days_until_due: NotRequired[int] """ Number of days a customer has to pay invoices generated by this subscription. Valid only for subscriptions where `collection_method` is set to `send_invoice`. """ default_payment_method: NotRequired[str] """ ID of the default payment method for the subscription. It must belong to the customer associated with the subscription. This takes precedence over `default_source`. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). """ default_source: NotRequired["Literal['']|str"] """ ID of the default payment source for the subscription. It must belong to the customer associated with the subscription and be in a chargeable state. If `default_payment_method` is also set, `default_payment_method` will take precedence. If neither are set, invoices will use the customer's [invoice_settings.default_payment_method](https://stripe.com/docs/api/customers/object#customer_object-invoice_settings-default_payment_method) or [default_source](https://stripe.com/docs/api/customers/object#customer_object-default_source). """ default_tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates that will apply to any subscription item that does not have `tax_rates` set. Invoices created will have their `default_tax_rates` populated from the subscription. Pass an empty string to remove previously-defined tax rates. """ description: NotRequired["Literal['']|str"] """ The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in Stripe surfaces and certain local payment methods UIs. """ discounts: NotRequired[ "Literal['']|List[SubscriptionService.UpdateParamsDiscount]" ] """ The coupons to redeem into discounts for the subscription. If not specified or empty, inherits the discount from the subscription's customer. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ invoice_settings: NotRequired[ "SubscriptionService.UpdateParamsInvoiceSettings" ] """ All invoices will be billed using the specified settings. """ items: NotRequired[List["SubscriptionService.UpdateParamsItem"]] """ A list of up to 20 subscription items, each with an attached price. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ off_session: NotRequired[bool] """ Indicates if a customer is on or off-session while an invoice payment is attempted. """ on_behalf_of: NotRequired["Literal['']|str"] """ The account on behalf of which to charge, for each of the subscription's invoices. """ pause_collection: NotRequired[ "Literal['']|SubscriptionService.UpdateParamsPauseCollection" ] """ If specified, payment collection for this subscription will be paused. Note that the subscription status will be unchanged and will not be updated to `paused`. Learn more about [pausing collection](https://stripe.com/billing/subscriptions/pause-payment). """ payment_behavior: NotRequired[ Literal[ "allow_incomplete", "default_incomplete", "error_if_incomplete", "pending_if_incomplete", ] ] """ Use `allow_incomplete` to transition the subscription to `status=past_due` if a payment is required but cannot be paid. This allows you to manage scenarios where additional user actions are needed to pay a subscription's invoice. For example, SCA regulation may require 3DS authentication to complete payment. See the [SCA Migration Guide](https://stripe.com/docs/billing/migration/strong-customer-authentication) for Billing to learn more. This is the default behavior. Use `default_incomplete` to transition the subscription to `status=past_due` when payment is required and await explicit confirmation of the invoice's payment intent. This allows simpler management of scenarios where additional user actions are needed to pay a subscription's invoice. Such as failed payments, [SCA regulation](https://stripe.com/docs/billing/migration/strong-customer-authentication), or collecting a mandate for a bank debit payment method. Use `pending_if_incomplete` to update the subscription using [pending updates](https://stripe.com/docs/billing/subscriptions/pending-updates). When you use `pending_if_incomplete` you can only pass the parameters [supported by pending updates](https://stripe.com/docs/billing/pending-updates-reference#supported-attributes). Use `error_if_incomplete` if you want Stripe to return an HTTP 402 status code if a subscription's invoice cannot be paid. For example, if a payment method requires 3DS authentication due to SCA regulation and further user action is needed, this parameter does not update the subscription and returns an error instead. This was the default behavior for API versions prior to 2019-03-14. See the [changelog](https://stripe.com/docs/upgrades#2019-03-14) to learn more. """ payment_settings: NotRequired[ "SubscriptionService.UpdateParamsPaymentSettings" ] """ Payment settings to pass to invoices created by the subscription. """ pending_invoice_item_interval: NotRequired[ "Literal['']|SubscriptionService.UpdateParamsPendingInvoiceItemInterval" ] """ Specifies an interval for how often to bill for any pending invoice items. It is analogous to calling [Create an invoice](https://stripe.com/docs/api#create_invoice) for the given subscription at the specified interval. """ promotion_code: NotRequired[str] """ The promotion code to apply to this subscription. A promotion code applied to a subscription will only affect invoices created for that particular subscription. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle [prorations](https://stripe.com/docs/billing/subscriptions/prorations) when the billing cycle changes (e.g., when switching plans, resetting `billing_cycle_anchor=now`, or starting a trial), or if an item's `quantity` changes. The default value is `create_prorations`. """ proration_date: NotRequired[int] """ If set, the proration will be calculated as though the subscription was updated at the given time. This can be used to apply exactly the same proration that was previewed with [upcoming invoice](https://stripe.com/docs/api#upcoming_invoice) endpoint. It can also be used to implement custom proration logic, such as prorating by day instead of by second, by providing the time that you wish to use for proration calculations. """ transfer_data: NotRequired[ "Literal['']|SubscriptionService.UpdateParamsTransferData" ] """ If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges. This will be unset if you POST an empty value. """ trial_end: NotRequired["Literal['now']|int"] """ Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. This will always overwrite any trials that might apply via a subscribed plan. If set, trial_end will override the default trial period of the plan the customer is being subscribed to. The special value `now` can be provided to end the customer's trial immediately. Can be at most two years from `billing_cycle_anchor`. """ trial_from_plan: NotRequired[bool] """ Indicates if a plan's `trial_period_days` should be applied to the subscription. Setting `trial_end` per subscription is preferred, and this defaults to `false`. Setting this flag to `true` together with `trial_end` is not allowed. See [Using trial periods on subscriptions](https://stripe.com/docs/billing/subscriptions/trials) to learn more. """ trial_settings: NotRequired[ "SubscriptionService.UpdateParamsTrialSettings" ] """ Settings related to subscription trials. """ class UpdateParamsAddInvoiceItem(TypedDict): discounts: NotRequired[ List["SubscriptionService.UpdateParamsAddInvoiceItemDiscount"] ] """ The coupons to redeem into discounts for the item. """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. """ price_data: NotRequired[ "SubscriptionService.UpdateParamsAddInvoiceItemPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ Quantity for this item. Defaults to 1. """ tax_rates: NotRequired["Literal['']|List[str]"] """ The tax rates which apply to the item. When set, the `default_tax_rates` do not apply to this item. """ class UpdateParamsAddInvoiceItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class UpdateParamsAddInvoiceItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class UpdateParamsAutomaticTax(TypedDict): enabled: bool """ Enabled automatic tax calculation which will automatically compute tax rates on all invoices generated by the subscription. """ liability: NotRequired[ "SubscriptionService.UpdateParamsAutomaticTaxLiability" ] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ class UpdateParamsAutomaticTaxLiability(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class UpdateParamsBillingThresholds(TypedDict): amount_gte: NotRequired[int] """ Monetary threshold that triggers the subscription to advance to a new billing period """ reset_billing_cycle_anchor: NotRequired[bool] """ Indicates if the `billing_cycle_anchor` should be reset when a threshold is reached. If true, `billing_cycle_anchor` will be updated to the date/time the threshold was last reached; otherwise, the value will remain unchanged. """ class UpdateParamsCancellationDetails(TypedDict): comment: NotRequired["Literal['']|str"] """ Additional comments about why the user canceled the subscription, if the subscription was canceled explicitly by the user. """ feedback: NotRequired[ "Literal['']|Literal['customer_service', 'low_quality', 'missing_features', 'other', 'switched_service', 'too_complex', 'too_expensive', 'unused']" ] """ The customer submitted reason for why they canceled, if the subscription was canceled explicitly by the user. """ class UpdateParamsDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class UpdateParamsInvoiceSettings(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ The account tax IDs associated with the subscription. Will be set on invoices generated by the subscription. """ issuer: NotRequired[ "SubscriptionService.UpdateParamsInvoiceSettingsIssuer" ] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ class UpdateParamsInvoiceSettingsIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class UpdateParamsItem(TypedDict): billing_thresholds: NotRequired[ "Literal['']|SubscriptionService.UpdateParamsItemBillingThresholds" ] """ Define thresholds at which an invoice will be sent, and the subscription advanced to a new billing period. When updating, pass an empty string to remove previously-defined thresholds. """ clear_usage: NotRequired[bool] """ Delete all usage for a given subscription item. Allowed only when `deleted` is set to `true` and the current plan's `usage_type` is `metered`. """ deleted: NotRequired[bool] """ A flag that, if set to `true`, will delete the specified item. """ discounts: NotRequired[ "Literal['']|List[SubscriptionService.UpdateParamsItemDiscount]" ] """ The coupons to redeem into discounts for the subscription item. """ id: NotRequired[str] """ Subscription item to update. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ plan: NotRequired[str] """ Plan ID for this item, as a string. """ price: NotRequired[str] """ The ID of the price object. One of `price` or `price_data` is required. When changing a subscription item's price, `quantity` is set to 1 unless a `quantity` parameter is provided. """ price_data: NotRequired[ "SubscriptionService.UpdateParamsItemPriceData" ] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ Quantity for this item. """ tax_rates: NotRequired["Literal['']|List[str]"] """ A list of [Tax Rate](https://stripe.com/docs/api/tax_rates) ids. These Tax Rates will override the [`default_tax_rates`](https://stripe.com/docs/api/subscriptions/create#create_subscription-default_tax_rates) on the Subscription. When updating, pass an empty string to remove previously-defined tax rates. """ class UpdateParamsItemBillingThresholds(TypedDict): usage_gte: int """ Number of units that meets the billing threshold to advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 [monetary threshold](https://stripe.com/docs/api/subscriptions/update#update_subscription-billing_thresholds-amount_gte)) """ class UpdateParamsItemDiscount(TypedDict): coupon: NotRequired[str] """ ID of the coupon to create a new discount for. """ discount: NotRequired[str] """ ID of an existing discount on the object (or one of its ancestors) to reuse. """ promotion_code: NotRequired[str] """ ID of the promotion code to create a new discount for. """ class UpdateParamsItemPriceData(TypedDict): 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). """ product: str """ The ID of the product that this price will belong to. """ recurring: "SubscriptionService.UpdateParamsItemPriceDataRecurring" """ The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A positive integer in cents (or local equivalent) (or 0 for a free price) representing how much to charge. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class UpdateParamsItemPriceDataRecurring(TypedDict): interval: Literal["day", "month", "week", "year"] """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class UpdateParamsPauseCollection(TypedDict): behavior: Literal["keep_as_draft", "mark_uncollectible", "void"] """ The payment collection behavior for this subscription while paused. One of `keep_as_draft`, `mark_uncollectible`, or `void`. """ resumes_at: NotRequired[int] """ The time after which the subscription will resume collecting payments. """ class UpdateParamsPaymentSettings(TypedDict): payment_method_options: NotRequired[ "SubscriptionService.UpdateParamsPaymentSettingsPaymentMethodOptions" ] """ Payment-method-specific configuration to provide to invoices created by the subscription. """ payment_method_types: NotRequired[ "Literal['']|List[Literal['ach_credit_transfer', 'ach_debit', 'acss_debit', 'amazon_pay', 'au_becs_debit', 'bacs_debit', 'bancontact', 'boleto', 'card', 'cashapp', 'customer_balance', 'eps', 'fpx', 'giropay', 'grabpay', 'ideal', 'konbini', 'link', 'p24', 'paynow', 'paypal', 'promptpay', 'revolut_pay', 'sepa_credit_transfer', 'sepa_debit', 'sofort', 'swish', 'us_bank_account', 'wechat_pay']]" ] """ The list of payment method types (e.g. card) to provide to the invoice's PaymentIntent. If not set, Stripe attempts to automatically determine the types to use by looking at the invoice's default payment method, the subscription's default payment method, the customer's default payment method, and your [invoice template settings](https://dashboard.stripe.com/settings/billing/invoice). """ save_default_payment_method: NotRequired[ Literal["off", "on_subscription"] ] """ Either `off`, or `on_subscription`. With `on_subscription` Stripe updates `subscription.default_payment_method` when a subscription payment succeeds. """ class UpdateParamsPaymentSettingsPaymentMethodOptions(TypedDict): acss_debit: NotRequired[ "Literal['']|SubscriptionService.UpdateParamsPaymentSettingsPaymentMethodOptionsAcssDebit" ] """ This sub-hash contains details about the Canadian pre-authorized debit payment method options to pass to the invoice's PaymentIntent. """ bancontact: NotRequired[ "Literal['']|SubscriptionService.UpdateParamsPaymentSettingsPaymentMethodOptionsBancontact" ] """ This sub-hash contains details about the Bancontact payment method options to pass to the invoice's PaymentIntent. """ card: NotRequired[ "Literal['']|SubscriptionService.UpdateParamsPaymentSettingsPaymentMethodOptionsCard" ] """ This sub-hash contains details about the Card payment method options to pass to the invoice's PaymentIntent. """ customer_balance: NotRequired[ "Literal['']|SubscriptionService.UpdateParamsPaymentSettingsPaymentMethodOptionsCustomerBalance" ] """ This sub-hash contains details about the Bank transfer payment method options to pass to the invoice's PaymentIntent. """ konbini: NotRequired[ "Literal['']|SubscriptionService.UpdateParamsPaymentSettingsPaymentMethodOptionsKonbini" ] """ This sub-hash contains details about the Konbini payment method options to pass to the invoice's PaymentIntent. """ sepa_debit: NotRequired[ "Literal['']|SubscriptionService.UpdateParamsPaymentSettingsPaymentMethodOptionsSepaDebit" ] """ This sub-hash contains details about the SEPA Direct Debit payment method options to pass to the invoice's PaymentIntent. """ us_bank_account: NotRequired[ "Literal['']|SubscriptionService.UpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccount" ] """ This sub-hash contains details about the ACH direct debit payment method options to pass to the invoice's PaymentIntent. """ class UpdateParamsPaymentSettingsPaymentMethodOptionsAcssDebit(TypedDict): mandate_options: NotRequired[ "SubscriptionService.UpdateParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions" ] """ Additional fields for Mandate creation """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] """ Verification method for the intent """ class UpdateParamsPaymentSettingsPaymentMethodOptionsAcssDebitMandateOptions( TypedDict, ): transaction_type: NotRequired[Literal["business", "personal"]] """ Transaction type of the mandate. """ class UpdateParamsPaymentSettingsPaymentMethodOptionsBancontact(TypedDict): preferred_language: NotRequired[Literal["de", "en", "fr", "nl"]] """ Preferred language of the Bancontact authorization page that the customer is redirected to. """ class UpdateParamsPaymentSettingsPaymentMethodOptionsCard(TypedDict): mandate_options: NotRequired[ "SubscriptionService.UpdateParamsPaymentSettingsPaymentMethodOptionsCardMandateOptions" ] """ Configuration options for setting up an eMandate for cards issued in India. """ network: NotRequired[ Literal[ "amex", "cartes_bancaires", "diners", "discover", "eftpos_au", "interac", "jcb", "mastercard", "unionpay", "unknown", "visa", ] ] """ Selected network to process this Subscription on. Depends on the available networks of the card attached to the Subscription. Can be only set confirm-time. """ request_three_d_secure: NotRequired[ Literal["any", "automatic", "challenge"] ] """ 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://stripe.com/docs/strong-customer-authentication). However, if you wish to request 3D Secure based on logic from your own fraud engine, provide this option. Read our guide on [manually requesting 3D Secure](https://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ class UpdateParamsPaymentSettingsPaymentMethodOptionsCardMandateOptions( TypedDict, ): amount: NotRequired[int] """ Amount to be charged for future payments. """ amount_type: NotRequired[Literal["fixed", "maximum"]] """ One of `fixed` or `maximum`. If `fixed`, the `amount` param refers to the exact amount to be charged in future payments. If `maximum`, the amount charged can be up to the value passed for the `amount` param. """ description: NotRequired[str] """ A description of the mandate or subscription that is meant to be displayed to the customer. """ class UpdateParamsPaymentSettingsPaymentMethodOptionsCustomerBalance( TypedDict, ): bank_transfer: NotRequired[ "SubscriptionService.UpdateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer" ] """ Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. """ funding_type: NotRequired[str] """ The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. """ class UpdateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransfer( TypedDict, ): eu_bank_transfer: NotRequired[ "SubscriptionService.UpdateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer" ] """ Configuration for eu_bank_transfer funding type. """ type: NotRequired[str] """ The bank transfer type that can be used for funding. Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. """ class UpdateParamsPaymentSettingsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer( TypedDict, ): country: str """ The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. """ class UpdateParamsPaymentSettingsPaymentMethodOptionsKonbini(TypedDict): pass class UpdateParamsPaymentSettingsPaymentMethodOptionsSepaDebit(TypedDict): pass class UpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccount( TypedDict, ): financial_connections: NotRequired[ "SubscriptionService.UpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections" ] """ Additional fields for Financial Connections Session creation """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] """ Verification method for the intent """ class UpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): filters: NotRequired[ "SubscriptionService.UpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters" ] """ Provide filters for the linked accounts that the customer can select for the payment method. """ permissions: NotRequired[ List[ Literal[ "balances", "ownership", "payment_method", "transactions" ] ] ] """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ List[Literal["balances", "ownership", "transactions"]] ] """ List of data features that you would like to retrieve upon account creation. """ class UpdateParamsPaymentSettingsPaymentMethodOptionsUsBankAccountFinancialConnectionsFilters( TypedDict, ): account_subcategories: NotRequired[ List[Literal["checking", "savings"]] ] """ The account subcategories to use to filter for selectable accounts. Valid subcategories are `checking` and `savings`. """ class UpdateParamsPendingInvoiceItemInterval(TypedDict): interval: Literal["day", "month", "week", "year"] """ Specifies invoicing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: NotRequired[int] """ The number of intervals between invoices. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of one year interval allowed (1 year, 12 months, or 52 weeks). """ class UpdateParamsTransferData(TypedDict): amount_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. """ destination: str """ ID of an existing, connected Stripe account. """ class UpdateParamsTrialSettings(TypedDict): end_behavior: ( "SubscriptionService.UpdateParamsTrialSettingsEndBehavior" ) """ Defines how the subscription should behave when the user's free trial ends. """ class UpdateParamsTrialSettingsEndBehavior(TypedDict): missing_payment_method: Literal["cancel", "create_invoice", "pause"] """ Indicates how the subscription should change when the trial ends if the user did not provide a payment method. """ def cancel( self, subscription_exposed_id: str, params: "SubscriptionService.CancelParams" = {}, options: RequestOptions = {}, ) -> Subscription: """ Cancels a customer's subscription immediately. The customer will not be charged again for the subscription. Note, however, that any pending invoice items that you've created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed. By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all. """ return cast( Subscription, self._request( "delete", "/v1/subscriptions/{subscription_exposed_id}".format( subscription_exposed_id=sanitize_id( subscription_exposed_id ), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def cancel_async( self, subscription_exposed_id: str, params: "SubscriptionService.CancelParams" = {}, options: RequestOptions = {}, ) -> Subscription: """ Cancels a customer's subscription immediately. The customer will not be charged again for the subscription. Note, however, that any pending invoice items that you've created will still be charged for at the end of the period, unless manually [deleted](https://stripe.com/docs/api#delete_invoiceitem). If you've set the subscription to cancel at the end of the period, any pending prorations will also be left in place and collected at the end of the period. But if the subscription is set to cancel immediately, pending prorations will be removed. By default, upon subscription cancellation, Stripe will stop automatic collection of all finalized invoices for the customer. This is intended to prevent unexpected payment attempts after the customer has canceled a subscription. However, you can resume automatic collection of the invoices manually after subscription cancellation to have us proceed. Or, you could check for unpaid invoices before allowing the customer to cancel the subscription at all. """ return cast( Subscription, await self._request_async( "delete", "/v1/subscriptions/{subscription_exposed_id}".format( subscription_exposed_id=sanitize_id( subscription_exposed_id ), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, subscription_exposed_id: str, params: "SubscriptionService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Subscription: """ Retrieves the subscription with the given ID. """ return cast( Subscription, self._request( "get", "/v1/subscriptions/{subscription_exposed_id}".format( subscription_exposed_id=sanitize_id( subscription_exposed_id ), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, subscription_exposed_id: str, params: "SubscriptionService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Subscription: """ Retrieves the subscription with the given ID. """ return cast( Subscription, await self._request_async( "get", "/v1/subscriptions/{subscription_exposed_id}".format( subscription_exposed_id=sanitize_id( subscription_exposed_id ), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, subscription_exposed_id: str, params: "SubscriptionService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Subscription: """ Updates an existing subscription to match the specified parameters. When changing prices or quantities, we optionally prorate the price we charge next month to make up for any price changes. To preview how the proration is calculated, use the [upcoming invoice](https://stripe.com/docs/api/invoices/upcoming) endpoint. By default, we prorate subscription changes. For example, if a customer signs up on May 1 for a 100 price, they'll be billed 100 immediately. If on May 15 they switch to a 200 price, then on June 1 they'll be billed 250 (200 for a renewal of her subscription, plus a 50 prorating adjustment for half of the previous month's 100 difference). Similarly, a downgrade generates a credit that is applied to the next invoice. We also prorate when you make quantity changes. Switching prices does not normally change the billing date or generate an immediate charge unless: The billing interval is changed (for example, from monthly to yearly). The subscription moves from free to paid, or paid to free. A trial starts or ends. In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date. If you want to charge for an upgrade immediately, pass proration_behavior as always_invoice to create prorations, automatically invoice the customer for those proration adjustments, and attempt to collect payment. If you pass create_prorations, the prorations are created but not automatically invoiced. If you want to bill the customer for the prorations before the subscription's renewal date, you need to manually [invoice the customer](https://stripe.com/docs/api/invoices/create). If you don't want to prorate, set the proration_behavior option to none. With this option, the customer is billed 100 on May 1 and 200 on June 1. Similarly, if you set proration_behavior to none when switching between different billing intervals (for example, from monthly to yearly), we don't generate any credits for the old subscription's unused time. We still reset the billing date and bill immediately for the new subscription. Updating the quantity on a subscription many times in an hour may result in [rate limiting. If you need to bill for a frequently changing quantity, consider integrating usage-based billing](https://stripe.com/docs/rate-limits) instead. """ return cast( Subscription, self._request( "post", "/v1/subscriptions/{subscription_exposed_id}".format( subscription_exposed_id=sanitize_id( subscription_exposed_id ), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, subscription_exposed_id: str, params: "SubscriptionService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Subscription: """ Updates an existing subscription to match the specified parameters. When changing prices or quantities, we optionally prorate the price we charge next month to make up for any price changes. To preview how the proration is calculated, use the [upcoming invoice](https://stripe.com/docs/api/invoices/upcoming) endpoint. By default, we prorate subscription changes. For example, if a customer signs up on May 1 for a 100 price, they'll be billed 100 immediately. If on May 15 they switch to a 200 price, then on June 1 they'll be billed 250 (200 for a renewal of her subscription, plus a 50 prorating adjustment for half of the previous month's 100 difference). Similarly, a downgrade generates a credit that is applied to the next invoice. We also prorate when you make quantity changes. Switching prices does not normally change the billing date or generate an immediate charge unless: The billing interval is changed (for example, from monthly to yearly). The subscription moves from free to paid, or paid to free. A trial starts or ends. In these cases, we apply a credit for the unused time on the previous price, immediately charge the customer using the new price, and reset the billing date. If you want to charge for an upgrade immediately, pass proration_behavior as always_invoice to create prorations, automatically invoice the customer for those proration adjustments, and attempt to collect payment. If you pass create_prorations, the prorations are created but not automatically invoiced. If you want to bill the customer for the prorations before the subscription's renewal date, you need to manually [invoice the customer](https://stripe.com/docs/api/invoices/create). If you don't want to prorate, set the proration_behavior option to none. With this option, the customer is billed 100 on May 1 and 200 on June 1. Similarly, if you set proration_behavior to none when switching between different billing intervals (for example, from monthly to yearly), we don't generate any credits for the old subscription's unused time. We still reset the billing date and bill immediately for the new subscription. Updating the quantity on a subscription many times in an hour may result in [rate limiting. If you need to bill for a frequently changing quantity, consider integrating usage-based billing](https://stripe.com/docs/rate-limits) instead. """ return cast( Subscription, await self._request_async( "post", "/v1/subscriptions/{subscription_exposed_id}".format( subscription_exposed_id=sanitize_id( subscription_exposed_id ), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def delete_discount( self, subscription_exposed_id: str, params: "SubscriptionService.DeleteDiscountParams" = {}, options: RequestOptions = {}, ) -> Discount: """ Removes the currently applied discount on a subscription. """ return cast( Discount, self._request( "delete", "/v1/subscriptions/{subscription_exposed_id}/discount".format( subscription_exposed_id=sanitize_id( subscription_exposed_id ), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def delete_discount_async( self, subscription_exposed_id: str, params: "SubscriptionService.DeleteDiscountParams" = {}, options: RequestOptions = {}, ) -> Discount: """ Removes the currently applied discount on a subscription. """ return cast( Discount, await self._request_async( "delete", "/v1/subscriptions/{subscription_exposed_id}/discount".format( subscription_exposed_id=sanitize_id( subscription_exposed_id ), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def list( self, params: "SubscriptionService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Subscription]: """ By default, returns a list of subscriptions that have not been canceled. In order to list canceled subscriptions, specify status=canceled. """ return cast( ListObject[Subscription], self._request( "get", "/v1/subscriptions", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "SubscriptionService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Subscription]: """ By default, returns a list of subscriptions that have not been canceled. In order to list canceled subscriptions, specify status=canceled. """ return cast( ListObject[Subscription], await self._request_async( "get", "/v1/subscriptions", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "SubscriptionService.CreateParams", options: RequestOptions = {}, ) -> Subscription: """ Creates a new subscription on an existing customer. Each customer can have up to 500 active or scheduled subscriptions. When you create a subscription with collection_method=charge_automatically, the first invoice is finalized as part of the request. The payment_behavior parameter determines the exact behavior of the initial payment. To start subscriptions where the first invoice always begins in a draft status, use [subscription schedules](https://stripe.com/docs/billing/subscriptions/subscription-schedules#managing) instead. Schedules provide the flexibility to model more complex billing configurations that change over time. """ return cast( Subscription, self._request( "post", "/v1/subscriptions", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "SubscriptionService.CreateParams", options: RequestOptions = {}, ) -> Subscription: """ Creates a new subscription on an existing customer. Each customer can have up to 500 active or scheduled subscriptions. When you create a subscription with collection_method=charge_automatically, the first invoice is finalized as part of the request. The payment_behavior parameter determines the exact behavior of the initial payment. To start subscriptions where the first invoice always begins in a draft status, use [subscription schedules](https://stripe.com/docs/billing/subscriptions/subscription-schedules#managing) instead. Schedules provide the flexibility to model more complex billing configurations that change over time. """ return cast( Subscription, await self._request_async( "post", "/v1/subscriptions", api_mode="V1", base_address="api", params=params, options=options, ), ) def search( self, params: "SubscriptionService.SearchParams", options: RequestOptions = {}, ) -> SearchResultObject[Subscription]: """ Search for subscriptions you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India. """ return cast( SearchResultObject[Subscription], self._request( "get", "/v1/subscriptions/search", api_mode="V1", base_address="api", params=params, options=options, ), ) async def search_async( self, params: "SubscriptionService.SearchParams", options: RequestOptions = {}, ) -> SearchResultObject[Subscription]: """ Search for subscriptions you've previously created using Stripe's [Search Query Language](https://stripe.com/docs/search#search-query-language). Don't use search in read-after-write flows where strict consistency is necessary. Under normal operating conditions, data is searchable in less than a minute. Occasionally, propagation of new or updated data can be up to an hour behind during outages. Search functionality is not available to merchants in India. """ return cast( SearchResultObject[Subscription], await self._request_async( "get", "/v1/subscriptions/search", api_mode="V1", base_address="api", params=params, options=options, ), ) def resume( self, subscription: str, params: "SubscriptionService.ResumeParams" = {}, options: RequestOptions = {}, ) -> Subscription: """ Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. If a resumption invoice is generated, it must be paid or marked uncollectible before the subscription will be unpaused. If payment succeeds the subscription will become active, and if payment fails the subscription will be past_due. The resumption invoice will void automatically if not paid by the expiration date. """ return cast( Subscription, self._request( "post", "/v1/subscriptions/{subscription}/resume".format( subscription=sanitize_id(subscription), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def resume_async( self, subscription: str, params: "SubscriptionService.ResumeParams" = {}, options: RequestOptions = {}, ) -> Subscription: """ Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor and creating prorations. If a resumption invoice is generated, it must be paid or marked uncollectible before the subscription will be unpaused. If payment succeeds the subscription will become active, and if payment fails the subscription will be past_due. The resumption invoice will void automatically if not paid by the expiration date. """ return cast( Subscription, await self._request_async( "post", "/v1/subscriptions/{subscription}/resume".format( subscription=sanitize_id(subscription), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_tax_code.py0000644000175100001770000001022214637354563016326 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from typing import ClassVar, List from typing_extensions import Literal, NotRequired, Unpack class TaxCode(ListableAPIResource["TaxCode"]): """ [Tax codes](https://stripe.com/docs/tax/tax-categories) classify goods and services for tax purposes. """ OBJECT_NAME: ClassVar[Literal["tax_code"]] = "tax_code" class ListParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ description: str """ A detailed description of which types of products the tax code represents. """ id: str """ Unique identifier for the object. """ name: str """ A short name for the tax code. """ object: Literal["tax_code"] """ String representing the object's type. Objects of the same type share the same value. """ @classmethod def list( cls, **params: Unpack["TaxCode.ListParams"] ) -> ListObject["TaxCode"]: """ A list of [all tax codes available](https://stripe.com/docs/tax/tax-categories) to add to Products in order to allow specific tax calculations. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["TaxCode.ListParams"] ) -> ListObject["TaxCode"]: """ A list of [all tax codes available](https://stripe.com/docs/tax/tax-categories) to add to Products in order to allow specific tax calculations. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def retrieve( cls, id: str, **params: Unpack["TaxCode.RetrieveParams"] ) -> "TaxCode": """ Retrieves the details of an existing tax code. Supply the unique tax code ID and Stripe will return the corresponding tax code information. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["TaxCode.RetrieveParams"] ) -> "TaxCode": """ Retrieves the details of an existing tax code. Supply the unique tax code ID and Stripe will return the corresponding tax code information. """ instance = cls(id, **params) await instance.refresh_async() return instance ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_tax_code_service.py0000644000175100001770000001016314637354563020052 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._tax_code import TaxCode from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict class TaxCodeService(StripeService): class ListParams(TypedDict): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def list( self, params: "TaxCodeService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[TaxCode]: """ A list of [all tax codes available](https://stripe.com/docs/tax/tax-categories) to add to Products in order to allow specific tax calculations. """ return cast( ListObject[TaxCode], self._request( "get", "/v1/tax_codes", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "TaxCodeService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[TaxCode]: """ A list of [all tax codes available](https://stripe.com/docs/tax/tax-categories) to add to Products in order to allow specific tax calculations. """ return cast( ListObject[TaxCode], await self._request_async( "get", "/v1/tax_codes", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, id: str, params: "TaxCodeService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> TaxCode: """ Retrieves the details of an existing tax code. Supply the unique tax code ID and Stripe will return the corresponding tax code information. """ return cast( TaxCode, self._request( "get", "/v1/tax_codes/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, id: str, params: "TaxCodeService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> TaxCode: """ Retrieves the details of an existing tax code. Supply the unique tax code ID and Stripe will return the corresponding tax code information. """ return cast( TaxCode, await self._request_async( "get", "/v1/tax_codes/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_tax_deducted_at_source.py0000644000175100001770000000166714637354563021256 0ustar00runnerdocker# -*- 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 TaxDeductedAtSource(StripeObject): OBJECT_NAME: ClassVar[Literal["tax_deducted_at_source"]] = ( "tax_deducted_at_source" ) id: str """ Unique identifier for the object. """ object: Literal["tax_deducted_at_source"] """ String representing the object's type. Objects of the same type share the same value. """ period_end: int """ The end of the invoicing period. This TDS applies to Stripe fees collected during this invoicing period. """ period_start: int """ The start of the invoicing period. This TDS applies to Stripe fees collected during this invoicing period. """ tax_deduction_account_number: str """ The TAN that was supplied to Stripe when TDS was assessed """ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_tax_id.py0000644000175100001770000003673314637354563016027 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._deletable_api_resource import DeletableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, List, Optional, cast, overload from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._account import Account from stripe._application import Application from stripe._customer import Customer class TaxId( CreateableAPIResource["TaxId"], DeletableAPIResource["TaxId"], ListableAPIResource["TaxId"], ): """ You can add one or multiple tax IDs to a [customer](https://stripe.com/docs/api/customers) or account. Customer and account tax IDs get displayed on related invoices and credit notes. Related guides: [Customer tax identification numbers](https://stripe.com/docs/billing/taxes/tax-ids), [Account tax IDs](https://stripe.com/docs/invoicing/connect#account-tax-ids) """ OBJECT_NAME: ClassVar[Literal["tax_id"]] = "tax_id" class Owner(StripeObject): account: Optional[ExpandableField["Account"]] """ The account being referenced when `type` is `account`. """ application: Optional[ExpandableField["Application"]] """ The Connect Application being referenced when `type` is `application`. """ customer: Optional[ExpandableField["Customer"]] """ The customer being referenced when `type` is `customer`. """ type: Literal["account", "application", "customer", "self"] """ Type of owner referenced. """ class Verification(StripeObject): status: Literal["pending", "unavailable", "unverified", "verified"] """ Verification status, one of `pending`, `verified`, `unverified`, or `unavailable`. """ verified_address: Optional[str] """ Verified address. """ verified_name: Optional[str] """ Verified name. """ class CreateParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ owner: NotRequired["TaxId.CreateParamsOwner"] """ The account or customer the tax ID belongs to. Defaults to `owner[type]=self`. """ type: Literal[ "ad_nrt", "ae_trn", "ar_cuit", "au_abn", "au_arn", "bg_uic", "bh_vat", "bo_tin", "br_cnpj", "br_cpf", "ca_bn", "ca_gst_hst", "ca_pst_bc", "ca_pst_mb", "ca_pst_sk", "ca_qst", "ch_uid", "ch_vat", "cl_tin", "cn_tin", "co_nit", "cr_tin", "de_stn", "do_rcn", "ec_ruc", "eg_tin", "es_cif", "eu_oss_vat", "eu_vat", "gb_vat", "ge_vat", "hk_br", "hu_tin", "id_npwp", "il_vat", "in_gst", "is_vat", "jp_cn", "jp_rn", "jp_trn", "ke_pin", "kr_brn", "kz_bin", "li_uid", "mx_rfc", "my_frp", "my_itn", "my_sst", "ng_tin", "no_vat", "no_voec", "nz_gst", "om_vat", "pe_ruc", "ph_tin", "ro_tin", "rs_pib", "ru_inn", "ru_kpp", "sa_vat", "sg_gst", "sg_uen", "si_tin", "sv_nit", "th_vat", "tr_tin", "tw_vat", "ua_vat", "us_ein", "uy_ruc", "ve_rif", "vn_tin", "za_vat", ] """ Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ Value of the tax ID. """ class CreateParamsOwner(TypedDict): account: NotRequired[str] """ Account the tax ID belongs to. Required when `type=account` """ customer: NotRequired[str] """ Customer the tax ID belongs to. Required when `type=customer` """ type: Literal["account", "application", "customer", "self"] """ Type of owner referenced. """ class DeleteParams(RequestOptions): pass class ListParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ owner: NotRequired["TaxId.ListParamsOwner"] """ The account or customer the tax ID belongs to. Defaults to `owner[type]=self`. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsOwner(TypedDict): account: NotRequired[str] """ Account the tax ID belongs to. Required when `type=account` """ customer: NotRequired[str] """ Customer the tax ID belongs to. Required when `type=customer` """ type: Literal["account", "application", "customer", "self"] """ Type of owner referenced. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ country: Optional[str] """ Two-letter ISO code representing the country of the tax ID. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ customer: Optional[ExpandableField["Customer"]] """ ID of the customer. """ id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ object: Literal["tax_id"] """ String representing the object's type. Objects of the same type share the same value. """ owner: Optional[Owner] """ The account or customer the tax ID belongs to. """ type: Literal[ "ad_nrt", "ae_trn", "ar_cuit", "au_abn", "au_arn", "bg_uic", "bh_vat", "bo_tin", "br_cnpj", "br_cpf", "ca_bn", "ca_gst_hst", "ca_pst_bc", "ca_pst_mb", "ca_pst_sk", "ca_qst", "ch_uid", "ch_vat", "cl_tin", "cn_tin", "co_nit", "cr_tin", "de_stn", "do_rcn", "ec_ruc", "eg_tin", "es_cif", "eu_oss_vat", "eu_vat", "gb_vat", "ge_vat", "hk_br", "hu_tin", "id_npwp", "il_vat", "in_gst", "is_vat", "jp_cn", "jp_rn", "jp_trn", "ke_pin", "kr_brn", "kz_bin", "li_uid", "mx_rfc", "my_frp", "my_itn", "my_sst", "ng_tin", "no_vat", "no_voec", "nz_gst", "om_vat", "pe_ruc", "ph_tin", "ro_tin", "rs_pib", "ru_inn", "ru_kpp", "sa_vat", "sg_gst", "sg_uen", "si_tin", "sv_nit", "th_vat", "tr_tin", "tw_vat", "ua_vat", "unknown", "us_ein", "uy_ruc", "ve_rif", "vn_tin", "za_vat", ] """ Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat`. Note that some legacy tax IDs have type `unknown` """ value: str """ Value of the tax ID. """ verification: Optional[Verification] """ Tax ID verification information. """ deleted: Optional[Literal[True]] """ Always true for a deleted object """ @classmethod def create(cls, **params: Unpack["TaxId.CreateParams"]) -> "TaxId": """ Creates a new account or customer tax_id object. """ return cast( "TaxId", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["TaxId.CreateParams"] ) -> "TaxId": """ Creates a new account or customer tax_id object. """ return cast( "TaxId", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def _cls_delete( cls, sid: str, **params: Unpack["TaxId.DeleteParams"] ) -> "TaxId": """ Deletes an existing account or customer tax_id object. """ url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "TaxId", cls._static_request( "delete", url, params=params, ), ) @overload @staticmethod def delete(sid: str, **params: Unpack["TaxId.DeleteParams"]) -> "TaxId": """ Deletes an existing account or customer tax_id object. """ ... @overload def delete(self, **params: Unpack["TaxId.DeleteParams"]) -> "TaxId": """ Deletes an existing account or customer tax_id object. """ ... @class_method_variant("_cls_delete") def delete( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["TaxId.DeleteParams"] ) -> "TaxId": """ Deletes an existing account or customer tax_id object. """ return self._request_and_refresh( "delete", self.instance_url(), params=params, ) @classmethod async def _cls_delete_async( cls, sid: str, **params: Unpack["TaxId.DeleteParams"] ) -> "TaxId": """ Deletes an existing account or customer tax_id object. """ url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "TaxId", await cls._static_request_async( "delete", url, params=params, ), ) @overload @staticmethod async def delete_async( sid: str, **params: Unpack["TaxId.DeleteParams"] ) -> "TaxId": """ Deletes an existing account or customer tax_id object. """ ... @overload async def delete_async( self, **params: Unpack["TaxId.DeleteParams"] ) -> "TaxId": """ Deletes an existing account or customer tax_id object. """ ... @class_method_variant("_cls_delete_async") async def delete_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["TaxId.DeleteParams"] ) -> "TaxId": """ Deletes an existing account or customer tax_id object. """ return await self._request_and_refresh_async( "delete", self.instance_url(), params=params, ) @classmethod def list(cls, **params: Unpack["TaxId.ListParams"]) -> ListObject["TaxId"]: """ Returns a list of tax IDs. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["TaxId.ListParams"] ) -> ListObject["TaxId"]: """ Returns a list of tax IDs. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def retrieve( cls, id: str, **params: Unpack["TaxId.RetrieveParams"] ) -> "TaxId": """ Retrieves an account or customer tax_id object. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["TaxId.RetrieveParams"] ) -> "TaxId": """ Retrieves an account or customer tax_id object. """ instance = cls(id, **params) await instance.refresh_async() return instance _inner_class_types = {"owner": Owner, "verification": Verification} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_tax_id_service.py0000644000175100001770000002310114637354563017530 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._tax_id import TaxId from stripe._util import sanitize_id from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict class TaxIdService(StripeService): class CreateParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ owner: NotRequired["TaxIdService.CreateParamsOwner"] """ The account or customer the tax ID belongs to. Defaults to `owner[type]=self`. """ type: Literal[ "ad_nrt", "ae_trn", "ar_cuit", "au_abn", "au_arn", "bg_uic", "bh_vat", "bo_tin", "br_cnpj", "br_cpf", "ca_bn", "ca_gst_hst", "ca_pst_bc", "ca_pst_mb", "ca_pst_sk", "ca_qst", "ch_uid", "ch_vat", "cl_tin", "cn_tin", "co_nit", "cr_tin", "de_stn", "do_rcn", "ec_ruc", "eg_tin", "es_cif", "eu_oss_vat", "eu_vat", "gb_vat", "ge_vat", "hk_br", "hu_tin", "id_npwp", "il_vat", "in_gst", "is_vat", "jp_cn", "jp_rn", "jp_trn", "ke_pin", "kr_brn", "kz_bin", "li_uid", "mx_rfc", "my_frp", "my_itn", "my_sst", "ng_tin", "no_vat", "no_voec", "nz_gst", "om_vat", "pe_ruc", "ph_tin", "ro_tin", "rs_pib", "ru_inn", "ru_kpp", "sa_vat", "sg_gst", "sg_uen", "si_tin", "sv_nit", "th_vat", "tr_tin", "tw_vat", "ua_vat", "us_ein", "uy_ruc", "ve_rif", "vn_tin", "za_vat", ] """ Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ Value of the tax ID. """ class CreateParamsOwner(TypedDict): account: NotRequired[str] """ Account the tax ID belongs to. Required when `type=account` """ customer: NotRequired[str] """ Customer the tax ID belongs to. Required when `type=customer` """ type: Literal["account", "application", "customer", "self"] """ Type of owner referenced. """ class DeleteParams(TypedDict): pass class ListParams(TypedDict): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ owner: NotRequired["TaxIdService.ListParamsOwner"] """ The account or customer the tax ID belongs to. Defaults to `owner[type]=self`. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsOwner(TypedDict): account: NotRequired[str] """ Account the tax ID belongs to. Required when `type=account` """ customer: NotRequired[str] """ Customer the tax ID belongs to. Required when `type=customer` """ type: Literal["account", "application", "customer", "self"] """ Type of owner referenced. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def delete( self, id: str, params: "TaxIdService.DeleteParams" = {}, options: RequestOptions = {}, ) -> TaxId: """ Deletes an existing account or customer tax_id object. """ return cast( TaxId, self._request( "delete", "/v1/tax_ids/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def delete_async( self, id: str, params: "TaxIdService.DeleteParams" = {}, options: RequestOptions = {}, ) -> TaxId: """ Deletes an existing account or customer tax_id object. """ return cast( TaxId, await self._request_async( "delete", "/v1/tax_ids/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, id: str, params: "TaxIdService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> TaxId: """ Retrieves an account or customer tax_id object. """ return cast( TaxId, self._request( "get", "/v1/tax_ids/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, id: str, params: "TaxIdService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> TaxId: """ Retrieves an account or customer tax_id object. """ return cast( TaxId, await self._request_async( "get", "/v1/tax_ids/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) def list( self, params: "TaxIdService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[TaxId]: """ Returns a list of tax IDs. """ return cast( ListObject[TaxId], self._request( "get", "/v1/tax_ids", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "TaxIdService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[TaxId]: """ Returns a list of tax IDs. """ return cast( ListObject[TaxId], await self._request_async( "get", "/v1/tax_ids", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "TaxIdService.CreateParams", options: RequestOptions = {} ) -> TaxId: """ Creates a new account or customer tax_id object. """ return cast( TaxId, self._request( "post", "/v1/tax_ids", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "TaxIdService.CreateParams", options: RequestOptions = {} ) -> TaxId: """ Creates a new account or customer tax_id object. """ return cast( TaxId, await self._request_async( "post", "/v1/tax_ids", api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_tax_rate.py0000644000175100001770000003420514637354563016356 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import sanitize_id from typing import ClassVar, Dict, List, Optional, cast from typing_extensions import Literal, NotRequired, TypedDict, Unpack class TaxRate( CreateableAPIResource["TaxRate"], ListableAPIResource["TaxRate"], UpdateableAPIResource["TaxRate"], ): """ Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates) """ OBJECT_NAME: ClassVar[Literal["tax_rate"]] = "tax_rate" class CreateParams(RequestOptions): active: NotRequired[bool] """ Flag determining whether the tax rate is active or inactive (archived). Inactive tax rates cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ description: NotRequired[str] """ An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers. """ display_name: str """ The display name of the tax rate, which will be shown to users. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ inclusive: bool """ This specifies if the tax rate is inclusive or exclusive. """ jurisdiction: NotRequired[str] """ The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ percentage: float """ This represents the tax rate percent out of 100. """ state: NotRequired[str] """ [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. """ tax_type: NotRequired[ Literal[ "amusement_tax", "communications_tax", "gst", "hst", "igst", "jct", "lease_tax", "pst", "qst", "rst", "sales_tax", "vat", ] ] """ The high-level tax type, such as `vat` or `sales_tax`. """ class ListParams(RequestOptions): active: NotRequired[bool] """ Optional flag to filter by tax rates that are either active or inactive (archived). """ created: NotRequired["TaxRate.ListParamsCreated|int"] """ Optional range for filtering created date. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ inclusive: NotRequired[bool] """ Optional flag to filter by tax rates that are inclusive (or those that are not inclusive). """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): active: NotRequired[bool] """ Flag determining whether the tax rate is active or inactive (archived). Inactive tax rates cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ description: NotRequired[str] """ An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers. """ display_name: NotRequired[str] """ The display name of the tax rate, which will be shown to users. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ jurisdiction: NotRequired[str] """ The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ state: NotRequired[str] """ [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. """ tax_type: NotRequired[ Literal[ "amusement_tax", "communications_tax", "gst", "hst", "igst", "jct", "lease_tax", "pst", "qst", "rst", "sales_tax", "vat", ] ] """ The high-level tax type, such as `vat` or `sales_tax`. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ active: bool """ Defaults to `true`. When set to `false`, this tax rate cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set. """ country: Optional[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ description: Optional[str] """ An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers. """ display_name: str """ The display name of the tax rates as it will appear to your customer on their receipt email, PDF, and the hosted invoice page. """ effective_percentage: Optional[float] """ Actual/effective tax rate percentage out of 100. For tax calculations with automatic_tax[enabled]=true, this percentage reflects the rate actually used to calculate tax based on the product's taxability and whether the user is registered to collect taxes in the corresponding jurisdiction. """ id: str """ Unique identifier for the object. """ inclusive: bool """ This specifies if the tax rate is inclusive or exclusive. """ jurisdiction: Optional[str] """ The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice. """ jurisdiction_level: Optional[ Literal["city", "country", "county", "district", "multiple", "state"] ] """ The level of the jurisdiction that imposes this tax rate. Will be `null` for manually defined tax rates. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ metadata: Optional[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ object: Literal["tax_rate"] """ String representing the object's type. Objects of the same type share the same value. """ percentage: float """ Tax rate percentage out of 100. For tax calculations with automatic_tax[enabled]=true, this percentage includes the statutory tax rate of non-taxable jurisdictions. """ state: Optional[str] """ [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. """ tax_type: Optional[ Literal[ "amusement_tax", "communications_tax", "gst", "hst", "igst", "jct", "lease_tax", "pst", "qst", "rst", "sales_tax", "vat", ] ] """ The high-level tax type, such as `vat` or `sales_tax`. """ @classmethod def create(cls, **params: Unpack["TaxRate.CreateParams"]) -> "TaxRate": """ Creates a new tax rate. """ return cast( "TaxRate", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["TaxRate.CreateParams"] ) -> "TaxRate": """ Creates a new tax rate. """ return cast( "TaxRate", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def list( cls, **params: Unpack["TaxRate.ListParams"] ) -> ListObject["TaxRate"]: """ Returns a list of your tax rates. Tax rates are returned sorted by creation date, with the most recently created tax rates appearing first. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["TaxRate.ListParams"] ) -> ListObject["TaxRate"]: """ Returns a list of your tax rates. Tax rates are returned sorted by creation date, with the most recently created tax rates appearing first. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def modify( cls, id: str, **params: Unpack["TaxRate.ModifyParams"] ) -> "TaxRate": """ Updates an existing tax rate. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "TaxRate", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["TaxRate.ModifyParams"] ) -> "TaxRate": """ Updates an existing tax rate. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "TaxRate", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["TaxRate.RetrieveParams"] ) -> "TaxRate": """ Retrieves a tax rate with the given ID """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["TaxRate.RetrieveParams"] ) -> "TaxRate": """ Retrieves a tax rate with the given ID """ instance = cls(id, **params) await instance.refresh_async() return instance ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_tax_rate_service.py0000644000175100001770000002721114637354563020075 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._tax_rate import TaxRate from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class TaxRateService(StripeService): class CreateParams(TypedDict): active: NotRequired[bool] """ Flag determining whether the tax rate is active or inactive (archived). Inactive tax rates cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ description: NotRequired[str] """ An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers. """ display_name: str """ The display name of the tax rate, which will be shown to users. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ inclusive: bool """ This specifies if the tax rate is inclusive or exclusive. """ jurisdiction: NotRequired[str] """ The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ percentage: float """ This represents the tax rate percent out of 100. """ state: NotRequired[str] """ [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. """ tax_type: NotRequired[ Literal[ "amusement_tax", "communications_tax", "gst", "hst", "igst", "jct", "lease_tax", "pst", "qst", "rst", "sales_tax", "vat", ] ] """ The high-level tax type, such as `vat` or `sales_tax`. """ class ListParams(TypedDict): active: NotRequired[bool] """ Optional flag to filter by tax rates that are either active or inactive (archived). """ created: NotRequired["TaxRateService.ListParamsCreated|int"] """ Optional range for filtering created date. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ inclusive: NotRequired[bool] """ Optional flag to filter by tax rates that are inclusive (or those that are not inclusive). """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): active: NotRequired[bool] """ Flag determining whether the tax rate is active or inactive (archived). Inactive tax rates cannot be used with new applications or Checkout Sessions, but will still work for subscriptions and invoices that already have it set. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ description: NotRequired[str] """ An arbitrary string attached to the tax rate for your internal use only. It will not be visible to your customers. """ display_name: NotRequired[str] """ The display name of the tax rate, which will be shown to users. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ jurisdiction: NotRequired[str] """ The jurisdiction for the tax rate. You can use this label field for tax reporting purposes. It also appears on your customer's invoice. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ state: NotRequired[str] """ [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. """ tax_type: NotRequired[ Literal[ "amusement_tax", "communications_tax", "gst", "hst", "igst", "jct", "lease_tax", "pst", "qst", "rst", "sales_tax", "vat", ] ] """ The high-level tax type, such as `vat` or `sales_tax`. """ def list( self, params: "TaxRateService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[TaxRate]: """ Returns a list of your tax rates. Tax rates are returned sorted by creation date, with the most recently created tax rates appearing first. """ return cast( ListObject[TaxRate], self._request( "get", "/v1/tax_rates", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "TaxRateService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[TaxRate]: """ Returns a list of your tax rates. Tax rates are returned sorted by creation date, with the most recently created tax rates appearing first. """ return cast( ListObject[TaxRate], await self._request_async( "get", "/v1/tax_rates", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "TaxRateService.CreateParams", options: RequestOptions = {}, ) -> TaxRate: """ Creates a new tax rate. """ return cast( TaxRate, self._request( "post", "/v1/tax_rates", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "TaxRateService.CreateParams", options: RequestOptions = {}, ) -> TaxRate: """ Creates a new tax rate. """ return cast( TaxRate, await self._request_async( "post", "/v1/tax_rates", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, tax_rate: str, params: "TaxRateService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> TaxRate: """ Retrieves a tax rate with the given ID """ return cast( TaxRate, self._request( "get", "/v1/tax_rates/{tax_rate}".format( tax_rate=sanitize_id(tax_rate), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, tax_rate: str, params: "TaxRateService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> TaxRate: """ Retrieves a tax rate with the given ID """ return cast( TaxRate, await self._request_async( "get", "/v1/tax_rates/{tax_rate}".format( tax_rate=sanitize_id(tax_rate), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, tax_rate: str, params: "TaxRateService.UpdateParams" = {}, options: RequestOptions = {}, ) -> TaxRate: """ Updates an existing tax rate. """ return cast( TaxRate, self._request( "post", "/v1/tax_rates/{tax_rate}".format( tax_rate=sanitize_id(tax_rate), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, tax_rate: str, params: "TaxRateService.UpdateParams" = {}, options: RequestOptions = {}, ) -> TaxRate: """ Updates an existing tax rate. """ return cast( TaxRate, await self._request_async( "post", "/v1/tax_rates/{tax_rate}".format( tax_rate=sanitize_id(tax_rate), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_tax_service.py0000644000175100001770000000131514637354563017057 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_service import StripeService from stripe.tax._calculation_service import CalculationService from stripe.tax._registration_service import RegistrationService from stripe.tax._settings_service import SettingsService from stripe.tax._transaction_service import TransactionService class TaxService(StripeService): def __init__(self, requestor): super().__init__(requestor) self.calculations = CalculationService(self._requestor) self.registrations = RegistrationService(self._requestor) self.settings = SettingsService(self._requestor) self.transactions = TransactionService(self._requestor) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_terminal_service.py0000644000175100001770000000135114637354563020076 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_service import StripeService from stripe.terminal._configuration_service import ConfigurationService from stripe.terminal._connection_token_service import ConnectionTokenService from stripe.terminal._location_service import LocationService from stripe.terminal._reader_service import ReaderService class TerminalService(StripeService): def __init__(self, requestor): super().__init__(requestor) self.configurations = ConfigurationService(self._requestor) self.connection_tokens = ConnectionTokenService(self._requestor) self.locations = LocationService(self._requestor) self.readers = ReaderService(self._requestor) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_test_helpers.py0000644000175100001770000000423514637354563017250 0ustar00runnerdockerfrom stripe._error import InvalidRequestError from urllib.parse import quote_plus from typing import TypeVar, ClassVar, Any from typing_extensions import Protocol from stripe._api_resource import APIResource T = TypeVar("T", bound=APIResource[Any]) class APIResourceTestHelpers(Protocol[T]): """ The base type for the TestHelper nested classes. Handles request URL generation for test_helper custom methods. Should be used in combination with the @test_helpers decorator. @test_helpers class Foo(APIResource): class TestHelpers(APIResourceTestHelpers): """ _resource_cls: ClassVar[Any] resource: T def __init__(self, resource): self.resource = resource @classmethod def _static_request(cls, *args, **kwargs): return cls._resource_cls._static_request(*args, **kwargs) @classmethod async def _static_request_async(cls, *args, **kwargs): return await cls._resource_cls._static_request_async(*args, **kwargs) @classmethod def _static_request_stream(cls, *args, **kwargs): return cls._resource_cls._static_request_stream(*args, **kwargs) @classmethod def class_url(cls): if cls == APIResourceTestHelpers: raise NotImplementedError( "APIResourceTestHelpers is an abstract class. You should perform " "actions on its subclasses (e.g. Charge, Customer)" ) # Namespaces are separated in object names with periods (.) and in URLs # with forward slashes (/), so replace the former with the latter. base = cls._resource_cls.OBJECT_NAME.replace(".", "/") return "/v1/test_helpers/%ss" % (base,) def instance_url(self): id = getattr(self.resource, "id", None) if not isinstance(id, str): raise InvalidRequestError( "Could not determine which URL to request: %s instance " "has invalid ID: %r, %s. ID should be of type `str` (or" " `unicode`)" % (type(self).__name__, id, type(id)), "id", ) base = self.class_url() extn = quote_plus(id) return "%s/%s" % (base, extn) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_test_helpers_service.py0000644000175100001770000000215414637354563020766 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_service import StripeService from stripe.test_helpers._confirmation_token_service import ( ConfirmationTokenService, ) from stripe.test_helpers._customer_service import CustomerService from stripe.test_helpers._issuing_service import IssuingService from stripe.test_helpers._refund_service import RefundService from stripe.test_helpers._terminal_service import TerminalService from stripe.test_helpers._test_clock_service import TestClockService from stripe.test_helpers._treasury_service import TreasuryService class TestHelpersService(StripeService): def __init__(self, requestor): super().__init__(requestor) self.confirmation_tokens = ConfirmationTokenService(self._requestor) self.customers = CustomerService(self._requestor) self.issuing = IssuingService(self._requestor) self.refunds = RefundService(self._requestor) self.terminal = TerminalService(self._requestor) self.test_clocks = TestClockService(self._requestor) self.treasury = TreasuryService(self._requestor) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_token.py0000644000175100001770000013164614637354563015676 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._request_options import RequestOptions from typing import ClassVar, Dict, List, Optional, cast from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._bank_account import BankAccount from stripe._card import Card class Token(CreateableAPIResource["Token"]): """ Tokenization is the process Stripe uses to collect sensitive card or bank account details, or personally identifiable information (PII), directly from your customers in a secure manner. A token representing this information is returned to your server to use. Use our [recommended payments integrations](https://stripe.com/docs/payments) to perform this process on the client-side. This guarantees that no sensitive card data touches your server, and allows your integration to operate in a PCI-compliant way. If you can't use client-side tokenization, you can also create tokens using the API with either your publishable or secret API key. If your integration uses this method, you're responsible for any PCI compliance that it might require, and you must keep your secret API key safe. Unlike with client-side tokenization, your customer's information isn't sent directly to Stripe, so we can't determine how it's handled or stored. You can't store or use tokens more than once. To store card or bank account information for later use, create [Customer](https://stripe.com/docs/api#customers) objects or [External accounts](https://stripe.com/api#external_accounts). [Radar](https://stripe.com/docs/radar), our integrated solution for automatic fraud protection, performs best with integrations that use client-side tokenization. """ OBJECT_NAME: ClassVar[Literal["token"]] = "token" class CreateParams(RequestOptions): account: NotRequired["Token.CreateParamsAccount"] """ Information for the account this token represents. """ bank_account: NotRequired["Token.CreateParamsBankAccount"] """ The bank account this token will represent. """ card: NotRequired["Token.CreateParamsCard|str"] """ The card this token will represent. If you also pass in a customer, the card must be the ID of a card belonging to the customer. Otherwise, if you do not pass in a customer, this is a dictionary containing a user's credit card details, with the options described below. """ customer: NotRequired[str] """ Create a token for the customer, which is owned by the application's account. You can only use this with an [OAuth access token](https://stripe.com/docs/connect/standard-accounts) or [Stripe-Account header](https://stripe.com/docs/connect/authentication). Learn more about [cloning saved payment methods](https://stripe.com/docs/connect/cloning-saved-payment-methods). """ cvc_update: NotRequired["Token.CreateParamsCvcUpdate"] """ The updated CVC value this token represents. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ person: NotRequired["Token.CreateParamsPerson"] """ Information for the person this token represents. """ pii: NotRequired["Token.CreateParamsPii"] """ The PII this token represents. """ class CreateParamsAccount(TypedDict): business_type: NotRequired[ Literal["company", "government_entity", "individual", "non_profit"] ] """ The business type. """ company: NotRequired["Token.CreateParamsAccountCompany"] """ Information about the company or business. """ individual: NotRequired["Token.CreateParamsAccountIndividual"] """ Information about the person represented by the account. """ tos_shown_and_accepted: NotRequired[bool] """ Whether the user described by the data in the token has been shown [the Stripe Connected Account Agreement](https://docs.stripe.com/connect/account-tokens#stripe-connected-account-agreement). When creating an account token to create a new Connect account, this value must be `true`. """ class CreateParamsAccountCompany(TypedDict): address: NotRequired["Token.CreateParamsAccountCompanyAddress"] """ The company's primary address. """ address_kana: NotRequired[ "Token.CreateParamsAccountCompanyAddressKana" ] """ The Kana variation of the company's primary address (Japan only). """ address_kanji: NotRequired[ "Token.CreateParamsAccountCompanyAddressKanji" ] """ The Kanji variation of the company's primary address (Japan only). """ directors_provided: NotRequired[bool] """ Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. """ executives_provided: NotRequired[bool] """ Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.executive` requirement. """ export_license_id: NotRequired[str] """ The export license ID number of the company, also referred as Import Export Code (India only). """ export_purpose_code: NotRequired[str] """ The purpose code to use for export transactions (India only). """ name: NotRequired[str] """ The company's legal name. """ name_kana: NotRequired[str] """ The Kana variation of the company's legal name (Japan only). """ name_kanji: NotRequired[str] """ The Kanji variation of the company's legal name (Japan only). """ owners_provided: NotRequired[bool] """ Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.owner` requirement. """ ownership_declaration: NotRequired[ "Token.CreateParamsAccountCompanyOwnershipDeclaration" ] """ This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. """ ownership_declaration_shown_and_signed: NotRequired[bool] """ Whether the user described by the data in the token has been shown the Ownership Declaration and indicated that it is correct. """ phone: NotRequired[str] """ The company's phone number (used for verification). """ registration_number: NotRequired[str] """ The identification number given to a company when it is registered or incorporated, if distinct from the identification number used for filing taxes. (Examples are the CIN for companies and LLP IN for partnerships in India, and the Company Registration Number in Hong Kong). """ structure: NotRequired[ "Literal['']|Literal['free_zone_establishment', 'free_zone_llc', 'government_instrumentality', 'governmental_unit', 'incorporated_non_profit', 'incorporated_partnership', 'limited_liability_partnership', 'llc', 'multi_member_llc', 'private_company', 'private_corporation', 'private_partnership', 'public_company', 'public_corporation', 'public_partnership', 'registered_charity', 'single_member_llc', 'sole_establishment', 'sole_proprietorship', 'tax_exempt_government_instrumentality', 'unincorporated_association', 'unincorporated_non_profit', 'unincorporated_partnership']" ] """ The category identifying the legal structure of the company or legal entity. See [Business structure](https://docs.stripe.com/connect/identity-verification#business-structure) for more details. Pass an empty string to unset this value. """ tax_id: NotRequired[str] """ The business ID number of the company, as appropriate for the company's country. (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.) """ tax_id_registrar: NotRequired[str] """ The jurisdiction in which the `tax_id` is registered (Germany-based companies only). """ vat_id: NotRequired[str] """ The VAT number of the company. """ verification: NotRequired[ "Token.CreateParamsAccountCompanyVerification" ] """ Information on the verification state of the company. """ class CreateParamsAccountCompanyAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsAccountCompanyAddressKana(TypedDict): city: NotRequired[str] """ City or ward. """ 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] """ Block or building number. """ line2: NotRequired[str] """ Building details. """ postal_code: NotRequired[str] """ Postal code. """ state: NotRequired[str] """ Prefecture. """ town: NotRequired[str] """ Town or cho-me. """ class CreateParamsAccountCompanyAddressKanji(TypedDict): city: NotRequired[str] """ City or ward. """ 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] """ Block or building number. """ line2: NotRequired[str] """ Building details. """ postal_code: NotRequired[str] """ Postal code. """ state: NotRequired[str] """ Prefecture. """ town: NotRequired[str] """ Town or cho-me. """ class CreateParamsAccountCompanyOwnershipDeclaration(TypedDict): date: NotRequired[int] """ The Unix timestamp marking when the beneficial owner attestation was made. """ ip: NotRequired[str] """ The IP address from which the beneficial owner attestation was made. """ user_agent: NotRequired[str] """ The user agent of the browser from which the beneficial owner attestation was made. """ class CreateParamsAccountCompanyVerification(TypedDict): document: NotRequired[ "Token.CreateParamsAccountCompanyVerificationDocument" ] """ A document verifying the business. """ class CreateParamsAccountCompanyVerificationDocument(TypedDict): back: NotRequired[str] """ The back of a document returned by a [file upload](https://stripe.com/docs/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://stripe.com/docs/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. """ class CreateParamsAccountIndividual(TypedDict): address: NotRequired["Token.CreateParamsAccountIndividualAddress"] """ The individual's primary address. """ address_kana: NotRequired[ "Token.CreateParamsAccountIndividualAddressKana" ] """ The Kana variation of the individual's primary address (Japan only). """ address_kanji: NotRequired[ "Token.CreateParamsAccountIndividualAddressKanji" ] """ The Kanji variation of the individual's primary address (Japan only). """ dob: NotRequired["Literal['']|Token.CreateParamsAccountIndividualDob"] """ The individual's date of birth. """ email: NotRequired[str] """ The individual's email address. """ first_name: NotRequired[str] """ The individual's first name. """ first_name_kana: NotRequired[str] """ The Kana variation of the individual's first name (Japan only). """ first_name_kanji: NotRequired[str] """ The Kanji variation of the individual's first name (Japan only). """ full_name_aliases: NotRequired["Literal['']|List[str]"] """ A list of alternate names or aliases that the individual is known by. """ gender: NotRequired[str] """ The individual's gender (International regulations require either "male" or "female"). """ id_number: NotRequired[str] """ The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). """ id_number_secondary: NotRequired[str] """ The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). """ last_name: NotRequired[str] """ The individual's last name. """ last_name_kana: NotRequired[str] """ The Kana variation of the individual's last name (Japan only). """ last_name_kanji: NotRequired[str] """ The Kanji variation of the individual's last name (Japan only). """ maiden_name: NotRequired[str] """ The individual's maiden name. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ phone: NotRequired[str] """ The individual's phone number. """ political_exposure: NotRequired[Literal["existing", "none"]] """ Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. """ registered_address: NotRequired[ "Token.CreateParamsAccountIndividualRegisteredAddress" ] """ The individual's registered address. """ relationship: NotRequired[ "Token.CreateParamsAccountIndividualRelationship" ] """ Describes the person's relationship to the account. """ ssn_last_4: NotRequired[str] """ The last four digits of the individual's Social Security Number (U.S. only). """ verification: NotRequired[ "Token.CreateParamsAccountIndividualVerification" ] """ The individual's verification document information. """ class CreateParamsAccountIndividualAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsAccountIndividualAddressKana(TypedDict): city: NotRequired[str] """ City or ward. """ 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] """ Block or building number. """ line2: NotRequired[str] """ Building details. """ postal_code: NotRequired[str] """ Postal code. """ state: NotRequired[str] """ Prefecture. """ town: NotRequired[str] """ Town or cho-me. """ class CreateParamsAccountIndividualAddressKanji(TypedDict): city: NotRequired[str] """ City or ward. """ 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] """ Block or building number. """ line2: NotRequired[str] """ Building details. """ postal_code: NotRequired[str] """ Postal code. """ state: NotRequired[str] """ Prefecture. """ town: NotRequired[str] """ Town or cho-me. """ class CreateParamsAccountIndividualDob(TypedDict): day: int """ The day of birth, between 1 and 31. """ month: int """ The month of birth, between 1 and 12. """ year: int """ The four-digit year of birth. """ class CreateParamsAccountIndividualRegisteredAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsAccountIndividualRelationship(TypedDict): director: NotRequired[bool] """ Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. """ executive: NotRequired[bool] """ Whether the person has significant responsibility to control, manage, or direct the organization. """ owner: NotRequired[bool] """ Whether the person is an owner of the account's legal entity. """ percent_ownership: NotRequired["Literal['']|float"] """ The percent owned by the person of the account's legal entity. """ title: NotRequired[str] """ The person's title (e.g., CEO, Support Engineer). """ class CreateParamsAccountIndividualVerification(TypedDict): additional_document: NotRequired[ "Token.CreateParamsAccountIndividualVerificationAdditionalDocument" ] """ A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. """ document: NotRequired[ "Token.CreateParamsAccountIndividualVerificationDocument" ] """ An identifying document, either a passport or local ID card. """ class CreateParamsAccountIndividualVerificationAdditionalDocument( TypedDict, ): back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/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://stripe.com/docs/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 CreateParamsAccountIndividualVerificationDocument(TypedDict): back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/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://stripe.com/docs/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 CreateParamsBankAccount(TypedDict): account_holder_name: NotRequired[str] """ The name of the person or business that owns the bank account. This field is required when attaching the bank account to a `Customer` object. """ account_holder_type: NotRequired[Literal["company", "individual"]] """ The type of entity that holds the account. It can be `company` or `individual`. This field is required when attaching the bank account to a `Customer` object. """ account_number: str """ The account number for the bank account, in string form. Must be a checking account. """ account_type: NotRequired[ Literal["checking", "futsu", "savings", "toza"] ] """ The bank account type. This can only be `checking` or `savings` in most countries. In Japan, this can only be `futsu` or `toza`. """ country: str """ The country in which the bank account is located. """ currency: NotRequired[str] """ The currency the bank account is in. This must be a country/currency pairing that [Stripe supports.](https://stripe.com/docs/payouts) """ payment_method: NotRequired[str] """ The ID of a Payment Method with a `type` of `us_bank_account`. The Payment Method's bank account information will be copied and returned as a Bank Account Token. This parameter is exclusive with respect to all other parameters in the `bank_account` hash. You must include the top-level `customer` parameter if the Payment Method is attached to a `Customer` object. If the Payment Method is not attached to a `Customer` object, it will be consumed and cannot be used again. You may not use Payment Methods which were created by a Setup Intent with `attach_to_self=true`. """ routing_number: NotRequired[str] """ The routing number, sort code, or other country-appropriate institution number for the bank account. For US bank accounts, this is required and should be the ACH routing number, not the wire routing number. If you are providing an IBAN for `account_number`, this field is not required. """ class CreateParamsCard(TypedDict): address_city: NotRequired[str] """ City / District / Suburb / Town / Village. """ address_country: NotRequired[str] """ Billing address country, if provided. """ address_line1: NotRequired[str] """ Address line 1 (Street address / PO Box / Company name). """ address_line2: NotRequired[str] """ Address line 2 (Apartment / Suite / Unit / Building). """ address_state: NotRequired[str] """ State / County / Province / Region. """ address_zip: NotRequired[str] """ ZIP or postal code. """ currency: NotRequired[str] """ Required in order to add the card to an account; in all other cases, this parameter is not used. When added to an account, the card (which must be a debit card) can be used as a transfer destination for funds in this currency. """ cvc: NotRequired[str] """ Card security code. Highly recommended to always include this value. """ exp_month: str """ Two-digit number representing the card's expiration month. """ exp_year: str """ Two- or four-digit number representing the card's expiration year. """ name: NotRequired[str] """ Cardholder's full name. """ networks: NotRequired["Token.CreateParamsCardNetworks"] """ Contains information about card networks used to process the payment. """ number: str """ The card number, as a string without any separators. """ class CreateParamsCardNetworks(TypedDict): preferred: NotRequired[ Literal["cartes_bancaires", "mastercard", "visa"] ] """ The customer's preferred card network for co-branded cards. Supports `cartes_bancaires`, `mastercard`, or `visa`. Selection of a network that does not apply to the card will be stored as `invalid_preference` on the card. """ class CreateParamsCvcUpdate(TypedDict): cvc: str """ The CVC value, in string form. """ class CreateParamsPerson(TypedDict): additional_tos_acceptances: NotRequired[ "Token.CreateParamsPersonAdditionalTosAcceptances" ] """ Details on the legal guardian's acceptance of the required Stripe agreements. """ address: NotRequired["Token.CreateParamsPersonAddress"] """ The person's address. """ address_kana: NotRequired["Token.CreateParamsPersonAddressKana"] """ The Kana variation of the person's address (Japan only). """ address_kanji: NotRequired["Token.CreateParamsPersonAddressKanji"] """ The Kanji variation of the person's address (Japan only). """ dob: NotRequired["Literal['']|Token.CreateParamsPersonDob"] """ The person's date of birth. """ documents: NotRequired["Token.CreateParamsPersonDocuments"] """ Documents that may be submitted to satisfy various informational requests. """ email: NotRequired[str] """ The person's email address. """ first_name: NotRequired[str] """ The person's first name. """ first_name_kana: NotRequired[str] """ The Kana variation of the person's first name (Japan only). """ first_name_kanji: NotRequired[str] """ The Kanji variation of the person's first name (Japan only). """ full_name_aliases: NotRequired["Literal['']|List[str]"] """ A list of alternate names or aliases that the person is known by. """ gender: NotRequired[str] """ The person's gender (International regulations require either "male" or "female"). """ id_number: NotRequired[str] """ The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). """ id_number_secondary: NotRequired[str] """ The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). """ last_name: NotRequired[str] """ The person's last name. """ last_name_kana: NotRequired[str] """ The Kana variation of the person's last name (Japan only). """ last_name_kanji: NotRequired[str] """ The Kanji variation of the person's last name (Japan only). """ maiden_name: NotRequired[str] """ The person's maiden name. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ nationality: NotRequired[str] """ The country where the person is a national. Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)), or "XX" if unavailable. """ phone: NotRequired[str] """ The person's phone number. """ political_exposure: NotRequired[str] """ Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. """ registered_address: NotRequired[ "Token.CreateParamsPersonRegisteredAddress" ] """ The person's registered address. """ relationship: NotRequired["Token.CreateParamsPersonRelationship"] """ The relationship that this person has with the account's legal entity. """ ssn_last_4: NotRequired[str] """ The last four digits of the person's Social Security number (U.S. only). """ verification: NotRequired["Token.CreateParamsPersonVerification"] """ The person's verification status. """ class CreateParamsPersonAdditionalTosAcceptances(TypedDict): account: NotRequired[ "Token.CreateParamsPersonAdditionalTosAcceptancesAccount" ] """ Details on the legal guardian's acceptance of the main Stripe service agreement. """ class CreateParamsPersonAdditionalTosAcceptancesAccount(TypedDict): date: NotRequired[int] """ The Unix timestamp marking when the account representative accepted the service agreement. """ ip: NotRequired[str] """ The IP address from which the account representative accepted the service agreement. """ user_agent: NotRequired["Literal['']|str"] """ The user agent of the browser from which the account representative accepted the service agreement. """ class CreateParamsPersonAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsPersonAddressKana(TypedDict): city: NotRequired[str] """ City or ward. """ 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] """ Block or building number. """ line2: NotRequired[str] """ Building details. """ postal_code: NotRequired[str] """ Postal code. """ state: NotRequired[str] """ Prefecture. """ town: NotRequired[str] """ Town or cho-me. """ class CreateParamsPersonAddressKanji(TypedDict): city: NotRequired[str] """ City or ward. """ 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] """ Block or building number. """ line2: NotRequired[str] """ Building details. """ postal_code: NotRequired[str] """ Postal code. """ state: NotRequired[str] """ Prefecture. """ town: NotRequired[str] """ Town or cho-me. """ class CreateParamsPersonDob(TypedDict): day: int """ The day of birth, between 1 and 31. """ month: int """ The month of birth, between 1 and 12. """ year: int """ The four-digit year of birth. """ class CreateParamsPersonDocuments(TypedDict): company_authorization: NotRequired[ "Token.CreateParamsPersonDocumentsCompanyAuthorization" ] """ One or more documents that demonstrate proof that this person is authorized to represent the company. """ passport: NotRequired["Token.CreateParamsPersonDocumentsPassport"] """ One or more documents showing the person's passport page with photo and personal data. """ visa: NotRequired["Token.CreateParamsPersonDocumentsVisa"] """ One or more documents showing the person's visa required for living in the country where they are residing. """ class CreateParamsPersonDocumentsCompanyAuthorization(TypedDict): files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreateParamsPersonDocumentsPassport(TypedDict): files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreateParamsPersonDocumentsVisa(TypedDict): files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreateParamsPersonRegisteredAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsPersonRelationship(TypedDict): director: NotRequired[bool] """ Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. """ executive: NotRequired[bool] """ Whether the person has significant responsibility to control, manage, or direct the organization. """ legal_guardian: NotRequired[bool] """ Whether the person is the legal guardian of the account's representative. """ owner: NotRequired[bool] """ Whether the person is an owner of the account's legal entity. """ percent_ownership: NotRequired["Literal['']|float"] """ The percent owned by the person of the account's legal entity. """ representative: NotRequired[bool] """ Whether the person is authorized as the primary representative of the account. This is the person nominated by the business to provide information about themselves, and general information about the account. There can only be one representative at any given time. At the time the account is created, this person should be set to the person responsible for opening the account. """ title: NotRequired[str] """ The person's title (e.g., CEO, Support Engineer). """ class CreateParamsPersonVerification(TypedDict): additional_document: NotRequired[ "Token.CreateParamsPersonVerificationAdditionalDocument" ] """ A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. """ document: NotRequired["Token.CreateParamsPersonVerificationDocument"] """ An identifying document, either a passport or local ID card. """ class CreateParamsPersonVerificationAdditionalDocument(TypedDict): back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/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://stripe.com/docs/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 CreateParamsPersonVerificationDocument(TypedDict): back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/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://stripe.com/docs/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 CreateParamsPii(TypedDict): id_number: NotRequired[str] """ The `id_number` for the PII, in string form. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ bank_account: Optional["BankAccount"] """ These bank accounts are payment methods on `Customer` objects. On the other hand [External Accounts](https://stripe.com/api#external_accounts) are transfer destinations on `Account` objects for connected accounts. They can be bank accounts or debit cards as well, and are documented in the links above. Related guide: [Bank debits and transfers](https://stripe.com/payments/bank-debits-transfers) """ card: Optional["Card"] """ You can store multiple cards on a customer in order to charge the customer later. You can also store multiple debit cards on a recipient in order to transfer to those cards later. Related guide: [Card payments with Sources](https://stripe.com/docs/sources/cards) """ client_ip: Optional[str] """ IP address of the client that generates the token. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ object: Literal["token"] """ String representing the object's type. Objects of the same type share the same value. """ type: str """ Type of the token: `account`, `bank_account`, `card`, or `pii`. """ used: bool """ Determines if you have already used this token (you can only use tokens once). """ @classmethod def create(cls, **params: Unpack["Token.CreateParams"]) -> "Token": """ Creates a single-use token that represents a bank account's details. You can use this token with any API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a [connected account](https://stripe.com/docs/api#accounts) where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is application, which includes Custom accounts. """ return cast( "Token", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["Token.CreateParams"] ) -> "Token": """ Creates a single-use token that represents a bank account's details. You can use this token with any API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a [connected account](https://stripe.com/docs/api#accounts) where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is application, which includes Custom accounts. """ return cast( "Token", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["Token.RetrieveParams"] ) -> "Token": """ Retrieves the token with the given ID. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["Token.RetrieveParams"] ) -> "Token": """ Retrieves the token with the given ID. """ instance = cls(id, **params) await instance.refresh_async() return instance ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_token_service.py0000644000175100001770000012576014637354563017416 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._token import Token from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class TokenService(StripeService): class CreateParams(TypedDict): account: NotRequired["TokenService.CreateParamsAccount"] """ Information for the account this token represents. """ bank_account: NotRequired["TokenService.CreateParamsBankAccount"] """ The bank account this token will represent. """ card: NotRequired["TokenService.CreateParamsCard|str"] """ The card this token will represent. If you also pass in a customer, the card must be the ID of a card belonging to the customer. Otherwise, if you do not pass in a customer, this is a dictionary containing a user's credit card details, with the options described below. """ customer: NotRequired[str] """ Create a token for the customer, which is owned by the application's account. You can only use this with an [OAuth access token](https://stripe.com/docs/connect/standard-accounts) or [Stripe-Account header](https://stripe.com/docs/connect/authentication). Learn more about [cloning saved payment methods](https://stripe.com/docs/connect/cloning-saved-payment-methods). """ cvc_update: NotRequired["TokenService.CreateParamsCvcUpdate"] """ The updated CVC value this token represents. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ person: NotRequired["TokenService.CreateParamsPerson"] """ Information for the person this token represents. """ pii: NotRequired["TokenService.CreateParamsPii"] """ The PII this token represents. """ class CreateParamsAccount(TypedDict): business_type: NotRequired[ Literal["company", "government_entity", "individual", "non_profit"] ] """ The business type. """ company: NotRequired["TokenService.CreateParamsAccountCompany"] """ Information about the company or business. """ individual: NotRequired["TokenService.CreateParamsAccountIndividual"] """ Information about the person represented by the account. """ tos_shown_and_accepted: NotRequired[bool] """ Whether the user described by the data in the token has been shown [the Stripe Connected Account Agreement](https://docs.stripe.com/connect/account-tokens#stripe-connected-account-agreement). When creating an account token to create a new Connect account, this value must be `true`. """ class CreateParamsAccountCompany(TypedDict): address: NotRequired["TokenService.CreateParamsAccountCompanyAddress"] """ The company's primary address. """ address_kana: NotRequired[ "TokenService.CreateParamsAccountCompanyAddressKana" ] """ The Kana variation of the company's primary address (Japan only). """ address_kanji: NotRequired[ "TokenService.CreateParamsAccountCompanyAddressKanji" ] """ The Kanji variation of the company's primary address (Japan only). """ directors_provided: NotRequired[bool] """ Whether the company's directors have been provided. Set this Boolean to `true` after creating all the company's directors with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.director` requirement. This value is not automatically set to `true` after creating directors, so it needs to be updated to indicate all directors have been provided. """ executives_provided: NotRequired[bool] """ Whether the company's executives have been provided. Set this Boolean to `true` after creating all the company's executives with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.executive` requirement. """ export_license_id: NotRequired[str] """ The export license ID number of the company, also referred as Import Export Code (India only). """ export_purpose_code: NotRequired[str] """ The purpose code to use for export transactions (India only). """ name: NotRequired[str] """ The company's legal name. """ name_kana: NotRequired[str] """ The Kana variation of the company's legal name (Japan only). """ name_kanji: NotRequired[str] """ The Kanji variation of the company's legal name (Japan only). """ owners_provided: NotRequired[bool] """ Whether the company's owners have been provided. Set this Boolean to `true` after creating all the company's owners with [the Persons API](https://docs.stripe.com/api/persons) for accounts with a `relationship.owner` requirement. """ ownership_declaration: NotRequired[ "TokenService.CreateParamsAccountCompanyOwnershipDeclaration" ] """ This hash is used to attest that the beneficial owner information provided to Stripe is both current and correct. """ ownership_declaration_shown_and_signed: NotRequired[bool] """ Whether the user described by the data in the token has been shown the Ownership Declaration and indicated that it is correct. """ phone: NotRequired[str] """ The company's phone number (used for verification). """ registration_number: NotRequired[str] """ The identification number given to a company when it is registered or incorporated, if distinct from the identification number used for filing taxes. (Examples are the CIN for companies and LLP IN for partnerships in India, and the Company Registration Number in Hong Kong). """ structure: NotRequired[ "Literal['']|Literal['free_zone_establishment', 'free_zone_llc', 'government_instrumentality', 'governmental_unit', 'incorporated_non_profit', 'incorporated_partnership', 'limited_liability_partnership', 'llc', 'multi_member_llc', 'private_company', 'private_corporation', 'private_partnership', 'public_company', 'public_corporation', 'public_partnership', 'registered_charity', 'single_member_llc', 'sole_establishment', 'sole_proprietorship', 'tax_exempt_government_instrumentality', 'unincorporated_association', 'unincorporated_non_profit', 'unincorporated_partnership']" ] """ The category identifying the legal structure of the company or legal entity. See [Business structure](https://docs.stripe.com/connect/identity-verification#business-structure) for more details. Pass an empty string to unset this value. """ tax_id: NotRequired[str] """ The business ID number of the company, as appropriate for the company's country. (Examples are an Employer ID Number in the U.S., a Business Number in Canada, or a Company Number in the UK.) """ tax_id_registrar: NotRequired[str] """ The jurisdiction in which the `tax_id` is registered (Germany-based companies only). """ vat_id: NotRequired[str] """ The VAT number of the company. """ verification: NotRequired[ "TokenService.CreateParamsAccountCompanyVerification" ] """ Information on the verification state of the company. """ class CreateParamsAccountCompanyAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsAccountCompanyAddressKana(TypedDict): city: NotRequired[str] """ City or ward. """ 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] """ Block or building number. """ line2: NotRequired[str] """ Building details. """ postal_code: NotRequired[str] """ Postal code. """ state: NotRequired[str] """ Prefecture. """ town: NotRequired[str] """ Town or cho-me. """ class CreateParamsAccountCompanyAddressKanji(TypedDict): city: NotRequired[str] """ City or ward. """ 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] """ Block or building number. """ line2: NotRequired[str] """ Building details. """ postal_code: NotRequired[str] """ Postal code. """ state: NotRequired[str] """ Prefecture. """ town: NotRequired[str] """ Town or cho-me. """ class CreateParamsAccountCompanyOwnershipDeclaration(TypedDict): date: NotRequired[int] """ The Unix timestamp marking when the beneficial owner attestation was made. """ ip: NotRequired[str] """ The IP address from which the beneficial owner attestation was made. """ user_agent: NotRequired[str] """ The user agent of the browser from which the beneficial owner attestation was made. """ class CreateParamsAccountCompanyVerification(TypedDict): document: NotRequired[ "TokenService.CreateParamsAccountCompanyVerificationDocument" ] """ A document verifying the business. """ class CreateParamsAccountCompanyVerificationDocument(TypedDict): back: NotRequired[str] """ The back of a document returned by a [file upload](https://stripe.com/docs/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://stripe.com/docs/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. """ class CreateParamsAccountIndividual(TypedDict): address: NotRequired[ "TokenService.CreateParamsAccountIndividualAddress" ] """ The individual's primary address. """ address_kana: NotRequired[ "TokenService.CreateParamsAccountIndividualAddressKana" ] """ The Kana variation of the individual's primary address (Japan only). """ address_kanji: NotRequired[ "TokenService.CreateParamsAccountIndividualAddressKanji" ] """ The Kanji variation of the individual's primary address (Japan only). """ dob: NotRequired[ "Literal['']|TokenService.CreateParamsAccountIndividualDob" ] """ The individual's date of birth. """ email: NotRequired[str] """ The individual's email address. """ first_name: NotRequired[str] """ The individual's first name. """ first_name_kana: NotRequired[str] """ The Kana variation of the individual's first name (Japan only). """ first_name_kanji: NotRequired[str] """ The Kanji variation of the individual's first name (Japan only). """ full_name_aliases: NotRequired["Literal['']|List[str]"] """ A list of alternate names or aliases that the individual is known by. """ gender: NotRequired[str] """ The individual's gender (International regulations require either "male" or "female"). """ id_number: NotRequired[str] """ The government-issued ID number of the individual, as appropriate for the representative's country. (Examples are a Social Security Number in the U.S., or a Social Insurance Number in Canada). Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). """ id_number_secondary: NotRequired[str] """ The government-issued secondary ID number of the individual, as appropriate for the representative's country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token created with Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). """ last_name: NotRequired[str] """ The individual's last name. """ last_name_kana: NotRequired[str] """ The Kana variation of the individual's last name (Japan only). """ last_name_kanji: NotRequired[str] """ The Kanji variation of the individual's last name (Japan only). """ maiden_name: NotRequired[str] """ The individual's maiden name. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ phone: NotRequired[str] """ The individual's phone number. """ political_exposure: NotRequired[Literal["existing", "none"]] """ Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. """ registered_address: NotRequired[ "TokenService.CreateParamsAccountIndividualRegisteredAddress" ] """ The individual's registered address. """ relationship: NotRequired[ "TokenService.CreateParamsAccountIndividualRelationship" ] """ Describes the person's relationship to the account. """ ssn_last_4: NotRequired[str] """ The last four digits of the individual's Social Security Number (U.S. only). """ verification: NotRequired[ "TokenService.CreateParamsAccountIndividualVerification" ] """ The individual's verification document information. """ class CreateParamsAccountIndividualAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsAccountIndividualAddressKana(TypedDict): city: NotRequired[str] """ City or ward. """ 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] """ Block or building number. """ line2: NotRequired[str] """ Building details. """ postal_code: NotRequired[str] """ Postal code. """ state: NotRequired[str] """ Prefecture. """ town: NotRequired[str] """ Town or cho-me. """ class CreateParamsAccountIndividualAddressKanji(TypedDict): city: NotRequired[str] """ City or ward. """ 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] """ Block or building number. """ line2: NotRequired[str] """ Building details. """ postal_code: NotRequired[str] """ Postal code. """ state: NotRequired[str] """ Prefecture. """ town: NotRequired[str] """ Town or cho-me. """ class CreateParamsAccountIndividualDob(TypedDict): day: int """ The day of birth, between 1 and 31. """ month: int """ The month of birth, between 1 and 12. """ year: int """ The four-digit year of birth. """ class CreateParamsAccountIndividualRegisteredAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsAccountIndividualRelationship(TypedDict): director: NotRequired[bool] """ Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. """ executive: NotRequired[bool] """ Whether the person has significant responsibility to control, manage, or direct the organization. """ owner: NotRequired[bool] """ Whether the person is an owner of the account's legal entity. """ percent_ownership: NotRequired["Literal['']|float"] """ The percent owned by the person of the account's legal entity. """ title: NotRequired[str] """ The person's title (e.g., CEO, Support Engineer). """ class CreateParamsAccountIndividualVerification(TypedDict): additional_document: NotRequired[ "TokenService.CreateParamsAccountIndividualVerificationAdditionalDocument" ] """ A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. """ document: NotRequired[ "TokenService.CreateParamsAccountIndividualVerificationDocument" ] """ An identifying document, either a passport or local ID card. """ class CreateParamsAccountIndividualVerificationAdditionalDocument( TypedDict, ): back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/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://stripe.com/docs/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 CreateParamsAccountIndividualVerificationDocument(TypedDict): back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/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://stripe.com/docs/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 CreateParamsBankAccount(TypedDict): account_holder_name: NotRequired[str] """ The name of the person or business that owns the bank account. This field is required when attaching the bank account to a `Customer` object. """ account_holder_type: NotRequired[Literal["company", "individual"]] """ The type of entity that holds the account. It can be `company` or `individual`. This field is required when attaching the bank account to a `Customer` object. """ account_number: str """ The account number for the bank account, in string form. Must be a checking account. """ account_type: NotRequired[ Literal["checking", "futsu", "savings", "toza"] ] """ The bank account type. This can only be `checking` or `savings` in most countries. In Japan, this can only be `futsu` or `toza`. """ country: str """ The country in which the bank account is located. """ currency: NotRequired[str] """ The currency the bank account is in. This must be a country/currency pairing that [Stripe supports.](https://stripe.com/docs/payouts) """ payment_method: NotRequired[str] """ The ID of a Payment Method with a `type` of `us_bank_account`. The Payment Method's bank account information will be copied and returned as a Bank Account Token. This parameter is exclusive with respect to all other parameters in the `bank_account` hash. You must include the top-level `customer` parameter if the Payment Method is attached to a `Customer` object. If the Payment Method is not attached to a `Customer` object, it will be consumed and cannot be used again. You may not use Payment Methods which were created by a Setup Intent with `attach_to_self=true`. """ routing_number: NotRequired[str] """ The routing number, sort code, or other country-appropriate institution number for the bank account. For US bank accounts, this is required and should be the ACH routing number, not the wire routing number. If you are providing an IBAN for `account_number`, this field is not required. """ class CreateParamsCard(TypedDict): address_city: NotRequired[str] """ City / District / Suburb / Town / Village. """ address_country: NotRequired[str] """ Billing address country, if provided. """ address_line1: NotRequired[str] """ Address line 1 (Street address / PO Box / Company name). """ address_line2: NotRequired[str] """ Address line 2 (Apartment / Suite / Unit / Building). """ address_state: NotRequired[str] """ State / County / Province / Region. """ address_zip: NotRequired[str] """ ZIP or postal code. """ currency: NotRequired[str] """ Required in order to add the card to an account; in all other cases, this parameter is not used. When added to an account, the card (which must be a debit card) can be used as a transfer destination for funds in this currency. """ cvc: NotRequired[str] """ Card security code. Highly recommended to always include this value. """ exp_month: str """ Two-digit number representing the card's expiration month. """ exp_year: str """ Two- or four-digit number representing the card's expiration year. """ name: NotRequired[str] """ Cardholder's full name. """ networks: NotRequired["TokenService.CreateParamsCardNetworks"] """ Contains information about card networks used to process the payment. """ number: str """ The card number, as a string without any separators. """ class CreateParamsCardNetworks(TypedDict): preferred: NotRequired[ Literal["cartes_bancaires", "mastercard", "visa"] ] """ The customer's preferred card network for co-branded cards. Supports `cartes_bancaires`, `mastercard`, or `visa`. Selection of a network that does not apply to the card will be stored as `invalid_preference` on the card. """ class CreateParamsCvcUpdate(TypedDict): cvc: str """ The CVC value, in string form. """ class CreateParamsPerson(TypedDict): additional_tos_acceptances: NotRequired[ "TokenService.CreateParamsPersonAdditionalTosAcceptances" ] """ Details on the legal guardian's acceptance of the required Stripe agreements. """ address: NotRequired["TokenService.CreateParamsPersonAddress"] """ The person's address. """ address_kana: NotRequired["TokenService.CreateParamsPersonAddressKana"] """ The Kana variation of the person's address (Japan only). """ address_kanji: NotRequired[ "TokenService.CreateParamsPersonAddressKanji" ] """ The Kanji variation of the person's address (Japan only). """ dob: NotRequired["Literal['']|TokenService.CreateParamsPersonDob"] """ The person's date of birth. """ documents: NotRequired["TokenService.CreateParamsPersonDocuments"] """ Documents that may be submitted to satisfy various informational requests. """ email: NotRequired[str] """ The person's email address. """ first_name: NotRequired[str] """ The person's first name. """ first_name_kana: NotRequired[str] """ The Kana variation of the person's first name (Japan only). """ first_name_kanji: NotRequired[str] """ The Kanji variation of the person's first name (Japan only). """ full_name_aliases: NotRequired["Literal['']|List[str]"] """ A list of alternate names or aliases that the person is known by. """ gender: NotRequired[str] """ The person's gender (International regulations require either "male" or "female"). """ id_number: NotRequired[str] """ The person's ID number, as appropriate for their country. For example, a social security number in the U.S., social insurance number in Canada, etc. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). """ id_number_secondary: NotRequired[str] """ The person's secondary ID number, as appropriate for their country, will be used for enhanced verification checks. In Thailand, this would be the laser code found on the back of an ID card. Instead of the number itself, you can also provide a [PII token provided by Stripe.js](https://docs.stripe.com/js/tokens/create_token?type=pii). """ last_name: NotRequired[str] """ The person's last name. """ last_name_kana: NotRequired[str] """ The Kana variation of the person's last name (Japan only). """ last_name_kanji: NotRequired[str] """ The Kanji variation of the person's last name (Japan only). """ maiden_name: NotRequired[str] """ The person's maiden name. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ nationality: NotRequired[str] """ The country where the person is a national. Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)), or "XX" if unavailable. """ phone: NotRequired[str] """ The person's phone number. """ political_exposure: NotRequired[str] """ Indicates if the person or any of their representatives, family members, or other closely related persons, declares that they hold or have held an important public job or function, in any jurisdiction. """ registered_address: NotRequired[ "TokenService.CreateParamsPersonRegisteredAddress" ] """ The person's registered address. """ relationship: NotRequired[ "TokenService.CreateParamsPersonRelationship" ] """ The relationship that this person has with the account's legal entity. """ ssn_last_4: NotRequired[str] """ The last four digits of the person's Social Security number (U.S. only). """ verification: NotRequired[ "TokenService.CreateParamsPersonVerification" ] """ The person's verification status. """ class CreateParamsPersonAdditionalTosAcceptances(TypedDict): account: NotRequired[ "TokenService.CreateParamsPersonAdditionalTosAcceptancesAccount" ] """ Details on the legal guardian's acceptance of the main Stripe service agreement. """ class CreateParamsPersonAdditionalTosAcceptancesAccount(TypedDict): date: NotRequired[int] """ The Unix timestamp marking when the account representative accepted the service agreement. """ ip: NotRequired[str] """ The IP address from which the account representative accepted the service agreement. """ user_agent: NotRequired["Literal['']|str"] """ The user agent of the browser from which the account representative accepted the service agreement. """ class CreateParamsPersonAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsPersonAddressKana(TypedDict): city: NotRequired[str] """ City or ward. """ 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] """ Block or building number. """ line2: NotRequired[str] """ Building details. """ postal_code: NotRequired[str] """ Postal code. """ state: NotRequired[str] """ Prefecture. """ town: NotRequired[str] """ Town or cho-me. """ class CreateParamsPersonAddressKanji(TypedDict): city: NotRequired[str] """ City or ward. """ 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] """ Block or building number. """ line2: NotRequired[str] """ Building details. """ postal_code: NotRequired[str] """ Postal code. """ state: NotRequired[str] """ Prefecture. """ town: NotRequired[str] """ Town or cho-me. """ class CreateParamsPersonDob(TypedDict): day: int """ The day of birth, between 1 and 31. """ month: int """ The month of birth, between 1 and 12. """ year: int """ The four-digit year of birth. """ class CreateParamsPersonDocuments(TypedDict): company_authorization: NotRequired[ "TokenService.CreateParamsPersonDocumentsCompanyAuthorization" ] """ One or more documents that demonstrate proof that this person is authorized to represent the company. """ passport: NotRequired[ "TokenService.CreateParamsPersonDocumentsPassport" ] """ One or more documents showing the person's passport page with photo and personal data. """ visa: NotRequired["TokenService.CreateParamsPersonDocumentsVisa"] """ One or more documents showing the person's visa required for living in the country where they are residing. """ class CreateParamsPersonDocumentsCompanyAuthorization(TypedDict): files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreateParamsPersonDocumentsPassport(TypedDict): files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreateParamsPersonDocumentsVisa(TypedDict): files: NotRequired[List[str]] """ One or more document ids returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `account_requirement`. """ class CreateParamsPersonRegisteredAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsPersonRelationship(TypedDict): director: NotRequired[bool] """ Whether the person is a director of the account's legal entity. Directors are typically members of the governing board of the company, or responsible for ensuring the company meets its regulatory obligations. """ executive: NotRequired[bool] """ Whether the person has significant responsibility to control, manage, or direct the organization. """ legal_guardian: NotRequired[bool] """ Whether the person is the legal guardian of the account's representative. """ owner: NotRequired[bool] """ Whether the person is an owner of the account's legal entity. """ percent_ownership: NotRequired["Literal['']|float"] """ The percent owned by the person of the account's legal entity. """ representative: NotRequired[bool] """ Whether the person is authorized as the primary representative of the account. This is the person nominated by the business to provide information about themselves, and general information about the account. There can only be one representative at any given time. At the time the account is created, this person should be set to the person responsible for opening the account. """ title: NotRequired[str] """ The person's title (e.g., CEO, Support Engineer). """ class CreateParamsPersonVerification(TypedDict): additional_document: NotRequired[ "TokenService.CreateParamsPersonVerificationAdditionalDocument" ] """ A document showing address, either a passport, local ID card, or utility bill from a well-known utility company. """ document: NotRequired[ "TokenService.CreateParamsPersonVerificationDocument" ] """ An identifying document, either a passport or local ID card. """ class CreateParamsPersonVerificationAdditionalDocument(TypedDict): back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/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://stripe.com/docs/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 CreateParamsPersonVerificationDocument(TypedDict): back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/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://stripe.com/docs/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 CreateParamsPii(TypedDict): id_number: NotRequired[str] """ The `id_number` for the PII, in string form. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def retrieve( self, token: str, params: "TokenService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Token: """ Retrieves the token with the given ID. """ return cast( Token, self._request( "get", "/v1/tokens/{token}".format(token=sanitize_id(token)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, token: str, params: "TokenService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Token: """ Retrieves the token with the given ID. """ return cast( Token, await self._request_async( "get", "/v1/tokens/{token}".format(token=sanitize_id(token)), api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "TokenService.CreateParams" = {}, options: RequestOptions = {}, ) -> Token: """ Creates a single-use token that represents a bank account's details. You can use this token with any API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a [connected account](https://stripe.com/docs/api#accounts) where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is application, which includes Custom accounts. """ return cast( Token, self._request( "post", "/v1/tokens", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "TokenService.CreateParams" = {}, options: RequestOptions = {}, ) -> Token: """ Creates a single-use token that represents a bank account's details. You can use this token with any API method in place of a bank account dictionary. You can only use this token once. To do so, attach it to a [connected account](https://stripe.com/docs/api#accounts) where [controller.requirement_collection](https://stripe.com/api/accounts/object#account_object-controller-requirement_collection) is application, which includes Custom accounts. """ return cast( Token, await self._request_async( "post", "/v1/tokens", api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_topup.py0000644000175100001770000003647214637354563015726 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._balance_transaction import BalanceTransaction from stripe._source import Source class Topup( CreateableAPIResource["Topup"], ListableAPIResource["Topup"], UpdateableAPIResource["Topup"], ): """ To top up your Stripe balance, you create a top-up object. You can retrieve individual top-ups, as well as list all top-ups. Top-ups are identified by a unique, random ID. Related guide: [Topping up your platform account](https://stripe.com/docs/connect/top-ups) """ OBJECT_NAME: ClassVar[Literal["topup"]] = "topup" class CancelParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CreateParams(RequestOptions): amount: int """ A positive integer representing how much to transfer. """ 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 string attached to the object. Often useful for displaying to users. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ source: NotRequired[str] """ The ID of a source to transfer funds from. For most users, this should be left unspecified which will use the bank account that was set up in the dashboard for the specified currency. In test mode, this can be a test bank token (see [Testing Top-ups](https://stripe.com/docs/connect/testing#testing-top-ups)). """ statement_descriptor: NotRequired[str] """ Extra information about a top-up for the source's bank statement. Limited to 15 ASCII characters. """ transfer_group: NotRequired[str] """ A string that identifies this top-up as part of a group. """ class ListParams(RequestOptions): amount: NotRequired["Topup.ListParamsAmount|int"] """ A positive integer representing how much to transfer. """ created: NotRequired["Topup.ListParamsCreated|int"] """ A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ Literal["canceled", "failed", "pending", "succeeded"] ] """ Only return top-ups that have the given status. One of `canceled`, `failed`, `pending` or `succeeded`. """ class ListParamsAmount(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ amount: int """ Amount transferred. """ balance_transaction: Optional[ExpandableField["BalanceTransaction"]] """ ID of the balance transaction that describes the impact of this top-up on your account balance. May not be specified depending on status of top-up. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ 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. """ expected_availability_date: Optional[int] """ Date the funds are expected to arrive in your Stripe account for payouts. This factors in delays like weekends or bank holidays. May not be specified depending on status of top-up. """ failure_code: Optional[str] """ Error code explaining reason for top-up failure if available (see [the errors section](https://stripe.com/docs/api#errors) for a list of codes). """ failure_message: Optional[str] """ Message to user further explaining reason for top-up failure if available. """ id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ metadata: Dict[str, str] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ object: Literal["topup"] """ String representing the object's type. Objects of the same type share the same value. """ source: Optional["Source"] """ The source field is deprecated. It might not always be present in the API response. """ statement_descriptor: Optional[str] """ Extra information about a top-up. This will appear on your source's bank statement. It must contain at least one letter. """ status: Literal["canceled", "failed", "pending", "reversed", "succeeded"] """ The status of the top-up is either `canceled`, `failed`, `pending`, `reversed`, or `succeeded`. """ transfer_group: Optional[str] """ A string that identifies this top-up as part of a group. """ @classmethod def _cls_cancel( cls, topup: str, **params: Unpack["Topup.CancelParams"] ) -> "Topup": """ Cancels a top-up. Only pending top-ups can be canceled. """ return cast( "Topup", cls._static_request( "post", "/v1/topups/{topup}/cancel".format(topup=sanitize_id(topup)), params=params, ), ) @overload @staticmethod def cancel(topup: str, **params: Unpack["Topup.CancelParams"]) -> "Topup": """ Cancels a top-up. Only pending top-ups can be canceled. """ ... @overload def cancel(self, **params: Unpack["Topup.CancelParams"]) -> "Topup": """ Cancels a top-up. Only pending top-ups can be canceled. """ ... @class_method_variant("_cls_cancel") def cancel( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Topup.CancelParams"] ) -> "Topup": """ Cancels a top-up. Only pending top-ups can be canceled. """ return cast( "Topup", self._request( "post", "/v1/topups/{topup}/cancel".format( topup=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_cancel_async( cls, topup: str, **params: Unpack["Topup.CancelParams"] ) -> "Topup": """ Cancels a top-up. Only pending top-ups can be canceled. """ return cast( "Topup", await cls._static_request_async( "post", "/v1/topups/{topup}/cancel".format(topup=sanitize_id(topup)), params=params, ), ) @overload @staticmethod async def cancel_async( topup: str, **params: Unpack["Topup.CancelParams"] ) -> "Topup": """ Cancels a top-up. Only pending top-ups can be canceled. """ ... @overload async def cancel_async( self, **params: Unpack["Topup.CancelParams"] ) -> "Topup": """ Cancels a top-up. Only pending top-ups can be canceled. """ ... @class_method_variant("_cls_cancel_async") async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Topup.CancelParams"] ) -> "Topup": """ Cancels a top-up. Only pending top-ups can be canceled. """ return cast( "Topup", await self._request_async( "post", "/v1/topups/{topup}/cancel".format( topup=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def create(cls, **params: Unpack["Topup.CreateParams"]) -> "Topup": """ Top up the balance of an account """ return cast( "Topup", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["Topup.CreateParams"] ) -> "Topup": """ Top up the balance of an account """ return cast( "Topup", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def list(cls, **params: Unpack["Topup.ListParams"]) -> ListObject["Topup"]: """ Returns a list of top-ups. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["Topup.ListParams"] ) -> ListObject["Topup"]: """ Returns a list of top-ups. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def modify( cls, id: str, **params: Unpack["Topup.ModifyParams"] ) -> "Topup": """ Updates the metadata of a top-up. Other top-up details are not editable by design. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Topup", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["Topup.ModifyParams"] ) -> "Topup": """ Updates the metadata of a top-up. Other top-up details are not editable by design. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Topup", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["Topup.RetrieveParams"] ) -> "Topup": """ Retrieves the details of a top-up that has previously been created. Supply the unique top-up ID that was returned from your previous request, and Stripe will return the corresponding top-up information. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["Topup.RetrieveParams"] ) -> "Topup": """ Retrieves the details of a top-up that has previously been created. Supply the unique top-up ID that was returned from your previous request, and Stripe will return the corresponding top-up information. """ instance = cls(id, **params) await instance.refresh_async() return instance ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_topup_service.py0000644000175100001770000002650114637354563017436 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._topup import Topup from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class TopupService(StripeService): class CancelParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CreateParams(TypedDict): amount: int """ A positive integer representing how much to transfer. """ 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 string attached to the object. Often useful for displaying to users. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ source: NotRequired[str] """ The ID of a source to transfer funds from. For most users, this should be left unspecified which will use the bank account that was set up in the dashboard for the specified currency. In test mode, this can be a test bank token (see [Testing Top-ups](https://stripe.com/docs/connect/testing#testing-top-ups)). """ statement_descriptor: NotRequired[str] """ Extra information about a top-up for the source's bank statement. Limited to 15 ASCII characters. """ transfer_group: NotRequired[str] """ A string that identifies this top-up as part of a group. """ class ListParams(TypedDict): amount: NotRequired["TopupService.ListParamsAmount|int"] """ A positive integer representing how much to transfer. """ created: NotRequired["TopupService.ListParamsCreated|int"] """ A filter on the list, based on the object `created` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with a number of different query options. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ Literal["canceled", "failed", "pending", "succeeded"] ] """ Only return top-ups that have the given status. One of `canceled`, `failed`, `pending` or `succeeded`. """ class ListParamsAmount(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ def list( self, params: "TopupService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Topup]: """ Returns a list of top-ups. """ return cast( ListObject[Topup], self._request( "get", "/v1/topups", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "TopupService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Topup]: """ Returns a list of top-ups. """ return cast( ListObject[Topup], await self._request_async( "get", "/v1/topups", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "TopupService.CreateParams", options: RequestOptions = {} ) -> Topup: """ Top up the balance of an account """ return cast( Topup, self._request( "post", "/v1/topups", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "TopupService.CreateParams", options: RequestOptions = {} ) -> Topup: """ Top up the balance of an account """ return cast( Topup, await self._request_async( "post", "/v1/topups", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, topup: str, params: "TopupService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Topup: """ Retrieves the details of a top-up that has previously been created. Supply the unique top-up ID that was returned from your previous request, and Stripe will return the corresponding top-up information. """ return cast( Topup, self._request( "get", "/v1/topups/{topup}".format(topup=sanitize_id(topup)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, topup: str, params: "TopupService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Topup: """ Retrieves the details of a top-up that has previously been created. Supply the unique top-up ID that was returned from your previous request, and Stripe will return the corresponding top-up information. """ return cast( Topup, await self._request_async( "get", "/v1/topups/{topup}".format(topup=sanitize_id(topup)), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, topup: str, params: "TopupService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Topup: """ Updates the metadata of a top-up. Other top-up details are not editable by design. """ return cast( Topup, self._request( "post", "/v1/topups/{topup}".format(topup=sanitize_id(topup)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, topup: str, params: "TopupService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Topup: """ Updates the metadata of a top-up. Other top-up details are not editable by design. """ return cast( Topup, await self._request_async( "post", "/v1/topups/{topup}".format(topup=sanitize_id(topup)), api_mode="V1", base_address="api", params=params, options=options, ), ) def cancel( self, topup: str, params: "TopupService.CancelParams" = {}, options: RequestOptions = {}, ) -> Topup: """ Cancels a top-up. Only pending top-ups can be canceled. """ return cast( Topup, self._request( "post", "/v1/topups/{topup}/cancel".format(topup=sanitize_id(topup)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def cancel_async( self, topup: str, params: "TopupService.CancelParams" = {}, options: RequestOptions = {}, ) -> Topup: """ Cancels a top-up. Only pending top-ups can be canceled. """ return cast( Topup, await self._request_async( "post", "/v1/topups/{topup}/cancel".format(topup=sanitize_id(topup)), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_transfer.py0000644000175100001770000005577014637354563016405 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._nested_resource_class_methods import nested_resource_class_methods from stripe._request_options import RequestOptions from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import sanitize_id from typing import ClassVar, Dict, List, Optional, cast from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._account import Account from stripe._balance_transaction import BalanceTransaction from stripe._charge import Charge from stripe._reversal import Reversal @nested_resource_class_methods("reversal") class Transfer( CreateableAPIResource["Transfer"], ListableAPIResource["Transfer"], UpdateableAPIResource["Transfer"], ): """ A `Transfer` object is created when you move funds between Stripe accounts as part of Connect. 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://stripe.com/docs/api#payout_object) object, with corresponding payout endpoints. For more information, read about the [transfer/payout split](https://stripe.com/docs/transfer-payout-split). Related guide: [Creating separate charges and transfers](https://stripe.com/docs/connect/separate-charges-and-transfers) """ OBJECT_NAME: ClassVar[Literal["transfer"]] = "transfer" class CreateParams(RequestOptions): amount: NotRequired[int] """ A positive integer in cents (or local equivalent) representing how much to transfer. """ currency: str """ 3-letter [ISO code for currency](https://stripe.com/docs/payouts). """ description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ destination: str """ The ID of a connected Stripe account. [See the Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ source_transaction: NotRequired[str] """ You can use this parameter to transfer funds from a charge before they are added to your available balance. A pending balance will transfer immediately but the funds will not become available until the original charge becomes available. [See the Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-availability) for details. """ source_type: NotRequired[Literal["bank_account", "card", "fpx"]] """ The source balance to use for this transfer. One of `bank_account`, `card`, or `fpx`. For most users, this will default to `card`. """ transfer_group: NotRequired[str] """ A string that identifies this transaction as part of a group. See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details. """ class CreateReversalParams(RequestOptions): amount: NotRequired[int] """ A positive integer in cents (or local equivalent) representing how much of this transfer to reverse. Can only reverse up to the unreversed amount remaining of the transfer. Partial transfer reversals are only allowed for transfers to Stripe Accounts. Defaults to the entire transfer amount. """ description: NotRequired[str] """ An arbitrary string which you can attach to a reversal object. This will be unset if you POST an empty value. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ refund_application_fee: NotRequired[bool] """ Boolean indicating whether the application fee should be refunded when reversing this transfer. If a full transfer reversal is given, the full application fee will be refunded. Otherwise, the application fee will be refunded with an amount proportional to the amount of the transfer reversed. """ class ListParams(RequestOptions): created: NotRequired["Transfer.ListParamsCreated|int"] """ Only return transfers that were created during the given date interval. """ destination: NotRequired[str] """ Only return transfers for the destination specified by this account ID. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ transfer_group: NotRequired[str] """ Only return transfers with the specified transfer group. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListReversalsParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ModifyParams(RequestOptions): description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ class ModifyReversalParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveReversalParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ amount: int """ Amount in cents (or local equivalent) to be transferred. """ amount_reversed: int """ Amount in cents (or local equivalent) reversed (can be less than the amount attribute on the transfer if a partial reversal was issued). """ balance_transaction: Optional[ExpandableField["BalanceTransaction"]] """ Balance transaction that describes the impact of this transfer on your account balance. """ created: int """ Time that this record of the transfer was first created. """ 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. """ destination: Optional[ExpandableField["Account"]] """ ID of the Stripe account the transfer was sent to. """ destination_payment: Optional[ExpandableField["Charge"]] """ If the destination is a Stripe account, this will be the ID of the payment that the destination account received for the transfer. """ id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ metadata: Dict[str, str] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ object: Literal["transfer"] """ String representing the object's type. Objects of the same type share the same value. """ reversals: ListObject["Reversal"] """ A list of reversals that have been applied to the transfer. """ reversed: bool """ Whether the transfer has been fully reversed. If the transfer is only partially reversed, this attribute will still be false. """ source_transaction: Optional[ExpandableField["Charge"]] """ ID of the charge or payment that was used to fund the transfer. If null, the transfer was funded from the available balance. """ source_type: Optional[str] """ The source balance this transfer came from. One of `card`, `fpx`, or `bank_account`. """ transfer_group: Optional[str] """ A string that identifies this transaction as part of a group. See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details. """ @classmethod def create(cls, **params: Unpack["Transfer.CreateParams"]) -> "Transfer": """ To send funds from your Stripe account to a connected account, you create a new transfer object. Your [Stripe balance](https://stripe.com/docs/api#balance) must be able to cover the transfer amount, or you'll receive an “Insufficient Funds” error. """ return cast( "Transfer", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["Transfer.CreateParams"] ) -> "Transfer": """ To send funds from your Stripe account to a connected account, you create a new transfer object. Your [Stripe balance](https://stripe.com/docs/api#balance) must be able to cover the transfer amount, or you'll receive an “Insufficient Funds” error. """ return cast( "Transfer", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def list( cls, **params: Unpack["Transfer.ListParams"] ) -> ListObject["Transfer"]: """ Returns a list of existing transfers sent to connected accounts. The transfers are returned in sorted order, with the most recently created transfers appearing first. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["Transfer.ListParams"] ) -> ListObject["Transfer"]: """ Returns a list of existing transfers sent to connected accounts. The transfers are returned in sorted order, with the most recently created transfers appearing first. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def modify( cls, id: str, **params: Unpack["Transfer.ModifyParams"] ) -> "Transfer": """ Updates the specified transfer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. This request accepts only metadata as an argument. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Transfer", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["Transfer.ModifyParams"] ) -> "Transfer": """ Updates the specified transfer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. This request accepts only metadata as an argument. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Transfer", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["Transfer.RetrieveParams"] ) -> "Transfer": """ Retrieves the details of an existing transfer. Supply the unique transfer ID from either a transfer creation request or the transfer list, and Stripe will return the corresponding transfer information. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["Transfer.RetrieveParams"] ) -> "Transfer": """ Retrieves the details of an existing transfer. Supply the unique transfer ID from either a transfer creation request or the transfer list, and Stripe will return the corresponding transfer information. """ instance = cls(id, **params) await instance.refresh_async() return instance @classmethod def create_reversal( cls, id: str, **params: Unpack["Transfer.CreateReversalParams"] ) -> "Reversal": """ When you create a new reversal, you must specify a transfer to create it on. When reversing transfers, you can optionally reverse part of the transfer. You can do so as many times as you wish until the entire transfer has been reversed. Once entirely reversed, a transfer can't be reversed again. This method will return an error when called on an already-reversed transfer, or when trying to reverse more money than is left on a transfer. """ return cast( "Reversal", cls._static_request( "post", "/v1/transfers/{id}/reversals".format(id=sanitize_id(id)), params=params, ), ) @classmethod async def create_reversal_async( cls, id: str, **params: Unpack["Transfer.CreateReversalParams"] ) -> "Reversal": """ When you create a new reversal, you must specify a transfer to create it on. When reversing transfers, you can optionally reverse part of the transfer. You can do so as many times as you wish until the entire transfer has been reversed. Once entirely reversed, a transfer can't be reversed again. This method will return an error when called on an already-reversed transfer, or when trying to reverse more money than is left on a transfer. """ return cast( "Reversal", await cls._static_request_async( "post", "/v1/transfers/{id}/reversals".format(id=sanitize_id(id)), params=params, ), ) @classmethod def retrieve_reversal( cls, transfer: str, id: str, **params: Unpack["Transfer.RetrieveReversalParams"], ) -> "Reversal": """ By default, you can see the 10 most recent reversals stored directly on the transfer object, but you can also retrieve details about a specific reversal stored on the transfer. """ return cast( "Reversal", cls._static_request( "get", "/v1/transfers/{transfer}/reversals/{id}".format( transfer=sanitize_id(transfer), id=sanitize_id(id) ), params=params, ), ) @classmethod async def retrieve_reversal_async( cls, transfer: str, id: str, **params: Unpack["Transfer.RetrieveReversalParams"], ) -> "Reversal": """ By default, you can see the 10 most recent reversals stored directly on the transfer object, but you can also retrieve details about a specific reversal stored on the transfer. """ return cast( "Reversal", await cls._static_request_async( "get", "/v1/transfers/{transfer}/reversals/{id}".format( transfer=sanitize_id(transfer), id=sanitize_id(id) ), params=params, ), ) @classmethod def modify_reversal( cls, transfer: str, id: str, **params: Unpack["Transfer.ModifyReversalParams"], ) -> "Reversal": """ Updates the specified reversal by setting the values of the parameters passed. Any parameters not provided will be left unchanged. This request only accepts metadata and description as arguments. """ return cast( "Reversal", cls._static_request( "post", "/v1/transfers/{transfer}/reversals/{id}".format( transfer=sanitize_id(transfer), id=sanitize_id(id) ), params=params, ), ) @classmethod async def modify_reversal_async( cls, transfer: str, id: str, **params: Unpack["Transfer.ModifyReversalParams"], ) -> "Reversal": """ Updates the specified reversal by setting the values of the parameters passed. Any parameters not provided will be left unchanged. This request only accepts metadata and description as arguments. """ return cast( "Reversal", await cls._static_request_async( "post", "/v1/transfers/{transfer}/reversals/{id}".format( transfer=sanitize_id(transfer), id=sanitize_id(id) ), params=params, ), ) @classmethod def list_reversals( cls, id: str, **params: Unpack["Transfer.ListReversalsParams"] ) -> ListObject["Reversal"]: """ You can see a list of the reversals belonging to a specific transfer. Note that the 10 most recent reversals are always available by default on the transfer object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional reversals. """ return cast( ListObject["Reversal"], cls._static_request( "get", "/v1/transfers/{id}/reversals".format(id=sanitize_id(id)), params=params, ), ) @classmethod async def list_reversals_async( cls, id: str, **params: Unpack["Transfer.ListReversalsParams"] ) -> ListObject["Reversal"]: """ You can see a list of the reversals belonging to a specific transfer. Note that the 10 most recent reversals are always available by default on the transfer object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional reversals. """ return cast( ListObject["Reversal"], await cls._static_request_async( "get", "/v1/transfers/{id}/reversals".format(id=sanitize_id(id)), params=params, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_transfer_reversal_service.py0000644000175100001770000002514114637354563022015 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._reversal import Reversal from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class TransferReversalService(StripeService): class CreateParams(TypedDict): amount: NotRequired[int] """ A positive integer in cents (or local equivalent) representing how much of this transfer to reverse. Can only reverse up to the unreversed amount remaining of the transfer. Partial transfer reversals are only allowed for transfers to Stripe Accounts. Defaults to the entire transfer amount. """ description: NotRequired[str] """ An arbitrary string which you can attach to a reversal object. This will be unset if you POST an empty value. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ refund_application_fee: NotRequired[bool] """ Boolean indicating whether the application fee should be refunded when reversing this transfer. If a full transfer reversal is given, the full application fee will be refunded. Otherwise, the application fee will be refunded with an amount proportional to the amount of the transfer reversed. """ class ListParams(TypedDict): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ def list( self, id: str, params: "TransferReversalService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Reversal]: """ You can see a list of the reversals belonging to a specific transfer. Note that the 10 most recent reversals are always available by default on the transfer object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional reversals. """ return cast( ListObject[Reversal], self._request( "get", "/v1/transfers/{id}/reversals".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, id: str, params: "TransferReversalService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Reversal]: """ You can see a list of the reversals belonging to a specific transfer. Note that the 10 most recent reversals are always available by default on the transfer object. If you need more than those 10, you can use this API method and the limit and starting_after parameters to page through additional reversals. """ return cast( ListObject[Reversal], await self._request_async( "get", "/v1/transfers/{id}/reversals".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, id: str, params: "TransferReversalService.CreateParams" = {}, options: RequestOptions = {}, ) -> Reversal: """ When you create a new reversal, you must specify a transfer to create it on. When reversing transfers, you can optionally reverse part of the transfer. You can do so as many times as you wish until the entire transfer has been reversed. Once entirely reversed, a transfer can't be reversed again. This method will return an error when called on an already-reversed transfer, or when trying to reverse more money than is left on a transfer. """ return cast( Reversal, self._request( "post", "/v1/transfers/{id}/reversals".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, id: str, params: "TransferReversalService.CreateParams" = {}, options: RequestOptions = {}, ) -> Reversal: """ When you create a new reversal, you must specify a transfer to create it on. When reversing transfers, you can optionally reverse part of the transfer. You can do so as many times as you wish until the entire transfer has been reversed. Once entirely reversed, a transfer can't be reversed again. This method will return an error when called on an already-reversed transfer, or when trying to reverse more money than is left on a transfer. """ return cast( Reversal, await self._request_async( "post", "/v1/transfers/{id}/reversals".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, transfer: str, id: str, params: "TransferReversalService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Reversal: """ By default, you can see the 10 most recent reversals stored directly on the transfer object, but you can also retrieve details about a specific reversal stored on the transfer. """ return cast( Reversal, self._request( "get", "/v1/transfers/{transfer}/reversals/{id}".format( transfer=sanitize_id(transfer), id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, transfer: str, id: str, params: "TransferReversalService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Reversal: """ By default, you can see the 10 most recent reversals stored directly on the transfer object, but you can also retrieve details about a specific reversal stored on the transfer. """ return cast( Reversal, await self._request_async( "get", "/v1/transfers/{transfer}/reversals/{id}".format( transfer=sanitize_id(transfer), id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, transfer: str, id: str, params: "TransferReversalService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Reversal: """ Updates the specified reversal by setting the values of the parameters passed. Any parameters not provided will be left unchanged. This request only accepts metadata and description as arguments. """ return cast( Reversal, self._request( "post", "/v1/transfers/{transfer}/reversals/{id}".format( transfer=sanitize_id(transfer), id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, transfer: str, id: str, params: "TransferReversalService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Reversal: """ Updates the specified reversal by setting the values of the parameters passed. Any parameters not provided will be left unchanged. This request only accepts metadata and description as arguments. """ return cast( Reversal, await self._request_async( "post", "/v1/transfers/{transfer}/reversals/{id}".format( transfer=sanitize_id(transfer), id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_transfer_service.py0000644000175100001770000002631214637354563020113 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._transfer import Transfer from stripe._transfer_reversal_service import TransferReversalService from stripe._util import sanitize_id from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class TransferService(StripeService): def __init__(self, requestor): super().__init__(requestor) self.reversals = TransferReversalService(self._requestor) class CreateParams(TypedDict): amount: NotRequired[int] """ A positive integer in cents (or local equivalent) representing how much to transfer. """ currency: str """ 3-letter [ISO code for currency](https://stripe.com/docs/payouts). """ description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ destination: str """ The ID of a connected Stripe account. [See the Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ source_transaction: NotRequired[str] """ You can use this parameter to transfer funds from a charge before they are added to your available balance. A pending balance will transfer immediately but the funds will not become available until the original charge becomes available. [See the Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-availability) for details. """ source_type: NotRequired[Literal["bank_account", "card", "fpx"]] """ The source balance to use for this transfer. One of `bank_account`, `card`, or `fpx`. For most users, this will default to `card`. """ transfer_group: NotRequired[str] """ A string that identifies this transaction as part of a group. See the [Connect documentation](https://stripe.com/docs/connect/separate-charges-and-transfers#transfer-options) for details. """ class ListParams(TypedDict): created: NotRequired["TransferService.ListParamsCreated|int"] """ Only return transfers that were created during the given date interval. """ destination: NotRequired[str] """ Only return transfers for the destination specified by this account ID. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ transfer_group: NotRequired[str] """ Only return transfers with the specified transfer group. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ def list( self, params: "TransferService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Transfer]: """ Returns a list of existing transfers sent to connected accounts. The transfers are returned in sorted order, with the most recently created transfers appearing first. """ return cast( ListObject[Transfer], self._request( "get", "/v1/transfers", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "TransferService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Transfer]: """ Returns a list of existing transfers sent to connected accounts. The transfers are returned in sorted order, with the most recently created transfers appearing first. """ return cast( ListObject[Transfer], await self._request_async( "get", "/v1/transfers", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "TransferService.CreateParams", options: RequestOptions = {}, ) -> Transfer: """ To send funds from your Stripe account to a connected account, you create a new transfer object. Your [Stripe balance](https://stripe.com/docs/api#balance) must be able to cover the transfer amount, or you'll receive an “Insufficient Funds” error. """ return cast( Transfer, self._request( "post", "/v1/transfers", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "TransferService.CreateParams", options: RequestOptions = {}, ) -> Transfer: """ To send funds from your Stripe account to a connected account, you create a new transfer object. Your [Stripe balance](https://stripe.com/docs/api#balance) must be able to cover the transfer amount, or you'll receive an “Insufficient Funds” error. """ return cast( Transfer, await self._request_async( "post", "/v1/transfers", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, transfer: str, params: "TransferService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Transfer: """ Retrieves the details of an existing transfer. Supply the unique transfer ID from either a transfer creation request or the transfer list, and Stripe will return the corresponding transfer information. """ return cast( Transfer, self._request( "get", "/v1/transfers/{transfer}".format( transfer=sanitize_id(transfer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, transfer: str, params: "TransferService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Transfer: """ Retrieves the details of an existing transfer. Supply the unique transfer ID from either a transfer creation request or the transfer list, and Stripe will return the corresponding transfer information. """ return cast( Transfer, await self._request_async( "get", "/v1/transfers/{transfer}".format( transfer=sanitize_id(transfer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, transfer: str, params: "TransferService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Transfer: """ Updates the specified transfer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. This request accepts only metadata as an argument. """ return cast( Transfer, self._request( "post", "/v1/transfers/{transfer}".format( transfer=sanitize_id(transfer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, transfer: str, params: "TransferService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Transfer: """ Updates the specified transfer by setting the values of the parameters passed. Any parameters not provided will be left unchanged. This request accepts only metadata as an argument. """ return cast( Transfer, await self._request_async( "post", "/v1/transfers/{transfer}".format( transfer=sanitize_id(transfer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_treasury_service.py0000644000175100001770000000323614637354563020145 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_service import StripeService from stripe.treasury._credit_reversal_service import CreditReversalService from stripe.treasury._debit_reversal_service import DebitReversalService from stripe.treasury._financial_account_service import FinancialAccountService from stripe.treasury._inbound_transfer_service import InboundTransferService from stripe.treasury._outbound_payment_service import OutboundPaymentService from stripe.treasury._outbound_transfer_service import OutboundTransferService from stripe.treasury._received_credit_service import ReceivedCreditService from stripe.treasury._received_debit_service import ReceivedDebitService from stripe.treasury._transaction_entry_service import TransactionEntryService from stripe.treasury._transaction_service import TransactionService class TreasuryService(StripeService): def __init__(self, requestor): super().__init__(requestor) self.credit_reversals = CreditReversalService(self._requestor) self.debit_reversals = DebitReversalService(self._requestor) self.financial_accounts = FinancialAccountService(self._requestor) self.inbound_transfers = InboundTransferService(self._requestor) self.outbound_payments = OutboundPaymentService(self._requestor) self.outbound_transfers = OutboundTransferService(self._requestor) self.received_credits = ReceivedCreditService(self._requestor) self.received_debits = ReceivedDebitService(self._requestor) self.transactions = TransactionService(self._requestor) self.transaction_entries = TransactionEntryService(self._requestor) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_updateable_api_resource.py0000644000175100001770000000214614637354563021414 0ustar00runnerdockerfrom stripe import _util from stripe._api_resource import APIResource from urllib.parse import quote_plus from typing import TypeVar, cast from stripe._stripe_object import StripeObject T = TypeVar("T", bound=StripeObject) class UpdateableAPIResource(APIResource[T]): @classmethod def modify(cls, sid, **params) -> T: url = "%s/%s" % (cls.class_url(), quote_plus(sid)) return cast(T, cls._static_request("post", url, params=params)) @_util.deprecated( "The `save` method is deprecated and will be removed in a future major version of the library. Use the class method `modify` on the resource instead." ) def save(self, idempotency_key=None): updated_params = self.serialize(None) if updated_params: updated_params["idempotency_key"] = idempotency_key self._request_and_refresh( "post", self.instance_url(), params=updated_params, usage=["save"], ) else: _util.logger.debug("Trying to save already saved object %r", self) return self ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_usage_record.py0000644000175100001770000000344014637354563017206 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from typing import ClassVar from typing_extensions import Literal class UsageRecord(CreateableAPIResource["UsageRecord"]): """ Usage records allow you to report customer usage and metrics to Stripe for metered billing of subscription prices. Related guide: [Metered billing](https://stripe.com/docs/billing/subscriptions/metered-billing) This is our legacy usage-based billing API. See the [updated usage-based billing docs](https://docs.stripe.com/billing/subscriptions/usage-based). """ OBJECT_NAME: ClassVar[Literal["usage_record"]] = "usage_record" id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ object: Literal["usage_record"] """ String representing the object's type. Objects of the same type share the same value. """ quantity: int """ The usage quantity for the specified date. """ subscription_item: str """ The ID of the subscription item this usage record contains data for. """ timestamp: int """ The timestamp when this usage occurred. """ @classmethod def create(cls, **params): if "subscription_item" not in params: raise ValueError("Params must have a subscription_item key") subscription_item = params.pop("subscription_item") url = "/v1/subscription_items/%s/usage_records" % subscription_item return cls._static_request( "post", url, params=params, base_address="api", api_mode="V1", ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_usage_record_summary.py0000644000175100001770000000255614637354563020772 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject from typing import ClassVar, Optional from typing_extensions import Literal class UsageRecordSummary(StripeObject): OBJECT_NAME: ClassVar[Literal["usage_record_summary"]] = ( "usage_record_summary" ) class Period(StripeObject): end: Optional[int] """ The end date of this usage period. All usage up to and including this point in time is included. """ start: Optional[int] """ The start date of this usage period. All usage after this point in time is included. """ id: str """ Unique identifier for the object. """ invoice: Optional[str] """ The invoice in which this usage period has been billed for. """ 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["usage_record_summary"] """ String representing the object's type. Objects of the same type share the same value. """ period: Period subscription_item: str """ The ID of the subscription item this summary is describing. """ total_usage: int """ The total usage within this usage period. """ _inner_class_types = {"period": Period} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_util.py0000644000175100001770000003110014637354563015513 0ustar00runnerdockerimport functools import hmac import io # noqa: F401 import logging import sys import os import re import warnings from stripe._api_mode import ApiMode from urllib.parse import parse_qsl, quote_plus # noqa: F401 from typing_extensions import Type, TYPE_CHECKING from typing import ( Callable, TypeVar, Union, overload, Dict, List, cast, Any, Optional, Mapping, ) import typing_extensions # Used for global variables import stripe # noqa: IMP101 if TYPE_CHECKING: from stripe._stripe_response import StripeResponse from stripe._stripe_object import StripeObject from stripe._api_requestor import _APIRequestor STRIPE_LOG = os.environ.get("STRIPE_LOG") logger: logging.Logger = logging.getLogger("stripe") if TYPE_CHECKING: deprecated = typing_extensions.deprecated else: _T = TypeVar("_T") # Copied from python/typing_extensions, as this was added in typing_extensions 4.5.0 which is incompatible with # python 3.6. We still need `deprecated = typing_extensions.deprecated` in addition to this fallback, as # IDEs (pylance) specially detect references to symbols defined in `typing_extensions` # # https://github.com/python/typing_extensions/blob/5d20e9eed31de88667542ba5a6f66e6dc439b681/src/typing_extensions.py#L2289-L2370 def deprecated( __msg: str, *, category: Optional[Type[Warning]] = DeprecationWarning, stacklevel: int = 1, ) -> Callable[[_T], _T]: def decorator(__arg: _T) -> _T: if category is None: __arg.__deprecated__ = __msg return __arg elif isinstance(__arg, type): original_new = __arg.__new__ has_init = __arg.__init__ is not object.__init__ @functools.wraps(original_new) def __new__(cls, *args, **kwargs): warnings.warn( __msg, category=category, stacklevel=stacklevel + 1 ) if original_new is not object.__new__: return original_new(cls, *args, **kwargs) # Mirrors a similar check in object.__new__. elif not has_init and (args or kwargs): raise TypeError(f"{cls.__name__}() takes no arguments") else: return original_new(cls) __arg.__new__ = staticmethod(__new__) __arg.__deprecated__ = __new__.__deprecated__ = __msg return __arg elif callable(__arg): @functools.wraps(__arg) def wrapper(*args, **kwargs): warnings.warn( __msg, category=category, stacklevel=stacklevel + 1 ) return __arg(*args, **kwargs) __arg.__deprecated__ = wrapper.__deprecated__ = __msg return wrapper else: raise TypeError( "@deprecated decorator with non-None category must be applied to " f"a class or callable, not {__arg!r}" ) return decorator def is_appengine_dev(): return "APPENGINE_RUNTIME" in os.environ and "Dev" in os.environ.get( "SERVER_SOFTWARE", "" ) def _console_log_level(): if stripe.log in ["debug", "info"]: return stripe.log elif STRIPE_LOG in ["debug", "info"]: return STRIPE_LOG else: return None def log_debug(message, **params): msg = logfmt(dict(message=message, **params)) if _console_log_level() == "debug": print(msg, file=sys.stderr) logger.debug(msg) def log_info(message, **params): msg = logfmt(dict(message=message, **params)) if _console_log_level() in ["debug", "info"]: print(msg, file=sys.stderr) logger.info(msg) def _test_or_live_environment(): if stripe.api_key is None: return match = re.match(r"sk_(live|test)_", stripe.api_key) if match is None: return return match.groups()[0] def dashboard_link(request_id): return "https://dashboard.stripe.com/{env}/logs/{reqid}".format( env=_test_or_live_environment() or "test", reqid=request_id ) def logfmt(props): def fmt(key, val): # Handle case where val is a bytes or bytesarray if hasattr(val, "decode"): val = val.decode("utf-8") # Check if val is already a string to avoid re-encoding into # ascii. Since the code is sent through 2to3, we can't just # use unicode(val, encoding='utf8') since it will be # translated incorrectly. if not isinstance(val, str): val = str(val) if re.search(r"\s", val): val = repr(val) # key should already be a string if re.search(r"\s", key): key = repr(key) return "{key}={val}".format(key=key, val=val) return " ".join([fmt(key, val) for key, val in sorted(props.items())]) # Borrowed from Django's source code if hasattr(hmac, "compare_digest"): # Prefer the stdlib implementation, when available. def secure_compare(val1, val2): return hmac.compare_digest(val1, val2) else: def secure_compare(val1, val2): """ Returns True if the two strings are equal, False otherwise. The time taken is independent of the number of characters that match. For the sake of simplicity, this function executes in constant time only when the two strings have the same length. It short-circuits when they have different lengths. """ if len(val1) != len(val2): return False result = 0 if isinstance(val1, bytes) and isinstance(val2, bytes): for x, y in zip(val1, val2): result |= x ^ y else: for x, y in zip(val1, val2): result |= ord(cast(str, x)) ^ ord(cast(str, y)) return result == 0 def get_object_classes(): # This is here to avoid a circular dependency from stripe._object_classes import OBJECT_CLASSES return OBJECT_CLASSES Resp = Union["StripeResponse", Dict[str, Any], List["Resp"]] @overload def convert_to_stripe_object( resp: Union["StripeResponse", Dict[str, Any]], api_key: Optional[str] = None, stripe_version: Optional[str] = None, stripe_account: Optional[str] = None, params: Optional[Mapping[str, Any]] = None, klass_: Optional[Type["StripeObject"]] = None, *, api_mode: ApiMode = "V1", ) -> "StripeObject": ... @overload def convert_to_stripe_object( resp: List[Resp], api_key: Optional[str] = None, stripe_version: Optional[str] = None, stripe_account: Optional[str] = None, params: Optional[Mapping[str, Any]] = None, klass_: Optional[Type["StripeObject"]] = None, *, api_mode: ApiMode = "V1", ) -> List["StripeObject"]: ... def convert_to_stripe_object( resp: Resp, api_key: Optional[str] = None, stripe_version: Optional[str] = None, stripe_account: Optional[str] = None, params: Optional[Mapping[str, Any]] = None, klass_: Optional[Type["StripeObject"]] = None, *, api_mode: ApiMode = "V1", ) -> Union["StripeObject", List["StripeObject"]]: from stripe._api_requestor import _APIRequestor return _convert_to_stripe_object( resp=resp, params=params, klass_=klass_, requestor=_APIRequestor._global_with_options( api_key=api_key, stripe_version=stripe_version, stripe_account=stripe_account, ), api_mode=api_mode, ) @overload def _convert_to_stripe_object( *, resp: Union["StripeResponse", Dict[str, Any]], params: Optional[Mapping[str, Any]] = None, klass_: Optional[Type["StripeObject"]] = None, requestor: "_APIRequestor", api_mode: ApiMode, ) -> "StripeObject": ... @overload def _convert_to_stripe_object( *, resp: List[Resp], params: Optional[Mapping[str, Any]] = None, klass_: Optional[Type["StripeObject"]] = None, requestor: "_APIRequestor", api_mode: ApiMode, ) -> List["StripeObject"]: ... def _convert_to_stripe_object( *, resp: Resp, params: Optional[Mapping[str, Any]] = None, klass_: Optional[Type["StripeObject"]] = None, requestor: "_APIRequestor", api_mode: ApiMode, ) -> Union["StripeObject", List["StripeObject"]]: # If we get a StripeResponse, we'll want to return a # StripeObject with the last_response field filled out with # the raw API response information stripe_response = None # Imports here at runtime to avoid circular dependencies from stripe._stripe_response import StripeResponse from stripe._stripe_object import StripeObject if isinstance(resp, StripeResponse): stripe_response = resp resp = cast(Resp, stripe_response.data) if isinstance(resp, list): return [ _convert_to_stripe_object( resp=cast("Union[StripeResponse, Dict[str, Any]]", i), requestor=requestor, api_mode=api_mode, klass_=klass_, ) for i in resp ] elif isinstance(resp, dict) and not isinstance(resp, StripeObject): resp = resp.copy() klass_name = resp.get("object") if isinstance(klass_name, str): klass = get_object_classes().get(klass_name, StripeObject) elif klass_ is not None: klass = klass_ else: klass = StripeObject obj = klass._construct_from( values=resp, last_response=stripe_response, requestor=requestor, api_mode=api_mode, ) # We only need to update _retrieve_params when special params were # actually passed. Otherwise, leave it as is as the list / search result # constructors will instantiate their own params. if ( params is not None and hasattr(obj, "object") and ( (getattr(obj, "object") == "list") or (getattr(obj, "object") == "search_result") ) ): obj._retrieve_params = params return obj else: return cast("StripeObject", resp) def convert_to_dict(obj): """Converts a StripeObject back to a regular dict. Nested StripeObjects are also converted back to regular dicts. :param obj: The StripeObject to convert. :returns: The StripeObject as a dict. """ if isinstance(obj, list): return [convert_to_dict(i) for i in obj] # This works by virtue of the fact that StripeObjects _are_ dicts. The dict # comprehension returns a regular dict and recursively applies the # conversion to each value. elif isinstance(obj, dict): return {k: convert_to_dict(v) for k, v in obj.items()} else: return obj @overload def populate_headers( idempotency_key: str, ) -> Dict[str, str]: ... @overload def populate_headers(idempotency_key: None) -> None: ... def populate_headers( idempotency_key: Union[str, None], ) -> Union[Dict[str, str], None]: if idempotency_key is not None: return {"Idempotency-Key": idempotency_key} return None T = TypeVar("T") def merge_dicts(x, y): z = x.copy() z.update(y) return z def sanitize_id(id): quotedId = quote_plus(id) return quotedId class class_method_variant(object): def __init__(self, class_method_name): self.class_method_name = class_method_name T = TypeVar("T") method: Any def __call__(self, method: T) -> T: self.method = method return cast(T, self) def __get__(self, obj, objtype: Optional[Type[Any]] = None): @functools.wraps(self.method) def _wrapper(*args, **kwargs): if obj is not None: # Method was called as an instance method, e.g. # instance.method(...) return self.method(obj, *args, **kwargs) elif ( len(args) > 0 and objtype is not None and isinstance(args[0], objtype) ): # Method was called as a class method with the instance as the # first argument, e.g. Class.method(instance, ...) which in # Python is the same thing as calling an instance method return self.method(args[0], *args[1:], **kwargs) else: # Method was called as a class method, e.g. Class.method(...) class_method = getattr(objtype, self.class_method_name) return class_method(*args, **kwargs) return _wrapper ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_verify_mixin.py0000644000175100001770000000075614637354563017263 0ustar00runnerdockerfrom typing import Any, Dict from typing_extensions import Protocol from stripe._stripe_object import StripeObject class _Verifiable(Protocol): def instance_url(self) -> str: ... def _request( self, method: str, url: str, params: Dict[str, Any], ) -> StripeObject: ... class VerifyMixin(object): def verify(self: _Verifiable, **params): url = self.instance_url() + "/verify" return self._request("post", url, params=params) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_version.py0000644000175100001770000000002314637354563016223 0ustar00runnerdockerVERSION = "10.1.0" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_webhook.py0000644000175100001770000000560514637354563016207 0ustar00runnerdockerimport hmac import json import time from collections import OrderedDict from hashlib import sha256 # Used for global variables import stripe # noqa: IMP101 from stripe._event import Event from stripe import _util from stripe._error import SignatureVerificationError from stripe._api_requestor import _APIRequestor class Webhook(object): DEFAULT_TOLERANCE = 300 @staticmethod def construct_event( payload, sig_header, secret, tolerance=DEFAULT_TOLERANCE, api_key=None ): if hasattr(payload, "decode"): payload = payload.decode("utf-8") WebhookSignature.verify_header(payload, sig_header, secret, tolerance) data = json.loads(payload, object_pairs_hook=OrderedDict) event = Event._construct_from( values=data, requestor=_APIRequestor._global_with_options( api_key=api_key or stripe.api_key ), api_mode="V1", ) return event class WebhookSignature(object): EXPECTED_SCHEME = "v1" @staticmethod def _compute_signature(payload, secret): mac = hmac.new( secret.encode("utf-8"), msg=payload.encode("utf-8"), digestmod=sha256, ) return mac.hexdigest() @staticmethod def _get_timestamp_and_signatures(header, scheme): list_items = [i.split("=", 2) for i in header.split(",")] timestamp = int([i[1] for i in list_items if i[0] == "t"][0]) signatures = [i[1] for i in list_items if i[0] == scheme] return timestamp, signatures @classmethod def verify_header(cls, payload, header, secret, tolerance=None): try: timestamp, signatures = cls._get_timestamp_and_signatures( header, cls.EXPECTED_SCHEME ) except Exception: raise SignatureVerificationError( "Unable to extract timestamp and signatures from header", header, payload, ) if not signatures: raise SignatureVerificationError( "No signatures found with expected scheme " "%s" % cls.EXPECTED_SCHEME, header, payload, ) signed_payload = "%d.%s" % (timestamp, payload) expected_sig = cls._compute_signature(signed_payload, secret) if not any(_util.secure_compare(expected_sig, s) for s in signatures): raise SignatureVerificationError( "No signatures found matching the expected signature for " "payload", header, payload, ) if tolerance and timestamp < time.time() - tolerance: raise SignatureVerificationError( "Timestamp outside the tolerance zone (%d)" % timestamp, header, payload, ) return True ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_webhook_endpoint.py0000644000175100001770000011730414637354563020107 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._deletable_api_resource import DeletableAPIResource from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import Literal, NotRequired, Unpack class WebhookEndpoint( CreateableAPIResource["WebhookEndpoint"], DeletableAPIResource["WebhookEndpoint"], ListableAPIResource["WebhookEndpoint"], UpdateableAPIResource["WebhookEndpoint"], ): """ You can configure [webhook endpoints](https://docs.stripe.com/webhooks/) via the API to be notified about events that happen in your Stripe account or connected accounts. Most users configure webhooks from [the dashboard](https://dashboard.stripe.com/webhooks), which provides a user interface for registering and testing your webhook endpoints. Related guide: [Setting up webhooks](https://docs.stripe.com/webhooks/configure) """ OBJECT_NAME: ClassVar[Literal["webhook_endpoint"]] = "webhook_endpoint" class CreateParams(RequestOptions): api_version: NotRequired[ Literal[ "2011-01-01", "2011-06-21", "2011-06-28", "2011-08-01", "2011-09-15", "2011-11-17", "2012-02-23", "2012-03-25", "2012-06-18", "2012-06-28", "2012-07-09", "2012-09-24", "2012-10-26", "2012-11-07", "2013-02-11", "2013-02-13", "2013-07-05", "2013-08-12", "2013-08-13", "2013-10-29", "2013-12-03", "2014-01-31", "2014-03-13", "2014-03-28", "2014-05-19", "2014-06-13", "2014-06-17", "2014-07-22", "2014-07-26", "2014-08-04", "2014-08-20", "2014-09-08", "2014-10-07", "2014-11-05", "2014-11-20", "2014-12-08", "2014-12-17", "2014-12-22", "2015-01-11", "2015-01-26", "2015-02-10", "2015-02-16", "2015-02-18", "2015-03-24", "2015-04-07", "2015-06-15", "2015-07-07", "2015-07-13", "2015-07-28", "2015-08-07", "2015-08-19", "2015-09-03", "2015-09-08", "2015-09-23", "2015-10-01", "2015-10-12", "2015-10-16", "2016-02-03", "2016-02-19", "2016-02-22", "2016-02-23", "2016-02-29", "2016-03-07", "2016-06-15", "2016-07-06", "2016-10-19", "2017-01-27", "2017-02-14", "2017-04-06", "2017-05-25", "2017-06-05", "2017-08-15", "2017-12-14", "2018-01-23", "2018-02-05", "2018-02-06", "2018-02-28", "2018-05-21", "2018-07-27", "2018-08-23", "2018-09-06", "2018-09-24", "2018-10-31", "2018-11-08", "2019-02-11", "2019-02-19", "2019-03-14", "2019-05-16", "2019-08-14", "2019-09-09", "2019-10-08", "2019-10-17", "2019-11-05", "2019-12-03", "2020-03-02", "2020-08-27", "2022-08-01", "2022-11-15", "2023-08-16", "2023-10-16", "2024-04-10", "2024-06-20", ] ] """ Events sent to this endpoint will be generated with this Stripe Version instead of your account's default Stripe Version. """ connect: NotRequired[bool] """ Whether this endpoint should receive events from connected accounts (`true`), or from your account (`false`). Defaults to `false`. """ description: NotRequired["Literal['']|str"] """ An optional description of what the webhook is used for. """ enabled_events: List[ Literal[ "*", "account.application.authorized", "account.application.deauthorized", "account.external_account.created", "account.external_account.deleted", "account.external_account.updated", "account.updated", "application_fee.created", "application_fee.refund.updated", "application_fee.refunded", "balance.available", "billing_portal.configuration.created", "billing_portal.configuration.updated", "billing_portal.session.created", "capability.updated", "cash_balance.funds_available", "charge.captured", "charge.dispute.closed", "charge.dispute.created", "charge.dispute.funds_reinstated", "charge.dispute.funds_withdrawn", "charge.dispute.updated", "charge.expired", "charge.failed", "charge.pending", "charge.refund.updated", "charge.refunded", "charge.succeeded", "charge.updated", "checkout.session.async_payment_failed", "checkout.session.async_payment_succeeded", "checkout.session.completed", "checkout.session.expired", "climate.order.canceled", "climate.order.created", "climate.order.delayed", "climate.order.delivered", "climate.order.product_substituted", "climate.product.created", "climate.product.pricing_updated", "coupon.created", "coupon.deleted", "coupon.updated", "credit_note.created", "credit_note.updated", "credit_note.voided", "customer.created", "customer.deleted", "customer.discount.created", "customer.discount.deleted", "customer.discount.updated", "customer.source.created", "customer.source.deleted", "customer.source.expiring", "customer.source.updated", "customer.subscription.created", "customer.subscription.deleted", "customer.subscription.paused", "customer.subscription.pending_update_applied", "customer.subscription.pending_update_expired", "customer.subscription.resumed", "customer.subscription.trial_will_end", "customer.subscription.updated", "customer.tax_id.created", "customer.tax_id.deleted", "customer.tax_id.updated", "customer.updated", "customer_cash_balance_transaction.created", "entitlements.active_entitlement_summary.updated", "file.created", "financial_connections.account.created", "financial_connections.account.deactivated", "financial_connections.account.disconnected", "financial_connections.account.reactivated", "financial_connections.account.refreshed_balance", "financial_connections.account.refreshed_ownership", "financial_connections.account.refreshed_transactions", "identity.verification_session.canceled", "identity.verification_session.created", "identity.verification_session.processing", "identity.verification_session.redacted", "identity.verification_session.requires_input", "identity.verification_session.verified", "invoice.created", "invoice.deleted", "invoice.finalization_failed", "invoice.finalized", "invoice.marked_uncollectible", "invoice.paid", "invoice.payment_action_required", "invoice.payment_failed", "invoice.payment_succeeded", "invoice.sent", "invoice.upcoming", "invoice.updated", "invoice.voided", "invoiceitem.created", "invoiceitem.deleted", "issuing_authorization.created", "issuing_authorization.request", "issuing_authorization.updated", "issuing_card.created", "issuing_card.updated", "issuing_cardholder.created", "issuing_cardholder.updated", "issuing_dispute.closed", "issuing_dispute.created", "issuing_dispute.funds_reinstated", "issuing_dispute.submitted", "issuing_dispute.updated", "issuing_personalization_design.activated", "issuing_personalization_design.deactivated", "issuing_personalization_design.rejected", "issuing_personalization_design.updated", "issuing_token.created", "issuing_token.updated", "issuing_transaction.created", "issuing_transaction.updated", "mandate.updated", "payment_intent.amount_capturable_updated", "payment_intent.canceled", "payment_intent.created", "payment_intent.partially_funded", "payment_intent.payment_failed", "payment_intent.processing", "payment_intent.requires_action", "payment_intent.succeeded", "payment_link.created", "payment_link.updated", "payment_method.attached", "payment_method.automatically_updated", "payment_method.detached", "payment_method.updated", "payout.canceled", "payout.created", "payout.failed", "payout.paid", "payout.reconciliation_completed", "payout.updated", "person.created", "person.deleted", "person.updated", "plan.created", "plan.deleted", "plan.updated", "price.created", "price.deleted", "price.updated", "product.created", "product.deleted", "product.updated", "promotion_code.created", "promotion_code.updated", "quote.accepted", "quote.canceled", "quote.created", "quote.finalized", "radar.early_fraud_warning.created", "radar.early_fraud_warning.updated", "refund.created", "refund.updated", "reporting.report_run.failed", "reporting.report_run.succeeded", "reporting.report_type.updated", "review.closed", "review.opened", "setup_intent.canceled", "setup_intent.created", "setup_intent.requires_action", "setup_intent.setup_failed", "setup_intent.succeeded", "sigma.scheduled_query_run.created", "source.canceled", "source.chargeable", "source.failed", "source.mandate_notification", "source.refund_attributes_required", "source.transaction.created", "source.transaction.updated", "subscription_schedule.aborted", "subscription_schedule.canceled", "subscription_schedule.completed", "subscription_schedule.created", "subscription_schedule.expiring", "subscription_schedule.released", "subscription_schedule.updated", "tax.settings.updated", "tax_rate.created", "tax_rate.updated", "terminal.reader.action_failed", "terminal.reader.action_succeeded", "test_helpers.test_clock.advancing", "test_helpers.test_clock.created", "test_helpers.test_clock.deleted", "test_helpers.test_clock.internal_failure", "test_helpers.test_clock.ready", "topup.canceled", "topup.created", "topup.failed", "topup.reversed", "topup.succeeded", "transfer.created", "transfer.reversed", "transfer.updated", "treasury.credit_reversal.created", "treasury.credit_reversal.posted", "treasury.debit_reversal.completed", "treasury.debit_reversal.created", "treasury.debit_reversal.initial_credit_granted", "treasury.financial_account.closed", "treasury.financial_account.created", "treasury.financial_account.features_status_updated", "treasury.inbound_transfer.canceled", "treasury.inbound_transfer.created", "treasury.inbound_transfer.failed", "treasury.inbound_transfer.succeeded", "treasury.outbound_payment.canceled", "treasury.outbound_payment.created", "treasury.outbound_payment.expected_arrival_date_updated", "treasury.outbound_payment.failed", "treasury.outbound_payment.posted", "treasury.outbound_payment.returned", "treasury.outbound_payment.tracking_details_updated", "treasury.outbound_transfer.canceled", "treasury.outbound_transfer.created", "treasury.outbound_transfer.expected_arrival_date_updated", "treasury.outbound_transfer.failed", "treasury.outbound_transfer.posted", "treasury.outbound_transfer.returned", "treasury.outbound_transfer.tracking_details_updated", "treasury.received_credit.created", "treasury.received_credit.failed", "treasury.received_credit.succeeded", "treasury.received_debit.created", ] ] """ The list of events to enable for this endpoint. You may specify `['*']` to enable all events, except those that require explicit selection. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ url: str """ The URL of the webhook endpoint. """ class DeleteParams(RequestOptions): pass class ListParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ModifyParams(RequestOptions): description: NotRequired["Literal['']|str"] """ An optional description of what the webhook is used for. """ disabled: NotRequired[bool] """ Disable the webhook endpoint if set to true. """ enabled_events: NotRequired[ List[ Literal[ "*", "account.application.authorized", "account.application.deauthorized", "account.external_account.created", "account.external_account.deleted", "account.external_account.updated", "account.updated", "application_fee.created", "application_fee.refund.updated", "application_fee.refunded", "balance.available", "billing_portal.configuration.created", "billing_portal.configuration.updated", "billing_portal.session.created", "capability.updated", "cash_balance.funds_available", "charge.captured", "charge.dispute.closed", "charge.dispute.created", "charge.dispute.funds_reinstated", "charge.dispute.funds_withdrawn", "charge.dispute.updated", "charge.expired", "charge.failed", "charge.pending", "charge.refund.updated", "charge.refunded", "charge.succeeded", "charge.updated", "checkout.session.async_payment_failed", "checkout.session.async_payment_succeeded", "checkout.session.completed", "checkout.session.expired", "climate.order.canceled", "climate.order.created", "climate.order.delayed", "climate.order.delivered", "climate.order.product_substituted", "climate.product.created", "climate.product.pricing_updated", "coupon.created", "coupon.deleted", "coupon.updated", "credit_note.created", "credit_note.updated", "credit_note.voided", "customer.created", "customer.deleted", "customer.discount.created", "customer.discount.deleted", "customer.discount.updated", "customer.source.created", "customer.source.deleted", "customer.source.expiring", "customer.source.updated", "customer.subscription.created", "customer.subscription.deleted", "customer.subscription.paused", "customer.subscription.pending_update_applied", "customer.subscription.pending_update_expired", "customer.subscription.resumed", "customer.subscription.trial_will_end", "customer.subscription.updated", "customer.tax_id.created", "customer.tax_id.deleted", "customer.tax_id.updated", "customer.updated", "customer_cash_balance_transaction.created", "entitlements.active_entitlement_summary.updated", "file.created", "financial_connections.account.created", "financial_connections.account.deactivated", "financial_connections.account.disconnected", "financial_connections.account.reactivated", "financial_connections.account.refreshed_balance", "financial_connections.account.refreshed_ownership", "financial_connections.account.refreshed_transactions", "identity.verification_session.canceled", "identity.verification_session.created", "identity.verification_session.processing", "identity.verification_session.redacted", "identity.verification_session.requires_input", "identity.verification_session.verified", "invoice.created", "invoice.deleted", "invoice.finalization_failed", "invoice.finalized", "invoice.marked_uncollectible", "invoice.paid", "invoice.payment_action_required", "invoice.payment_failed", "invoice.payment_succeeded", "invoice.sent", "invoice.upcoming", "invoice.updated", "invoice.voided", "invoiceitem.created", "invoiceitem.deleted", "issuing_authorization.created", "issuing_authorization.request", "issuing_authorization.updated", "issuing_card.created", "issuing_card.updated", "issuing_cardholder.created", "issuing_cardholder.updated", "issuing_dispute.closed", "issuing_dispute.created", "issuing_dispute.funds_reinstated", "issuing_dispute.submitted", "issuing_dispute.updated", "issuing_personalization_design.activated", "issuing_personalization_design.deactivated", "issuing_personalization_design.rejected", "issuing_personalization_design.updated", "issuing_token.created", "issuing_token.updated", "issuing_transaction.created", "issuing_transaction.updated", "mandate.updated", "payment_intent.amount_capturable_updated", "payment_intent.canceled", "payment_intent.created", "payment_intent.partially_funded", "payment_intent.payment_failed", "payment_intent.processing", "payment_intent.requires_action", "payment_intent.succeeded", "payment_link.created", "payment_link.updated", "payment_method.attached", "payment_method.automatically_updated", "payment_method.detached", "payment_method.updated", "payout.canceled", "payout.created", "payout.failed", "payout.paid", "payout.reconciliation_completed", "payout.updated", "person.created", "person.deleted", "person.updated", "plan.created", "plan.deleted", "plan.updated", "price.created", "price.deleted", "price.updated", "product.created", "product.deleted", "product.updated", "promotion_code.created", "promotion_code.updated", "quote.accepted", "quote.canceled", "quote.created", "quote.finalized", "radar.early_fraud_warning.created", "radar.early_fraud_warning.updated", "refund.created", "refund.updated", "reporting.report_run.failed", "reporting.report_run.succeeded", "reporting.report_type.updated", "review.closed", "review.opened", "setup_intent.canceled", "setup_intent.created", "setup_intent.requires_action", "setup_intent.setup_failed", "setup_intent.succeeded", "sigma.scheduled_query_run.created", "source.canceled", "source.chargeable", "source.failed", "source.mandate_notification", "source.refund_attributes_required", "source.transaction.created", "source.transaction.updated", "subscription_schedule.aborted", "subscription_schedule.canceled", "subscription_schedule.completed", "subscription_schedule.created", "subscription_schedule.expiring", "subscription_schedule.released", "subscription_schedule.updated", "tax.settings.updated", "tax_rate.created", "tax_rate.updated", "terminal.reader.action_failed", "terminal.reader.action_succeeded", "test_helpers.test_clock.advancing", "test_helpers.test_clock.created", "test_helpers.test_clock.deleted", "test_helpers.test_clock.internal_failure", "test_helpers.test_clock.ready", "topup.canceled", "topup.created", "topup.failed", "topup.reversed", "topup.succeeded", "transfer.created", "transfer.reversed", "transfer.updated", "treasury.credit_reversal.created", "treasury.credit_reversal.posted", "treasury.debit_reversal.completed", "treasury.debit_reversal.created", "treasury.debit_reversal.initial_credit_granted", "treasury.financial_account.closed", "treasury.financial_account.created", "treasury.financial_account.features_status_updated", "treasury.inbound_transfer.canceled", "treasury.inbound_transfer.created", "treasury.inbound_transfer.failed", "treasury.inbound_transfer.succeeded", "treasury.outbound_payment.canceled", "treasury.outbound_payment.created", "treasury.outbound_payment.expected_arrival_date_updated", "treasury.outbound_payment.failed", "treasury.outbound_payment.posted", "treasury.outbound_payment.returned", "treasury.outbound_payment.tracking_details_updated", "treasury.outbound_transfer.canceled", "treasury.outbound_transfer.created", "treasury.outbound_transfer.expected_arrival_date_updated", "treasury.outbound_transfer.failed", "treasury.outbound_transfer.posted", "treasury.outbound_transfer.returned", "treasury.outbound_transfer.tracking_details_updated", "treasury.received_credit.created", "treasury.received_credit.failed", "treasury.received_credit.succeeded", "treasury.received_debit.created", ] ] ] """ The list of events to enable for this endpoint. You may specify `['*']` to enable all events, except those that require explicit selection. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ url: NotRequired[str] """ The URL of the webhook endpoint. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ api_version: Optional[str] """ The API version events are rendered as for this webhook endpoint. """ application: Optional[str] """ The ID of the associated Connect application. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ description: Optional[str] """ An optional description of what the webhook is used for. """ enabled_events: List[str] """ The list of events to enable for this endpoint. `['*']` indicates that all events are enabled, except those that require explicit selection. """ id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ metadata: Dict[str, str] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ object: Literal["webhook_endpoint"] """ String representing the object's type. Objects of the same type share the same value. """ secret: Optional[str] """ The endpoint's secret, used to generate [webhook signatures](https://docs.stripe.com/webhooks/signatures). Only returned at creation. """ status: str """ The status of the webhook. It can be `enabled` or `disabled`. """ url: str """ The URL of the webhook endpoint. """ deleted: Optional[Literal[True]] """ Always true for a deleted object """ @classmethod def create( cls, **params: Unpack["WebhookEndpoint.CreateParams"] ) -> "WebhookEndpoint": """ A webhook endpoint must have a url and a list of enabled_events. You may optionally specify the Boolean connect parameter. If set to true, then a Connect webhook endpoint that notifies the specified url about events from all connected accounts is created; otherwise an account webhook endpoint that notifies the specified url only about events from your account is created. You can also create webhook endpoints in the [webhooks settings](https://dashboard.stripe.com/account/webhooks) section of the Dashboard. """ return cast( "WebhookEndpoint", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["WebhookEndpoint.CreateParams"] ) -> "WebhookEndpoint": """ A webhook endpoint must have a url and a list of enabled_events. You may optionally specify the Boolean connect parameter. If set to true, then a Connect webhook endpoint that notifies the specified url about events from all connected accounts is created; otherwise an account webhook endpoint that notifies the specified url only about events from your account is created. You can also create webhook endpoints in the [webhooks settings](https://dashboard.stripe.com/account/webhooks) section of the Dashboard. """ return cast( "WebhookEndpoint", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def _cls_delete( cls, sid: str, **params: Unpack["WebhookEndpoint.DeleteParams"] ) -> "WebhookEndpoint": """ You can also delete webhook endpoints via the [webhook endpoint management](https://dashboard.stripe.com/account/webhooks) page of the Stripe dashboard. """ url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "WebhookEndpoint", cls._static_request( "delete", url, params=params, ), ) @overload @staticmethod def delete( sid: str, **params: Unpack["WebhookEndpoint.DeleteParams"] ) -> "WebhookEndpoint": """ You can also delete webhook endpoints via the [webhook endpoint management](https://dashboard.stripe.com/account/webhooks) page of the Stripe dashboard. """ ... @overload def delete( self, **params: Unpack["WebhookEndpoint.DeleteParams"] ) -> "WebhookEndpoint": """ You can also delete webhook endpoints via the [webhook endpoint management](https://dashboard.stripe.com/account/webhooks) page of the Stripe dashboard. """ ... @class_method_variant("_cls_delete") def delete( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["WebhookEndpoint.DeleteParams"] ) -> "WebhookEndpoint": """ You can also delete webhook endpoints via the [webhook endpoint management](https://dashboard.stripe.com/account/webhooks) page of the Stripe dashboard. """ return self._request_and_refresh( "delete", self.instance_url(), params=params, ) @classmethod async def _cls_delete_async( cls, sid: str, **params: Unpack["WebhookEndpoint.DeleteParams"] ) -> "WebhookEndpoint": """ You can also delete webhook endpoints via the [webhook endpoint management](https://dashboard.stripe.com/account/webhooks) page of the Stripe dashboard. """ url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "WebhookEndpoint", await cls._static_request_async( "delete", url, params=params, ), ) @overload @staticmethod async def delete_async( sid: str, **params: Unpack["WebhookEndpoint.DeleteParams"] ) -> "WebhookEndpoint": """ You can also delete webhook endpoints via the [webhook endpoint management](https://dashboard.stripe.com/account/webhooks) page of the Stripe dashboard. """ ... @overload async def delete_async( self, **params: Unpack["WebhookEndpoint.DeleteParams"] ) -> "WebhookEndpoint": """ You can also delete webhook endpoints via the [webhook endpoint management](https://dashboard.stripe.com/account/webhooks) page of the Stripe dashboard. """ ... @class_method_variant("_cls_delete_async") async def delete_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["WebhookEndpoint.DeleteParams"] ) -> "WebhookEndpoint": """ You can also delete webhook endpoints via the [webhook endpoint management](https://dashboard.stripe.com/account/webhooks) page of the Stripe dashboard. """ return await self._request_and_refresh_async( "delete", self.instance_url(), params=params, ) @classmethod def list( cls, **params: Unpack["WebhookEndpoint.ListParams"] ) -> ListObject["WebhookEndpoint"]: """ Returns a list of your webhook endpoints. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["WebhookEndpoint.ListParams"] ) -> ListObject["WebhookEndpoint"]: """ Returns a list of your webhook endpoints. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def modify( cls, id: str, **params: Unpack["WebhookEndpoint.ModifyParams"] ) -> "WebhookEndpoint": """ Updates the webhook endpoint. You may edit the url, the list of enabled_events, and the status of your endpoint. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "WebhookEndpoint", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["WebhookEndpoint.ModifyParams"] ) -> "WebhookEndpoint": """ Updates the webhook endpoint. You may edit the url, the list of enabled_events, and the status of your endpoint. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "WebhookEndpoint", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["WebhookEndpoint.RetrieveParams"] ) -> "WebhookEndpoint": """ Retrieves the webhook endpoint with the given ID. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["WebhookEndpoint.RetrieveParams"] ) -> "WebhookEndpoint": """ Retrieves the webhook endpoint with the given ID. """ instance = cls(id, **params) await instance.refresh_async() return instance ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/_webhook_endpoint_service.py0000644000175100001770000011121714637354563021624 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe._webhook_endpoint import WebhookEndpoint from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class WebhookEndpointService(StripeService): class CreateParams(TypedDict): api_version: NotRequired[ Literal[ "2011-01-01", "2011-06-21", "2011-06-28", "2011-08-01", "2011-09-15", "2011-11-17", "2012-02-23", "2012-03-25", "2012-06-18", "2012-06-28", "2012-07-09", "2012-09-24", "2012-10-26", "2012-11-07", "2013-02-11", "2013-02-13", "2013-07-05", "2013-08-12", "2013-08-13", "2013-10-29", "2013-12-03", "2014-01-31", "2014-03-13", "2014-03-28", "2014-05-19", "2014-06-13", "2014-06-17", "2014-07-22", "2014-07-26", "2014-08-04", "2014-08-20", "2014-09-08", "2014-10-07", "2014-11-05", "2014-11-20", "2014-12-08", "2014-12-17", "2014-12-22", "2015-01-11", "2015-01-26", "2015-02-10", "2015-02-16", "2015-02-18", "2015-03-24", "2015-04-07", "2015-06-15", "2015-07-07", "2015-07-13", "2015-07-28", "2015-08-07", "2015-08-19", "2015-09-03", "2015-09-08", "2015-09-23", "2015-10-01", "2015-10-12", "2015-10-16", "2016-02-03", "2016-02-19", "2016-02-22", "2016-02-23", "2016-02-29", "2016-03-07", "2016-06-15", "2016-07-06", "2016-10-19", "2017-01-27", "2017-02-14", "2017-04-06", "2017-05-25", "2017-06-05", "2017-08-15", "2017-12-14", "2018-01-23", "2018-02-05", "2018-02-06", "2018-02-28", "2018-05-21", "2018-07-27", "2018-08-23", "2018-09-06", "2018-09-24", "2018-10-31", "2018-11-08", "2019-02-11", "2019-02-19", "2019-03-14", "2019-05-16", "2019-08-14", "2019-09-09", "2019-10-08", "2019-10-17", "2019-11-05", "2019-12-03", "2020-03-02", "2020-08-27", "2022-08-01", "2022-11-15", "2023-08-16", "2023-10-16", "2024-04-10", "2024-06-20", ] ] """ Events sent to this endpoint will be generated with this Stripe Version instead of your account's default Stripe Version. """ connect: NotRequired[bool] """ Whether this endpoint should receive events from connected accounts (`true`), or from your account (`false`). Defaults to `false`. """ description: NotRequired["Literal['']|str"] """ An optional description of what the webhook is used for. """ enabled_events: List[ Literal[ "*", "account.application.authorized", "account.application.deauthorized", "account.external_account.created", "account.external_account.deleted", "account.external_account.updated", "account.updated", "application_fee.created", "application_fee.refund.updated", "application_fee.refunded", "balance.available", "billing_portal.configuration.created", "billing_portal.configuration.updated", "billing_portal.session.created", "capability.updated", "cash_balance.funds_available", "charge.captured", "charge.dispute.closed", "charge.dispute.created", "charge.dispute.funds_reinstated", "charge.dispute.funds_withdrawn", "charge.dispute.updated", "charge.expired", "charge.failed", "charge.pending", "charge.refund.updated", "charge.refunded", "charge.succeeded", "charge.updated", "checkout.session.async_payment_failed", "checkout.session.async_payment_succeeded", "checkout.session.completed", "checkout.session.expired", "climate.order.canceled", "climate.order.created", "climate.order.delayed", "climate.order.delivered", "climate.order.product_substituted", "climate.product.created", "climate.product.pricing_updated", "coupon.created", "coupon.deleted", "coupon.updated", "credit_note.created", "credit_note.updated", "credit_note.voided", "customer.created", "customer.deleted", "customer.discount.created", "customer.discount.deleted", "customer.discount.updated", "customer.source.created", "customer.source.deleted", "customer.source.expiring", "customer.source.updated", "customer.subscription.created", "customer.subscription.deleted", "customer.subscription.paused", "customer.subscription.pending_update_applied", "customer.subscription.pending_update_expired", "customer.subscription.resumed", "customer.subscription.trial_will_end", "customer.subscription.updated", "customer.tax_id.created", "customer.tax_id.deleted", "customer.tax_id.updated", "customer.updated", "customer_cash_balance_transaction.created", "entitlements.active_entitlement_summary.updated", "file.created", "financial_connections.account.created", "financial_connections.account.deactivated", "financial_connections.account.disconnected", "financial_connections.account.reactivated", "financial_connections.account.refreshed_balance", "financial_connections.account.refreshed_ownership", "financial_connections.account.refreshed_transactions", "identity.verification_session.canceled", "identity.verification_session.created", "identity.verification_session.processing", "identity.verification_session.redacted", "identity.verification_session.requires_input", "identity.verification_session.verified", "invoice.created", "invoice.deleted", "invoice.finalization_failed", "invoice.finalized", "invoice.marked_uncollectible", "invoice.paid", "invoice.payment_action_required", "invoice.payment_failed", "invoice.payment_succeeded", "invoice.sent", "invoice.upcoming", "invoice.updated", "invoice.voided", "invoiceitem.created", "invoiceitem.deleted", "issuing_authorization.created", "issuing_authorization.request", "issuing_authorization.updated", "issuing_card.created", "issuing_card.updated", "issuing_cardholder.created", "issuing_cardholder.updated", "issuing_dispute.closed", "issuing_dispute.created", "issuing_dispute.funds_reinstated", "issuing_dispute.submitted", "issuing_dispute.updated", "issuing_personalization_design.activated", "issuing_personalization_design.deactivated", "issuing_personalization_design.rejected", "issuing_personalization_design.updated", "issuing_token.created", "issuing_token.updated", "issuing_transaction.created", "issuing_transaction.updated", "mandate.updated", "payment_intent.amount_capturable_updated", "payment_intent.canceled", "payment_intent.created", "payment_intent.partially_funded", "payment_intent.payment_failed", "payment_intent.processing", "payment_intent.requires_action", "payment_intent.succeeded", "payment_link.created", "payment_link.updated", "payment_method.attached", "payment_method.automatically_updated", "payment_method.detached", "payment_method.updated", "payout.canceled", "payout.created", "payout.failed", "payout.paid", "payout.reconciliation_completed", "payout.updated", "person.created", "person.deleted", "person.updated", "plan.created", "plan.deleted", "plan.updated", "price.created", "price.deleted", "price.updated", "product.created", "product.deleted", "product.updated", "promotion_code.created", "promotion_code.updated", "quote.accepted", "quote.canceled", "quote.created", "quote.finalized", "radar.early_fraud_warning.created", "radar.early_fraud_warning.updated", "refund.created", "refund.updated", "reporting.report_run.failed", "reporting.report_run.succeeded", "reporting.report_type.updated", "review.closed", "review.opened", "setup_intent.canceled", "setup_intent.created", "setup_intent.requires_action", "setup_intent.setup_failed", "setup_intent.succeeded", "sigma.scheduled_query_run.created", "source.canceled", "source.chargeable", "source.failed", "source.mandate_notification", "source.refund_attributes_required", "source.transaction.created", "source.transaction.updated", "subscription_schedule.aborted", "subscription_schedule.canceled", "subscription_schedule.completed", "subscription_schedule.created", "subscription_schedule.expiring", "subscription_schedule.released", "subscription_schedule.updated", "tax.settings.updated", "tax_rate.created", "tax_rate.updated", "terminal.reader.action_failed", "terminal.reader.action_succeeded", "test_helpers.test_clock.advancing", "test_helpers.test_clock.created", "test_helpers.test_clock.deleted", "test_helpers.test_clock.internal_failure", "test_helpers.test_clock.ready", "topup.canceled", "topup.created", "topup.failed", "topup.reversed", "topup.succeeded", "transfer.created", "transfer.reversed", "transfer.updated", "treasury.credit_reversal.created", "treasury.credit_reversal.posted", "treasury.debit_reversal.completed", "treasury.debit_reversal.created", "treasury.debit_reversal.initial_credit_granted", "treasury.financial_account.closed", "treasury.financial_account.created", "treasury.financial_account.features_status_updated", "treasury.inbound_transfer.canceled", "treasury.inbound_transfer.created", "treasury.inbound_transfer.failed", "treasury.inbound_transfer.succeeded", "treasury.outbound_payment.canceled", "treasury.outbound_payment.created", "treasury.outbound_payment.expected_arrival_date_updated", "treasury.outbound_payment.failed", "treasury.outbound_payment.posted", "treasury.outbound_payment.returned", "treasury.outbound_payment.tracking_details_updated", "treasury.outbound_transfer.canceled", "treasury.outbound_transfer.created", "treasury.outbound_transfer.expected_arrival_date_updated", "treasury.outbound_transfer.failed", "treasury.outbound_transfer.posted", "treasury.outbound_transfer.returned", "treasury.outbound_transfer.tracking_details_updated", "treasury.received_credit.created", "treasury.received_credit.failed", "treasury.received_credit.succeeded", "treasury.received_debit.created", ] ] """ The list of events to enable for this endpoint. You may specify `['*']` to enable all events, except those that require explicit selection. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ url: str """ The URL of the webhook endpoint. """ class DeleteParams(TypedDict): pass class ListParams(TypedDict): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): description: NotRequired["Literal['']|str"] """ An optional description of what the webhook is used for. """ disabled: NotRequired[bool] """ Disable the webhook endpoint if set to true. """ enabled_events: NotRequired[ List[ Literal[ "*", "account.application.authorized", "account.application.deauthorized", "account.external_account.created", "account.external_account.deleted", "account.external_account.updated", "account.updated", "application_fee.created", "application_fee.refund.updated", "application_fee.refunded", "balance.available", "billing_portal.configuration.created", "billing_portal.configuration.updated", "billing_portal.session.created", "capability.updated", "cash_balance.funds_available", "charge.captured", "charge.dispute.closed", "charge.dispute.created", "charge.dispute.funds_reinstated", "charge.dispute.funds_withdrawn", "charge.dispute.updated", "charge.expired", "charge.failed", "charge.pending", "charge.refund.updated", "charge.refunded", "charge.succeeded", "charge.updated", "checkout.session.async_payment_failed", "checkout.session.async_payment_succeeded", "checkout.session.completed", "checkout.session.expired", "climate.order.canceled", "climate.order.created", "climate.order.delayed", "climate.order.delivered", "climate.order.product_substituted", "climate.product.created", "climate.product.pricing_updated", "coupon.created", "coupon.deleted", "coupon.updated", "credit_note.created", "credit_note.updated", "credit_note.voided", "customer.created", "customer.deleted", "customer.discount.created", "customer.discount.deleted", "customer.discount.updated", "customer.source.created", "customer.source.deleted", "customer.source.expiring", "customer.source.updated", "customer.subscription.created", "customer.subscription.deleted", "customer.subscription.paused", "customer.subscription.pending_update_applied", "customer.subscription.pending_update_expired", "customer.subscription.resumed", "customer.subscription.trial_will_end", "customer.subscription.updated", "customer.tax_id.created", "customer.tax_id.deleted", "customer.tax_id.updated", "customer.updated", "customer_cash_balance_transaction.created", "entitlements.active_entitlement_summary.updated", "file.created", "financial_connections.account.created", "financial_connections.account.deactivated", "financial_connections.account.disconnected", "financial_connections.account.reactivated", "financial_connections.account.refreshed_balance", "financial_connections.account.refreshed_ownership", "financial_connections.account.refreshed_transactions", "identity.verification_session.canceled", "identity.verification_session.created", "identity.verification_session.processing", "identity.verification_session.redacted", "identity.verification_session.requires_input", "identity.verification_session.verified", "invoice.created", "invoice.deleted", "invoice.finalization_failed", "invoice.finalized", "invoice.marked_uncollectible", "invoice.paid", "invoice.payment_action_required", "invoice.payment_failed", "invoice.payment_succeeded", "invoice.sent", "invoice.upcoming", "invoice.updated", "invoice.voided", "invoiceitem.created", "invoiceitem.deleted", "issuing_authorization.created", "issuing_authorization.request", "issuing_authorization.updated", "issuing_card.created", "issuing_card.updated", "issuing_cardholder.created", "issuing_cardholder.updated", "issuing_dispute.closed", "issuing_dispute.created", "issuing_dispute.funds_reinstated", "issuing_dispute.submitted", "issuing_dispute.updated", "issuing_personalization_design.activated", "issuing_personalization_design.deactivated", "issuing_personalization_design.rejected", "issuing_personalization_design.updated", "issuing_token.created", "issuing_token.updated", "issuing_transaction.created", "issuing_transaction.updated", "mandate.updated", "payment_intent.amount_capturable_updated", "payment_intent.canceled", "payment_intent.created", "payment_intent.partially_funded", "payment_intent.payment_failed", "payment_intent.processing", "payment_intent.requires_action", "payment_intent.succeeded", "payment_link.created", "payment_link.updated", "payment_method.attached", "payment_method.automatically_updated", "payment_method.detached", "payment_method.updated", "payout.canceled", "payout.created", "payout.failed", "payout.paid", "payout.reconciliation_completed", "payout.updated", "person.created", "person.deleted", "person.updated", "plan.created", "plan.deleted", "plan.updated", "price.created", "price.deleted", "price.updated", "product.created", "product.deleted", "product.updated", "promotion_code.created", "promotion_code.updated", "quote.accepted", "quote.canceled", "quote.created", "quote.finalized", "radar.early_fraud_warning.created", "radar.early_fraud_warning.updated", "refund.created", "refund.updated", "reporting.report_run.failed", "reporting.report_run.succeeded", "reporting.report_type.updated", "review.closed", "review.opened", "setup_intent.canceled", "setup_intent.created", "setup_intent.requires_action", "setup_intent.setup_failed", "setup_intent.succeeded", "sigma.scheduled_query_run.created", "source.canceled", "source.chargeable", "source.failed", "source.mandate_notification", "source.refund_attributes_required", "source.transaction.created", "source.transaction.updated", "subscription_schedule.aborted", "subscription_schedule.canceled", "subscription_schedule.completed", "subscription_schedule.created", "subscription_schedule.expiring", "subscription_schedule.released", "subscription_schedule.updated", "tax.settings.updated", "tax_rate.created", "tax_rate.updated", "terminal.reader.action_failed", "terminal.reader.action_succeeded", "test_helpers.test_clock.advancing", "test_helpers.test_clock.created", "test_helpers.test_clock.deleted", "test_helpers.test_clock.internal_failure", "test_helpers.test_clock.ready", "topup.canceled", "topup.created", "topup.failed", "topup.reversed", "topup.succeeded", "transfer.created", "transfer.reversed", "transfer.updated", "treasury.credit_reversal.created", "treasury.credit_reversal.posted", "treasury.debit_reversal.completed", "treasury.debit_reversal.created", "treasury.debit_reversal.initial_credit_granted", "treasury.financial_account.closed", "treasury.financial_account.created", "treasury.financial_account.features_status_updated", "treasury.inbound_transfer.canceled", "treasury.inbound_transfer.created", "treasury.inbound_transfer.failed", "treasury.inbound_transfer.succeeded", "treasury.outbound_payment.canceled", "treasury.outbound_payment.created", "treasury.outbound_payment.expected_arrival_date_updated", "treasury.outbound_payment.failed", "treasury.outbound_payment.posted", "treasury.outbound_payment.returned", "treasury.outbound_payment.tracking_details_updated", "treasury.outbound_transfer.canceled", "treasury.outbound_transfer.created", "treasury.outbound_transfer.expected_arrival_date_updated", "treasury.outbound_transfer.failed", "treasury.outbound_transfer.posted", "treasury.outbound_transfer.returned", "treasury.outbound_transfer.tracking_details_updated", "treasury.received_credit.created", "treasury.received_credit.failed", "treasury.received_credit.succeeded", "treasury.received_debit.created", ] ] ] """ The list of events to enable for this endpoint. You may specify `['*']` to enable all events, except those that require explicit selection. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ url: NotRequired[str] """ The URL of the webhook endpoint. """ def delete( self, webhook_endpoint: str, params: "WebhookEndpointService.DeleteParams" = {}, options: RequestOptions = {}, ) -> WebhookEndpoint: """ You can also delete webhook endpoints via the [webhook endpoint management](https://dashboard.stripe.com/account/webhooks) page of the Stripe dashboard. """ return cast( WebhookEndpoint, self._request( "delete", "/v1/webhook_endpoints/{webhook_endpoint}".format( webhook_endpoint=sanitize_id(webhook_endpoint), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def delete_async( self, webhook_endpoint: str, params: "WebhookEndpointService.DeleteParams" = {}, options: RequestOptions = {}, ) -> WebhookEndpoint: """ You can also delete webhook endpoints via the [webhook endpoint management](https://dashboard.stripe.com/account/webhooks) page of the Stripe dashboard. """ return cast( WebhookEndpoint, await self._request_async( "delete", "/v1/webhook_endpoints/{webhook_endpoint}".format( webhook_endpoint=sanitize_id(webhook_endpoint), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, webhook_endpoint: str, params: "WebhookEndpointService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> WebhookEndpoint: """ Retrieves the webhook endpoint with the given ID. """ return cast( WebhookEndpoint, self._request( "get", "/v1/webhook_endpoints/{webhook_endpoint}".format( webhook_endpoint=sanitize_id(webhook_endpoint), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, webhook_endpoint: str, params: "WebhookEndpointService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> WebhookEndpoint: """ Retrieves the webhook endpoint with the given ID. """ return cast( WebhookEndpoint, await self._request_async( "get", "/v1/webhook_endpoints/{webhook_endpoint}".format( webhook_endpoint=sanitize_id(webhook_endpoint), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, webhook_endpoint: str, params: "WebhookEndpointService.UpdateParams" = {}, options: RequestOptions = {}, ) -> WebhookEndpoint: """ Updates the webhook endpoint. You may edit the url, the list of enabled_events, and the status of your endpoint. """ return cast( WebhookEndpoint, self._request( "post", "/v1/webhook_endpoints/{webhook_endpoint}".format( webhook_endpoint=sanitize_id(webhook_endpoint), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, webhook_endpoint: str, params: "WebhookEndpointService.UpdateParams" = {}, options: RequestOptions = {}, ) -> WebhookEndpoint: """ Updates the webhook endpoint. You may edit the url, the list of enabled_events, and the status of your endpoint. """ return cast( WebhookEndpoint, await self._request_async( "post", "/v1/webhook_endpoints/{webhook_endpoint}".format( webhook_endpoint=sanitize_id(webhook_endpoint), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def list( self, params: "WebhookEndpointService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[WebhookEndpoint]: """ Returns a list of your webhook endpoints. """ return cast( ListObject[WebhookEndpoint], self._request( "get", "/v1/webhook_endpoints", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "WebhookEndpointService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[WebhookEndpoint]: """ Returns a list of your webhook endpoints. """ return cast( ListObject[WebhookEndpoint], await self._request_async( "get", "/v1/webhook_endpoints", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "WebhookEndpointService.CreateParams", options: RequestOptions = {}, ) -> WebhookEndpoint: """ A webhook endpoint must have a url and a list of enabled_events. You may optionally specify the Boolean connect parameter. If set to true, then a Connect webhook endpoint that notifies the specified url about events from all connected accounts is created; otherwise an account webhook endpoint that notifies the specified url only about events from your account is created. You can also create webhook endpoints in the [webhooks settings](https://dashboard.stripe.com/account/webhooks) section of the Dashboard. """ return cast( WebhookEndpoint, self._request( "post", "/v1/webhook_endpoints", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "WebhookEndpointService.CreateParams", options: RequestOptions = {}, ) -> WebhookEndpoint: """ A webhook endpoint must have a url and a list of enabled_events. You may optionally specify the Boolean connect parameter. If set to true, then a Connect webhook endpoint that notifies the specified url about events from all connected accounts is created; otherwise an account webhook endpoint that notifies the specified url only about events from your account is created. You can also create webhook endpoints in the [webhooks settings](https://dashboard.stripe.com/account/webhooks) section of the Dashboard. """ return cast( WebhookEndpoint, await self._request_async( "post", "/v1/webhook_endpoints", api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5169404 stripe-10.1.0/stripe/api_resources/0000755000175100001770000000000014637354616016674 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/__init__.py0000644000175100001770000001427514637354563021017 0ustar00runnerdocker# The beginning of the section generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources import ... To: from stripe import ... """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.api_resources import ( abstract, apps, billing, billing_portal, checkout, climate, entitlements, financial_connections, forwarding, identity, issuing, radar, reporting, sigma, tax, terminal, test_helpers, treasury, ) from stripe.api_resources.account import Account from stripe.api_resources.account_link import AccountLink from stripe.api_resources.account_session import AccountSession from stripe.api_resources.apple_pay_domain import ApplePayDomain from stripe.api_resources.application import Application from stripe.api_resources.application_fee import ApplicationFee from stripe.api_resources.application_fee_refund import ( ApplicationFeeRefund, ) from stripe.api_resources.balance import Balance from stripe.api_resources.balance_transaction import BalanceTransaction from stripe.api_resources.bank_account import BankAccount from stripe.api_resources.capability import Capability from stripe.api_resources.card import Card from stripe.api_resources.cash_balance import CashBalance from stripe.api_resources.charge import Charge from stripe.api_resources.confirmation_token import ConfirmationToken from stripe.api_resources.connect_collection_transfer import ( ConnectCollectionTransfer, ) from stripe.api_resources.country_spec import CountrySpec from stripe.api_resources.coupon import Coupon from stripe.api_resources.credit_note import CreditNote from stripe.api_resources.credit_note_line_item import CreditNoteLineItem from stripe.api_resources.customer import Customer from stripe.api_resources.customer_balance_transaction import ( CustomerBalanceTransaction, ) from stripe.api_resources.customer_cash_balance_transaction import ( CustomerCashBalanceTransaction, ) from stripe.api_resources.customer_session import CustomerSession from stripe.api_resources.discount import Discount from stripe.api_resources.dispute import Dispute from stripe.api_resources.ephemeral_key import EphemeralKey from stripe.api_resources.event import Event from stripe.api_resources.exchange_rate import ExchangeRate from stripe.api_resources.file import File from stripe.api_resources.file_link import FileLink from stripe.api_resources.funding_instructions import FundingInstructions from stripe.api_resources.invoice import Invoice from stripe.api_resources.invoice_item import InvoiceItem from stripe.api_resources.invoice_line_item import InvoiceLineItem from stripe.api_resources.line_item import LineItem from stripe.api_resources.list_object import ListObject from stripe.api_resources.login_link import LoginLink from stripe.api_resources.mandate import Mandate from stripe.api_resources.payment_intent import PaymentIntent from stripe.api_resources.payment_link import PaymentLink from stripe.api_resources.payment_method import PaymentMethod from stripe.api_resources.payment_method_configuration import ( PaymentMethodConfiguration, ) from stripe.api_resources.payment_method_domain import PaymentMethodDomain from stripe.api_resources.payout import Payout from stripe.api_resources.person import Person from stripe.api_resources.plan import Plan from stripe.api_resources.price import Price from stripe.api_resources.product import Product from stripe.api_resources.product_feature import ProductFeature from stripe.api_resources.promotion_code import PromotionCode from stripe.api_resources.quote import Quote from stripe.api_resources.refund import Refund from stripe.api_resources.reserve_transaction import ReserveTransaction from stripe.api_resources.reversal import Reversal from stripe.api_resources.review import Review from stripe.api_resources.search_result_object import SearchResultObject from stripe.api_resources.setup_attempt import SetupAttempt from stripe.api_resources.setup_intent import SetupIntent from stripe.api_resources.shipping_rate import ShippingRate from stripe.api_resources.source import Source from stripe.api_resources.source_mandate_notification import ( SourceMandateNotification, ) from stripe.api_resources.source_transaction import SourceTransaction from stripe.api_resources.subscription import Subscription from stripe.api_resources.subscription_item import SubscriptionItem from stripe.api_resources.subscription_schedule import SubscriptionSchedule from stripe.api_resources.tax_code import TaxCode from stripe.api_resources.tax_deducted_at_source import TaxDeductedAtSource from stripe.api_resources.tax_id import TaxId from stripe.api_resources.tax_rate import TaxRate from stripe.api_resources.token import Token from stripe.api_resources.topup import Topup from stripe.api_resources.transfer import Transfer from stripe.api_resources.usage_record import UsageRecord from stripe.api_resources.usage_record_summary import UsageRecordSummary from stripe.api_resources.webhook_endpoint import WebhookEndpoint # The end of the section generated from our OpenAPI spec # These two exports are "special" and can't be handled by the generator. # - error_object exports two symbols # - File is renamed to FileUpload on export # - RecipientTransfer is a manually maintained deprecated class if not TYPE_CHECKING: from stripe.api_resources.error_object import ErrorObject from stripe.api_resources.error_object import ( OAuthErrorObject, ) from stripe.api_resources.file import ( File as FileUpload, ) from stripe.api_resources.recipient_transfer import RecipientTransfer ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5169404 stripe-10.1.0/stripe/api_resources/abstract/0000755000175100001770000000000014637354616020477 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/abstract/__init__.py0000644000175100001770000000277214637354563022621 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.abstract package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.abstract import ... To: from stripe import ... """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.api_resources.abstract.api_resource import APIResource from stripe.api_resources.abstract.createable_api_resource import ( CreateableAPIResource, ) from stripe.api_resources.abstract.custom_method import custom_method from stripe.api_resources.abstract.deletable_api_resource import ( DeletableAPIResource, ) from stripe.api_resources.abstract.listable_api_resource import ( ListableAPIResource, ) from stripe.api_resources.abstract.nested_resource_class_methods import ( nested_resource_class_methods, ) from stripe.api_resources.abstract.searchable_api_resource import ( SearchableAPIResource, ) from stripe.api_resources.abstract.singleton_api_resource import ( SingletonAPIResource, ) from stripe.api_resources.abstract.test_helpers import ( APIResourceTestHelpers, ) from stripe.api_resources.abstract.updateable_api_resource import ( UpdateableAPIResource, ) from stripe.api_resources.abstract.verify_mixin import VerifyMixin ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/abstract/api_resource.py0000644000175100001770000000104014637354563023525 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.api_resource package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.api_resource import APIResource To: from stripe import APIResource """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._api_resource import ( # noqa APIResource, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/abstract/createable_api_resource.py0000644000175100001770000000113714637354563025703 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.createable_api_resource package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.createable_api_resource import CreateableAPIResource To: from stripe import CreateableAPIResource """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._createable_api_resource import ( # noqa CreateableAPIResource, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/abstract/custom_method.py0000644000175100001770000000105114637354563023721 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.custom_method package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.custom_method import custom_method To: from stripe import custom_method """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._custom_method import ( # noqa custom_method, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/abstract/deletable_api_resource.py0000644000175100001770000000113114637354563025527 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.deletable_api_resource package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.deletable_api_resource import DeletableAPIResource To: from stripe import DeletableAPIResource """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._deletable_api_resource import ( # noqa DeletableAPIResource, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/abstract/listable_api_resource.py0000644000175100001770000000112314637354563025406 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.listable_api_resource package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.listable_api_resource import ListableAPIResource To: from stripe import ListableAPIResource """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._listable_api_resource import ( # noqa ListableAPIResource, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/abstract/nested_resource_class_methods.py0000644000175100001770000000121114637354563027146 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.nested_resource_class_methods package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.nested_resource_class_methods import nested_resource_class_methods To: from stripe import nested_resource_class_methods """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._nested_resource_class_methods import ( # noqa nested_resource_class_methods, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/abstract/searchable_api_resource.py0000644000175100001770000000113714637354563025705 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.searchable_api_resource package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.searchable_api_resource import SearchableAPIResource To: from stripe import SearchableAPIResource """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._searchable_api_resource import ( # noqa SearchableAPIResource, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/abstract/singleton_api_resource.py0000644000175100001770000000113114637354563025610 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.singleton_api_resource package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.singleton_api_resource import SingletonAPIResource To: from stripe import SingletonAPIResource """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._singleton_api_resource import ( # noqa SingletonAPIResource, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/abstract/test_helpers.py0000644000175100001770000000110114637354563023544 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.test_helpers package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.test_helpers import APIResourceTestHelpers To: from stripe import APIResourceTestHelpers """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._test_helpers import ( # noqa APIResourceTestHelpers, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/abstract/updateable_api_resource.py0000644000175100001770000000113714637354563025722 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.updateable_api_resource package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.updateable_api_resource import UpdateableAPIResource To: from stripe import UpdateableAPIResource """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._updateable_api_resource import ( # noqa UpdateableAPIResource, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/abstract/verify_mixin.py0000644000175100001770000000104014637354563023555 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.verify_mixin package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.verify_mixin import VerifyMixin To: from stripe import VerifyMixin """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._verify_mixin import ( # noqa VerifyMixin, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/account.py0000644000175100001770000000100514637354563020677 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.account package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.account import Account To: from stripe import Account """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._account import ( # noqa Account, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/account_link.py0000644000175100001770000000104014637354563021713 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.account_link package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.account_link import AccountLink To: from stripe import AccountLink """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._account_link import ( # noqa AccountLink, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/account_session.py0000644000175100001770000000106214637354563022445 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.account_session package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.account_session import AccountSession To: from stripe import AccountSession """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._account_session import ( # noqa AccountSession, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/apple_pay_domain.py0000644000175100001770000000106514637354563022552 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.apple_pay_domain package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.apple_pay_domain import ApplePayDomain To: from stripe import ApplePayDomain """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._apple_pay_domain import ( # noqa ApplePayDomain, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/application.py0000644000175100001770000000103514637354563021551 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.application package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.application import Application To: from stripe import Application """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._application import ( # noqa Application, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/application_fee.py0000644000175100001770000000106214637354563022370 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.application_fee package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.application_fee import ApplicationFee To: from stripe import ApplicationFee """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._application_fee import ( # noqa ApplicationFee, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/application_fee_refund.py0000644000175100001770000000113114637354563023730 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.application_fee_refund package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.application_fee_refund import ApplicationFeeRefund To: from stripe import ApplicationFeeRefund """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._application_fee_refund import ( # noqa ApplicationFeeRefund, ) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5169404 stripe-10.1.0/stripe/api_resources/apps/0000755000175100001770000000000014637354616017637 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/apps/__init__.py0000644000175100001770000000077014637354563021755 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.apps package is deprecated, please change your imports to import from stripe.apps directly. From: from stripe.api_resources.apps import ... To: from stripe.apps import ... """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.api_resources.apps.secret import Secret ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/apps/secret.py0000644000175100001770000000103014637354563021471 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.apps.secret package is deprecated, please change your imports to import from stripe.apps directly. From: from stripe.api_resources.apps.secret import Secret To: from stripe.apps import Secret """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.apps._secret import ( # noqa Secret, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/balance.py0000644000175100001770000000100514637354563020630 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.balance package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.balance import Balance To: from stripe import Balance """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._balance import ( # noqa Balance, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/balance_transaction.py0000644000175100001770000000111214637354563023234 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.balance_transaction package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.balance_transaction import BalanceTransaction To: from stripe import BalanceTransaction """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._balance_transaction import ( # noqa BalanceTransaction, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/bank_account.py0000644000175100001770000000104014637354563021671 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.bank_account package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.bank_account import BankAccount To: from stripe import BankAccount """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._bank_account import ( # noqa BankAccount, ) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5169404 stripe-10.1.0/stripe/api_resources/billing/0000755000175100001770000000000014637354616020314 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/billing/__init__.py0000644000175100001770000000142714637354563022432 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.billing package is deprecated, please change your imports to import from stripe.billing directly. From: from stripe.api_resources.billing import ... To: from stripe.billing import ... """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.api_resources.billing.meter import Meter from stripe.api_resources.billing.meter_event import MeterEvent from stripe.api_resources.billing.meter_event_adjustment import ( MeterEventAdjustment, ) from stripe.api_resources.billing.meter_event_summary import ( MeterEventSummary, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/billing/meter.py0000644000175100001770000000104114637354563021777 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.billing.meter package is deprecated, please change your imports to import from stripe.billing directly. From: from stripe.api_resources.billing.meter import Meter To: from stripe.billing import Meter """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.billing._meter import ( # noqa Meter, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/billing/meter_event.py0000644000175100001770000000110214637354563023176 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.billing.meter_event package is deprecated, please change your imports to import from stripe.billing directly. From: from stripe.api_resources.billing.meter_event import MeterEvent To: from stripe.billing import MeterEvent """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.billing._meter_event import ( # noqa MeterEvent, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/billing/meter_event_adjustment.py0000644000175100001770000000120114637354563025434 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.billing.meter_event_adjustment package is deprecated, please change your imports to import from stripe.billing directly. From: from stripe.api_resources.billing.meter_event_adjustment import MeterEventAdjustment To: from stripe.billing import MeterEventAdjustment """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.billing._meter_event_adjustment import ( # noqa MeterEventAdjustment, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/billing/meter_event_summary.py0000644000175100001770000000115714637354563024765 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.billing.meter_event_summary package is deprecated, please change your imports to import from stripe.billing directly. From: from stripe.api_resources.billing.meter_event_summary import MeterEventSummary To: from stripe.billing import MeterEventSummary """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.billing._meter_event_summary import ( # noqa MeterEventSummary, ) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5209403 stripe-10.1.0/stripe/api_resources/billing_portal/0000755000175100001770000000000014637354616021675 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/billing_portal/__init__.py0000644000175100001770000000117414637354563024012 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.billing_portal package is deprecated, please change your imports to import from stripe.billing_portal directly. From: from stripe.api_resources.billing_portal import ... To: from stripe.billing_portal import ... """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.api_resources.billing_portal.configuration import Configuration from stripe.api_resources.billing_portal.session import Session ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/billing_portal/configuration.py0000644000175100001770000000116414637354563025121 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.billing_portal.configuration package is deprecated, please change your imports to import from stripe.billing_portal directly. From: from stripe.api_resources.billing_portal.configuration import Configuration To: from stripe.billing_portal import Configuration """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.billing_portal._configuration import ( # noqa Configuration, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/billing_portal/session.py0000644000175100001770000000112014637354563023725 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.billing_portal.session package is deprecated, please change your imports to import from stripe.billing_portal directly. From: from stripe.api_resources.billing_portal.session import Session To: from stripe.billing_portal import Session """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.billing_portal._session import ( # noqa Session, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/capability.py0000644000175100001770000000102714637354563021370 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.capability package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.capability import Capability To: from stripe import Capability """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._capability import ( # noqa Capability, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/card.py0000644000175100001770000000076314637354563020166 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.card package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.card import Card To: from stripe import Card """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._card import ( # noqa Card, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/cash_balance.py0000644000175100001770000000104014637354563021625 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.cash_balance package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.cash_balance import CashBalance To: from stripe import CashBalance """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._cash_balance import ( # noqa CashBalance, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/charge.py0000644000175100001770000000077714637354563020513 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.charge package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.charge import Charge To: from stripe import Charge """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._charge import ( # noqa Charge, ) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5209403 stripe-10.1.0/stripe/api_resources/checkout/0000755000175100001770000000000014637354616020501 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/checkout/__init__.py0000644000175100001770000000101614637354563022611 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.checkout package is deprecated, please change your imports to import from stripe.checkout directly. From: from stripe.api_resources.checkout import ... To: from stripe.checkout import ... """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.api_resources.checkout.session import Session ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/checkout/session.py0000644000175100001770000000106214637354563022536 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.checkout.session package is deprecated, please change your imports to import from stripe.checkout directly. From: from stripe.api_resources.checkout.session import Session To: from stripe.checkout import Session """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.checkout._session import ( # noqa Session, ) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5209403 stripe-10.1.0/stripe/api_resources/climate/0000755000175100001770000000000014637354616020312 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/climate/__init__.py0000644000175100001770000000120114637354563022416 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.climate package is deprecated, please change your imports to import from stripe.climate directly. From: from stripe.api_resources.climate import ... To: from stripe.climate import ... """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.api_resources.climate.order import Order from stripe.api_resources.climate.product import Product from stripe.api_resources.climate.supplier import Supplier ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/climate/order.py0000644000175100001770000000104114637354563021774 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.climate.order package is deprecated, please change your imports to import from stripe.climate directly. From: from stripe.api_resources.climate.order import Order To: from stripe.climate import Order """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.climate._order import ( # noqa Order, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/climate/product.py0000644000175100001770000000105514637354563022346 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.climate.product package is deprecated, please change your imports to import from stripe.climate directly. From: from stripe.api_resources.climate.product import Product To: from stripe.climate import Product """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.climate._product import ( # noqa Product, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/climate/supplier.py0000644000175100001770000000106314637354563022530 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.climate.supplier package is deprecated, please change your imports to import from stripe.climate directly. From: from stripe.api_resources.climate.supplier import Supplier To: from stripe.climate import Supplier """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.climate._supplier import ( # noqa Supplier, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/confirmation_token.py0000644000175100001770000000110414637354563023133 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.confirmation_token package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.confirmation_token import ConfirmationToken To: from stripe import ConfirmationToken """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._confirmation_token import ( # noqa ConfirmationToken, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/connect_collection_transfer.py0000644000175100001770000000116714637354563025024 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.connect_collection_transfer package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.connect_collection_transfer import ConnectCollectionTransfer To: from stripe import ConnectCollectionTransfer """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._connect_collection_transfer import ( # noqa ConnectCollectionTransfer, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/country_spec.py0000644000175100001770000000104014637354563021757 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.country_spec package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.country_spec import CountrySpec To: from stripe import CountrySpec """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._country_spec import ( # noqa CountrySpec, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/coupon.py0000644000175100001770000000077714637354563020565 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.coupon package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.coupon import Coupon To: from stripe import Coupon """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._coupon import ( # noqa Coupon, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/credit_note.py0000644000175100001770000000103214637354563021542 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.credit_note package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.credit_note import CreditNote To: from stripe import CreditNote """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._credit_note import ( # noqa CreditNote, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/credit_note_line_item.py0000644000175100001770000000112014637354563023565 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.credit_note_line_item package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.credit_note_line_item import CreditNoteLineItem To: from stripe import CreditNoteLineItem """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._credit_note_line_item import ( # noqa CreditNoteLineItem, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/customer.py0000644000175100001770000000101314637354563021103 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.customer package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.customer import Customer To: from stripe import Customer """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._customer import ( # noqa Customer, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/customer_balance_transaction.py0000644000175100001770000000117514637354563025166 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.customer_balance_transaction package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.customer_balance_transaction import CustomerBalanceTransaction To: from stripe import CustomerBalanceTransaction """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._customer_balance_transaction import ( # noqa CustomerBalanceTransaction, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/customer_cash_balance_transaction.py0000644000175100001770000000123014637354563026154 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.customer_cash_balance_transaction package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.customer_cash_balance_transaction import CustomerCashBalanceTransaction To: from stripe import CustomerCashBalanceTransaction """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._customer_cash_balance_transaction import ( # noqa CustomerCashBalanceTransaction, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/customer_session.py0000644000175100001770000000107014637354563022651 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.customer_session package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.customer_session import CustomerSession To: from stripe import CustomerSession """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._customer_session import ( # noqa CustomerSession, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/discount.py0000644000175100001770000000101314637354563021072 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.discount package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.discount import Discount To: from stripe import Discount """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._discount import ( # noqa Discount, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/dispute.py0000644000175100001770000000100514637354563020720 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.dispute package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.dispute import Dispute To: from stripe import Dispute """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._dispute import ( # noqa Dispute, ) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5209403 stripe-10.1.0/stripe/api_resources/entitlements/0000755000175100001770000000000014637354616021407 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/entitlements/__init__.py0000644000175100001770000000140114637354563023515 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.entitlements package is deprecated, please change your imports to import from stripe.entitlements directly. From: from stripe.api_resources.entitlements import ... To: from stripe.entitlements import ... """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.api_resources.entitlements.active_entitlement import ( ActiveEntitlement, ) from stripe.api_resources.entitlements.active_entitlement_summary import ( ActiveEntitlementSummary, ) from stripe.api_resources.entitlements.feature import Feature ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/entitlements/active_entitlement.py0000644000175100001770000000120514637354563025643 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.entitlements.active_entitlement package is deprecated, please change your imports to import from stripe.entitlements directly. From: from stripe.api_resources.entitlements.active_entitlement import ActiveEntitlement To: from stripe.entitlements import ActiveEntitlement """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.entitlements._active_entitlement import ( # noqa ActiveEntitlement, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/entitlements/active_entitlement_summary.py0000644000175100001770000000126214637354563027423 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.entitlements.active_entitlement_summary package is deprecated, please change your imports to import from stripe.entitlements directly. From: from stripe.api_resources.entitlements.active_entitlement_summary import ActiveEntitlementSummary To: from stripe.entitlements import ActiveEntitlementSummary """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.entitlements._active_entitlement_summary import ( # noqa ActiveEntitlementSummary, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/entitlements/feature.py0000644000175100001770000000110614637354563023413 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.entitlements.feature package is deprecated, please change your imports to import from stripe.entitlements directly. From: from stripe.api_resources.entitlements.feature import Feature To: from stripe.entitlements import Feature """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.entitlements._feature import ( # noqa Feature, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/ephemeral_key.py0000644000175100001770000000104614637354563022062 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.ephemeral_key package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.ephemeral_key import EphemeralKey To: from stripe import EphemeralKey """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._ephemeral_key import ( # noqa EphemeralKey, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/error_object.py0000644000175100001770000000100114637354563021716 0ustar00runnerdocker# -*- coding: utf-8 -*- from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.error_object package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.error_object import ErrorObject To: from stripe import ErrorObject """, DeprecationWarning, ) if not TYPE_CHECKING: from stripe._error_object import ( # noqa ErrorObject, OAuthErrorObject, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/event.py0000644000175100001770000000077114637354563020375 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.event package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.event import Event To: from stripe import Event """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._event import ( # noqa Event, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/exchange_rate.py0000644000175100001770000000104614637354563022045 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.exchange_rate package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.exchange_rate import ExchangeRate To: from stripe import ExchangeRate """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._exchange_rate import ( # noqa ExchangeRate, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/file.py0000644000175100001770000000076314637354563020174 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.file package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.file import File To: from stripe import File """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._file import ( # noqa File, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/file_link.py0000644000175100001770000000101614637354563021201 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.file_link package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.file_link import FileLink To: from stripe import FileLink """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._file_link import ( # noqa FileLink, ) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5209403 stripe-10.1.0/stripe/api_resources/financial_connections/0000755000175100001770000000000014637354616023222 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/financial_connections/__init__.py0000644000175100001770000000172414637354563025340 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.financial_connections package is deprecated, please change your imports to import from stripe.financial_connections directly. From: from stripe.api_resources.financial_connections import ... To: from stripe.financial_connections import ... """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.api_resources.financial_connections.account import Account from stripe.api_resources.financial_connections.account_owner import ( AccountOwner, ) from stripe.api_resources.financial_connections.account_ownership import ( AccountOwnership, ) from stripe.api_resources.financial_connections.session import Session from stripe.api_resources.financial_connections.transaction import ( Transaction, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/financial_connections/account.py0000644000175100001770000000116314637354563025232 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.financial_connections.account package is deprecated, please change your imports to import from stripe.financial_connections directly. From: from stripe.api_resources.financial_connections.account import Account To: from stripe.financial_connections import Account """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.financial_connections._account import ( # noqa Account, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/financial_connections/account_owner.py0000644000175100001770000000122414637354563026442 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.financial_connections.account_owner package is deprecated, please change your imports to import from stripe.financial_connections directly. From: from stripe.api_resources.financial_connections.account_owner import AccountOwner To: from stripe.financial_connections import AccountOwner """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.financial_connections._account_owner import ( # noqa AccountOwner, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/financial_connections/account_ownership.py0000644000175100001770000000125414637354563027331 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.financial_connections.account_ownership package is deprecated, please change your imports to import from stripe.financial_connections directly. From: from stripe.api_resources.financial_connections.account_ownership import AccountOwnership To: from stripe.financial_connections import AccountOwnership """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.financial_connections._account_ownership import ( # noqa AccountOwnership, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/financial_connections/session.py0000644000175100001770000000116314637354563025261 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.financial_connections.session package is deprecated, please change your imports to import from stripe.financial_connections directly. From: from stripe.api_resources.financial_connections.session import Session To: from stripe.financial_connections import Session """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.financial_connections._session import ( # noqa Session, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/financial_connections/transaction.py0000644000175100001770000000121314637354563026117 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.financial_connections.transaction package is deprecated, please change your imports to import from stripe.financial_connections directly. From: from stripe.api_resources.financial_connections.transaction import Transaction To: from stripe.financial_connections import Transaction """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.financial_connections._transaction import ( # noqa Transaction, ) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5209403 stripe-10.1.0/stripe/api_resources/forwarding/0000755000175100001770000000000014637354616021036 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/forwarding/__init__.py0000644000175100001770000000103014637354563023142 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.forwarding package is deprecated, please change your imports to import from stripe.forwarding directly. From: from stripe.api_resources.forwarding import ... To: from stripe.forwarding import ... """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.api_resources.forwarding.request import Request ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/forwarding/request.py0000644000175100001770000000107414637354563023103 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.forwarding.request package is deprecated, please change your imports to import from stripe.forwarding directly. From: from stripe.api_resources.forwarding.request import Request To: from stripe.forwarding import Request """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.forwarding._request import ( # noqa Request, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/funding_instructions.py0000644000175100001770000000112014637354563023517 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.funding_instructions package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.funding_instructions import FundingInstructions To: from stripe import FundingInstructions """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._funding_instructions import ( # noqa FundingInstructions, ) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5209403 stripe-10.1.0/stripe/api_resources/identity/0000755000175100001770000000000014637354616020525 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/identity/__init__.py0000644000175100001770000000123614637354563022641 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.identity package is deprecated, please change your imports to import from stripe.identity directly. From: from stripe.api_resources.identity import ... To: from stripe.identity import ... """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.api_resources.identity.verification_report import ( VerificationReport, ) from stripe.api_resources.identity.verification_session import ( VerificationSession, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/identity/verification_report.py0000644000175100001770000000116714637354563025162 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.identity.verification_report package is deprecated, please change your imports to import from stripe.identity directly. From: from stripe.api_resources.identity.verification_report import VerificationReport To: from stripe.identity import VerificationReport """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.identity._verification_report import ( # noqa VerificationReport, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/identity/verification_session.py0000644000175100001770000000117514637354563025331 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.identity.verification_session package is deprecated, please change your imports to import from stripe.identity directly. From: from stripe.api_resources.identity.verification_session import VerificationSession To: from stripe.identity import VerificationSession """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.identity._verification_session import ( # noqa VerificationSession, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/invoice.py0000644000175100001770000000100514637354563020677 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.invoice package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.invoice import Invoice To: from stripe import Invoice """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._invoice import ( # noqa Invoice, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/invoice_item.py0000644000175100001770000000104014637354563021714 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.invoice_item package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.invoice_item import InvoiceItem To: from stripe import InvoiceItem """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._invoice_item import ( # noqa InvoiceItem, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/invoice_line_item.py0000644000175100001770000000107314637354563022731 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.invoice_line_item package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.invoice_line_item import InvoiceLineItem To: from stripe import InvoiceLineItem """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._invoice_line_item import ( # noqa InvoiceLineItem, ) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5249405 stripe-10.1.0/stripe/api_resources/issuing/0000755000175100001770000000000014637354616020355 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/issuing/__init__.py0000644000175100001770000000200114637354563022460 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.issuing package is deprecated, please change your imports to import from stripe.issuing directly. From: from stripe.api_resources.issuing import ... To: from stripe.issuing import ... """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.api_resources.issuing.authorization import Authorization from stripe.api_resources.issuing.card import Card from stripe.api_resources.issuing.cardholder import Cardholder from stripe.api_resources.issuing.dispute import Dispute from stripe.api_resources.issuing.personalization_design import ( PersonalizationDesign, ) from stripe.api_resources.issuing.physical_bundle import PhysicalBundle from stripe.api_resources.issuing.token import Token from stripe.api_resources.issuing.transaction import Transaction ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/issuing/authorization.py0000644000175100001770000000112114637354563023623 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.issuing.authorization package is deprecated, please change your imports to import from stripe.issuing directly. From: from stripe.api_resources.issuing.authorization import Authorization To: from stripe.issuing import Authorization """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.issuing._authorization import ( # noqa Authorization, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/issuing/card.py0000644000175100001770000000103314637354563021636 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.issuing.card package is deprecated, please change your imports to import from stripe.issuing directly. From: from stripe.api_resources.issuing.card import Card To: from stripe.issuing import Card """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.issuing._card import ( # noqa Card, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/issuing/cardholder.py0000644000175100001770000000107714637354563023044 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.issuing.cardholder package is deprecated, please change your imports to import from stripe.issuing directly. From: from stripe.api_resources.issuing.cardholder import Cardholder To: from stripe.issuing import Cardholder """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.issuing._cardholder import ( # noqa Cardholder, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/issuing/dispute.py0000644000175100001770000000105514637354563022406 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.issuing.dispute package is deprecated, please change your imports to import from stripe.issuing directly. From: from stripe.api_resources.issuing.dispute import Dispute To: from stripe.issuing import Dispute """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.issuing._dispute import ( # noqa Dispute, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/issuing/personalization_design.py0000644000175100001770000000120414637354563025477 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.issuing.personalization_design package is deprecated, please change your imports to import from stripe.issuing directly. From: from stripe.api_resources.issuing.personalization_design import PersonalizationDesign To: from stripe.issuing import PersonalizationDesign """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.issuing._personalization_design import ( # noqa PersonalizationDesign, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/issuing/physical_bundle.py0000644000175100001770000000113214637354563024072 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.issuing.physical_bundle package is deprecated, please change your imports to import from stripe.issuing directly. From: from stripe.api_resources.issuing.physical_bundle import PhysicalBundle To: from stripe.issuing import PhysicalBundle """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.issuing._physical_bundle import ( # noqa PhysicalBundle, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/issuing/token.py0000644000175100001770000000104114637354563022044 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.issuing.token package is deprecated, please change your imports to import from stripe.issuing directly. From: from stripe.api_resources.issuing.token import Token To: from stripe.issuing import Token """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.issuing._token import ( # noqa Token, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/issuing/transaction.py0000644000175100001770000000110514637354563023252 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.issuing.transaction package is deprecated, please change your imports to import from stripe.issuing directly. From: from stripe.api_resources.issuing.transaction import Transaction To: from stripe.issuing import Transaction """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.issuing._transaction import ( # noqa Transaction, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/line_item.py0000644000175100001770000000101614637354563021212 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.line_item package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.line_item import LineItem To: from stripe import LineItem """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._line_item import ( # noqa LineItem, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/list_object.py0000644000175100001770000000103214637354563021544 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.list_object package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.list_object import ListObject To: from stripe import ListObject """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._list_object import ( # noqa ListObject, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/login_link.py0000644000175100001770000000102414637354563021371 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.login_link package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.login_link import LoginLink To: from stripe import LoginLink """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._login_link import ( # noqa LoginLink, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/mandate.py0000644000175100001770000000100514637354563020654 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.mandate package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.mandate import Mandate To: from stripe import Mandate """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._mandate import ( # noqa Mandate, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/payment_intent.py0000644000175100001770000000105414637354563022305 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.payment_intent package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.payment_intent import PaymentIntent To: from stripe import PaymentIntent """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._payment_intent import ( # noqa PaymentIntent, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/payment_link.py0000644000175100001770000000104014637354563021734 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.payment_link package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.payment_link import PaymentLink To: from stripe import PaymentLink """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._payment_link import ( # noqa PaymentLink, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/payment_method.py0000644000175100001770000000105414637354563022264 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.payment_method package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.payment_method import PaymentMethod To: from stripe import PaymentMethod """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._payment_method import ( # noqa PaymentMethod, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/payment_method_configuration.py0000644000175100001770000000117514637354563025217 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.payment_method_configuration package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.payment_method_configuration import PaymentMethodConfiguration To: from stripe import PaymentMethodConfiguration """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._payment_method_configuration import ( # noqa PaymentMethodConfiguration, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/payment_method_domain.py0000644000175100001770000000112314637354563023610 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.payment_method_domain package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.payment_method_domain import PaymentMethodDomain To: from stripe import PaymentMethodDomain """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._payment_method_domain import ( # noqa PaymentMethodDomain, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/payout.py0000644000175100001770000000077714637354563020603 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.payout package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.payout import Payout To: from stripe import Payout """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._payout import ( # noqa Payout, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/person.py0000644000175100001770000000077714637354563020570 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.person package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.person import Person To: from stripe import Person """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._person import ( # noqa Person, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/plan.py0000644000175100001770000000076314637354563020207 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.plan package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.plan import Plan To: from stripe import Plan """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._plan import ( # noqa Plan, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/price.py0000644000175100001770000000077114637354563020356 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.price package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.price import Price To: from stripe import Price """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._price import ( # noqa Price, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/product.py0000644000175100001770000000100514637354563020723 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.product package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.product import Product To: from stripe import Product """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._product import ( # noqa Product, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/product_feature.py0000644000175100001770000000106214637354563022441 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.product_feature package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.product_feature import ProductFeature To: from stripe import ProductFeature """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._product_feature import ( # noqa ProductFeature, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/promotion_code.py0000644000175100001770000000105414637354563022267 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.promotion_code package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.promotion_code import PromotionCode To: from stripe import PromotionCode """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._promotion_code import ( # noqa PromotionCode, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/quote.py0000644000175100001770000000077114637354563020411 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.quote package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.quote import Quote To: from stripe import Quote """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._quote import ( # noqa Quote, ) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5249405 stripe-10.1.0/stripe/api_resources/radar/0000755000175100001770000000000014637354616017765 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/radar/__init__.py0000644000175100001770000000125714637354563022104 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.radar package is deprecated, please change your imports to import from stripe.radar directly. From: from stripe.api_resources.radar import ... To: from stripe.radar import ... """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.api_resources.radar.early_fraud_warning import ( EarlyFraudWarning, ) from stripe.api_resources.radar.value_list import ValueList from stripe.api_resources.radar.value_list_item import ValueListItem ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/radar/early_fraud_warning.py0000644000175100001770000000114514637354563024363 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.radar.early_fraud_warning package is deprecated, please change your imports to import from stripe.radar directly. From: from stripe.api_resources.radar.early_fraud_warning import EarlyFraudWarning To: from stripe.radar import EarlyFraudWarning """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.radar._early_fraud_warning import ( # noqa EarlyFraudWarning, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/radar/value_list.py0000644000175100001770000000106214637354563022506 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.radar.value_list package is deprecated, please change your imports to import from stripe.radar directly. From: from stripe.api_resources.radar.value_list import ValueList To: from stripe.radar import ValueList """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.radar._value_list import ( # noqa ValueList, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/radar/value_list_item.py0000644000175100001770000000111514637354563023523 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.radar.value_list_item package is deprecated, please change your imports to import from stripe.radar directly. From: from stripe.api_resources.radar.value_list_item import ValueListItem To: from stripe.radar import ValueListItem """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.radar._value_list_item import ( # noqa ValueListItem, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/recipient_transfer.py0000644000175100001770000000045414637354563023140 0ustar00runnerdockerfrom stripe._stripe_object import StripeObject from warnings import warn warn( """ The RecipientTransfer class is deprecated and will be removed in a future """, DeprecationWarning, stacklevel=2, ) class RecipientTransfer(StripeObject): OBJECT_NAME = "recipient_transfer" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/refund.py0000644000175100001770000000077714637354563020545 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.refund package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.refund import Refund To: from stripe import Refund """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._refund import ( # noqa Refund, ) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5249405 stripe-10.1.0/stripe/api_resources/reporting/0000755000175100001770000000000014637354616020705 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/reporting/__init__.py0000644000175100001770000000113614637354563023020 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.reporting package is deprecated, please change your imports to import from stripe.reporting directly. From: from stripe.api_resources.reporting import ... To: from stripe.reporting import ... """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.api_resources.reporting.report_run import ReportRun from stripe.api_resources.reporting.report_type import ReportType ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/reporting/report_run.py0000644000175100001770000000110614637354563023455 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.reporting.report_run package is deprecated, please change your imports to import from stripe.reporting directly. From: from stripe.api_resources.reporting.report_run import ReportRun To: from stripe.reporting import ReportRun """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.reporting._report_run import ( # noqa ReportRun, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/reporting/report_type.py0000644000175100001770000000111414637354563023631 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.reporting.report_type package is deprecated, please change your imports to import from stripe.reporting directly. From: from stripe.api_resources.reporting.report_type import ReportType To: from stripe.reporting import ReportType """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.reporting._report_type import ( # noqa ReportType, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/reserve_transaction.py0000644000175100001770000000111214637354563023322 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.reserve_transaction package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.reserve_transaction import ReserveTransaction To: from stripe import ReserveTransaction """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._reserve_transaction import ( # noqa ReserveTransaction, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/reversal.py0000644000175100001770000000101314637354563021065 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.reversal package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.reversal import Reversal To: from stripe import Reversal """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._reversal import ( # noqa Reversal, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/review.py0000644000175100001770000000077714637354563020563 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.review package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.review import Review To: from stripe import Review """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._review import ( # noqa Review, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/search_result_object.py0000644000175100001770000000111514637354563023436 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.search_result_object package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.search_result_object import SearchResultObject To: from stripe import SearchResultObject """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._search_result_object import ( # noqa SearchResultObject, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/setup_attempt.py0000644000175100001770000000104614637354563022146 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.setup_attempt package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.setup_attempt import SetupAttempt To: from stripe import SetupAttempt """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._setup_attempt import ( # noqa SetupAttempt, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/setup_intent.py0000644000175100001770000000104014637354563021763 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.setup_intent package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.setup_intent import SetupIntent To: from stripe import SetupIntent """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._setup_intent import ( # noqa SetupIntent, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/shipping_rate.py0000644000175100001770000000104614637354563022104 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.shipping_rate package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.shipping_rate import ShippingRate To: from stripe import ShippingRate """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._shipping_rate import ( # noqa ShippingRate, ) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5249405 stripe-10.1.0/stripe/api_resources/sigma/0000755000175100001770000000000014637354616017774 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/sigma/__init__.py0000644000175100001770000000104614637354563022107 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.sigma package is deprecated, please change your imports to import from stripe.sigma directly. From: from stripe.api_resources.sigma import ... To: from stripe.sigma import ... """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.api_resources.sigma.scheduled_query_run import ( ScheduledQueryRun, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/sigma/scheduled_query_run.py0000644000175100001770000000114514637354563024421 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.sigma.scheduled_query_run package is deprecated, please change your imports to import from stripe.sigma directly. From: from stripe.api_resources.sigma.scheduled_query_run import ScheduledQueryRun To: from stripe.sigma import ScheduledQueryRun """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.sigma._scheduled_query_run import ( # noqa ScheduledQueryRun, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/source.py0000644000175100001770000000077714637354563020562 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.source package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.source import Source To: from stripe import Source """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._source import ( # noqa Source, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/source_mandate_notification.py0000644000175100001770000000116714637354563025013 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.source_mandate_notification package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.source_mandate_notification import SourceMandateNotification To: from stripe import SourceMandateNotification """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._source_mandate_notification import ( # noqa SourceMandateNotification, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/source_transaction.py0000644000175100001770000000110414637354563023150 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.source_transaction package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.source_transaction import SourceTransaction To: from stripe import SourceTransaction """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._source_transaction import ( # noqa SourceTransaction, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/subscription.py0000644000175100001770000000104314637354563021771 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.subscription package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.subscription import Subscription To: from stripe import Subscription """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._subscription import ( # noqa Subscription, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/subscription_item.py0000644000175100001770000000107614637354563023015 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.subscription_item package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.subscription_item import SubscriptionItem To: from stripe import SubscriptionItem """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._subscription_item import ( # noqa SubscriptionItem, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/subscription_schedule.py0000644000175100001770000000112614637354563023647 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.subscription_schedule package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.subscription_schedule import SubscriptionSchedule To: from stripe import SubscriptionSchedule """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._subscription_schedule import ( # noqa SubscriptionSchedule, ) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5249405 stripe-10.1.0/stripe/api_resources/tax/0000755000175100001770000000000014637354616017470 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/tax/__init__.py0000644000175100001770000000160414637354563021603 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.tax package is deprecated, please change your imports to import from stripe.tax directly. From: from stripe.api_resources.tax import ... To: from stripe.tax import ... """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.api_resources.tax.calculation import Calculation from stripe.api_resources.tax.calculation_line_item import ( CalculationLineItem, ) from stripe.api_resources.tax.registration import Registration from stripe.api_resources.tax.settings import Settings from stripe.api_resources.tax.transaction import Transaction from stripe.api_resources.tax.transaction_line_item import ( TransactionLineItem, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/tax/calculation.py0000644000175100001770000000106114637354563022337 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.tax.calculation package is deprecated, please change your imports to import from stripe.tax directly. From: from stripe.api_resources.tax.calculation import Calculation To: from stripe.tax import Calculation """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.tax._calculation import ( # noqa Calculation, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/tax/calculation_line_item.py0000644000175100001770000000114714637354563024371 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.tax.calculation_line_item package is deprecated, please change your imports to import from stripe.tax directly. From: from stripe.api_resources.tax.calculation_line_item import CalculationLineItem To: from stripe.tax import CalculationLineItem """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.tax._calculation_line_item import ( # noqa CalculationLineItem, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/tax/registration.py0000644000175100001770000000106714637354563022561 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.tax.registration package is deprecated, please change your imports to import from stripe.tax directly. From: from stripe.api_resources.tax.registration import Registration To: from stripe.tax import Registration """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.tax._registration import ( # noqa Registration, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/tax/settings.py0000644000175100001770000000103714637354563021704 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.tax.settings package is deprecated, please change your imports to import from stripe.tax directly. From: from stripe.api_resources.tax.settings import Settings To: from stripe.tax import Settings """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.tax._settings import ( # noqa Settings, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/tax/transaction.py0000644000175100001770000000106114637354563022366 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.tax.transaction package is deprecated, please change your imports to import from stripe.tax directly. From: from stripe.api_resources.tax.transaction import Transaction To: from stripe.tax import Transaction """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.tax._transaction import ( # noqa Transaction, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/tax/transaction_line_item.py0000644000175100001770000000114714637354563024420 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.tax.transaction_line_item package is deprecated, please change your imports to import from stripe.tax directly. From: from stripe.api_resources.tax.transaction_line_item import TransactionLineItem To: from stripe.tax import TransactionLineItem """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.tax._transaction_line_item import ( # noqa TransactionLineItem, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/tax_code.py0000644000175100001770000000101014637354563021025 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.tax_code package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.tax_code import TaxCode To: from stripe import TaxCode """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._tax_code import ( # noqa TaxCode, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/tax_deducted_at_source.py0000644000175100001770000000112614637354563023750 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.tax_deducted_at_source package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.tax_deducted_at_source import TaxDeductedAtSource To: from stripe import TaxDeductedAtSource """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._tax_deducted_at_source import ( # noqa TaxDeductedAtSource, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/tax_id.py0000644000175100001770000000077414637354563020527 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.tax_id package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.tax_id import TaxId To: from stripe import TaxId """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._tax_id import ( # noqa TaxId, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/tax_rate.py0000644000175100001770000000101014637354563021046 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.tax_rate package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.tax_rate import TaxRate To: from stripe import TaxRate """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._tax_rate import ( # noqa TaxRate, ) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5249405 stripe-10.1.0/stripe/api_resources/terminal/0000755000175100001770000000000014637354616020507 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/terminal/__init__.py0000644000175100001770000000134514637354563022624 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.terminal package is deprecated, please change your imports to import from stripe.terminal directly. From: from stripe.api_resources.terminal import ... To: from stripe.terminal import ... """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.api_resources.terminal.configuration import Configuration from stripe.api_resources.terminal.connection_token import ConnectionToken from stripe.api_resources.terminal.location import Location from stripe.api_resources.terminal.reader import Reader ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/terminal/configuration.py0000644000175100001770000000112614637354563023731 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.terminal.configuration package is deprecated, please change your imports to import from stripe.terminal directly. From: from stripe.api_resources.terminal.configuration import Configuration To: from stripe.terminal import Configuration """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.terminal._configuration import ( # noqa Configuration, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/terminal/connection_token.py0000644000175100001770000000114514637354563024422 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.terminal.connection_token package is deprecated, please change your imports to import from stripe.terminal directly. From: from stripe.api_resources.terminal.connection_token import ConnectionToken To: from stripe.terminal import ConnectionToken """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.terminal._connection_token import ( # noqa ConnectionToken, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/terminal/location.py0000644000175100001770000000107014637354563022670 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.terminal.location package is deprecated, please change your imports to import from stripe.terminal directly. From: from stripe.api_resources.terminal.location import Location To: from stripe.terminal import Location """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.terminal._location import ( # noqa Location, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/terminal/reader.py0000644000175100001770000000105414637354563022324 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.terminal.reader package is deprecated, please change your imports to import from stripe.terminal directly. From: from stripe.api_resources.terminal.reader import Reader To: from stripe.terminal import Reader """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.terminal._reader import ( # noqa Reader, ) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5289404 stripe-10.1.0/stripe/api_resources/test_helpers/0000755000175100001770000000000014637354616021375 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/test_helpers/__init__.py0000644000175100001770000000104714637354563023511 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.test_helpers package is deprecated, please change your imports to import from stripe.test_helpers directly. From: from stripe.api_resources.test_helpers import ... To: from stripe.test_helpers import ... """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.api_resources.test_helpers.test_clock import TestClock ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/test_helpers/test_clock.py0000644000175100001770000000112514637354563024101 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.test_helpers.test_clock package is deprecated, please change your imports to import from stripe.test_helpers directly. From: from stripe.api_resources.test_helpers.test_clock import TestClock To: from stripe.test_helpers import TestClock """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.test_helpers._test_clock import ( # noqa TestClock, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/token.py0000644000175100001770000000077114637354563020374 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.token package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.token import Token To: from stripe import Token """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._token import ( # noqa Token, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/topup.py0000644000175100001770000000077114637354563020423 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.topup package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.topup import Topup To: from stripe import Topup """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._topup import ( # noqa Topup, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/transfer.py0000644000175100001770000000101314637354563021066 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.transfer package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.transfer import Transfer To: from stripe import Transfer """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._transfer import ( # noqa Transfer, ) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5289404 stripe-10.1.0/stripe/api_resources/treasury/0000755000175100001770000000000014637354616020552 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/treasury/__init__.py0000644000175100001770000000257514637354563022675 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.treasury package is deprecated, please change your imports to import from stripe.treasury directly. From: from stripe.api_resources.treasury import ... To: from stripe.treasury import ... """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.api_resources.treasury.credit_reversal import CreditReversal from stripe.api_resources.treasury.debit_reversal import DebitReversal from stripe.api_resources.treasury.financial_account import ( FinancialAccount, ) from stripe.api_resources.treasury.financial_account_features import ( FinancialAccountFeatures, ) from stripe.api_resources.treasury.inbound_transfer import InboundTransfer from stripe.api_resources.treasury.outbound_payment import OutboundPayment from stripe.api_resources.treasury.outbound_transfer import ( OutboundTransfer, ) from stripe.api_resources.treasury.received_credit import ReceivedCredit from stripe.api_resources.treasury.received_debit import ReceivedDebit from stripe.api_resources.treasury.transaction import Transaction from stripe.api_resources.treasury.transaction_entry import ( TransactionEntry, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/treasury/credit_reversal.py0000644000175100001770000000113714637354563024304 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.treasury.credit_reversal package is deprecated, please change your imports to import from stripe.treasury directly. From: from stripe.api_resources.treasury.credit_reversal import CreditReversal To: from stripe.treasury import CreditReversal """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.treasury._credit_reversal import ( # noqa CreditReversal, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/treasury/debit_reversal.py0000644000175100001770000000113114637354563024113 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.treasury.debit_reversal package is deprecated, please change your imports to import from stripe.treasury directly. From: from stripe.api_resources.treasury.debit_reversal import DebitReversal To: from stripe.treasury import DebitReversal """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.treasury._debit_reversal import ( # noqa DebitReversal, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/treasury/financial_account.py0000644000175100001770000000115314637354563024565 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.treasury.financial_account package is deprecated, please change your imports to import from stripe.treasury directly. From: from stripe.api_resources.treasury.financial_account import FinancialAccount To: from stripe.treasury import FinancialAccount """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.treasury._financial_account import ( # noqa FinancialAccount, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/treasury/financial_account_features.py0000644000175100001770000000123614637354563026465 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.treasury.financial_account_features package is deprecated, please change your imports to import from stripe.treasury directly. From: from stripe.api_resources.treasury.financial_account_features import FinancialAccountFeatures To: from stripe.treasury import FinancialAccountFeatures """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.treasury._financial_account_features import ( # noqa FinancialAccountFeatures, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/treasury/inbound_transfer.py0000644000175100001770000000114514637354563024470 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.treasury.inbound_transfer package is deprecated, please change your imports to import from stripe.treasury directly. From: from stripe.api_resources.treasury.inbound_transfer import InboundTransfer To: from stripe.treasury import InboundTransfer """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.treasury._inbound_transfer import ( # noqa InboundTransfer, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/treasury/outbound_payment.py0000644000175100001770000000114514637354563024522 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.treasury.outbound_payment package is deprecated, please change your imports to import from stripe.treasury directly. From: from stripe.api_resources.treasury.outbound_payment import OutboundPayment To: from stripe.treasury import OutboundPayment """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.treasury._outbound_payment import ( # noqa OutboundPayment, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/treasury/outbound_transfer.py0000644000175100001770000000115314637354563024670 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.treasury.outbound_transfer package is deprecated, please change your imports to import from stripe.treasury directly. From: from stripe.api_resources.treasury.outbound_transfer import OutboundTransfer To: from stripe.treasury import OutboundTransfer """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.treasury._outbound_transfer import ( # noqa OutboundTransfer, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/treasury/received_credit.py0000644000175100001770000000113714637354563024247 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.treasury.received_credit package is deprecated, please change your imports to import from stripe.treasury directly. From: from stripe.api_resources.treasury.received_credit import ReceivedCredit To: from stripe.treasury import ReceivedCredit """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.treasury._received_credit import ( # noqa ReceivedCredit, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/treasury/received_debit.py0000644000175100001770000000113114637354563024056 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.treasury.received_debit package is deprecated, please change your imports to import from stripe.treasury directly. From: from stripe.api_resources.treasury.received_debit import ReceivedDebit To: from stripe.treasury import ReceivedDebit """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.treasury._received_debit import ( # noqa ReceivedDebit, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/treasury/transaction.py0000644000175100001770000000111214637354563023445 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.treasury.transaction package is deprecated, please change your imports to import from stripe.treasury directly. From: from stripe.api_resources.treasury.transaction import Transaction To: from stripe.treasury import Transaction """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.treasury._transaction import ( # noqa Transaction, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/treasury/transaction_entry.py0000644000175100001770000000115314637354563024673 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.treasury.transaction_entry package is deprecated, please change your imports to import from stripe.treasury directly. From: from stripe.api_resources.treasury.transaction_entry import TransactionEntry To: from stripe.treasury import TransactionEntry """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe.treasury._transaction_entry import ( # noqa TransactionEntry, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/usage_record.py0000644000175100001770000000104014637354563021704 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.usage_record package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.usage_record import UsageRecord To: from stripe import UsageRecord """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._usage_record import ( # noqa UsageRecord, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/usage_record_summary.py0000644000175100001770000000111514637354563023464 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.usage_record_summary package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.usage_record_summary import UsageRecordSummary To: from stripe import UsageRecordSummary """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._usage_record_summary import ( # noqa UsageRecordSummary, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_resources/webhook_endpoint.py0000644000175100001770000000107014637354563022603 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.webhook_endpoint package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.webhook_endpoint import WebhookEndpoint To: from stripe import WebhookEndpoint """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._webhook_endpoint import ( # noqa WebhookEndpoint, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/api_version.py0000644000175100001770000000051114637354563016717 0ustar00runnerdocker# -*- coding: utf-8 -*- from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_version package is deprecated and will become internal in the future. """, DeprecationWarning, ) if not TYPE_CHECKING: from stripe._api_version import ( # noqa _ApiVersion, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/app_info.py0000644000175100001770000000110514637354563016174 0ustar00runnerdocker# -*- coding: utf-8 -*- """ The stripe.app_info package is deprecated, please change your imports to import from stripe directly. From: from stripe.app_info import AppInfo To: from stripe import AppInfo """ from typing_extensions import TYPE_CHECKING # No deprecation warning is raised here, because it would happen # on every import of `stripe/__init__.py` otherwise. Since that # module declares its own `app_info` name, this module becomes # practically impossible to import anyway. if not TYPE_CHECKING: from stripe._app_info import ( # noqa AppInfo, ) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5289404 stripe-10.1.0/stripe/apps/0000755000175100001770000000000014637354616014774 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/apps/__init__.py0000644000175100001770000000026714637354563017113 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe.apps._secret import Secret as Secret from stripe.apps._secret_service import SecretService as SecretService ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/apps/_secret.py0000644000175100001770000002425114637354563016777 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from typing import ClassVar, List, Optional, cast from typing_extensions import Literal, NotRequired, TypedDict, Unpack class Secret(CreateableAPIResource["Secret"], ListableAPIResource["Secret"]): """ Secret Store is an API that allows Stripe Apps developers to securely persist secrets for use by UI Extensions and app backends. The primary resource in Secret Store is a `secret`. Other apps can't view secrets created by an app. Additionally, secrets are scoped to provide further permission control. All Dashboard users and the app backend share `account` scoped secrets. Use the `account` scope for secrets that don't change per-user, like a third-party API key. A `user` scoped secret is accessible by the app backend and one specific Dashboard user. Use the `user` scope for per-user secrets like per-user OAuth tokens, where different users might have different permissions. Related guide: [Store data between page reloads](https://stripe.com/docs/stripe-apps/store-auth-data-custom-objects) """ OBJECT_NAME: ClassVar[Literal["apps.secret"]] = "apps.secret" class Scope(StripeObject): type: Literal["account", "user"] """ The secret scope type. """ user: Optional[str] """ The user ID, if type is set to "user" """ class CreateParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ expires_at: NotRequired[int] """ The Unix timestamp for the expiry time of the secret, after which the secret deletes. """ name: str """ A name for the secret that's unique within the scope. """ payload: str """ The plaintext secret value to be stored. """ scope: "Secret.CreateParamsScope" """ Specifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. """ class CreateParamsScope(TypedDict): type: Literal["account", "user"] """ The secret scope type. """ user: NotRequired[str] """ The user ID. This field is required if `type` is set to `user`, and should not be provided if `type` is set to `account`. """ class DeleteWhereParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ name: str """ A name for the secret that's unique within the scope. """ scope: "Secret.DeleteWhereParamsScope" """ Specifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. """ class DeleteWhereParamsScope(TypedDict): type: Literal["account", "user"] """ The secret scope type. """ user: NotRequired[str] """ The user ID. This field is required if `type` is set to `user`, and should not be provided if `type` is set to `account`. """ class FindParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ name: str """ A name for the secret that's unique within the scope. """ scope: "Secret.FindParamsScope" """ Specifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. """ class FindParamsScope(TypedDict): type: Literal["account", "user"] """ The secret scope type. """ user: NotRequired[str] """ The user ID. This field is required if `type` is set to `user`, and should not be provided if `type` is set to `account`. """ class ListParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ scope: "Secret.ListParamsScope" """ Specifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsScope(TypedDict): type: Literal["account", "user"] """ The secret scope type. """ user: NotRequired[str] """ The user ID. This field is required if `type` is set to `user`, and should not be provided if `type` is set to `account`. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ deleted: Optional[bool] """ If true, indicates that this secret has been deleted """ expires_at: Optional[int] """ The Unix timestamp for the expiry time of the secret, after which the secret deletes. """ id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ name: str """ A name for the secret that's unique within the scope. """ object: Literal["apps.secret"] """ String representing the object's type. Objects of the same type share the same value. """ payload: Optional[str] """ The plaintext secret value to be stored. """ scope: Scope @classmethod def create(cls, **params: Unpack["Secret.CreateParams"]) -> "Secret": """ Create or replace a secret in the secret store. """ return cast( "Secret", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["Secret.CreateParams"] ) -> "Secret": """ Create or replace a secret in the secret store. """ return cast( "Secret", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def delete_where( cls, **params: Unpack["Secret.DeleteWhereParams"] ) -> "Secret": """ Deletes a secret from the secret store by name and scope. """ return cast( "Secret", cls._static_request( "post", "/v1/apps/secrets/delete", params=params, ), ) @classmethod async def delete_where_async( cls, **params: Unpack["Secret.DeleteWhereParams"] ) -> "Secret": """ Deletes a secret from the secret store by name and scope. """ return cast( "Secret", await cls._static_request_async( "post", "/v1/apps/secrets/delete", params=params, ), ) @classmethod def find(cls, **params: Unpack["Secret.FindParams"]) -> "Secret": """ Finds a secret in the secret store by name and scope. """ return cast( "Secret", cls._static_request( "get", "/v1/apps/secrets/find", params=params, ), ) @classmethod async def find_async( cls, **params: Unpack["Secret.FindParams"] ) -> "Secret": """ Finds a secret in the secret store by name and scope. """ return cast( "Secret", await cls._static_request_async( "get", "/v1/apps/secrets/find", params=params, ), ) @classmethod def list( cls, **params: Unpack["Secret.ListParams"] ) -> ListObject["Secret"]: """ List all secrets stored on the given scope. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["Secret.ListParams"] ) -> ListObject["Secret"]: """ List all secrets stored on the given scope. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result _inner_class_types = {"scope": Scope} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/apps/_secret_service.py0000644000175100001770000002117414637354563020520 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe.apps._secret import Secret from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict class SecretService(StripeService): class CreateParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ expires_at: NotRequired[int] """ The Unix timestamp for the expiry time of the secret, after which the secret deletes. """ name: str """ A name for the secret that's unique within the scope. """ payload: str """ The plaintext secret value to be stored. """ scope: "SecretService.CreateParamsScope" """ Specifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. """ class CreateParamsScope(TypedDict): type: Literal["account", "user"] """ The secret scope type. """ user: NotRequired[str] """ The user ID. This field is required if `type` is set to `user`, and should not be provided if `type` is set to `account`. """ class DeleteWhereParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ name: str """ A name for the secret that's unique within the scope. """ scope: "SecretService.DeleteWhereParamsScope" """ Specifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. """ class DeleteWhereParamsScope(TypedDict): type: Literal["account", "user"] """ The secret scope type. """ user: NotRequired[str] """ The user ID. This field is required if `type` is set to `user`, and should not be provided if `type` is set to `account`. """ class FindParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ name: str """ A name for the secret that's unique within the scope. """ scope: "SecretService.FindParamsScope" """ Specifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. """ class FindParamsScope(TypedDict): type: Literal["account", "user"] """ The secret scope type. """ user: NotRequired[str] """ The user ID. This field is required if `type` is set to `user`, and should not be provided if `type` is set to `account`. """ class ListParams(TypedDict): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ scope: "SecretService.ListParamsScope" """ Specifies the scoping of the secret. Requests originating from UI extensions can only access account-scoped secrets or secrets scoped to their own user. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsScope(TypedDict): type: Literal["account", "user"] """ The secret scope type. """ user: NotRequired[str] """ The user ID. This field is required if `type` is set to `user`, and should not be provided if `type` is set to `account`. """ def list( self, params: "SecretService.ListParams", options: RequestOptions = {} ) -> ListObject[Secret]: """ List all secrets stored on the given scope. """ return cast( ListObject[Secret], self._request( "get", "/v1/apps/secrets", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "SecretService.ListParams", options: RequestOptions = {} ) -> ListObject[Secret]: """ List all secrets stored on the given scope. """ return cast( ListObject[Secret], await self._request_async( "get", "/v1/apps/secrets", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "SecretService.CreateParams", options: RequestOptions = {}, ) -> Secret: """ Create or replace a secret in the secret store. """ return cast( Secret, self._request( "post", "/v1/apps/secrets", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "SecretService.CreateParams", options: RequestOptions = {}, ) -> Secret: """ Create or replace a secret in the secret store. """ return cast( Secret, await self._request_async( "post", "/v1/apps/secrets", api_mode="V1", base_address="api", params=params, options=options, ), ) def find( self, params: "SecretService.FindParams", options: RequestOptions = {} ) -> Secret: """ Finds a secret in the secret store by name and scope. """ return cast( Secret, self._request( "get", "/v1/apps/secrets/find", api_mode="V1", base_address="api", params=params, options=options, ), ) async def find_async( self, params: "SecretService.FindParams", options: RequestOptions = {} ) -> Secret: """ Finds a secret in the secret store by name and scope. """ return cast( Secret, await self._request_async( "get", "/v1/apps/secrets/find", api_mode="V1", base_address="api", params=params, options=options, ), ) def delete_where( self, params: "SecretService.DeleteWhereParams", options: RequestOptions = {}, ) -> Secret: """ Deletes a secret from the secret store by name and scope. """ return cast( Secret, self._request( "post", "/v1/apps/secrets/delete", api_mode="V1", base_address="api", params=params, options=options, ), ) async def delete_where_async( self, params: "SecretService.DeleteWhereParams", options: RequestOptions = {}, ) -> Secret: """ Deletes a secret from the secret store by name and scope. """ return cast( Secret, await self._request_async( "post", "/v1/apps/secrets/delete", api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5289404 stripe-10.1.0/stripe/billing/0000755000175100001770000000000014637354616015451 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/billing/__init__.py0000644000175100001770000000142614637354563017566 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe.billing._meter import Meter as Meter from stripe.billing._meter_event import MeterEvent as MeterEvent from stripe.billing._meter_event_adjustment import ( MeterEventAdjustment as MeterEventAdjustment, ) from stripe.billing._meter_event_adjustment_service import ( MeterEventAdjustmentService as MeterEventAdjustmentService, ) from stripe.billing._meter_event_service import ( MeterEventService as MeterEventService, ) from stripe.billing._meter_event_summary import ( MeterEventSummary as MeterEventSummary, ) from stripe.billing._meter_event_summary_service import ( MeterEventSummaryService as MeterEventSummaryService, ) from stripe.billing._meter_service import MeterService as MeterService ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/billing/_meter.py0000644000175100001770000004565414637354563017315 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._nested_resource_class_methods import nested_resource_class_methods from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, List, Optional, cast, overload from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe.billing._meter_event_summary import MeterEventSummary @nested_resource_class_methods("event_summary") class Meter( CreateableAPIResource["Meter"], ListableAPIResource["Meter"], UpdateableAPIResource["Meter"], ): """ A billing meter is a resource that allows you to track usage of a particular event. For example, you might create a billing meter to track the number of API calls made by a particular user. You can then attach the billing meter to a price and attach the price to a subscription to charge the user for the number of API calls they make. """ OBJECT_NAME: ClassVar[Literal["billing.meter"]] = "billing.meter" class CustomerMapping(StripeObject): event_payload_key: str """ The key in the meter event payload to use for mapping the event to a customer. """ type: Literal["by_id"] """ The method for mapping a meter event to a customer. """ class DefaultAggregation(StripeObject): formula: Literal["count", "sum"] """ Specifies how events are aggregated. """ class StatusTransitions(StripeObject): deactivated_at: Optional[int] """ The time the meter was deactivated, if any. Measured in seconds since Unix epoch. """ class ValueSettings(StripeObject): event_payload_key: str """ The key in the meter event payload to use as the value for this meter. """ class CreateParams(RequestOptions): customer_mapping: NotRequired["Meter.CreateParamsCustomerMapping"] """ Fields that specify how to map a meter event to a customer. """ default_aggregation: "Meter.CreateParamsDefaultAggregation" """ The default settings to aggregate a meter's events with. """ display_name: str """ The meter's name. """ event_name: str """ The name of the meter event to record usage for. Corresponds with the `event_name` field on meter events. """ event_time_window: NotRequired[Literal["day", "hour"]] """ The time window to pre-aggregate meter events for, if any. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ value_settings: NotRequired["Meter.CreateParamsValueSettings"] """ Fields that specify how to calculate a meter event's value. """ class CreateParamsCustomerMapping(TypedDict): event_payload_key: str """ The key in the usage event payload to use for mapping the event to a customer. """ type: Literal["by_id"] """ The method for mapping a meter event to a customer. Must be `by_id`. """ class CreateParamsDefaultAggregation(TypedDict): formula: Literal["count", "sum"] """ Specifies how events are aggregated. Allowed values are `count` to count the number of events and `sum` to sum each event's value. """ class CreateParamsValueSettings(TypedDict): event_payload_key: str """ The key in the usage event payload to use as the value for this meter. For example, if the event payload contains usage on a `bytes_used` field, then set the event_payload_key to "bytes_used". """ class DeactivateParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ListEventSummariesParams(RequestOptions): customer: str """ The customer for which to fetch event summaries. """ end_time: int """ The timestamp from when to stop aggregating meter events (exclusive). """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ start_time: int """ The timestamp from when to start aggregating meter events (inclusive). """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ value_grouping_window: NotRequired[Literal["day", "hour"]] """ Specifies what granularity to use when generating event summaries. If not specified, a single event summary would be returned for the specified time range. For hourly granularity, start and end times must align with hour boundaries (e.g., 00:00, 01:00, ..., 23:00). For daily granularity, start and end times must align with UTC day boundaries (00:00 UTC). """ class ListParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[Literal["active", "inactive"]] """ Filter results to only include meters with the given status. """ class ModifyParams(RequestOptions): display_name: NotRequired[str] """ The meter's name. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ReactivateParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ customer_mapping: CustomerMapping default_aggregation: DefaultAggregation display_name: str """ The meter's name. """ event_name: str """ The name of the meter event to record usage for. Corresponds with the `event_name` field on meter events. """ event_time_window: Optional[Literal["day", "hour"]] """ The time window to pre-aggregate meter events for, if any. """ id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ object: Literal["billing.meter"] """ String representing the object's type. Objects of the same type share the same value. """ status: Literal["active", "inactive"] """ The meter's status. """ status_transitions: StatusTransitions updated: int """ Time at which the object was last updated. Measured in seconds since the Unix epoch. """ value_settings: ValueSettings @classmethod def create(cls, **params: Unpack["Meter.CreateParams"]) -> "Meter": """ Creates a billing meter """ return cast( "Meter", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["Meter.CreateParams"] ) -> "Meter": """ Creates a billing meter """ return cast( "Meter", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def _cls_deactivate( cls, id: str, **params: Unpack["Meter.DeactivateParams"] ) -> "Meter": """ Deactivates a billing meter """ return cast( "Meter", cls._static_request( "post", "/v1/billing/meters/{id}/deactivate".format( id=sanitize_id(id) ), params=params, ), ) @overload @staticmethod def deactivate( id: str, **params: Unpack["Meter.DeactivateParams"] ) -> "Meter": """ Deactivates a billing meter """ ... @overload def deactivate( self, **params: Unpack["Meter.DeactivateParams"] ) -> "Meter": """ Deactivates a billing meter """ ... @class_method_variant("_cls_deactivate") def deactivate( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Meter.DeactivateParams"] ) -> "Meter": """ Deactivates a billing meter """ return cast( "Meter", self._request( "post", "/v1/billing/meters/{id}/deactivate".format( id=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_deactivate_async( cls, id: str, **params: Unpack["Meter.DeactivateParams"] ) -> "Meter": """ Deactivates a billing meter """ return cast( "Meter", await cls._static_request_async( "post", "/v1/billing/meters/{id}/deactivate".format( id=sanitize_id(id) ), params=params, ), ) @overload @staticmethod async def deactivate_async( id: str, **params: Unpack["Meter.DeactivateParams"] ) -> "Meter": """ Deactivates a billing meter """ ... @overload async def deactivate_async( self, **params: Unpack["Meter.DeactivateParams"] ) -> "Meter": """ Deactivates a billing meter """ ... @class_method_variant("_cls_deactivate_async") async def deactivate_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Meter.DeactivateParams"] ) -> "Meter": """ Deactivates a billing meter """ return cast( "Meter", await self._request_async( "post", "/v1/billing/meters/{id}/deactivate".format( id=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def list(cls, **params: Unpack["Meter.ListParams"]) -> ListObject["Meter"]: """ Retrieve a list of billing meters. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["Meter.ListParams"] ) -> ListObject["Meter"]: """ Retrieve a list of billing meters. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def modify( cls, id: str, **params: Unpack["Meter.ModifyParams"] ) -> "Meter": """ Updates a billing meter """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Meter", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["Meter.ModifyParams"] ) -> "Meter": """ Updates a billing meter """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Meter", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def _cls_reactivate( cls, id: str, **params: Unpack["Meter.ReactivateParams"] ) -> "Meter": """ Reactivates a billing meter """ return cast( "Meter", cls._static_request( "post", "/v1/billing/meters/{id}/reactivate".format( id=sanitize_id(id) ), params=params, ), ) @overload @staticmethod def reactivate( id: str, **params: Unpack["Meter.ReactivateParams"] ) -> "Meter": """ Reactivates a billing meter """ ... @overload def reactivate( self, **params: Unpack["Meter.ReactivateParams"] ) -> "Meter": """ Reactivates a billing meter """ ... @class_method_variant("_cls_reactivate") def reactivate( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Meter.ReactivateParams"] ) -> "Meter": """ Reactivates a billing meter """ return cast( "Meter", self._request( "post", "/v1/billing/meters/{id}/reactivate".format( id=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_reactivate_async( cls, id: str, **params: Unpack["Meter.ReactivateParams"] ) -> "Meter": """ Reactivates a billing meter """ return cast( "Meter", await cls._static_request_async( "post", "/v1/billing/meters/{id}/reactivate".format( id=sanitize_id(id) ), params=params, ), ) @overload @staticmethod async def reactivate_async( id: str, **params: Unpack["Meter.ReactivateParams"] ) -> "Meter": """ Reactivates a billing meter """ ... @overload async def reactivate_async( self, **params: Unpack["Meter.ReactivateParams"] ) -> "Meter": """ Reactivates a billing meter """ ... @class_method_variant("_cls_reactivate_async") async def reactivate_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Meter.ReactivateParams"] ) -> "Meter": """ Reactivates a billing meter """ return cast( "Meter", await self._request_async( "post", "/v1/billing/meters/{id}/reactivate".format( id=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["Meter.RetrieveParams"] ) -> "Meter": """ Retrieves a billing meter given an ID """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["Meter.RetrieveParams"] ) -> "Meter": """ Retrieves a billing meter given an ID """ instance = cls(id, **params) await instance.refresh_async() return instance @classmethod def list_event_summaries( cls, id: str, **params: Unpack["Meter.ListEventSummariesParams"] ) -> ListObject["MeterEventSummary"]: """ Retrieve a list of billing meter event summaries. """ return cast( ListObject["MeterEventSummary"], cls._static_request( "get", "/v1/billing/meters/{id}/event_summaries".format( id=sanitize_id(id) ), params=params, ), ) @classmethod async def list_event_summaries_async( cls, id: str, **params: Unpack["Meter.ListEventSummariesParams"] ) -> ListObject["MeterEventSummary"]: """ Retrieve a list of billing meter event summaries. """ return cast( ListObject["MeterEventSummary"], await cls._static_request_async( "get", "/v1/billing/meters/{id}/event_summaries".format( id=sanitize_id(id) ), params=params, ), ) _inner_class_types = { "customer_mapping": CustomerMapping, "default_aggregation": DefaultAggregation, "status_transitions": StatusTransitions, "value_settings": ValueSettings, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/billing/_meter_event.py0000644000175100001770000000742314637354563020506 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._request_options import RequestOptions from typing import ClassVar, Dict, List, cast from typing_extensions import Literal, NotRequired, Unpack class MeterEvent(CreateableAPIResource["MeterEvent"]): """ A billing meter event represents a customer's usage of a product. Meter events are used to bill a customer based on their usage. Meter events are associated with billing meters, which define the shape of the event's payload and how those events are aggregated for billing. """ OBJECT_NAME: ClassVar[Literal["billing.meter_event"]] = ( "billing.meter_event" ) class CreateParams(RequestOptions): event_name: str """ The name of the meter event. Corresponds with the `event_name` field on a meter. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ identifier: NotRequired[str] """ A unique identifier for the event. If not provided, one will be generated. We recommend using a globally unique identifier for this. We'll enforce uniqueness within a rolling 24 hour period. """ payload: Dict[str, str] """ The payload of the event. This must contain the fields corresponding to a meter's `customer_mapping.event_payload_key` (default is `stripe_customer_id`) and `value_settings.event_payload_key` (default is `value`). Read more about the [payload](https://docs.stripe.com/billing/subscriptions/usage-based/recording-usage#payload-key-overrides). """ timestamp: NotRequired[int] """ The time of the event. Measured in seconds since the Unix epoch. Must be within the past 35 calendar days or up to 5 minutes in the future. Defaults to current timestamp if not specified. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ event_name: str """ The name of the meter event. Corresponds with the `event_name` field on a meter. """ identifier: str """ A unique identifier for the event. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ object: Literal["billing.meter_event"] """ String representing the object's type. Objects of the same type share the same value. """ payload: Dict[str, str] """ The payload of the event. This contains the fields corresponding to a meter's `customer_mapping.event_payload_key` (default is `stripe_customer_id`) and `value_settings.event_payload_key` (default is `value`). Read more about the [payload](https://stripe.com/docs/billing/subscriptions/usage-based/recording-usage#payload-key-overrides). """ timestamp: int """ The timestamp passed in when creating the event. Measured in seconds since the Unix epoch. """ @classmethod def create( cls, **params: Unpack["MeterEvent.CreateParams"] ) -> "MeterEvent": """ Creates a billing meter event """ return cast( "MeterEvent", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["MeterEvent.CreateParams"] ) -> "MeterEvent": """ Creates a billing meter event """ return cast( "MeterEvent", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/billing/_meter_event_adjustment.py0000644000175100001770000000661114637354563022742 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from typing import ClassVar, List, Optional, cast from typing_extensions import Literal, NotRequired, TypedDict, Unpack class MeterEventAdjustment(CreateableAPIResource["MeterEventAdjustment"]): """ A billing meter event adjustment is a resource that allows you to cancel a meter event. For example, you might create a billing meter event adjustment to cancel a meter event that was created in error or attached to the wrong customer. """ OBJECT_NAME: ClassVar[Literal["billing.meter_event_adjustment"]] = ( "billing.meter_event_adjustment" ) class Cancel(StripeObject): identifier: Optional[str] """ Unique identifier for the event. """ class CreateParams(RequestOptions): cancel: NotRequired["MeterEventAdjustment.CreateParamsCancel"] """ Specifies which event to cancel. """ event_name: str """ The name of the meter event. Corresponds with the `event_name` field on a meter. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ type: Literal["cancel"] """ Specifies whether to cancel a single event or a range of events for a time period. Time period cancellation is not supported yet. """ class CreateParamsCancel(TypedDict): identifier: NotRequired[str] """ Unique identifier for the event. You can only cancel events within 24 hours of Stripe receiving them. """ cancel: Optional[Cancel] """ Specifies which event to cancel. """ event_name: str """ The name of the meter event. Corresponds with the `event_name` field on a meter. """ 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["billing.meter_event_adjustment"] """ String representing the object's type. Objects of the same type share the same value. """ status: Literal["complete", "pending"] """ The meter event adjustment's status. """ type: Literal["cancel"] """ Specifies whether to cancel a single event or a range of events for a time period. Time period cancellation is not supported yet. """ @classmethod def create( cls, **params: Unpack["MeterEventAdjustment.CreateParams"] ) -> "MeterEventAdjustment": """ Creates a billing meter event adjustment """ return cast( "MeterEventAdjustment", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["MeterEventAdjustment.CreateParams"] ) -> "MeterEventAdjustment": """ Creates a billing meter event adjustment """ return cast( "MeterEventAdjustment", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) _inner_class_types = {"cancel": Cancel} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/billing/_meter_event_adjustment_service.py0000644000175100001770000000446314637354563024465 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe.billing._meter_event_adjustment import MeterEventAdjustment from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict class MeterEventAdjustmentService(StripeService): class CreateParams(TypedDict): cancel: NotRequired["MeterEventAdjustmentService.CreateParamsCancel"] """ Specifies which event to cancel. """ event_name: str """ The name of the meter event. Corresponds with the `event_name` field on a meter. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ type: Literal["cancel"] """ Specifies whether to cancel a single event or a range of events for a time period. Time period cancellation is not supported yet. """ class CreateParamsCancel(TypedDict): identifier: NotRequired[str] """ Unique identifier for the event. You can only cancel events within 24 hours of Stripe receiving them. """ def create( self, params: "MeterEventAdjustmentService.CreateParams", options: RequestOptions = {}, ) -> MeterEventAdjustment: """ Creates a billing meter event adjustment """ return cast( MeterEventAdjustment, self._request( "post", "/v1/billing/meter_event_adjustments", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "MeterEventAdjustmentService.CreateParams", options: RequestOptions = {}, ) -> MeterEventAdjustment: """ Creates a billing meter event adjustment """ return cast( MeterEventAdjustment, await self._request_async( "post", "/v1/billing/meter_event_adjustments", api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/billing/_meter_event_service.py0000644000175100001770000000503514637354563022223 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe.billing._meter_event import MeterEvent from typing import Dict, List, cast from typing_extensions import NotRequired, TypedDict class MeterEventService(StripeService): class CreateParams(TypedDict): event_name: str """ The name of the meter event. Corresponds with the `event_name` field on a meter. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ identifier: NotRequired[str] """ A unique identifier for the event. If not provided, one will be generated. We recommend using a globally unique identifier for this. We'll enforce uniqueness within a rolling 24 hour period. """ payload: Dict[str, str] """ The payload of the event. This must contain the fields corresponding to a meter's `customer_mapping.event_payload_key` (default is `stripe_customer_id`) and `value_settings.event_payload_key` (default is `value`). Read more about the [payload](https://docs.stripe.com/billing/subscriptions/usage-based/recording-usage#payload-key-overrides). """ timestamp: NotRequired[int] """ The time of the event. Measured in seconds since the Unix epoch. Must be within the past 35 calendar days or up to 5 minutes in the future. Defaults to current timestamp if not specified. """ def create( self, params: "MeterEventService.CreateParams", options: RequestOptions = {}, ) -> MeterEvent: """ Creates a billing meter event """ return cast( MeterEvent, self._request( "post", "/v1/billing/meter_events", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "MeterEventService.CreateParams", options: RequestOptions = {}, ) -> MeterEvent: """ Creates a billing meter event """ return cast( MeterEvent, await self._request_async( "post", "/v1/billing/meter_events", api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/billing/_meter_event_summary.py0000644000175100001770000000257314637354563022264 0ustar00runnerdocker# -*- 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 MeterEventSummary(StripeObject): """ A billing meter event summary represents an aggregated view of a customer's billing meter events within a specified timeframe. It indicates how much usage was accrued by a customer for that period. """ OBJECT_NAME: ClassVar[Literal["billing.meter_event_summary"]] = ( "billing.meter_event_summary" ) aggregated_value: float """ Aggregated value of all the events within `start_time` (inclusive) and `end_time` (inclusive). The aggregation strategy is defined on meter via `default_aggregation`. """ end_time: int """ End timestamp for this event summary (inclusive). """ id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ meter: str """ The meter associated with this event summary. """ object: Literal["billing.meter_event_summary"] """ String representing the object's type. Objects of the same type share the same value. """ start_time: int """ Start timestamp for this event summary (inclusive). """ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/billing/_meter_event_summary_service.py0000644000175100001770000000712314637354563024000 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.billing._meter_event_summary import MeterEventSummary from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict class MeterEventSummaryService(StripeService): class ListParams(TypedDict): customer: str """ The customer for which to fetch event summaries. """ end_time: int """ The timestamp from when to stop aggregating meter events (exclusive). """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ start_time: int """ The timestamp from when to start aggregating meter events (inclusive). """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ value_grouping_window: NotRequired[Literal["day", "hour"]] """ Specifies what granularity to use when generating event summaries. If not specified, a single event summary would be returned for the specified time range. For hourly granularity, start and end times must align with hour boundaries (e.g., 00:00, 01:00, ..., 23:00). For daily granularity, start and end times must align with UTC day boundaries (00:00 UTC). """ def list( self, id: str, params: "MeterEventSummaryService.ListParams", options: RequestOptions = {}, ) -> ListObject[MeterEventSummary]: """ Retrieve a list of billing meter event summaries. """ return cast( ListObject[MeterEventSummary], self._request( "get", "/v1/billing/meters/{id}/event_summaries".format( id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, id: str, params: "MeterEventSummaryService.ListParams", options: RequestOptions = {}, ) -> ListObject[MeterEventSummary]: """ Retrieve a list of billing meter event summaries. """ return cast( ListObject[MeterEventSummary], await self._request_async( "get", "/v1/billing/meters/{id}/event_summaries".format( id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/billing/_meter_service.py0000644000175100001770000002561714637354563021032 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.billing._meter import Meter from stripe.billing._meter_event_summary_service import ( MeterEventSummaryService, ) from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict class MeterService(StripeService): def __init__(self, requestor): super().__init__(requestor) self.event_summaries = MeterEventSummaryService(self._requestor) class CreateParams(TypedDict): customer_mapping: NotRequired[ "MeterService.CreateParamsCustomerMapping" ] """ Fields that specify how to map a meter event to a customer. """ default_aggregation: "MeterService.CreateParamsDefaultAggregation" """ The default settings to aggregate a meter's events with. """ display_name: str """ The meter's name. """ event_name: str """ The name of the meter event to record usage for. Corresponds with the `event_name` field on meter events. """ event_time_window: NotRequired[Literal["day", "hour"]] """ The time window to pre-aggregate meter events for, if any. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ value_settings: NotRequired["MeterService.CreateParamsValueSettings"] """ Fields that specify how to calculate a meter event's value. """ class CreateParamsCustomerMapping(TypedDict): event_payload_key: str """ The key in the usage event payload to use for mapping the event to a customer. """ type: Literal["by_id"] """ The method for mapping a meter event to a customer. Must be `by_id`. """ class CreateParamsDefaultAggregation(TypedDict): formula: Literal["count", "sum"] """ Specifies how events are aggregated. Allowed values are `count` to count the number of events and `sum` to sum each event's value. """ class CreateParamsValueSettings(TypedDict): event_payload_key: str """ The key in the usage event payload to use as the value for this meter. For example, if the event payload contains usage on a `bytes_used` field, then set the event_payload_key to "bytes_used". """ class DeactivateParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ListParams(TypedDict): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[Literal["active", "inactive"]] """ Filter results to only include meters with the given status. """ class ReactivateParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): display_name: NotRequired[str] """ The meter's name. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def list( self, params: "MeterService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Meter]: """ Retrieve a list of billing meters. """ return cast( ListObject[Meter], self._request( "get", "/v1/billing/meters", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "MeterService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Meter]: """ Retrieve a list of billing meters. """ return cast( ListObject[Meter], await self._request_async( "get", "/v1/billing/meters", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "MeterService.CreateParams", options: RequestOptions = {} ) -> Meter: """ Creates a billing meter """ return cast( Meter, self._request( "post", "/v1/billing/meters", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "MeterService.CreateParams", options: RequestOptions = {} ) -> Meter: """ Creates a billing meter """ return cast( Meter, await self._request_async( "post", "/v1/billing/meters", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, id: str, params: "MeterService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Meter: """ Retrieves a billing meter given an ID """ return cast( Meter, self._request( "get", "/v1/billing/meters/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, id: str, params: "MeterService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Meter: """ Retrieves a billing meter given an ID """ return cast( Meter, await self._request_async( "get", "/v1/billing/meters/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, id: str, params: "MeterService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Meter: """ Updates a billing meter """ return cast( Meter, self._request( "post", "/v1/billing/meters/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, id: str, params: "MeterService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Meter: """ Updates a billing meter """ return cast( Meter, await self._request_async( "post", "/v1/billing/meters/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) def deactivate( self, id: str, params: "MeterService.DeactivateParams" = {}, options: RequestOptions = {}, ) -> Meter: """ Deactivates a billing meter """ return cast( Meter, self._request( "post", "/v1/billing/meters/{id}/deactivate".format( id=sanitize_id(id) ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def deactivate_async( self, id: str, params: "MeterService.DeactivateParams" = {}, options: RequestOptions = {}, ) -> Meter: """ Deactivates a billing meter """ return cast( Meter, await self._request_async( "post", "/v1/billing/meters/{id}/deactivate".format( id=sanitize_id(id) ), api_mode="V1", base_address="api", params=params, options=options, ), ) def reactivate( self, id: str, params: "MeterService.ReactivateParams" = {}, options: RequestOptions = {}, ) -> Meter: """ Reactivates a billing meter """ return cast( Meter, self._request( "post", "/v1/billing/meters/{id}/reactivate".format( id=sanitize_id(id) ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def reactivate_async( self, id: str, params: "MeterService.ReactivateParams" = {}, options: RequestOptions = {}, ) -> Meter: """ Reactivates a billing meter """ return cast( Meter, await self._request_async( "post", "/v1/billing/meters/{id}/reactivate".format( id=sanitize_id(id) ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5329404 stripe-10.1.0/stripe/billing_portal/0000755000175100001770000000000014637354616017032 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/billing_portal/__init__.py0000644000175100001770000000063114637354563021144 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe.billing_portal._configuration import Configuration as Configuration from stripe.billing_portal._configuration_service import ( ConfigurationService as ConfigurationService, ) from stripe.billing_portal._session import Session as Session from stripe.billing_portal._session_service import ( SessionService as SessionService, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/billing_portal/_configuration.py0000644000175100001770000006605114637354563022423 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import sanitize_id from typing import ClassVar, Dict, List, Optional, Union, cast from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._application import Application class Configuration( CreateableAPIResource["Configuration"], ListableAPIResource["Configuration"], UpdateableAPIResource["Configuration"], ): """ A portal configuration describes the functionality and behavior of a portal session. """ OBJECT_NAME: ClassVar[Literal["billing_portal.configuration"]] = ( "billing_portal.configuration" ) class BusinessProfile(StripeObject): headline: Optional[str] """ The messaging shown to customers in the portal. """ privacy_policy_url: Optional[str] """ A link to the business's publicly available privacy policy. """ terms_of_service_url: Optional[str] """ A link to the business's publicly available terms of service. """ class Features(StripeObject): class CustomerUpdate(StripeObject): allowed_updates: List[ Literal[ "address", "email", "name", "phone", "shipping", "tax_id" ] ] """ The types of customer updates that are supported. When empty, customers are not updateable. """ enabled: bool """ Whether the feature is enabled. """ class InvoiceHistory(StripeObject): enabled: bool """ Whether the feature is enabled. """ class PaymentMethodUpdate(StripeObject): enabled: bool """ Whether the feature is enabled. """ class SubscriptionCancel(StripeObject): class CancellationReason(StripeObject): enabled: bool """ Whether the feature is enabled. """ options: List[ Literal[ "customer_service", "low_quality", "missing_features", "other", "switched_service", "too_complex", "too_expensive", "unused", ] ] """ Which cancellation reasons will be given as options to the customer. """ cancellation_reason: CancellationReason enabled: bool """ Whether the feature is enabled. """ mode: Literal["at_period_end", "immediately"] """ Whether to cancel subscriptions immediately or at the end of the billing period. """ proration_behavior: Literal[ "always_invoice", "create_prorations", "none" ] """ Whether to create prorations when canceling subscriptions. Possible values are `none` and `create_prorations`. """ _inner_class_types = {"cancellation_reason": CancellationReason} class SubscriptionUpdate(StripeObject): class Product(StripeObject): prices: List[str] """ The list of price IDs which, when subscribed to, a subscription can be updated. """ product: str """ The product ID. """ default_allowed_updates: List[ Literal["price", "promotion_code", "quantity"] ] """ The types of subscription updates that are supported for items listed in the `products` attribute. When empty, subscriptions are not updateable. """ enabled: bool """ Whether the feature is enabled. """ products: Optional[List[Product]] """ The list of up to 10 products that support subscription updates. """ proration_behavior: Literal[ "always_invoice", "create_prorations", "none" ] """ Determines how to handle prorations resulting from subscription updates. Valid values are `none`, `create_prorations`, and `always_invoice`. Defaults to a value of `none` if you don't set it during creation. """ _inner_class_types = {"products": Product} customer_update: CustomerUpdate invoice_history: InvoiceHistory payment_method_update: PaymentMethodUpdate subscription_cancel: SubscriptionCancel subscription_update: SubscriptionUpdate _inner_class_types = { "customer_update": CustomerUpdate, "invoice_history": InvoiceHistory, "payment_method_update": PaymentMethodUpdate, "subscription_cancel": SubscriptionCancel, "subscription_update": SubscriptionUpdate, } class LoginPage(StripeObject): enabled: bool """ If `true`, a shareable `url` will be generated that will take your customers to a hosted login page for the customer portal. If `false`, the previously generated `url`, if any, will be deactivated. """ url: Optional[str] """ A shareable URL to the hosted portal login page. Your customers will be able to log in with their [email](https://stripe.com/docs/api/customers/object#customer_object-email) and receive a link to their customer portal. """ class CreateParams(RequestOptions): business_profile: "Configuration.CreateParamsBusinessProfile" """ The business information shown to customers in the portal. """ default_return_url: NotRequired["Literal['']|str"] """ The default URL to redirect customers to when they click on the portal's link to return to your website. This can be [overriden](https://stripe.com/docs/api/customer_portal/sessions/create#create_portal_session-return_url) when creating the session. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ features: "Configuration.CreateParamsFeatures" """ Information about the features available in the portal. """ login_page: NotRequired["Configuration.CreateParamsLoginPage"] """ The hosted login page for this configuration. Learn more about the portal login page in our [integration docs](https://stripe.com/docs/billing/subscriptions/integrating-customer-portal#share). """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ class CreateParamsBusinessProfile(TypedDict): headline: NotRequired["Literal['']|str"] """ The messaging shown to customers in the portal. """ privacy_policy_url: NotRequired[str] """ A link to the business's publicly available privacy policy. """ terms_of_service_url: NotRequired[str] """ A link to the business's publicly available terms of service. """ class CreateParamsFeatures(TypedDict): customer_update: NotRequired[ "Configuration.CreateParamsFeaturesCustomerUpdate" ] """ Information about updating the customer details in the portal. """ invoice_history: NotRequired[ "Configuration.CreateParamsFeaturesInvoiceHistory" ] """ Information about showing the billing history in the portal. """ payment_method_update: NotRequired[ "Configuration.CreateParamsFeaturesPaymentMethodUpdate" ] """ Information about updating payment methods in the portal. """ subscription_cancel: NotRequired[ "Configuration.CreateParamsFeaturesSubscriptionCancel" ] """ Information about canceling subscriptions in the portal. """ subscription_update: NotRequired[ "Configuration.CreateParamsFeaturesSubscriptionUpdate" ] """ Information about updating subscriptions in the portal. """ class CreateParamsFeaturesCustomerUpdate(TypedDict): allowed_updates: NotRequired[ "Literal['']|List[Literal['address', 'email', 'name', 'phone', 'shipping', 'tax_id']]" ] """ The types of customer updates that are supported. When empty, customers are not updateable. """ enabled: bool """ Whether the feature is enabled. """ class CreateParamsFeaturesInvoiceHistory(TypedDict): enabled: bool """ Whether the feature is enabled. """ class CreateParamsFeaturesPaymentMethodUpdate(TypedDict): enabled: bool """ Whether the feature is enabled. """ class CreateParamsFeaturesSubscriptionCancel(TypedDict): cancellation_reason: NotRequired[ "Configuration.CreateParamsFeaturesSubscriptionCancelCancellationReason" ] """ Whether the cancellation reasons will be collected in the portal and which options are exposed to the customer """ enabled: bool """ Whether the feature is enabled. """ mode: NotRequired[Literal["at_period_end", "immediately"]] """ Whether to cancel subscriptions immediately or at the end of the billing period. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ Whether to create prorations when canceling subscriptions. Possible values are `none` and `create_prorations`, which is only compatible with `mode=immediately`. No prorations are generated when canceling a subscription at the end of its natural billing period. """ class CreateParamsFeaturesSubscriptionCancelCancellationReason(TypedDict): enabled: bool """ Whether the feature is enabled. """ options: Union[ Literal[""], List[ Literal[ "customer_service", "low_quality", "missing_features", "other", "switched_service", "too_complex", "too_expensive", "unused", ] ], ] """ Which cancellation reasons will be given as options to the customer. """ class CreateParamsFeaturesSubscriptionUpdate(TypedDict): default_allowed_updates: Union[ Literal[""], List[Literal["price", "promotion_code", "quantity"]] ] """ The types of subscription updates that are supported. When empty, subscriptions are not updateable. """ enabled: bool """ Whether the feature is enabled. """ products: Union[ Literal[""], List[ "Configuration.CreateParamsFeaturesSubscriptionUpdateProduct" ], ] """ The list of up to 10 products that support subscription updates. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle prorations resulting from subscription updates. Valid values are `none`, `create_prorations`, and `always_invoice`. """ class CreateParamsFeaturesSubscriptionUpdateProduct(TypedDict): prices: List[str] """ The list of price IDs for the product that a subscription can be updated to. """ product: str """ The product id. """ class CreateParamsLoginPage(TypedDict): enabled: bool """ Set to `true` to generate a shareable URL [`login_page.url`](https://stripe.com/docs/api/customer_portal/configuration#portal_configuration_object-login_page-url) that will take your customers to a hosted login page for the customer portal. """ class ListParams(RequestOptions): active: NotRequired[bool] """ Only return configurations that are active or inactive (e.g., pass `true` to only list active configurations). """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ is_default: NotRequired[bool] """ Only return the default or non-default configurations (e.g., pass `true` to only list the default configuration). """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ModifyParams(RequestOptions): active: NotRequired[bool] """ Whether the configuration is active and can be used to create portal sessions. """ business_profile: NotRequired[ "Configuration.ModifyParamsBusinessProfile" ] """ The business information shown to customers in the portal. """ default_return_url: NotRequired["Literal['']|str"] """ The default URL to redirect customers to when they click on the portal's link to return to your website. This can be [overriden](https://stripe.com/docs/api/customer_portal/sessions/create#create_portal_session-return_url) when creating the session. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ features: NotRequired["Configuration.ModifyParamsFeatures"] """ Information about the features available in the portal. """ login_page: NotRequired["Configuration.ModifyParamsLoginPage"] """ The hosted login page for this configuration. Learn more about the portal login page in our [integration docs](https://stripe.com/docs/billing/subscriptions/integrating-customer-portal#share). """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ class ModifyParamsBusinessProfile(TypedDict): headline: NotRequired["Literal['']|str"] """ The messaging shown to customers in the portal. """ privacy_policy_url: NotRequired["Literal['']|str"] """ A link to the business's publicly available privacy policy. """ terms_of_service_url: NotRequired["Literal['']|str"] """ A link to the business's publicly available terms of service. """ class ModifyParamsFeatures(TypedDict): customer_update: NotRequired[ "Configuration.ModifyParamsFeaturesCustomerUpdate" ] """ Information about updating the customer details in the portal. """ invoice_history: NotRequired[ "Configuration.ModifyParamsFeaturesInvoiceHistory" ] """ Information about showing the billing history in the portal. """ payment_method_update: NotRequired[ "Configuration.ModifyParamsFeaturesPaymentMethodUpdate" ] """ Information about updating payment methods in the portal. """ subscription_cancel: NotRequired[ "Configuration.ModifyParamsFeaturesSubscriptionCancel" ] """ Information about canceling subscriptions in the portal. """ subscription_update: NotRequired[ "Configuration.ModifyParamsFeaturesSubscriptionUpdate" ] """ Information about updating subscriptions in the portal. """ class ModifyParamsFeaturesCustomerUpdate(TypedDict): allowed_updates: NotRequired[ "Literal['']|List[Literal['address', 'email', 'name', 'phone', 'shipping', 'tax_id']]" ] """ The types of customer updates that are supported. When empty, customers are not updateable. """ enabled: NotRequired[bool] """ Whether the feature is enabled. """ class ModifyParamsFeaturesInvoiceHistory(TypedDict): enabled: bool """ Whether the feature is enabled. """ class ModifyParamsFeaturesPaymentMethodUpdate(TypedDict): enabled: bool """ Whether the feature is enabled. """ class ModifyParamsFeaturesSubscriptionCancel(TypedDict): cancellation_reason: NotRequired[ "Configuration.ModifyParamsFeaturesSubscriptionCancelCancellationReason" ] """ Whether the cancellation reasons will be collected in the portal and which options are exposed to the customer """ enabled: NotRequired[bool] """ Whether the feature is enabled. """ mode: NotRequired[Literal["at_period_end", "immediately"]] """ Whether to cancel subscriptions immediately or at the end of the billing period. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ Whether to create prorations when canceling subscriptions. Possible values are `none` and `create_prorations`, which is only compatible with `mode=immediately`. No prorations are generated when canceling a subscription at the end of its natural billing period. """ class ModifyParamsFeaturesSubscriptionCancelCancellationReason(TypedDict): enabled: bool """ Whether the feature is enabled. """ options: NotRequired[ "Literal['']|List[Literal['customer_service', 'low_quality', 'missing_features', 'other', 'switched_service', 'too_complex', 'too_expensive', 'unused']]" ] """ Which cancellation reasons will be given as options to the customer. """ class ModifyParamsFeaturesSubscriptionUpdate(TypedDict): default_allowed_updates: NotRequired[ "Literal['']|List[Literal['price', 'promotion_code', 'quantity']]" ] """ The types of subscription updates that are supported. When empty, subscriptions are not updateable. """ enabled: NotRequired[bool] """ Whether the feature is enabled. """ products: NotRequired[ "Literal['']|List[Configuration.ModifyParamsFeaturesSubscriptionUpdateProduct]" ] """ The list of up to 10 products that support subscription updates. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle prorations resulting from subscription updates. Valid values are `none`, `create_prorations`, and `always_invoice`. """ class ModifyParamsFeaturesSubscriptionUpdateProduct(TypedDict): prices: List[str] """ The list of price IDs for the product that a subscription can be updated to. """ product: str """ The product id. """ class ModifyParamsLoginPage(TypedDict): enabled: bool """ Set to `true` to generate a shareable URL [`login_page.url`](https://stripe.com/docs/api/customer_portal/configuration#portal_configuration_object-login_page-url) that will take your customers to a hosted login page for the customer portal. Set to `false` to deactivate the `login_page.url`. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ active: bool """ Whether the configuration is active and can be used to create portal sessions. """ application: Optional[ExpandableField["Application"]] """ ID of the Connect Application that created the configuration. """ business_profile: BusinessProfile created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ default_return_url: Optional[str] """ The default URL to redirect customers to when they click on the portal's link to return to your website. This can be [overriden](https://stripe.com/docs/api/customer_portal/sessions/create#create_portal_session-return_url) when creating the session. """ features: Features id: str """ Unique identifier for the object. """ is_default: bool """ Whether the configuration is the default. If `true`, this configuration can be managed in the Dashboard and portal sessions will use this configuration unless it is overriden when creating the session. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ login_page: LoginPage metadata: Optional[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ object: Literal["billing_portal.configuration"] """ String representing the object's type. Objects of the same type share the same value. """ updated: int """ Time at which the object was last updated. Measured in seconds since the Unix epoch. """ @classmethod def create( cls, **params: Unpack["Configuration.CreateParams"] ) -> "Configuration": """ Creates a configuration that describes the functionality and behavior of a PortalSession """ return cast( "Configuration", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["Configuration.CreateParams"] ) -> "Configuration": """ Creates a configuration that describes the functionality and behavior of a PortalSession """ return cast( "Configuration", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def list( cls, **params: Unpack["Configuration.ListParams"] ) -> ListObject["Configuration"]: """ Returns a list of configurations that describe the functionality of the customer portal. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["Configuration.ListParams"] ) -> ListObject["Configuration"]: """ Returns a list of configurations that describe the functionality of the customer portal. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def modify( cls, id: str, **params: Unpack["Configuration.ModifyParams"] ) -> "Configuration": """ Updates a configuration that describes the functionality of the customer portal. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Configuration", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["Configuration.ModifyParams"] ) -> "Configuration": """ Updates a configuration that describes the functionality of the customer portal. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Configuration", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["Configuration.RetrieveParams"] ) -> "Configuration": """ Retrieves a configuration that describes the functionality of the customer portal. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["Configuration.RetrieveParams"] ) -> "Configuration": """ Retrieves a configuration that describes the functionality of the customer portal. """ instance = cls(id, **params) await instance.refresh_async() return instance _inner_class_types = { "business_profile": BusinessProfile, "features": Features, "login_page": LoginPage, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/billing_portal/_configuration_service.py0000644000175100001770000005217614637354563024146 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.billing_portal._configuration import Configuration from typing import Dict, List, Union, cast from typing_extensions import Literal, NotRequired, TypedDict class ConfigurationService(StripeService): class CreateParams(TypedDict): business_profile: "ConfigurationService.CreateParamsBusinessProfile" """ The business information shown to customers in the portal. """ default_return_url: NotRequired["Literal['']|str"] """ The default URL to redirect customers to when they click on the portal's link to return to your website. This can be [overriden](https://stripe.com/docs/api/customer_portal/sessions/create#create_portal_session-return_url) when creating the session. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ features: "ConfigurationService.CreateParamsFeatures" """ Information about the features available in the portal. """ login_page: NotRequired["ConfigurationService.CreateParamsLoginPage"] """ The hosted login page for this configuration. Learn more about the portal login page in our [integration docs](https://stripe.com/docs/billing/subscriptions/integrating-customer-portal#share). """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ class CreateParamsBusinessProfile(TypedDict): headline: NotRequired["Literal['']|str"] """ The messaging shown to customers in the portal. """ privacy_policy_url: NotRequired[str] """ A link to the business's publicly available privacy policy. """ terms_of_service_url: NotRequired[str] """ A link to the business's publicly available terms of service. """ class CreateParamsFeatures(TypedDict): customer_update: NotRequired[ "ConfigurationService.CreateParamsFeaturesCustomerUpdate" ] """ Information about updating the customer details in the portal. """ invoice_history: NotRequired[ "ConfigurationService.CreateParamsFeaturesInvoiceHistory" ] """ Information about showing the billing history in the portal. """ payment_method_update: NotRequired[ "ConfigurationService.CreateParamsFeaturesPaymentMethodUpdate" ] """ Information about updating payment methods in the portal. """ subscription_cancel: NotRequired[ "ConfigurationService.CreateParamsFeaturesSubscriptionCancel" ] """ Information about canceling subscriptions in the portal. """ subscription_update: NotRequired[ "ConfigurationService.CreateParamsFeaturesSubscriptionUpdate" ] """ Information about updating subscriptions in the portal. """ class CreateParamsFeaturesCustomerUpdate(TypedDict): allowed_updates: NotRequired[ "Literal['']|List[Literal['address', 'email', 'name', 'phone', 'shipping', 'tax_id']]" ] """ The types of customer updates that are supported. When empty, customers are not updateable. """ enabled: bool """ Whether the feature is enabled. """ class CreateParamsFeaturesInvoiceHistory(TypedDict): enabled: bool """ Whether the feature is enabled. """ class CreateParamsFeaturesPaymentMethodUpdate(TypedDict): enabled: bool """ Whether the feature is enabled. """ class CreateParamsFeaturesSubscriptionCancel(TypedDict): cancellation_reason: NotRequired[ "ConfigurationService.CreateParamsFeaturesSubscriptionCancelCancellationReason" ] """ Whether the cancellation reasons will be collected in the portal and which options are exposed to the customer """ enabled: bool """ Whether the feature is enabled. """ mode: NotRequired[Literal["at_period_end", "immediately"]] """ Whether to cancel subscriptions immediately or at the end of the billing period. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ Whether to create prorations when canceling subscriptions. Possible values are `none` and `create_prorations`, which is only compatible with `mode=immediately`. No prorations are generated when canceling a subscription at the end of its natural billing period. """ class CreateParamsFeaturesSubscriptionCancelCancellationReason(TypedDict): enabled: bool """ Whether the feature is enabled. """ options: Union[ Literal[""], List[ Literal[ "customer_service", "low_quality", "missing_features", "other", "switched_service", "too_complex", "too_expensive", "unused", ] ], ] """ Which cancellation reasons will be given as options to the customer. """ class CreateParamsFeaturesSubscriptionUpdate(TypedDict): default_allowed_updates: Union[ Literal[""], List[Literal["price", "promotion_code", "quantity"]] ] """ The types of subscription updates that are supported. When empty, subscriptions are not updateable. """ enabled: bool """ Whether the feature is enabled. """ products: Union[ Literal[""], List[ "ConfigurationService.CreateParamsFeaturesSubscriptionUpdateProduct" ], ] """ The list of up to 10 products that support subscription updates. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle prorations resulting from subscription updates. Valid values are `none`, `create_prorations`, and `always_invoice`. """ class CreateParamsFeaturesSubscriptionUpdateProduct(TypedDict): prices: List[str] """ The list of price IDs for the product that a subscription can be updated to. """ product: str """ The product id. """ class CreateParamsLoginPage(TypedDict): enabled: bool """ Set to `true` to generate a shareable URL [`login_page.url`](https://stripe.com/docs/api/customer_portal/configuration#portal_configuration_object-login_page-url) that will take your customers to a hosted login page for the customer portal. """ class ListParams(TypedDict): active: NotRequired[bool] """ Only return configurations that are active or inactive (e.g., pass `true` to only list active configurations). """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ is_default: NotRequired[bool] """ Only return the default or non-default configurations (e.g., pass `true` to only list the default configuration). """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): active: NotRequired[bool] """ Whether the configuration is active and can be used to create portal sessions. """ business_profile: NotRequired[ "ConfigurationService.UpdateParamsBusinessProfile" ] """ The business information shown to customers in the portal. """ default_return_url: NotRequired["Literal['']|str"] """ The default URL to redirect customers to when they click on the portal's link to return to your website. This can be [overriden](https://stripe.com/docs/api/customer_portal/sessions/create#create_portal_session-return_url) when creating the session. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ features: NotRequired["ConfigurationService.UpdateParamsFeatures"] """ Information about the features available in the portal. """ login_page: NotRequired["ConfigurationService.UpdateParamsLoginPage"] """ The hosted login page for this configuration. Learn more about the portal login page in our [integration docs](https://stripe.com/docs/billing/subscriptions/integrating-customer-portal#share). """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ class UpdateParamsBusinessProfile(TypedDict): headline: NotRequired["Literal['']|str"] """ The messaging shown to customers in the portal. """ privacy_policy_url: NotRequired["Literal['']|str"] """ A link to the business's publicly available privacy policy. """ terms_of_service_url: NotRequired["Literal['']|str"] """ A link to the business's publicly available terms of service. """ class UpdateParamsFeatures(TypedDict): customer_update: NotRequired[ "ConfigurationService.UpdateParamsFeaturesCustomerUpdate" ] """ Information about updating the customer details in the portal. """ invoice_history: NotRequired[ "ConfigurationService.UpdateParamsFeaturesInvoiceHistory" ] """ Information about showing the billing history in the portal. """ payment_method_update: NotRequired[ "ConfigurationService.UpdateParamsFeaturesPaymentMethodUpdate" ] """ Information about updating payment methods in the portal. """ subscription_cancel: NotRequired[ "ConfigurationService.UpdateParamsFeaturesSubscriptionCancel" ] """ Information about canceling subscriptions in the portal. """ subscription_update: NotRequired[ "ConfigurationService.UpdateParamsFeaturesSubscriptionUpdate" ] """ Information about updating subscriptions in the portal. """ class UpdateParamsFeaturesCustomerUpdate(TypedDict): allowed_updates: NotRequired[ "Literal['']|List[Literal['address', 'email', 'name', 'phone', 'shipping', 'tax_id']]" ] """ The types of customer updates that are supported. When empty, customers are not updateable. """ enabled: NotRequired[bool] """ Whether the feature is enabled. """ class UpdateParamsFeaturesInvoiceHistory(TypedDict): enabled: bool """ Whether the feature is enabled. """ class UpdateParamsFeaturesPaymentMethodUpdate(TypedDict): enabled: bool """ Whether the feature is enabled. """ class UpdateParamsFeaturesSubscriptionCancel(TypedDict): cancellation_reason: NotRequired[ "ConfigurationService.UpdateParamsFeaturesSubscriptionCancelCancellationReason" ] """ Whether the cancellation reasons will be collected in the portal and which options are exposed to the customer """ enabled: NotRequired[bool] """ Whether the feature is enabled. """ mode: NotRequired[Literal["at_period_end", "immediately"]] """ Whether to cancel subscriptions immediately or at the end of the billing period. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ Whether to create prorations when canceling subscriptions. Possible values are `none` and `create_prorations`, which is only compatible with `mode=immediately`. No prorations are generated when canceling a subscription at the end of its natural billing period. """ class UpdateParamsFeaturesSubscriptionCancelCancellationReason(TypedDict): enabled: bool """ Whether the feature is enabled. """ options: NotRequired[ "Literal['']|List[Literal['customer_service', 'low_quality', 'missing_features', 'other', 'switched_service', 'too_complex', 'too_expensive', 'unused']]" ] """ Which cancellation reasons will be given as options to the customer. """ class UpdateParamsFeaturesSubscriptionUpdate(TypedDict): default_allowed_updates: NotRequired[ "Literal['']|List[Literal['price', 'promotion_code', 'quantity']]" ] """ The types of subscription updates that are supported. When empty, subscriptions are not updateable. """ enabled: NotRequired[bool] """ Whether the feature is enabled. """ products: NotRequired[ "Literal['']|List[ConfigurationService.UpdateParamsFeaturesSubscriptionUpdateProduct]" ] """ The list of up to 10 products that support subscription updates. """ proration_behavior: NotRequired[ Literal["always_invoice", "create_prorations", "none"] ] """ Determines how to handle prorations resulting from subscription updates. Valid values are `none`, `create_prorations`, and `always_invoice`. """ class UpdateParamsFeaturesSubscriptionUpdateProduct(TypedDict): prices: List[str] """ The list of price IDs for the product that a subscription can be updated to. """ product: str """ The product id. """ class UpdateParamsLoginPage(TypedDict): enabled: bool """ Set to `true` to generate a shareable URL [`login_page.url`](https://stripe.com/docs/api/customer_portal/configuration#portal_configuration_object-login_page-url) that will take your customers to a hosted login page for the customer portal. Set to `false` to deactivate the `login_page.url`. """ def list( self, params: "ConfigurationService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Configuration]: """ Returns a list of configurations that describe the functionality of the customer portal. """ return cast( ListObject[Configuration], self._request( "get", "/v1/billing_portal/configurations", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "ConfigurationService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Configuration]: """ Returns a list of configurations that describe the functionality of the customer portal. """ return cast( ListObject[Configuration], await self._request_async( "get", "/v1/billing_portal/configurations", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "ConfigurationService.CreateParams", options: RequestOptions = {}, ) -> Configuration: """ Creates a configuration that describes the functionality and behavior of a PortalSession """ return cast( Configuration, self._request( "post", "/v1/billing_portal/configurations", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "ConfigurationService.CreateParams", options: RequestOptions = {}, ) -> Configuration: """ Creates a configuration that describes the functionality and behavior of a PortalSession """ return cast( Configuration, await self._request_async( "post", "/v1/billing_portal/configurations", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, configuration: str, params: "ConfigurationService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Configuration: """ Retrieves a configuration that describes the functionality of the customer portal. """ return cast( Configuration, self._request( "get", "/v1/billing_portal/configurations/{configuration}".format( configuration=sanitize_id(configuration), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, configuration: str, params: "ConfigurationService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Configuration: """ Retrieves a configuration that describes the functionality of the customer portal. """ return cast( Configuration, await self._request_async( "get", "/v1/billing_portal/configurations/{configuration}".format( configuration=sanitize_id(configuration), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, configuration: str, params: "ConfigurationService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Configuration: """ Updates a configuration that describes the functionality of the customer portal. """ return cast( Configuration, self._request( "post", "/v1/billing_portal/configurations/{configuration}".format( configuration=sanitize_id(configuration), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, configuration: str, params: "ConfigurationService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Configuration: """ Updates a configuration that describes the functionality of the customer portal. """ return cast( Configuration, await self._request_async( "post", "/v1/billing_portal/configurations/{configuration}".format( configuration=sanitize_id(configuration), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/billing_portal/_session.py0000644000175100001770000004410514637354563021233 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from typing import ClassVar, List, Optional, cast from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe.billing_portal._configuration import Configuration class Session(CreateableAPIResource["Session"]): """ The Billing customer portal is a Stripe-hosted UI for subscription and billing management. A portal configuration describes the functionality and features that you want to provide to your customers through the portal. A portal session describes the instantiation of the customer portal for a particular customer. By visiting the session's URL, the customer can manage their subscriptions and billing details. For security reasons, sessions are short-lived and will expire if the customer does not visit the URL. Create sessions on-demand when customers intend to manage their subscriptions and billing details. Learn more in the [integration guide](https://stripe.com/docs/billing/subscriptions/integrating-customer-portal). """ OBJECT_NAME: ClassVar[Literal["billing_portal.session"]] = ( "billing_portal.session" ) class Flow(StripeObject): class AfterCompletion(StripeObject): class HostedConfirmation(StripeObject): custom_message: Optional[str] """ A custom message to display to the customer after the flow is completed. """ class Redirect(StripeObject): return_url: str """ The URL the customer will be redirected to after the flow is completed. """ hosted_confirmation: Optional[HostedConfirmation] """ Configuration when `after_completion.type=hosted_confirmation`. """ redirect: Optional[Redirect] """ Configuration when `after_completion.type=redirect`. """ type: Literal["hosted_confirmation", "portal_homepage", "redirect"] """ The specified type of behavior after the flow is completed. """ _inner_class_types = { "hosted_confirmation": HostedConfirmation, "redirect": Redirect, } class SubscriptionCancel(StripeObject): class Retention(StripeObject): class CouponOffer(StripeObject): coupon: str """ The ID of the coupon to be offered. """ coupon_offer: Optional[CouponOffer] """ Configuration when `retention.type=coupon_offer`. """ type: Literal["coupon_offer"] """ Type of retention strategy that will be used. """ _inner_class_types = {"coupon_offer": CouponOffer} retention: Optional[Retention] """ Specify a retention strategy to be used in the cancellation flow. """ subscription: str """ The ID of the subscription to be canceled. """ _inner_class_types = {"retention": Retention} class SubscriptionUpdate(StripeObject): subscription: str """ The ID of the subscription to be updated. """ class SubscriptionUpdateConfirm(StripeObject): class Discount(StripeObject): coupon: Optional[str] """ The ID of the coupon to apply to this subscription update. """ promotion_code: Optional[str] """ The ID of a promotion code to apply to this subscription update. """ class Item(StripeObject): id: Optional[str] """ The ID of the [subscription item](https://stripe.com/docs/api/subscriptions/object#subscription_object-items-data-id) to be updated. """ price: Optional[str] """ The price the customer should subscribe to through this flow. The price must also be included in the configuration's [`features.subscription_update.products`](https://stripe.com/docs/api/customer_portal/configuration#portal_configuration_object-features-subscription_update-products). """ quantity: Optional[int] """ [Quantity](https://stripe.com/docs/subscriptions/quantities) for this item that the customer should subscribe to through this flow. """ discounts: Optional[List[Discount]] """ The coupon or promotion code to apply to this subscription update. Currently, only up to one may be specified. """ items: List[Item] """ The [subscription item](https://stripe.com/docs/api/subscription_items) to be updated through this flow. Currently, only up to one may be specified and subscriptions with multiple items are not updatable. """ subscription: str """ The ID of the subscription to be updated. """ _inner_class_types = {"discounts": Discount, "items": Item} after_completion: AfterCompletion subscription_cancel: Optional[SubscriptionCancel] """ Configuration when `flow.type=subscription_cancel`. """ subscription_update: Optional[SubscriptionUpdate] """ Configuration when `flow.type=subscription_update`. """ subscription_update_confirm: Optional[SubscriptionUpdateConfirm] """ Configuration when `flow.type=subscription_update_confirm`. """ type: Literal[ "payment_method_update", "subscription_cancel", "subscription_update", "subscription_update_confirm", ] """ Type of flow that the customer will go through. """ _inner_class_types = { "after_completion": AfterCompletion, "subscription_cancel": SubscriptionCancel, "subscription_update": SubscriptionUpdate, "subscription_update_confirm": SubscriptionUpdateConfirm, } class CreateParams(RequestOptions): configuration: NotRequired[str] """ The ID of an existing [configuration](https://stripe.com/docs/api/customer_portal/configuration) to use for this session, describing its functionality and features. If not specified, the session uses the default configuration. """ customer: str """ The ID of an existing customer. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ flow_data: NotRequired["Session.CreateParamsFlowData"] """ Information about a specific flow for the customer to go through. See the [docs](https://stripe.com/docs/customer-management/portal-deep-links) to learn more about using customer portal deep links and flows. """ locale: NotRequired[ Literal[ "auto", "bg", "cs", "da", "de", "el", "en", "en-AU", "en-CA", "en-GB", "en-IE", "en-IN", "en-NZ", "en-SG", "es", "es-419", "et", "fi", "fil", "fr", "fr-CA", "hr", "hu", "id", "it", "ja", "ko", "lt", "lv", "ms", "mt", "nb", "nl", "pl", "pt", "pt-BR", "ro", "ru", "sk", "sl", "sv", "th", "tr", "vi", "zh", "zh-HK", "zh-TW", ] ] """ The IETF language tag of the locale customer portal is displayed in. If blank or auto, the customer's `preferred_locales` or browser's locale is used. """ on_behalf_of: NotRequired[str] """ The `on_behalf_of` account to use for this session. When specified, only subscriptions and invoices with this `on_behalf_of` account appear in the portal. For more information, see the [docs](https://stripe.com/docs/connect/separate-charges-and-transfers#settlement-merchant). Use the [Accounts API](https://stripe.com/docs/api/accounts/object#account_object-settings-branding) to modify the `on_behalf_of` account's branding settings, which the portal displays. """ return_url: NotRequired[str] """ The default URL to redirect customers to when they click on the portal's link to return to your website. """ class CreateParamsFlowData(TypedDict): after_completion: NotRequired[ "Session.CreateParamsFlowDataAfterCompletion" ] """ Behavior after the flow is completed. """ subscription_cancel: NotRequired[ "Session.CreateParamsFlowDataSubscriptionCancel" ] """ Configuration when `flow_data.type=subscription_cancel`. """ subscription_update: NotRequired[ "Session.CreateParamsFlowDataSubscriptionUpdate" ] """ Configuration when `flow_data.type=subscription_update`. """ subscription_update_confirm: NotRequired[ "Session.CreateParamsFlowDataSubscriptionUpdateConfirm" ] """ Configuration when `flow_data.type=subscription_update_confirm`. """ type: Literal[ "payment_method_update", "subscription_cancel", "subscription_update", "subscription_update_confirm", ] """ Type of flow that the customer will go through. """ class CreateParamsFlowDataAfterCompletion(TypedDict): hosted_confirmation: NotRequired[ "Session.CreateParamsFlowDataAfterCompletionHostedConfirmation" ] """ Configuration when `after_completion.type=hosted_confirmation`. """ redirect: NotRequired[ "Session.CreateParamsFlowDataAfterCompletionRedirect" ] """ Configuration when `after_completion.type=redirect`. """ type: Literal["hosted_confirmation", "portal_homepage", "redirect"] """ The specified behavior after the flow is completed. """ class CreateParamsFlowDataAfterCompletionHostedConfirmation(TypedDict): custom_message: NotRequired[str] """ A custom message to display to the customer after the flow is completed. """ class CreateParamsFlowDataAfterCompletionRedirect(TypedDict): return_url: str """ The URL the customer will be redirected to after the flow is completed. """ class CreateParamsFlowDataSubscriptionCancel(TypedDict): retention: NotRequired[ "Session.CreateParamsFlowDataSubscriptionCancelRetention" ] """ Specify a retention strategy to be used in the cancellation flow. """ subscription: str """ The ID of the subscription to be canceled. """ class CreateParamsFlowDataSubscriptionCancelRetention(TypedDict): coupon_offer: "Session.CreateParamsFlowDataSubscriptionCancelRetentionCouponOffer" """ Configuration when `retention.type=coupon_offer`. """ type: Literal["coupon_offer"] """ Type of retention strategy to use with the customer. """ class CreateParamsFlowDataSubscriptionCancelRetentionCouponOffer( TypedDict ): coupon: str """ The ID of the coupon to be offered. """ class CreateParamsFlowDataSubscriptionUpdate(TypedDict): subscription: str """ The ID of the subscription to be updated. """ class CreateParamsFlowDataSubscriptionUpdateConfirm(TypedDict): discounts: NotRequired[ List[ "Session.CreateParamsFlowDataSubscriptionUpdateConfirmDiscount" ] ] """ The coupon or promotion code to apply to this subscription update. Currently, only up to one may be specified. """ items: List[ "Session.CreateParamsFlowDataSubscriptionUpdateConfirmItem" ] """ The [subscription item](https://stripe.com/docs/api/subscription_items) to be updated through this flow. Currently, only up to one may be specified and subscriptions with multiple items are not updatable. """ subscription: str """ The ID of the subscription to be updated. """ class CreateParamsFlowDataSubscriptionUpdateConfirmDiscount(TypedDict): coupon: NotRequired[str] """ The ID of the coupon to apply to this subscription update. """ promotion_code: NotRequired[str] """ The ID of a promotion code to apply to this subscription update. """ class CreateParamsFlowDataSubscriptionUpdateConfirmItem(TypedDict): id: str """ The ID of the [subscription item](https://stripe.com/docs/api/subscriptions/object#subscription_object-items-data-id) to be updated. """ price: NotRequired[str] """ The price the customer should subscribe to through this flow. The price must also be included in the configuration's [`features.subscription_update.products`](https://stripe.com/docs/api/customer_portal/configuration#portal_configuration_object-features-subscription_update-products). """ quantity: NotRequired[int] """ [Quantity](https://stripe.com/docs/subscriptions/quantities) for this item that the customer should subscribe to through this flow. """ configuration: ExpandableField["Configuration"] """ The configuration used by this session, describing the features available. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ customer: str """ The ID of the customer for this session. """ flow: Optional[Flow] """ Information about a specific flow for the customer to go through. See the [docs](https://stripe.com/docs/customer-management/portal-deep-links) to learn more about using customer portal deep links and flows. """ id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ locale: Optional[ Literal[ "auto", "bg", "cs", "da", "de", "el", "en", "en-AU", "en-CA", "en-GB", "en-IE", "en-IN", "en-NZ", "en-SG", "es", "es-419", "et", "fi", "fil", "fr", "fr-CA", "hr", "hu", "id", "it", "ja", "ko", "lt", "lv", "ms", "mt", "nb", "nl", "pl", "pt", "pt-BR", "ro", "ru", "sk", "sl", "sv", "th", "tr", "vi", "zh", "zh-HK", "zh-TW", ] ] """ The IETF language tag of the locale Customer Portal is displayed in. If blank or auto, the customer's `preferred_locales` or browser's locale is used. """ object: Literal["billing_portal.session"] """ String representing the object's type. Objects of the same type share the same value. """ on_behalf_of: Optional[str] """ The account for which the session was created on behalf of. When specified, only subscriptions and invoices with this `on_behalf_of` account appear in the portal. For more information, see the [docs](https://stripe.com/docs/connect/separate-charges-and-transfers#settlement-merchant). Use the [Accounts API](https://stripe.com/docs/api/accounts/object#account_object-settings-branding) to modify the `on_behalf_of` account's branding settings, which the portal displays. """ return_url: Optional[str] """ The URL to redirect customers to when they click on the portal's link to return to your website. """ url: str """ The short-lived URL of the session that gives customers access to the customer portal. """ @classmethod def create(cls, **params: Unpack["Session.CreateParams"]) -> "Session": """ Creates a session of the customer portal. """ return cast( "Session", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["Session.CreateParams"] ) -> "Session": """ Creates a session of the customer portal. """ return cast( "Session", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) _inner_class_types = {"flow": Flow} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/billing_portal/_session_service.py0000644000175100001770000002251114637354563022750 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe.billing_portal._session import Session from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict class SessionService(StripeService): class CreateParams(TypedDict): configuration: NotRequired[str] """ The ID of an existing [configuration](https://stripe.com/docs/api/customer_portal/configuration) to use for this session, describing its functionality and features. If not specified, the session uses the default configuration. """ customer: str """ The ID of an existing customer. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ flow_data: NotRequired["SessionService.CreateParamsFlowData"] """ Information about a specific flow for the customer to go through. See the [docs](https://stripe.com/docs/customer-management/portal-deep-links) to learn more about using customer portal deep links and flows. """ locale: NotRequired[ Literal[ "auto", "bg", "cs", "da", "de", "el", "en", "en-AU", "en-CA", "en-GB", "en-IE", "en-IN", "en-NZ", "en-SG", "es", "es-419", "et", "fi", "fil", "fr", "fr-CA", "hr", "hu", "id", "it", "ja", "ko", "lt", "lv", "ms", "mt", "nb", "nl", "pl", "pt", "pt-BR", "ro", "ru", "sk", "sl", "sv", "th", "tr", "vi", "zh", "zh-HK", "zh-TW", ] ] """ The IETF language tag of the locale customer portal is displayed in. If blank or auto, the customer's `preferred_locales` or browser's locale is used. """ on_behalf_of: NotRequired[str] """ The `on_behalf_of` account to use for this session. When specified, only subscriptions and invoices with this `on_behalf_of` account appear in the portal. For more information, see the [docs](https://stripe.com/docs/connect/separate-charges-and-transfers#settlement-merchant). Use the [Accounts API](https://stripe.com/docs/api/accounts/object#account_object-settings-branding) to modify the `on_behalf_of` account's branding settings, which the portal displays. """ return_url: NotRequired[str] """ The default URL to redirect customers to when they click on the portal's link to return to your website. """ class CreateParamsFlowData(TypedDict): after_completion: NotRequired[ "SessionService.CreateParamsFlowDataAfterCompletion" ] """ Behavior after the flow is completed. """ subscription_cancel: NotRequired[ "SessionService.CreateParamsFlowDataSubscriptionCancel" ] """ Configuration when `flow_data.type=subscription_cancel`. """ subscription_update: NotRequired[ "SessionService.CreateParamsFlowDataSubscriptionUpdate" ] """ Configuration when `flow_data.type=subscription_update`. """ subscription_update_confirm: NotRequired[ "SessionService.CreateParamsFlowDataSubscriptionUpdateConfirm" ] """ Configuration when `flow_data.type=subscription_update_confirm`. """ type: Literal[ "payment_method_update", "subscription_cancel", "subscription_update", "subscription_update_confirm", ] """ Type of flow that the customer will go through. """ class CreateParamsFlowDataAfterCompletion(TypedDict): hosted_confirmation: NotRequired[ "SessionService.CreateParamsFlowDataAfterCompletionHostedConfirmation" ] """ Configuration when `after_completion.type=hosted_confirmation`. """ redirect: NotRequired[ "SessionService.CreateParamsFlowDataAfterCompletionRedirect" ] """ Configuration when `after_completion.type=redirect`. """ type: Literal["hosted_confirmation", "portal_homepage", "redirect"] """ The specified behavior after the flow is completed. """ class CreateParamsFlowDataAfterCompletionHostedConfirmation(TypedDict): custom_message: NotRequired[str] """ A custom message to display to the customer after the flow is completed. """ class CreateParamsFlowDataAfterCompletionRedirect(TypedDict): return_url: str """ The URL the customer will be redirected to after the flow is completed. """ class CreateParamsFlowDataSubscriptionCancel(TypedDict): retention: NotRequired[ "SessionService.CreateParamsFlowDataSubscriptionCancelRetention" ] """ Specify a retention strategy to be used in the cancellation flow. """ subscription: str """ The ID of the subscription to be canceled. """ class CreateParamsFlowDataSubscriptionCancelRetention(TypedDict): coupon_offer: "SessionService.CreateParamsFlowDataSubscriptionCancelRetentionCouponOffer" """ Configuration when `retention.type=coupon_offer`. """ type: Literal["coupon_offer"] """ Type of retention strategy to use with the customer. """ class CreateParamsFlowDataSubscriptionCancelRetentionCouponOffer( TypedDict ): coupon: str """ The ID of the coupon to be offered. """ class CreateParamsFlowDataSubscriptionUpdate(TypedDict): subscription: str """ The ID of the subscription to be updated. """ class CreateParamsFlowDataSubscriptionUpdateConfirm(TypedDict): discounts: NotRequired[ List[ "SessionService.CreateParamsFlowDataSubscriptionUpdateConfirmDiscount" ] ] """ The coupon or promotion code to apply to this subscription update. Currently, only up to one may be specified. """ items: List[ "SessionService.CreateParamsFlowDataSubscriptionUpdateConfirmItem" ] """ The [subscription item](https://stripe.com/docs/api/subscription_items) to be updated through this flow. Currently, only up to one may be specified and subscriptions with multiple items are not updatable. """ subscription: str """ The ID of the subscription to be updated. """ class CreateParamsFlowDataSubscriptionUpdateConfirmDiscount(TypedDict): coupon: NotRequired[str] """ The ID of the coupon to apply to this subscription update. """ promotion_code: NotRequired[str] """ The ID of a promotion code to apply to this subscription update. """ class CreateParamsFlowDataSubscriptionUpdateConfirmItem(TypedDict): id: str """ The ID of the [subscription item](https://stripe.com/docs/api/subscriptions/object#subscription_object-items-data-id) to be updated. """ price: NotRequired[str] """ The price the customer should subscribe to through this flow. The price must also be included in the configuration's [`features.subscription_update.products`](https://stripe.com/docs/api/customer_portal/configuration#portal_configuration_object-features-subscription_update-products). """ quantity: NotRequired[int] """ [Quantity](https://stripe.com/docs/subscriptions/quantities) for this item that the customer should subscribe to through this flow. """ def create( self, params: "SessionService.CreateParams", options: RequestOptions = {}, ) -> Session: """ Creates a session of the customer portal. """ return cast( Session, self._request( "post", "/v1/billing_portal/sessions", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "SessionService.CreateParams", options: RequestOptions = {}, ) -> Session: """ Creates a session of the customer portal. """ return cast( Session, await self._request_async( "post", "/v1/billing_portal/sessions", api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5329404 stripe-10.1.0/stripe/checkout/0000755000175100001770000000000014637354616015636 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/checkout/__init__.py0000644000175100001770000000046614637354563017756 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe.checkout._session import Session as Session from stripe.checkout._session_line_item_service import ( SessionLineItemService as SessionLineItemService, ) from stripe.checkout._session_service import SessionService as SessionService ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/checkout/_session.py0000644000175100001770000061321614637354563020044 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._account import Account from stripe._customer import Customer from stripe._discount import Discount as DiscountResource from stripe._invoice import Invoice from stripe._line_item import LineItem from stripe._payment_intent import PaymentIntent from stripe._payment_link import PaymentLink from stripe._setup_intent import SetupIntent from stripe._shipping_rate import ShippingRate from stripe._subscription import Subscription from stripe._tax_id import TaxId as TaxIdResource from stripe._tax_rate import TaxRate class Session( CreateableAPIResource["Session"], ListableAPIResource["Session"] ): """ A Checkout Session represents your customer's session as they pay for one-time purchases or subscriptions through [Checkout](https://stripe.com/docs/payments/checkout) or [Payment Links](https://stripe.com/docs/payments/payment-links). We recommend creating a new Session each time your customer attempts to pay. Once payment is successful, the Checkout Session will contain a reference to the [Customer](https://stripe.com/docs/api/customers), and either the successful [PaymentIntent](https://stripe.com/docs/api/payment_intents) or an active [Subscription](https://stripe.com/docs/api/subscriptions). You can create a Checkout Session on your server and redirect to its URL to begin Checkout. Related guide: [Checkout quickstart](https://stripe.com/docs/checkout/quickstart) """ OBJECT_NAME: ClassVar[Literal["checkout.session"]] = "checkout.session" class AfterExpiration(StripeObject): class Recovery(StripeObject): allow_promotion_codes: bool """ Enables user redeemable promotion codes on the recovered Checkout Sessions. Defaults to `false` """ enabled: bool """ If `true`, a recovery url will be generated to recover this Checkout Session if it expires before a transaction is completed. It will be attached to the Checkout Session object upon expiration. """ expires_at: Optional[int] """ The timestamp at which the recovery URL will expire. """ url: Optional[str] """ URL that creates a new Checkout Session when clicked that is a copy of this expired Checkout Session """ recovery: Optional[Recovery] """ When set, configuration used to recover the Checkout Session on expiry. """ _inner_class_types = {"recovery": Recovery} class AutomaticTax(StripeObject): class Liability(StripeObject): account: Optional[ExpandableField["Account"]] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced. """ enabled: bool """ Indicates whether automatic tax is enabled for the session """ liability: Optional[Liability] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ status: Optional[ Literal["complete", "failed", "requires_location_inputs"] ] """ The status of the most recent automated tax calculation for this session. """ _inner_class_types = {"liability": Liability} class Consent(StripeObject): promotions: Optional[Literal["opt_in", "opt_out"]] """ If `opt_in`, the customer consents to receiving promotional communications from the merchant about this Checkout Session. """ terms_of_service: Optional[Literal["accepted"]] """ If `accepted`, the customer in this Checkout Session has agreed to the merchant's terms of service. """ class ConsentCollection(StripeObject): class PaymentMethodReuseAgreement(StripeObject): position: Literal["auto", "hidden"] """ Determines the position and visibility of the payment method reuse agreement in the UI. When set to `auto`, Stripe's defaults will be used. When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI. """ payment_method_reuse_agreement: Optional[PaymentMethodReuseAgreement] """ If set to `hidden`, it will hide legal text related to the reuse of a payment method. """ promotions: Optional[Literal["auto", "none"]] """ If set to `auto`, enables the collection of customer consent for promotional communications. The Checkout Session will determine whether to display an option to opt into promotional communication from the merchant depending on the customer's locale. Only available to US merchants. """ terms_of_service: Optional[Literal["none", "required"]] """ If set to `required`, it requires customers to accept the terms of service before being able to pay. """ _inner_class_types = { "payment_method_reuse_agreement": PaymentMethodReuseAgreement, } class CurrencyConversion(StripeObject): amount_subtotal: int """ Total of all items in source currency before discounts or taxes are applied. """ amount_total: int """ Total of all items in source currency after discounts and taxes are applied. """ fx_rate: str """ Exchange rate used to convert source currency amounts to customer currency amounts """ source_currency: str """ Creation currency of the CheckoutSession before localization """ class CustomField(StripeObject): class Dropdown(StripeObject): class Option(StripeObject): label: str """ The label for the option, displayed to the customer. Up to 100 characters. """ value: str """ The value for this option, not displayed to the customer, used by your integration to reconcile the option selected by the customer. Must be unique to this option, alphanumeric, and up to 100 characters. """ default_value: Optional[str] """ The value that will pre-fill on the payment page. """ options: List[Option] """ The options available for the customer to select. Up to 200 options allowed. """ value: Optional[str] """ The option selected by the customer. This will be the `value` for the option. """ _inner_class_types = {"options": Option} class Label(StripeObject): custom: Optional[str] """ Custom text for the label, displayed to the customer. Up to 50 characters. """ type: Literal["custom"] """ The type of the label. """ class Numeric(StripeObject): default_value: Optional[str] """ The value that will pre-fill the field on the payment page. """ maximum_length: Optional[int] """ The maximum character length constraint for the customer's input. """ minimum_length: Optional[int] """ The minimum character length requirement for the customer's input. """ value: Optional[str] """ The value entered by the customer, containing only digits. """ class Text(StripeObject): default_value: Optional[str] """ The value that will pre-fill the field on the payment page. """ maximum_length: Optional[int] """ The maximum character length constraint for the customer's input. """ minimum_length: Optional[int] """ The minimum character length requirement for the customer's input. """ value: Optional[str] """ The value entered by the customer. """ dropdown: Optional[Dropdown] key: str """ String of your choice that your integration can use to reconcile this field. Must be unique to this field, alphanumeric, and up to 200 characters. """ label: Label numeric: Optional[Numeric] optional: bool """ Whether the customer is required to complete the field before completing the Checkout Session. Defaults to `false`. """ text: Optional[Text] type: Literal["dropdown", "numeric", "text"] """ The type of the field. """ _inner_class_types = { "dropdown": Dropdown, "label": Label, "numeric": Numeric, "text": Text, } class CustomText(StripeObject): class AfterSubmit(StripeObject): message: str """ Text may be up to 1200 characters in length. """ class ShippingAddress(StripeObject): message: str """ Text may be up to 1200 characters in length. """ class Submit(StripeObject): message: str """ Text may be up to 1200 characters in length. """ class TermsOfServiceAcceptance(StripeObject): message: str """ Text may be up to 1200 characters in length. """ after_submit: Optional[AfterSubmit] """ Custom text that should be displayed after the payment confirmation button. """ shipping_address: Optional[ShippingAddress] """ Custom text that should be displayed alongside shipping address collection. """ submit: Optional[Submit] """ Custom text that should be displayed alongside the payment confirmation button. """ terms_of_service_acceptance: Optional[TermsOfServiceAcceptance] """ Custom text that should be displayed in place of the default terms of service agreement text. """ _inner_class_types = { "after_submit": AfterSubmit, "shipping_address": ShippingAddress, "submit": Submit, "terms_of_service_acceptance": TermsOfServiceAcceptance, } class CustomerDetails(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 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State, county, province, or region. """ class TaxId(StripeObject): type: Literal[ "ad_nrt", "ae_trn", "ar_cuit", "au_abn", "au_arn", "bg_uic", "bh_vat", "bo_tin", "br_cnpj", "br_cpf", "ca_bn", "ca_gst_hst", "ca_pst_bc", "ca_pst_mb", "ca_pst_sk", "ca_qst", "ch_uid", "ch_vat", "cl_tin", "cn_tin", "co_nit", "cr_tin", "de_stn", "do_rcn", "ec_ruc", "eg_tin", "es_cif", "eu_oss_vat", "eu_vat", "gb_vat", "ge_vat", "hk_br", "hu_tin", "id_npwp", "il_vat", "in_gst", "is_vat", "jp_cn", "jp_rn", "jp_trn", "ke_pin", "kr_brn", "kz_bin", "li_uid", "mx_rfc", "my_frp", "my_itn", "my_sst", "ng_tin", "no_vat", "no_voec", "nz_gst", "om_vat", "pe_ruc", "ph_tin", "ro_tin", "rs_pib", "ru_inn", "ru_kpp", "sa_vat", "sg_gst", "sg_uen", "si_tin", "sv_nit", "th_vat", "tr_tin", "tw_vat", "ua_vat", "unknown", "us_ein", "uy_ruc", "ve_rif", "vn_tin", "za_vat", ] """ The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, or `unknown` """ value: Optional[str] """ The value of the tax ID. """ address: Optional[Address] """ The customer's address after a completed Checkout Session. Note: This property is populated only for sessions on or after March 30, 2022. """ email: Optional[str] """ The email associated with the Customer, if one exists, on the Checkout Session after a completed Checkout Session or at time of session expiry. Otherwise, if the customer has consented to promotional content, this value is the most recent valid email provided by the customer on the Checkout form. """ name: Optional[str] """ The customer's name after a completed Checkout Session. Note: This property is populated only for sessions on or after March 30, 2022. """ phone: Optional[str] """ The customer's phone number after a completed Checkout Session. """ tax_exempt: Optional[Literal["exempt", "none", "reverse"]] """ The customer's tax exempt status after a completed Checkout Session. """ tax_ids: Optional[List[TaxId]] """ The customer's tax IDs after a completed Checkout Session. """ _inner_class_types = {"address": Address, "tax_ids": TaxId} class InvoiceCreation(StripeObject): class InvoiceData(StripeObject): class CustomField(StripeObject): name: str """ The name of the custom field. """ value: str """ The value of the custom field. """ class Issuer(StripeObject): account: Optional[ExpandableField["Account"]] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced. """ class RenderingOptions(StripeObject): amount_tax_display: Optional[str] """ How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. """ account_tax_ids: Optional[List[ExpandableField["TaxIdResource"]]] """ The account tax IDs associated with the invoice. """ custom_fields: Optional[List[CustomField]] """ Custom fields displayed on the invoice. """ description: Optional[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ footer: Optional[str] """ Footer displayed on the invoice. """ issuer: Optional[Issuer] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ metadata: Optional[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ rendering_options: Optional[RenderingOptions] """ Options for invoice PDF rendering. """ _inner_class_types = { "custom_fields": CustomField, "issuer": Issuer, "rendering_options": RenderingOptions, } enabled: bool """ Indicates whether invoice creation is enabled for the Checkout Session. """ invoice_data: InvoiceData _inner_class_types = {"invoice_data": InvoiceData} class PaymentMethodConfigurationDetails(StripeObject): id: str """ ID of the payment method configuration used. """ parent: Optional[str] """ ID of the parent payment method configuration used. """ class PaymentMethodOptions(StripeObject): class AcssDebit(StripeObject): class MandateOptions(StripeObject): custom_mandate_url: Optional[str] """ A URL for custom mandate text """ default_for: Optional[List[Literal["invoice", "subscription"]]] """ List of Stripe products where this mandate can be selected automatically. Returned when the Session is in `setup` mode. """ interval_description: Optional[str] """ Description of the interval. Only required if the 'payment_schedule' parameter is 'interval' or 'combined'. """ payment_schedule: Optional[ Literal["combined", "interval", "sporadic"] ] """ Payment schedule for the mandate. """ transaction_type: Optional[Literal["business", "personal"]] """ Transaction type of the mandate. """ currency: Optional[Literal["cad", "usd"]] """ Currency supported by the bank account. Returned when the Session is in `setup` mode. """ mandate_options: Optional[MandateOptions] setup_future_usage: Optional[ Literal["none", "off_session", "on_session"] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ verification_method: Optional[ Literal["automatic", "instant", "microdeposits"] ] """ Bank account verification method. """ _inner_class_types = {"mandate_options": MandateOptions} class Affirm(StripeObject): setup_future_usage: Optional[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class AfterpayClearpay(StripeObject): setup_future_usage: Optional[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class Alipay(StripeObject): setup_future_usage: Optional[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class AmazonPay(StripeObject): setup_future_usage: Optional[Literal["none", "off_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class AuBecsDebit(StripeObject): setup_future_usage: Optional[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class BacsDebit(StripeObject): setup_future_usage: Optional[ Literal["none", "off_session", "on_session"] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class Bancontact(StripeObject): setup_future_usage: Optional[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class Boleto(StripeObject): expires_after_days: int """ The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto voucher will expire on Wednesday at 23:59 America/Sao_Paulo time. """ setup_future_usage: Optional[ Literal["none", "off_session", "on_session"] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class Card(StripeObject): class Installments(StripeObject): enabled: Optional[bool] """ Indicates if installments are enabled """ installments: Optional[Installments] request_three_d_secure: Literal["any", "automatic", "challenge"] """ 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://stripe.com/docs/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://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ setup_future_usage: Optional[ Literal["none", "off_session", "on_session"] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ statement_descriptor_suffix_kana: Optional[str] """ Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. """ statement_descriptor_suffix_kanji: Optional[str] """ 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. """ _inner_class_types = {"installments": Installments} class Cashapp(StripeObject): setup_future_usage: Optional[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CustomerBalance(StripeObject): class BankTransfer(StripeObject): class EuBankTransfer(StripeObject): country: Literal["BE", "DE", "ES", "FR", "IE", "NL"] """ The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. """ eu_bank_transfer: Optional[EuBankTransfer] requested_address_types: Optional[ List[ Literal[ "aba", "iban", "sepa", "sort_code", "spei", "swift", "zengin", ] ] ] """ List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. """ type: Optional[ Literal[ "eu_bank_transfer", "gb_bank_transfer", "jp_bank_transfer", "mx_bank_transfer", "us_bank_transfer", ] ] """ The bank transfer type that this PaymentIntent is allowed to use for funding Permitted values include: `eu_bank_transfer`, `gb_bank_transfer`, `jp_bank_transfer`, `mx_bank_transfer`, or `us_bank_transfer`. """ _inner_class_types = {"eu_bank_transfer": EuBankTransfer} bank_transfer: Optional[BankTransfer] funding_type: Optional[Literal["bank_transfer"]] """ The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. """ setup_future_usage: Optional[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ _inner_class_types = {"bank_transfer": BankTransfer} class Eps(StripeObject): setup_future_usage: Optional[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class Fpx(StripeObject): setup_future_usage: Optional[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class Giropay(StripeObject): setup_future_usage: Optional[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class Grabpay(StripeObject): setup_future_usage: Optional[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class Ideal(StripeObject): setup_future_usage: Optional[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class Klarna(StripeObject): setup_future_usage: Optional[ Literal["none", "off_session", "on_session"] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class Konbini(StripeObject): expires_after_days: Optional[int] """ The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. """ setup_future_usage: Optional[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class Link(StripeObject): setup_future_usage: Optional[Literal["none", "off_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class Mobilepay(StripeObject): setup_future_usage: Optional[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class Multibanco(StripeObject): setup_future_usage: Optional[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class Oxxo(StripeObject): expires_after_days: int """ The number of calendar days before an OXXO invoice expires. For example, if you create an OXXO invoice on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. """ setup_future_usage: Optional[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class P24(StripeObject): setup_future_usage: Optional[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class Paynow(StripeObject): setup_future_usage: Optional[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class Paypal(StripeObject): capture_method: Optional[Literal["manual"]] """ Controls when the funds will be captured from the customer's account. """ preferred_locale: Optional[str] """ Preferred locale of the PayPal checkout page that the customer is redirected to. """ reference: Optional[str] """ A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. """ setup_future_usage: Optional[Literal["none", "off_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class Pix(StripeObject): expires_after_seconds: Optional[int] """ The number of seconds after which Pix payment will expire. """ class RevolutPay(StripeObject): setup_future_usage: Optional[Literal["none", "off_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class SepaDebit(StripeObject): setup_future_usage: Optional[ Literal["none", "off_session", "on_session"] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class Sofort(StripeObject): setup_future_usage: Optional[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class Swish(StripeObject): reference: Optional[str] """ The order reference that will be displayed to customers in the Swish application. Defaults to the `id` of the Payment Intent. """ class UsBankAccount(StripeObject): class FinancialConnections(StripeObject): class Filters(StripeObject): account_subcategories: Optional[ List[Literal["checking", "savings"]] ] """ The account subcategories to use to filter for possible accounts to link. Valid subcategories are `checking` and `savings`. """ filters: Optional[Filters] permissions: Optional[ List[ Literal[ "balances", "ownership", "payment_method", "transactions", ] ] ] """ The list of permissions to request. The `payment_method` permission must be included. """ prefetch: Optional[ List[Literal["balances", "ownership", "transactions"]] ] """ Data features requested to be retrieved upon account creation. """ return_url: Optional[str] """ For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. """ _inner_class_types = {"filters": Filters} financial_connections: Optional[FinancialConnections] setup_future_usage: Optional[ Literal["none", "off_session", "on_session"] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ verification_method: Optional[Literal["automatic", "instant"]] """ Bank account verification method. """ _inner_class_types = { "financial_connections": FinancialConnections } acss_debit: Optional[AcssDebit] affirm: Optional[Affirm] afterpay_clearpay: Optional[AfterpayClearpay] alipay: Optional[Alipay] amazon_pay: Optional[AmazonPay] au_becs_debit: Optional[AuBecsDebit] bacs_debit: Optional[BacsDebit] bancontact: Optional[Bancontact] boleto: Optional[Boleto] card: Optional[Card] cashapp: Optional[Cashapp] customer_balance: Optional[CustomerBalance] eps: Optional[Eps] fpx: Optional[Fpx] giropay: Optional[Giropay] grabpay: Optional[Grabpay] ideal: Optional[Ideal] klarna: Optional[Klarna] konbini: Optional[Konbini] link: Optional[Link] mobilepay: Optional[Mobilepay] multibanco: Optional[Multibanco] oxxo: Optional[Oxxo] p24: Optional[P24] paynow: Optional[Paynow] paypal: Optional[Paypal] pix: Optional[Pix] revolut_pay: Optional[RevolutPay] sepa_debit: Optional[SepaDebit] sofort: Optional[Sofort] swish: Optional[Swish] us_bank_account: Optional[UsBankAccount] _inner_class_types = { "acss_debit": AcssDebit, "affirm": Affirm, "afterpay_clearpay": AfterpayClearpay, "alipay": Alipay, "amazon_pay": AmazonPay, "au_becs_debit": AuBecsDebit, "bacs_debit": BacsDebit, "bancontact": Bancontact, "boleto": Boleto, "card": Card, "cashapp": Cashapp, "customer_balance": CustomerBalance, "eps": Eps, "fpx": Fpx, "giropay": Giropay, "grabpay": Grabpay, "ideal": Ideal, "klarna": Klarna, "konbini": Konbini, "link": Link, "mobilepay": Mobilepay, "multibanco": Multibanco, "oxxo": Oxxo, "p24": P24, "paynow": Paynow, "paypal": Paypal, "pix": Pix, "revolut_pay": RevolutPay, "sepa_debit": SepaDebit, "sofort": Sofort, "swish": Swish, "us_bank_account": UsBankAccount, } class PhoneNumberCollection(StripeObject): enabled: bool """ Indicates whether phone number collection is enabled for the session """ class SavedPaymentMethodOptions(StripeObject): allow_redisplay_filters: Optional[ List[Literal["always", "limited", "unspecified"]] ] """ Uses the `allow_redisplay` value of each saved payment method to filter the set presented to a returning customer. By default, only saved payment methods with 'allow_redisplay: ‘always' are shown in Checkout. """ payment_method_remove: Optional[Literal["disabled", "enabled"]] """ Enable customers to choose if they wish to remove their saved payment methods. Disabled by default. """ payment_method_save: Optional[Literal["disabled", "enabled"]] """ Enable customers to choose if they wish to save their payment method for future use. Disabled by default. """ class ShippingAddressCollection(StripeObject): allowed_countries: List[ Literal[ "AC", "AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CV", "CW", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MK", "ML", "MM", "MN", "MO", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SZ", "TA", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VN", "VU", "WF", "WS", "XK", "YE", "YT", "ZA", "ZM", "ZW", "ZZ", ] ] """ An array of two-letter ISO country codes representing which countries Checkout should provide as options for shipping locations. Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. """ class ShippingCost(StripeObject): class Tax(StripeObject): amount: int """ Amount of tax applied for this rate. """ rate: "TaxRate" """ Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates) """ taxability_reason: Optional[ Literal[ "customer_exempt", "not_collecting", "not_subject_to_tax", "not_supported", "portion_product_exempt", "portion_reduced_rated", "portion_standard_rated", "product_exempt", "product_exempt_holiday", "proportionally_rated", "reduced_rated", "reverse_charge", "standard_rated", "taxable_basis_reduced", "zero_rated", ] ] """ The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. """ taxable_amount: Optional[int] """ The amount on which tax is calculated, in cents (or local equivalent). """ amount_subtotal: int """ Total shipping cost before any discounts or taxes are applied. """ amount_tax: int """ Total tax amount applied due to shipping costs. If no tax was applied, defaults to 0. """ amount_total: int """ Total shipping cost after discounts and taxes are applied. """ shipping_rate: Optional[ExpandableField["ShippingRate"]] """ The ID of the ShippingRate for this order. """ taxes: Optional[List[Tax]] """ The taxes applied to the shipping rate. """ _inner_class_types = {"taxes": Tax} 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 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State, county, province, or region. """ address: Optional[Address] carrier: Optional[str] """ The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. """ name: Optional[str] """ Recipient name. """ phone: Optional[str] """ Recipient phone (including extension). """ tracking_number: Optional[str] """ The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ _inner_class_types = {"address": Address} class ShippingOption(StripeObject): shipping_amount: int """ A non-negative integer in cents representing how much to charge. """ shipping_rate: ExpandableField["ShippingRate"] """ The shipping rate. """ class TaxIdCollection(StripeObject): enabled: bool """ Indicates whether tax ID collection is enabled for the session """ class TotalDetails(StripeObject): class Breakdown(StripeObject): class Discount(StripeObject): amount: int """ The amount discounted. """ discount: "DiscountResource" """ A discount represents the actual application of a [coupon](https://stripe.com/docs/api#coupons) or [promotion code](https://stripe.com/docs/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://stripe.com/docs/billing/subscriptions/discounts) """ class Tax(StripeObject): amount: int """ Amount of tax applied for this rate. """ rate: "TaxRate" """ Tax rates can be applied to [invoices](https://stripe.com/docs/billing/invoices/tax-rates), [subscriptions](https://stripe.com/docs/billing/subscriptions/taxes) and [Checkout Sessions](https://stripe.com/docs/payments/checkout/set-up-a-subscription#tax-rates) to collect tax. Related guide: [Tax rates](https://stripe.com/docs/billing/taxes/tax-rates) """ taxability_reason: Optional[ Literal[ "customer_exempt", "not_collecting", "not_subject_to_tax", "not_supported", "portion_product_exempt", "portion_reduced_rated", "portion_standard_rated", "product_exempt", "product_exempt_holiday", "proportionally_rated", "reduced_rated", "reverse_charge", "standard_rated", "taxable_basis_reduced", "zero_rated", ] ] """ The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. """ taxable_amount: Optional[int] """ The amount on which tax is calculated, in cents (or local equivalent). """ discounts: List[Discount] """ The aggregated discounts. """ taxes: List[Tax] """ The aggregated tax amounts by rate. """ _inner_class_types = {"discounts": Discount, "taxes": Tax} amount_discount: int """ This is the sum of all the discounts. """ amount_shipping: Optional[int] """ This is the sum of all the shipping amounts. """ amount_tax: int """ This is the sum of all the tax amounts. """ breakdown: Optional[Breakdown] _inner_class_types = {"breakdown": Breakdown} class CreateParams(RequestOptions): after_expiration: NotRequired["Session.CreateParamsAfterExpiration"] """ Configure actions after a Checkout Session has expired. """ allow_promotion_codes: NotRequired[bool] """ Enables user redeemable promotion codes. """ automatic_tax: NotRequired["Session.CreateParamsAutomaticTax"] """ Settings for automatic tax lookup for this session and resulting payments, invoices, and subscriptions. """ billing_address_collection: NotRequired[Literal["auto", "required"]] """ Specify whether Checkout should collect the customer's billing address. Defaults to `auto`. """ cancel_url: NotRequired[str] """ If set, Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website. """ client_reference_id: NotRequired[str] """ A unique string to reference the Checkout Session. This can be a customer ID, a cart ID, or similar, and can be used to reconcile the session with your internal systems. """ consent_collection: NotRequired[ "Session.CreateParamsConsentCollection" ] """ Configure fields for the Checkout Session to gather active consent from customers. """ currency: NotRequired[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). Required in `setup` mode when `payment_method_types` is not set. """ custom_fields: NotRequired[List["Session.CreateParamsCustomField"]] """ Collect additional information from your customer using custom fields. Up to 3 fields are supported. """ custom_text: NotRequired["Session.CreateParamsCustomText"] """ Display additional text for your customers using custom text. """ customer: NotRequired[str] """ ID of an existing Customer, if one exists. In `payment` mode, the customer's most recently saved card payment method will be used to prefill the email, name, card details, and billing address on the Checkout page. In `subscription` mode, the customer's [default payment method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method) will be used if it's a card, otherwise the most recently saved card will be used. A valid billing address, billing name and billing email are required on the payment method for Checkout to prefill the customer's card details. If the Customer already has a valid [email](https://stripe.com/docs/api/customers/object#customer_object-email) set, the email will be prefilled and not editable in Checkout. If the Customer does not have a valid `email`, Checkout will set the email entered during the session on the Customer. If blank for Checkout Sessions in `subscription` mode or with `customer_creation` set as `always` in `payment` mode, Checkout will create a new Customer object based on information provided during the payment flow. You can set [`payment_intent_data.setup_future_usage`](https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-setup_future_usage) to have Checkout automatically attach the payment method to the Customer you pass in for future reuse. """ customer_creation: NotRequired[Literal["always", "if_required"]] """ Configure whether a Checkout Session creates a [Customer](https://stripe.com/docs/api/customers) during Session confirmation. When a Customer is not created, you can still retrieve email, address, and other customer data entered in Checkout with [customer_details](https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-customer_details). Sessions that don't create Customers instead are grouped by [guest customers](https://stripe.com/docs/payments/checkout/guest-customers) in the Dashboard. Promotion codes limited to first time customers will return invalid for these Sessions. Can only be set in `payment` and `setup` mode. """ customer_email: NotRequired[str] """ If provided, this value will be used when the Customer object is created. If not provided, customers will be asked to enter their email address. Use this parameter to prefill customer data if you already have an email on file. To access information about the customer once a session is complete, use the `customer` field. """ customer_update: NotRequired["Session.CreateParamsCustomerUpdate"] """ Controls what fields on Customer can be updated by the Checkout Session. Can only be provided when `customer` is provided. """ discounts: NotRequired[List["Session.CreateParamsDiscount"]] """ The coupon or promotion code to apply to this Session. Currently, only up to one may be specified. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ expires_at: NotRequired[int] """ The Epoch time in seconds at which the Checkout Session will expire. It can be anywhere from 30 minutes to 24 hours after Checkout Session creation. By default, this value is 24 hours from creation. """ invoice_creation: NotRequired["Session.CreateParamsInvoiceCreation"] """ Generate a post-purchase Invoice for one-time payments. """ line_items: NotRequired[List["Session.CreateParamsLineItem"]] """ A list of items the customer is purchasing. Use this parameter to pass one-time or recurring [Prices](https://stripe.com/docs/api/prices). For `payment` mode, there is a maximum of 100 line items, however it is recommended to consolidate line items if there are more than a few dozen. For `subscription` mode, there is a maximum of 20 line items with recurring Prices and 20 line items with one-time Prices. Line items with one-time Prices will be on the initial invoice only. """ locale: NotRequired[ Literal[ "auto", "bg", "cs", "da", "de", "el", "en", "en-GB", "es", "es-419", "et", "fi", "fil", "fr", "fr-CA", "hr", "hu", "id", "it", "ja", "ko", "lt", "lv", "ms", "mt", "nb", "nl", "pl", "pt", "pt-BR", "ro", "ru", "sk", "sl", "sv", "th", "tr", "vi", "zh", "zh-HK", "zh-TW", ] ] """ The IETF language tag of the locale Checkout is displayed in. If blank or `auto`, the browser's locale is used. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ mode: NotRequired[Literal["payment", "setup", "subscription"]] """ The mode of the Checkout Session. Pass `subscription` if the Checkout Session includes at least one recurring item. """ payment_intent_data: NotRequired[ "Session.CreateParamsPaymentIntentData" ] """ A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode. """ payment_method_collection: NotRequired[ Literal["always", "if_required"] ] """ Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0. This may occur if the Checkout Session includes a free trial or a discount. Can only be set in `subscription` mode. Defaults to `always`. If you'd like information on how to collect a payment method outside of Checkout, read the guide on configuring [subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials). """ payment_method_configuration: NotRequired[str] """ The ID of the payment method configuration to use with this Checkout session. """ payment_method_data: NotRequired[ "Session.CreateParamsPaymentMethodData" ] """ This parameter allows you to set some attributes on the payment method created during a Checkout session. """ payment_method_options: NotRequired[ "Session.CreateParamsPaymentMethodOptions" ] """ Payment-method-specific configuration. """ payment_method_types: NotRequired[ List[ Literal[ "acss_debit", "affirm", "afterpay_clearpay", "alipay", "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", "blik", "boleto", "card", "cashapp", "customer_balance", "eps", "fpx", "giropay", "grabpay", "ideal", "klarna", "konbini", "link", "mobilepay", "multibanco", "oxxo", "p24", "paynow", "paypal", "pix", "promptpay", "revolut_pay", "sepa_debit", "sofort", "swish", "twint", "us_bank_account", "wechat_pay", "zip", ] ] ] """ A list of the types of payment methods (e.g., `card`) this Checkout Session can accept. You can omit this attribute to manage your payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). See [Dynamic Payment Methods](https://stripe.com/docs/payments/payment-methods/integration-options#using-dynamic-payment-methods) for more details. Read more about the supported payment methods and their requirements in our [payment method details guide](https://stripe.com/docs/payments/checkout/payment-methods). If multiple payment methods are passed, Checkout will dynamically reorder them to prioritize the most relevant payment methods based on the customer's location and other characteristics. """ phone_number_collection: NotRequired[ "Session.CreateParamsPhoneNumberCollection" ] """ Controls phone number collection settings for the session. We recommend that you review your privacy policy and check with your legal contacts before using this feature. Learn more about [collecting phone numbers with Checkout](https://stripe.com/docs/payments/checkout/phone-numbers). """ redirect_on_completion: NotRequired[ Literal["always", "if_required", "never"] ] """ This parameter applies to `ui_mode: embedded`. Learn more about the [redirect behavior](https://stripe.com/docs/payments/checkout/custom-redirect-behavior) of embedded sessions. Defaults to `always`. """ return_url: NotRequired[str] """ The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. This parameter is required if ui_mode is `embedded` and redirect-based payment methods are enabled on the session. """ saved_payment_method_options: NotRequired[ "Session.CreateParamsSavedPaymentMethodOptions" ] """ Controls saved payment method settings for the session. Only available in `payment` and `subscription` mode. """ setup_intent_data: NotRequired["Session.CreateParamsSetupIntentData"] """ A subset of parameters to be passed to SetupIntent creation for Checkout Sessions in `setup` mode. """ shipping_address_collection: NotRequired[ "Session.CreateParamsShippingAddressCollection" ] """ When set, provides configuration for Checkout to collect a shipping address from a customer. """ shipping_options: NotRequired[ List["Session.CreateParamsShippingOption"] ] """ The shipping rate options to apply to this Session. Up to a maximum of 5. """ submit_type: NotRequired[Literal["auto", "book", "donate", "pay"]] """ Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button. `submit_type` can only be specified on Checkout Sessions in `payment` mode. If blank or `auto`, `pay` is used. """ subscription_data: NotRequired["Session.CreateParamsSubscriptionData"] """ A subset of parameters to be passed to subscription creation for Checkout Sessions in `subscription` mode. """ success_url: NotRequired[str] """ The URL to which Stripe should send customers when payment or setup is complete. This parameter is not allowed if ui_mode is `embedded`. If you'd like to use information from the successful Checkout Session on your page, read the guide on [customizing your success page](https://stripe.com/docs/payments/checkout/custom-success-page). """ tax_id_collection: NotRequired["Session.CreateParamsTaxIdCollection"] """ Controls tax ID collection during checkout. """ ui_mode: NotRequired[Literal["embedded", "hosted"]] """ The UI mode of the Session. Defaults to `hosted`. """ class CreateParamsAfterExpiration(TypedDict): recovery: NotRequired["Session.CreateParamsAfterExpirationRecovery"] """ Configure a Checkout Session that can be used to recover an expired session. """ class CreateParamsAfterExpirationRecovery(TypedDict): allow_promotion_codes: NotRequired[bool] """ Enables user redeemable promotion codes on the recovered Checkout Sessions. Defaults to `false` """ enabled: bool """ If `true`, a recovery URL will be generated to recover this Checkout Session if it expires before a successful transaction is completed. It will be attached to the Checkout Session object upon expiration. """ class CreateParamsAutomaticTax(TypedDict): enabled: bool """ Set to true to enable automatic taxes. """ liability: NotRequired["Session.CreateParamsAutomaticTaxLiability"] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ class CreateParamsAutomaticTaxLiability(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class CreateParamsConsentCollection(TypedDict): payment_method_reuse_agreement: NotRequired[ "Session.CreateParamsConsentCollectionPaymentMethodReuseAgreement" ] """ Determines the display of payment method reuse agreement text in the UI. If set to `hidden`, it will hide legal text related to the reuse of a payment method. """ promotions: NotRequired[Literal["auto", "none"]] """ If set to `auto`, enables the collection of customer consent for promotional communications. The Checkout Session will determine whether to display an option to opt into promotional communication from the merchant depending on the customer's locale. Only available to US merchants. """ terms_of_service: NotRequired[Literal["none", "required"]] """ If set to `required`, it requires customers to check a terms of service checkbox before being able to pay. There must be a valid terms of service URL set in your [Dashboard settings](https://dashboard.stripe.com/settings/public). """ class CreateParamsConsentCollectionPaymentMethodReuseAgreement(TypedDict): position: Literal["auto", "hidden"] """ Determines the position and visibility of the payment method reuse agreement in the UI. When set to `auto`, Stripe's defaults will be used. When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI. """ class CreateParamsCustomField(TypedDict): dropdown: NotRequired["Session.CreateParamsCustomFieldDropdown"] """ Configuration for `type=dropdown` fields. """ key: str """ String of your choice that your integration can use to reconcile this field. Must be unique to this field, alphanumeric, and up to 200 characters. """ label: "Session.CreateParamsCustomFieldLabel" """ The label for the field, displayed to the customer. """ numeric: NotRequired["Session.CreateParamsCustomFieldNumeric"] """ Configuration for `type=numeric` fields. """ optional: NotRequired[bool] """ Whether the customer is required to complete the field before completing the Checkout Session. Defaults to `false`. """ text: NotRequired["Session.CreateParamsCustomFieldText"] """ Configuration for `type=text` fields. """ type: Literal["dropdown", "numeric", "text"] """ The type of the field. """ class CreateParamsCustomFieldDropdown(TypedDict): default_value: NotRequired[str] """ The value that will pre-fill the field on the payment page.Must match a `value` in the `options` array. """ options: List["Session.CreateParamsCustomFieldDropdownOption"] """ The options available for the customer to select. Up to 200 options allowed. """ class CreateParamsCustomFieldDropdownOption(TypedDict): label: str """ The label for the option, displayed to the customer. Up to 100 characters. """ value: str """ The value for this option, not displayed to the customer, used by your integration to reconcile the option selected by the customer. Must be unique to this option, alphanumeric, and up to 100 characters. """ class CreateParamsCustomFieldLabel(TypedDict): custom: str """ Custom text for the label, displayed to the customer. Up to 50 characters. """ type: Literal["custom"] """ The type of the label. """ class CreateParamsCustomFieldNumeric(TypedDict): default_value: NotRequired[str] """ The value that will pre-fill the field on the payment page. """ maximum_length: NotRequired[int] """ The maximum character length constraint for the customer's input. """ minimum_length: NotRequired[int] """ The minimum character length requirement for the customer's input. """ class CreateParamsCustomFieldText(TypedDict): default_value: NotRequired[str] """ The value that will pre-fill the field on the payment page. """ maximum_length: NotRequired[int] """ The maximum character length constraint for the customer's input. """ minimum_length: NotRequired[int] """ The minimum character length requirement for the customer's input. """ class CreateParamsCustomText(TypedDict): after_submit: NotRequired[ "Literal['']|Session.CreateParamsCustomTextAfterSubmit" ] """ Custom text that should be displayed after the payment confirmation button. """ shipping_address: NotRequired[ "Literal['']|Session.CreateParamsCustomTextShippingAddress" ] """ Custom text that should be displayed alongside shipping address collection. """ submit: NotRequired["Literal['']|Session.CreateParamsCustomTextSubmit"] """ Custom text that should be displayed alongside the payment confirmation button. """ terms_of_service_acceptance: NotRequired[ "Literal['']|Session.CreateParamsCustomTextTermsOfServiceAcceptance" ] """ Custom text that should be displayed in place of the default terms of service agreement text. """ class CreateParamsCustomTextAfterSubmit(TypedDict): message: str """ Text may be up to 1200 characters in length. """ class CreateParamsCustomTextShippingAddress(TypedDict): message: str """ Text may be up to 1200 characters in length. """ class CreateParamsCustomTextSubmit(TypedDict): message: str """ Text may be up to 1200 characters in length. """ class CreateParamsCustomTextTermsOfServiceAcceptance(TypedDict): message: str """ Text may be up to 1200 characters in length. """ class CreateParamsCustomerUpdate(TypedDict): address: NotRequired[Literal["auto", "never"]] """ Describes whether Checkout saves the billing address onto `customer.address`. To always collect a full billing address, use `billing_address_collection`. Defaults to `never`. """ name: NotRequired[Literal["auto", "never"]] """ Describes whether Checkout saves the name onto `customer.name`. Defaults to `never`. """ shipping: NotRequired[Literal["auto", "never"]] """ Describes whether Checkout saves shipping information onto `customer.shipping`. To collect shipping information, use `shipping_address_collection`. Defaults to `never`. """ class CreateParamsDiscount(TypedDict): coupon: NotRequired[str] """ The ID of the coupon to apply to this Session. """ promotion_code: NotRequired[str] """ The ID of a promotion code to apply to this Session. """ class CreateParamsInvoiceCreation(TypedDict): enabled: bool """ Set to `true` to enable invoice creation. """ invoice_data: NotRequired[ "Session.CreateParamsInvoiceCreationInvoiceData" ] """ Parameters passed when creating invoices for payment-mode Checkout Sessions. """ class CreateParamsInvoiceCreationInvoiceData(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ The account tax IDs associated with the invoice. """ custom_fields: NotRequired[ "Literal['']|List[Session.CreateParamsInvoiceCreationInvoiceDataCustomField]" ] """ Default custom fields to be displayed on invoices for this customer. """ description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ footer: NotRequired[str] """ Default footer to be displayed on invoices for this customer. """ issuer: NotRequired[ "Session.CreateParamsInvoiceCreationInvoiceDataIssuer" ] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ rendering_options: NotRequired[ "Literal['']|Session.CreateParamsInvoiceCreationInvoiceDataRenderingOptions" ] """ Default options for invoice PDF rendering for this customer. """ class CreateParamsInvoiceCreationInvoiceDataCustomField(TypedDict): name: str """ The name of the custom field. This may be up to 40 characters. """ value: str """ The value of the custom field. This may be up to 140 characters. """ class CreateParamsInvoiceCreationInvoiceDataIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class CreateParamsInvoiceCreationInvoiceDataRenderingOptions(TypedDict): amount_tax_display: NotRequired[ "Literal['']|Literal['exclude_tax', 'include_inclusive_tax']" ] """ How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. """ class CreateParamsLineItem(TypedDict): adjustable_quantity: NotRequired[ "Session.CreateParamsLineItemAdjustableQuantity" ] """ When set, provides configuration for this item's quantity to be adjusted by the customer during Checkout. """ dynamic_tax_rates: NotRequired[List[str]] """ The [tax rates](https://stripe.com/docs/api/tax_rates) that will be applied to this line item depending on the customer's billing/shipping address. We currently support the following countries: US, GB, AU, and all countries in the EU. """ price: NotRequired[str] """ The ID of the [Price](https://stripe.com/docs/api/prices) or [Plan](https://stripe.com/docs/api/plans) object. One of `price` or `price_data` is required. """ price_data: NotRequired["Session.CreateParamsLineItemPriceData"] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ The quantity of the line item being purchased. Quantity should not be defined when `recurring.usage_type=metered`. """ tax_rates: NotRequired[List[str]] """ The [tax rates](https://stripe.com/docs/api/tax_rates) which apply to this line item. """ class CreateParamsLineItemAdjustableQuantity(TypedDict): enabled: bool """ Set to true if the quantity can be adjusted to any non-negative integer. By default customers will be able to remove the line item by setting the quantity to 0. """ maximum: NotRequired[int] """ The maximum quantity the customer can purchase for the Checkout Session. By default this value is 99. You can specify a value up to 999999. """ minimum: NotRequired[int] """ The minimum quantity the customer must purchase for the Checkout Session. By default this value is 0. """ class CreateParamsLineItemPriceData(TypedDict): 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). """ product: NotRequired[str] """ The ID of the product that this price will belong to. One of `product` or `product_data` is required. """ product_data: NotRequired[ "Session.CreateParamsLineItemPriceDataProductData" ] """ Data used to generate a new product object inline. One of `product` or `product_data` is required. """ recurring: NotRequired[ "Session.CreateParamsLineItemPriceDataRecurring" ] """ The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class CreateParamsLineItemPriceDataProductData(TypedDict): description: NotRequired[str] """ The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. """ images: NotRequired[List[str]] """ A list of up to 8 URLs of images for this product, meant to be displayable to the customer. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ name: str """ The product's name, meant to be displayable to the customer. """ tax_code: NotRequired[str] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ class CreateParamsLineItemPriceDataRecurring(TypedDict): interval: Literal["day", "month", "week", "year"] """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class CreateParamsPaymentIntentData(TypedDict): application_fee_amount: NotRequired[int] """ The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ capture_method: NotRequired[ Literal["automatic", "automatic_async", "manual"] ] """ Controls when the funds will be captured from the customer's account. """ description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ on_behalf_of: NotRequired[str] """ The Stripe account ID for which these funds are intended. For details, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ receipt_email: NotRequired[str] """ Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). """ setup_future_usage: NotRequired[Literal["off_session", "on_session"]] """ Indicates that you intend to [make future payments](https://stripe.com/docs/payments/payment-intents#future-usage) with the payment method collected by this Checkout Session. When setting this to `on_session`, Checkout will show a notice to the customer that their payment details will be saved. When setting this to `off_session`, Checkout will show a notice to the customer that their payment details will be saved and used for future payments. If a Customer has been provided or Checkout creates a new Customer, Checkout will attach the payment method to the Customer. If Checkout does not create a Customer, the payment method is not attached to a Customer. To reuse the payment method, you can retrieve it from the Checkout Session's PaymentIntent. When processing card payments, Checkout also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as SCA. """ shipping: NotRequired["Session.CreateParamsPaymentIntentDataShipping"] """ Shipping information for this payment. """ statement_descriptor: NotRequired[str] """ Extra information about the payment. This will appear on your customer's statement when this payment succeeds in creating a charge. """ statement_descriptor_suffix: NotRequired[str] """ Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. """ transfer_data: NotRequired[ "Session.CreateParamsPaymentIntentDataTransferData" ] """ The parameters used to automatically create a Transfer when the payment succeeds. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ transfer_group: NotRequired[str] """ A string that identifies the resulting payment as part of a group. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. """ class CreateParamsPaymentIntentDataShipping(TypedDict): address: "Session.CreateParamsPaymentIntentDataShippingAddress" """ Shipping address. """ carrier: NotRequired[str] """ The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. """ name: str """ Recipient name. """ phone: NotRequired[str] """ Recipient phone (including extension). """ tracking_number: NotRequired[str] """ The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ class CreateParamsPaymentIntentDataShippingAddress(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: str """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsPaymentIntentDataTransferData(TypedDict): amount: NotRequired[int] """ The amount that will be transferred automatically when a charge succeeds. """ destination: str """ If specified, successful charges will be attributed to the destination account for tax reporting, and the funds from charges will be transferred to the destination account. The ID of the resulting transfer will be returned on the successful charge's `transfer` field. """ class CreateParamsPaymentMethodData(TypedDict): allow_redisplay: NotRequired[ Literal["always", "limited", "unspecified"] ] """ Allow redisplay will be set on the payment method on confirmation and indicates whether this payment method can be shown again to the customer in a checkout flow. Only set this field if you wish to override the allow_redisplay value determined by Checkout. """ class CreateParamsPaymentMethodOptions(TypedDict): acss_debit: NotRequired[ "Session.CreateParamsPaymentMethodOptionsAcssDebit" ] """ contains details about the ACSS Debit payment method options. """ affirm: NotRequired["Session.CreateParamsPaymentMethodOptionsAffirm"] """ contains details about the Affirm payment method options. """ afterpay_clearpay: NotRequired[ "Session.CreateParamsPaymentMethodOptionsAfterpayClearpay" ] """ contains details about the Afterpay Clearpay payment method options. """ alipay: NotRequired["Session.CreateParamsPaymentMethodOptionsAlipay"] """ contains details about the Alipay payment method options. """ amazon_pay: NotRequired[ "Session.CreateParamsPaymentMethodOptionsAmazonPay" ] """ contains details about the AmazonPay payment method options. """ au_becs_debit: NotRequired[ "Session.CreateParamsPaymentMethodOptionsAuBecsDebit" ] """ contains details about the AU Becs Debit payment method options. """ bacs_debit: NotRequired[ "Session.CreateParamsPaymentMethodOptionsBacsDebit" ] """ contains details about the Bacs Debit payment method options. """ bancontact: NotRequired[ "Session.CreateParamsPaymentMethodOptionsBancontact" ] """ contains details about the Bancontact payment method options. """ boleto: NotRequired["Session.CreateParamsPaymentMethodOptionsBoleto"] """ contains details about the Boleto payment method options. """ card: NotRequired["Session.CreateParamsPaymentMethodOptionsCard"] """ contains details about the Card payment method options. """ cashapp: NotRequired["Session.CreateParamsPaymentMethodOptionsCashapp"] """ contains details about the Cashapp Pay payment method options. """ customer_balance: NotRequired[ "Session.CreateParamsPaymentMethodOptionsCustomerBalance" ] """ contains details about the Customer Balance payment method options. """ eps: NotRequired["Session.CreateParamsPaymentMethodOptionsEps"] """ contains details about the EPS payment method options. """ fpx: NotRequired["Session.CreateParamsPaymentMethodOptionsFpx"] """ contains details about the FPX payment method options. """ giropay: NotRequired["Session.CreateParamsPaymentMethodOptionsGiropay"] """ contains details about the Giropay payment method options. """ grabpay: NotRequired["Session.CreateParamsPaymentMethodOptionsGrabpay"] """ contains details about the Grabpay payment method options. """ ideal: NotRequired["Session.CreateParamsPaymentMethodOptionsIdeal"] """ contains details about the Ideal payment method options. """ klarna: NotRequired["Session.CreateParamsPaymentMethodOptionsKlarna"] """ contains details about the Klarna payment method options. """ konbini: NotRequired["Session.CreateParamsPaymentMethodOptionsKonbini"] """ contains details about the Konbini payment method options. """ link: NotRequired["Session.CreateParamsPaymentMethodOptionsLink"] """ contains details about the Link payment method options. """ mobilepay: NotRequired[ "Session.CreateParamsPaymentMethodOptionsMobilepay" ] """ contains details about the Mobilepay payment method options. """ multibanco: NotRequired[ "Session.CreateParamsPaymentMethodOptionsMultibanco" ] """ contains details about the Multibanco payment method options. """ oxxo: NotRequired["Session.CreateParamsPaymentMethodOptionsOxxo"] """ contains details about the OXXO payment method options. """ p24: NotRequired["Session.CreateParamsPaymentMethodOptionsP24"] """ contains details about the P24 payment method options. """ paynow: NotRequired["Session.CreateParamsPaymentMethodOptionsPaynow"] """ contains details about the PayNow payment method options. """ paypal: NotRequired["Session.CreateParamsPaymentMethodOptionsPaypal"] """ contains details about the PayPal payment method options. """ pix: NotRequired["Session.CreateParamsPaymentMethodOptionsPix"] """ contains details about the Pix payment method options. """ revolut_pay: NotRequired[ "Session.CreateParamsPaymentMethodOptionsRevolutPay" ] """ contains details about the RevolutPay payment method options. """ sepa_debit: NotRequired[ "Session.CreateParamsPaymentMethodOptionsSepaDebit" ] """ contains details about the Sepa Debit payment method options. """ sofort: NotRequired["Session.CreateParamsPaymentMethodOptionsSofort"] """ contains details about the Sofort payment method options. """ swish: NotRequired["Session.CreateParamsPaymentMethodOptionsSwish"] """ contains details about the Swish payment method options. """ us_bank_account: NotRequired[ "Session.CreateParamsPaymentMethodOptionsUsBankAccount" ] """ contains details about the Us Bank Account payment method options. """ wechat_pay: NotRequired[ "Session.CreateParamsPaymentMethodOptionsWechatPay" ] """ contains details about the WeChat Pay payment method options. """ class CreateParamsPaymentMethodOptionsAcssDebit(TypedDict): currency: NotRequired[Literal["cad", "usd"]] """ Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). This is only accepted for Checkout Sessions in `setup` mode. """ mandate_options: NotRequired[ "Session.CreateParamsPaymentMethodOptionsAcssDebitMandateOptions" ] """ Additional fields for Mandate creation """ setup_future_usage: NotRequired[ Literal["none", "off_session", "on_session"] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] """ Verification method for the intent """ class CreateParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): custom_mandate_url: NotRequired["Literal['']|str"] """ A URL for custom mandate text to render during confirmation step. The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. """ default_for: NotRequired[List[Literal["invoice", "subscription"]]] """ List of Stripe products where this mandate can be selected automatically. Only usable in `setup` mode. """ interval_description: NotRequired[str] """ Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. """ payment_schedule: NotRequired[ Literal["combined", "interval", "sporadic"] ] """ Payment schedule for the mandate. """ transaction_type: NotRequired[Literal["business", "personal"]] """ Transaction type of the mandate. """ class CreateParamsPaymentMethodOptionsAffirm(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsAlipay(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsAmazonPay(TypedDict): setup_future_usage: NotRequired[Literal["none", "off_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): setup_future_usage: NotRequired[ Literal["none", "off_session", "on_session"] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsBancontact(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsBoleto(TypedDict): expires_after_days: NotRequired[int] """ The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. """ setup_future_usage: NotRequired[ Literal["none", "off_session", "on_session"] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsCard(TypedDict): installments: NotRequired[ "Session.CreateParamsPaymentMethodOptionsCardInstallments" ] """ Installment options for card payments """ request_three_d_secure: NotRequired[ Literal["any", "automatic", "challenge"] ] """ 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://stripe.com/docs/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://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ setup_future_usage: NotRequired[Literal["off_session", "on_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ statement_descriptor_suffix_kana: NotRequired[str] """ Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. """ statement_descriptor_suffix_kanji: NotRequired[str] """ 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. """ class CreateParamsPaymentMethodOptionsCardInstallments(TypedDict): enabled: NotRequired[bool] """ Setting to true enables installments for this Checkout Session. Setting to false will prevent any installment plan from applying to a payment. """ class CreateParamsPaymentMethodOptionsCashapp(TypedDict): setup_future_usage: NotRequired[ Literal["none", "off_session", "on_session"] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsCustomerBalance(TypedDict): bank_transfer: NotRequired[ "Session.CreateParamsPaymentMethodOptionsCustomerBalanceBankTransfer" ] """ Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. """ funding_type: NotRequired[Literal["bank_transfer"]] """ The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsCustomerBalanceBankTransfer( TypedDict, ): eu_bank_transfer: NotRequired[ "Session.CreateParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer" ] """ Configuration for eu_bank_transfer funding type. """ requested_address_types: NotRequired[ List[ Literal[ "aba", "iban", "sepa", "sort_code", "spei", "swift", "zengin", ] ] ] """ List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. """ type: Literal[ "eu_bank_transfer", "gb_bank_transfer", "jp_bank_transfer", "mx_bank_transfer", "us_bank_transfer", ] """ The list of bank transfer types that this PaymentIntent is allowed to use for funding. """ class CreateParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer( TypedDict, ): country: str """ The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. """ class CreateParamsPaymentMethodOptionsEps(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsFpx(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsGiropay(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsGrabpay(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsIdeal(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsKlarna(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsKonbini(TypedDict): expires_after_days: NotRequired[int] """ The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. Defaults to 3 days. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsLink(TypedDict): setup_future_usage: NotRequired[Literal["none", "off_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsMobilepay(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsMultibanco(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsOxxo(TypedDict): expires_after_days: NotRequired[int] """ The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsP24(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ tos_shown_and_accepted: NotRequired[bool] """ Confirm that the payer has accepted the P24 terms and conditions. """ class CreateParamsPaymentMethodOptionsPaynow(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsPaypal(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds will be captured from the customer's account. """ preferred_locale: NotRequired[ Literal[ "cs-CZ", "da-DK", "de-AT", "de-DE", "de-LU", "el-GR", "en-GB", "en-US", "es-ES", "fi-FI", "fr-BE", "fr-FR", "fr-LU", "hu-HU", "it-IT", "nl-BE", "nl-NL", "pl-PL", "pt-PT", "sk-SK", "sv-SE", ] ] """ [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. """ reference: NotRequired[str] """ A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. """ risk_correlation_id: NotRequired[str] """ The risk correlation ID for an on-session payment using a saved PayPal payment method. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsPix(TypedDict): expires_after_seconds: NotRequired[int] """ The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. """ class CreateParamsPaymentMethodOptionsRevolutPay(TypedDict): setup_future_usage: NotRequired[Literal["none", "off_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): setup_future_usage: NotRequired[ Literal["none", "off_session", "on_session"] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsSofort(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsSwish(TypedDict): reference: NotRequired[str] """ The order reference that will be displayed to customers in the Swish application. Defaults to the `id` of the Payment Intent. """ class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): financial_connections: NotRequired[ "Session.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections" ] """ Additional fields for Financial Connections Session creation """ setup_future_usage: NotRequired[ Literal["none", "off_session", "on_session"] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ verification_method: NotRequired[Literal["automatic", "instant"]] """ Verification method for the intent """ class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): permissions: NotRequired[ List[ Literal[ "balances", "ownership", "payment_method", "transactions" ] ] ] """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ List[Literal["balances", "ownership", "transactions"]] ] """ List of data features that you would like to retrieve upon account creation. """ class CreateParamsPaymentMethodOptionsWechatPay(TypedDict): app_id: NotRequired[str] """ The app ID registered with WeChat Pay. Only required when client is ios or android. """ client: Literal["android", "ios", "web"] """ The client type that the end customer will pay from """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPhoneNumberCollection(TypedDict): enabled: bool """ Set to `true` to enable phone number collection. """ class CreateParamsSavedPaymentMethodOptions(TypedDict): allow_redisplay_filters: NotRequired[ List[Literal["always", "limited", "unspecified"]] ] """ Uses the `allow_redisplay` value of each saved payment method to filter the set presented to a returning customer. By default, only saved payment methods with 'allow_redisplay: ‘always' are shown in Checkout. """ payment_method_save: NotRequired[Literal["disabled", "enabled"]] """ Enable customers to choose if they wish to save their payment method for future use. Disabled by default. """ class CreateParamsSetupIntentData(TypedDict): description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ on_behalf_of: NotRequired[str] """ The Stripe account for which the setup is intended. """ class CreateParamsShippingAddressCollection(TypedDict): allowed_countries: List[ Literal[ "AC", "AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CV", "CW", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MK", "ML", "MM", "MN", "MO", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SZ", "TA", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VN", "VU", "WF", "WS", "XK", "YE", "YT", "ZA", "ZM", "ZW", "ZZ", ] ] """ An array of two-letter ISO country codes representing which countries Checkout should provide as options for shipping locations. Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. """ class CreateParamsShippingOption(TypedDict): shipping_rate: NotRequired[str] """ The ID of the Shipping Rate to use for this shipping option. """ shipping_rate_data: NotRequired[ "Session.CreateParamsShippingOptionShippingRateData" ] """ Parameters to be passed to Shipping Rate creation for this shipping option. """ class CreateParamsShippingOptionShippingRateData(TypedDict): delivery_estimate: NotRequired[ "Session.CreateParamsShippingOptionShippingRateDataDeliveryEstimate" ] """ The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions. """ display_name: str """ The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions. """ fixed_amount: NotRequired[ "Session.CreateParamsShippingOptionShippingRateDataFixedAmount" ] """ Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. """ tax_code: NotRequired[str] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`. """ type: NotRequired[Literal["fixed_amount"]] """ The type of calculation to use on the shipping rate. """ class CreateParamsShippingOptionShippingRateDataDeliveryEstimate( TypedDict ): maximum: NotRequired[ "Session.CreateParamsShippingOptionShippingRateDataDeliveryEstimateMaximum" ] """ The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. """ minimum: NotRequired[ "Session.CreateParamsShippingOptionShippingRateDataDeliveryEstimateMinimum" ] """ The lower bound of the estimated range. If empty, represents no lower bound. """ class CreateParamsShippingOptionShippingRateDataDeliveryEstimateMaximum( TypedDict, ): unit: Literal["business_day", "day", "hour", "month", "week"] """ A unit of time. """ value: int """ Must be greater than 0. """ class CreateParamsShippingOptionShippingRateDataDeliveryEstimateMinimum( TypedDict, ): unit: Literal["business_day", "day", "hour", "month", "week"] """ A unit of time. """ value: int """ Must be greater than 0. """ class CreateParamsShippingOptionShippingRateDataFixedAmount(TypedDict): amount: int """ A non-negative integer in cents representing how much to charge. """ 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). """ currency_options: NotRequired[ Dict[ str, "Session.CreateParamsShippingOptionShippingRateDataFixedAmountCurrencyOptions", ] ] """ Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ class CreateParamsShippingOptionShippingRateDataFixedAmountCurrencyOptions( TypedDict, ): amount: int """ A non-negative integer in cents representing how much to charge. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. """ class CreateParamsSubscriptionData(TypedDict): application_fee_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. To use an application fee percent, the request must be made on behalf of another account, using the `Stripe-Account` header or an OAuth key. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). """ billing_cycle_anchor: NotRequired[int] """ A future timestamp to anchor the subscription's billing cycle for new subscriptions. """ default_tax_rates: NotRequired[List[str]] """ The tax rates that will apply to any subscription item that does not have `tax_rates` set. Invoices created will have their `default_tax_rates` populated from the subscription. """ description: NotRequired[str] """ The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in the [customer portal](https://stripe.com/docs/customer-management). """ invoice_settings: NotRequired[ "Session.CreateParamsSubscriptionDataInvoiceSettings" ] """ All invoices will be billed using the specified settings. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ on_behalf_of: NotRequired[str] """ The account on behalf of which to charge, for each of the subscription's invoices. """ proration_behavior: NotRequired[Literal["create_prorations", "none"]] """ Determines how to handle prorations resulting from the `billing_cycle_anchor`. If no value is passed, the default is `create_prorations`. """ transfer_data: NotRequired[ "Session.CreateParamsSubscriptionDataTransferData" ] """ If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges. """ trial_end: NotRequired[int] """ Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. Has to be at least 48 hours in the future. """ trial_period_days: NotRequired[int] """ Integer representing the number of trial period days before the customer is charged for the first time. Has to be at least 1. """ trial_settings: NotRequired[ "Session.CreateParamsSubscriptionDataTrialSettings" ] """ Settings related to subscription trials. """ class CreateParamsSubscriptionDataInvoiceSettings(TypedDict): issuer: NotRequired[ "Session.CreateParamsSubscriptionDataInvoiceSettingsIssuer" ] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ class CreateParamsSubscriptionDataInvoiceSettingsIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class CreateParamsSubscriptionDataTransferData(TypedDict): amount_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. """ destination: str """ ID of an existing, connected Stripe account. """ class CreateParamsSubscriptionDataTrialSettings(TypedDict): end_behavior: ( "Session.CreateParamsSubscriptionDataTrialSettingsEndBehavior" ) """ Defines how the subscription should behave when the user's free trial ends. """ class CreateParamsSubscriptionDataTrialSettingsEndBehavior(TypedDict): missing_payment_method: Literal["cancel", "create_invoice", "pause"] """ Indicates how the subscription should change when the trial ends if the user did not provide a payment method. """ class CreateParamsTaxIdCollection(TypedDict): enabled: bool """ Enable tax ID collection during checkout. Defaults to `false`. """ class ExpireParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ListLineItemsParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParams(RequestOptions): created: NotRequired["Session.ListParamsCreated|int"] """ Only return Checkout Sessions that were created during the given date interval. """ customer: NotRequired[str] """ Only return the Checkout Sessions for the Customer specified. """ customer_details: NotRequired["Session.ListParamsCustomerDetails"] """ Only return the Checkout Sessions for the Customer details specified. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ payment_intent: NotRequired[str] """ Only return the Checkout Session for the PaymentIntent specified. """ payment_link: NotRequired[str] """ Only return the Checkout Sessions for the Payment Link specified. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[Literal["complete", "expired", "open"]] """ Only return the Checkout Sessions matching the given status. """ subscription: NotRequired[str] """ Only return the Checkout Session for the subscription specified. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsCustomerDetails(TypedDict): email: str """ Customer's email address. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ after_expiration: Optional[AfterExpiration] """ When set, provides configuration for actions to take if this Checkout Session expires. """ allow_promotion_codes: Optional[bool] """ Enables user redeemable promotion codes. """ amount_subtotal: Optional[int] """ Total of all items before discounts or taxes are applied. """ amount_total: Optional[int] """ Total of all items after discounts and taxes are applied. """ automatic_tax: AutomaticTax billing_address_collection: Optional[Literal["auto", "required"]] """ Describes whether Checkout should collect the customer's billing address. Defaults to `auto`. """ cancel_url: Optional[str] """ If set, Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website. """ client_reference_id: Optional[str] """ A unique string to reference the Checkout Session. This can be a customer ID, a cart ID, or similar, and can be used to reconcile the Session with your internal systems. """ client_secret: Optional[str] """ Client secret to be used when initializing Stripe.js embedded checkout. """ consent: Optional[Consent] """ Results of `consent_collection` for this session. """ consent_collection: Optional[ConsentCollection] """ When set, provides configuration for the Checkout Session to gather active consent from customers. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ currency: Optional[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). """ currency_conversion: Optional[CurrencyConversion] """ Currency conversion details for automatic currency conversion sessions """ custom_fields: List[CustomField] """ Collect additional information from your customer using custom fields. Up to 3 fields are supported. """ custom_text: CustomText customer: Optional[ExpandableField["Customer"]] """ The ID of the customer for this Session. For Checkout Sessions in `subscription` mode or Checkout Sessions with `customer_creation` set as `always` in `payment` mode, Checkout will create a new customer object based on information provided during the payment flow unless an existing customer was provided when the Session was created. """ customer_creation: Optional[Literal["always", "if_required"]] """ Configure whether a Checkout Session creates a Customer when the Checkout Session completes. """ customer_details: Optional[CustomerDetails] """ The customer details including the customer's tax exempt status and the customer's tax IDs. Customer's address details are not present on Sessions in `setup` mode. """ customer_email: Optional[str] """ If provided, this value will be used when the Customer object is created. If not provided, customers will be asked to enter their email address. Use this parameter to prefill customer data if you already have an email on file. To access information about the customer once the payment flow is complete, use the `customer` attribute. """ expires_at: int """ The timestamp at which the Checkout Session will expire. """ id: str """ Unique identifier for the object. """ invoice: Optional[ExpandableField["Invoice"]] """ ID of the invoice created by the Checkout Session, if it exists. """ invoice_creation: Optional[InvoiceCreation] """ Details on the state of invoice creation for the Checkout Session. """ line_items: Optional[ListObject["LineItem"]] """ The line items purchased by the customer. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ locale: Optional[ Literal[ "auto", "bg", "cs", "da", "de", "el", "en", "en-GB", "es", "es-419", "et", "fi", "fil", "fr", "fr-CA", "hr", "hu", "id", "it", "ja", "ko", "lt", "lv", "ms", "mt", "nb", "nl", "pl", "pt", "pt-BR", "ro", "ru", "sk", "sl", "sv", "th", "tr", "vi", "zh", "zh-HK", "zh-TW", ] ] """ The IETF language tag of the locale Checkout is displayed in. If blank or `auto`, the browser's locale is used. """ metadata: Optional[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ mode: Literal["payment", "setup", "subscription"] """ The mode of the Checkout Session. """ object: Literal["checkout.session"] """ String representing the object's type. Objects of the same type share the same value. """ payment_intent: Optional[ExpandableField["PaymentIntent"]] """ The ID of the PaymentIntent for Checkout Sessions in `payment` mode. You can't confirm or cancel the PaymentIntent for a Checkout Session. To cancel, [expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. """ payment_link: Optional[ExpandableField["PaymentLink"]] """ The ID of the Payment Link that created this Session. """ payment_method_collection: Optional[Literal["always", "if_required"]] """ Configure whether a Checkout Session should collect a payment method. Defaults to `always`. """ payment_method_configuration_details: Optional[ PaymentMethodConfigurationDetails ] """ Information about the payment method configuration used for this Checkout session if using dynamic payment methods. """ payment_method_options: Optional[PaymentMethodOptions] """ Payment-method-specific configuration for the PaymentIntent or SetupIntent of this CheckoutSession. """ payment_method_types: List[str] """ A list of the types of payment methods (e.g. card) this Checkout Session is allowed to accept. """ payment_status: Literal["no_payment_required", "paid", "unpaid"] """ The payment status of the Checkout Session, one of `paid`, `unpaid`, or `no_payment_required`. You can use this value to decide when to fulfill your customer's order. """ phone_number_collection: Optional[PhoneNumberCollection] recovered_from: Optional[str] """ The ID of the original expired Checkout Session that triggered the recovery flow. """ redirect_on_completion: Optional[Literal["always", "if_required", "never"]] """ This parameter applies to `ui_mode: embedded`. Learn more about the [redirect behavior](https://stripe.com/docs/payments/checkout/custom-redirect-behavior) of embedded sessions. Defaults to `always`. """ return_url: Optional[str] """ Applies to Checkout Sessions with `ui_mode: embedded`. The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. """ saved_payment_method_options: Optional[SavedPaymentMethodOptions] """ Controls saved payment method settings for the session. Only available in `payment` and `subscription` mode. """ setup_intent: Optional[ExpandableField["SetupIntent"]] """ The ID of the SetupIntent for Checkout Sessions in `setup` mode. You can't confirm or cancel the SetupIntent for a Checkout Session. To cancel, [expire the Checkout Session](https://stripe.com/docs/api/checkout/sessions/expire) instead. """ shipping_address_collection: Optional[ShippingAddressCollection] """ When set, provides configuration for Checkout to collect a shipping address from a customer. """ shipping_cost: Optional[ShippingCost] """ The details of the customer cost of shipping, including the customer chosen ShippingRate. """ shipping_details: Optional[ShippingDetails] """ Shipping information for this Checkout Session. """ shipping_options: List[ShippingOption] """ The shipping rate options applied to this Session. """ status: Optional[Literal["complete", "expired", "open"]] """ The status of the Checkout Session, one of `open`, `complete`, or `expired`. """ submit_type: Optional[Literal["auto", "book", "donate", "pay"]] """ Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button. `submit_type` can only be specified on Checkout Sessions in `payment` mode. If blank or `auto`, `pay` is used. """ subscription: Optional[ExpandableField["Subscription"]] """ The ID of the subscription for Checkout Sessions in `subscription` mode. """ success_url: Optional[str] """ The URL the customer will be directed to after the payment or subscription creation is successful. """ tax_id_collection: Optional[TaxIdCollection] total_details: Optional[TotalDetails] """ Tax and discount details for the computed total amount. """ ui_mode: Optional[Literal["embedded", "hosted"]] """ The UI mode of the Session. Defaults to `hosted`. """ url: Optional[str] """ The URL to the Checkout Session. Redirect customers to this URL to take them to Checkout. If you're using [Custom Domains](https://stripe.com/docs/payments/checkout/custom-domains), the URL will use your subdomain. Otherwise, it'll use `checkout.stripe.com.` This value is only present when the session is active. """ @classmethod def create(cls, **params: Unpack["Session.CreateParams"]) -> "Session": """ Creates a Session object. """ return cast( "Session", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["Session.CreateParams"] ) -> "Session": """ Creates a Session object. """ return cast( "Session", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def _cls_expire( cls, session: str, **params: Unpack["Session.ExpireParams"] ) -> "Session": """ A Session can be expired when it is in one of these statuses: open After it expires, a customer can't complete a Session and customers loading the Session see a message saying the Session is expired. """ return cast( "Session", cls._static_request( "post", "/v1/checkout/sessions/{session}/expire".format( session=sanitize_id(session) ), params=params, ), ) @overload @staticmethod def expire( session: str, **params: Unpack["Session.ExpireParams"] ) -> "Session": """ A Session can be expired when it is in one of these statuses: open After it expires, a customer can't complete a Session and customers loading the Session see a message saying the Session is expired. """ ... @overload def expire(self, **params: Unpack["Session.ExpireParams"]) -> "Session": """ A Session can be expired when it is in one of these statuses: open After it expires, a customer can't complete a Session and customers loading the Session see a message saying the Session is expired. """ ... @class_method_variant("_cls_expire") def expire( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Session.ExpireParams"] ) -> "Session": """ A Session can be expired when it is in one of these statuses: open After it expires, a customer can't complete a Session and customers loading the Session see a message saying the Session is expired. """ return cast( "Session", self._request( "post", "/v1/checkout/sessions/{session}/expire".format( session=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_expire_async( cls, session: str, **params: Unpack["Session.ExpireParams"] ) -> "Session": """ A Session can be expired when it is in one of these statuses: open After it expires, a customer can't complete a Session and customers loading the Session see a message saying the Session is expired. """ return cast( "Session", await cls._static_request_async( "post", "/v1/checkout/sessions/{session}/expire".format( session=sanitize_id(session) ), params=params, ), ) @overload @staticmethod async def expire_async( session: str, **params: Unpack["Session.ExpireParams"] ) -> "Session": """ A Session can be expired when it is in one of these statuses: open After it expires, a customer can't complete a Session and customers loading the Session see a message saying the Session is expired. """ ... @overload async def expire_async( self, **params: Unpack["Session.ExpireParams"] ) -> "Session": """ A Session can be expired when it is in one of these statuses: open After it expires, a customer can't complete a Session and customers loading the Session see a message saying the Session is expired. """ ... @class_method_variant("_cls_expire_async") async def expire_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Session.ExpireParams"] ) -> "Session": """ A Session can be expired when it is in one of these statuses: open After it expires, a customer can't complete a Session and customers loading the Session see a message saying the Session is expired. """ return cast( "Session", await self._request_async( "post", "/v1/checkout/sessions/{session}/expire".format( session=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def list( cls, **params: Unpack["Session.ListParams"] ) -> ListObject["Session"]: """ Returns a list of Checkout Sessions. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["Session.ListParams"] ) -> ListObject["Session"]: """ Returns a list of Checkout Sessions. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def _cls_list_line_items( cls, session: str, **params: Unpack["Session.ListLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ return cast( ListObject["LineItem"], cls._static_request( "get", "/v1/checkout/sessions/{session}/line_items".format( session=sanitize_id(session) ), params=params, ), ) @overload @staticmethod def list_line_items( session: str, **params: Unpack["Session.ListLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ ... @overload def list_line_items( self, **params: Unpack["Session.ListLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ ... @class_method_variant("_cls_list_line_items") def list_line_items( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Session.ListLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ return cast( ListObject["LineItem"], self._request( "get", "/v1/checkout/sessions/{session}/line_items".format( session=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_list_line_items_async( cls, session: str, **params: Unpack["Session.ListLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ return cast( ListObject["LineItem"], await cls._static_request_async( "get", "/v1/checkout/sessions/{session}/line_items".format( session=sanitize_id(session) ), params=params, ), ) @overload @staticmethod async def list_line_items_async( session: str, **params: Unpack["Session.ListLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ ... @overload async def list_line_items_async( self, **params: Unpack["Session.ListLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ ... @class_method_variant("_cls_list_line_items_async") async def list_line_items_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Session.ListLineItemsParams"] ) -> ListObject["LineItem"]: """ When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ return cast( ListObject["LineItem"], await self._request_async( "get", "/v1/checkout/sessions/{session}/line_items".format( session=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["Session.RetrieveParams"] ) -> "Session": """ Retrieves a Session object. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["Session.RetrieveParams"] ) -> "Session": """ Retrieves a Session object. """ instance = cls(id, **params) await instance.refresh_async() return instance _inner_class_types = { "after_expiration": AfterExpiration, "automatic_tax": AutomaticTax, "consent": Consent, "consent_collection": ConsentCollection, "currency_conversion": CurrencyConversion, "custom_fields": CustomField, "custom_text": CustomText, "customer_details": CustomerDetails, "invoice_creation": InvoiceCreation, "payment_method_configuration_details": PaymentMethodConfigurationDetails, "payment_method_options": PaymentMethodOptions, "phone_number_collection": PhoneNumberCollection, "saved_payment_method_options": SavedPaymentMethodOptions, "shipping_address_collection": ShippingAddressCollection, "shipping_cost": ShippingCost, "shipping_details": ShippingDetails, "shipping_options": ShippingOption, "tax_id_collection": TaxIdCollection, "total_details": TotalDetails, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/checkout/_session_line_item_service.py0000644000175100001770000000610514637354563023602 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._line_item import LineItem from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict class SessionLineItemService(StripeService): class ListParams(TypedDict): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ def list( self, session: str, params: "SessionLineItemService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[LineItem]: """ When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ return cast( ListObject[LineItem], self._request( "get", "/v1/checkout/sessions/{session}/line_items".format( session=sanitize_id(session), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, session: str, params: "SessionLineItemService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[LineItem]: """ When retrieving a Checkout Session, there is an includable line_items property containing the first handful of those items. There is also a URL where you can retrieve the full (paginated) list of line items. """ return cast( ListObject[LineItem], await self._request_async( "get", "/v1/checkout/sessions/{session}/line_items".format( session=sanitize_id(session), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/checkout/_session_service.py0000644000175100001770000033301414637354563021557 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.checkout._session import Session from stripe.checkout._session_line_item_service import SessionLineItemService from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class SessionService(StripeService): def __init__(self, requestor): super().__init__(requestor) self.line_items = SessionLineItemService(self._requestor) class CreateParams(TypedDict): after_expiration: NotRequired[ "SessionService.CreateParamsAfterExpiration" ] """ Configure actions after a Checkout Session has expired. """ allow_promotion_codes: NotRequired[bool] """ Enables user redeemable promotion codes. """ automatic_tax: NotRequired["SessionService.CreateParamsAutomaticTax"] """ Settings for automatic tax lookup for this session and resulting payments, invoices, and subscriptions. """ billing_address_collection: NotRequired[Literal["auto", "required"]] """ Specify whether Checkout should collect the customer's billing address. Defaults to `auto`. """ cancel_url: NotRequired[str] """ If set, Checkout displays a back button and customers will be directed to this URL if they decide to cancel payment and return to your website. """ client_reference_id: NotRequired[str] """ A unique string to reference the Checkout Session. This can be a customer ID, a cart ID, or similar, and can be used to reconcile the session with your internal systems. """ consent_collection: NotRequired[ "SessionService.CreateParamsConsentCollection" ] """ Configure fields for the Checkout Session to gather active consent from customers. """ currency: NotRequired[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). Required in `setup` mode when `payment_method_types` is not set. """ custom_fields: NotRequired[ List["SessionService.CreateParamsCustomField"] ] """ Collect additional information from your customer using custom fields. Up to 3 fields are supported. """ custom_text: NotRequired["SessionService.CreateParamsCustomText"] """ Display additional text for your customers using custom text. """ customer: NotRequired[str] """ ID of an existing Customer, if one exists. In `payment` mode, the customer's most recently saved card payment method will be used to prefill the email, name, card details, and billing address on the Checkout page. In `subscription` mode, the customer's [default payment method](https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method) will be used if it's a card, otherwise the most recently saved card will be used. A valid billing address, billing name and billing email are required on the payment method for Checkout to prefill the customer's card details. If the Customer already has a valid [email](https://stripe.com/docs/api/customers/object#customer_object-email) set, the email will be prefilled and not editable in Checkout. If the Customer does not have a valid `email`, Checkout will set the email entered during the session on the Customer. If blank for Checkout Sessions in `subscription` mode or with `customer_creation` set as `always` in `payment` mode, Checkout will create a new Customer object based on information provided during the payment flow. You can set [`payment_intent_data.setup_future_usage`](https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-payment_intent_data-setup_future_usage) to have Checkout automatically attach the payment method to the Customer you pass in for future reuse. """ customer_creation: NotRequired[Literal["always", "if_required"]] """ Configure whether a Checkout Session creates a [Customer](https://stripe.com/docs/api/customers) during Session confirmation. When a Customer is not created, you can still retrieve email, address, and other customer data entered in Checkout with [customer_details](https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-customer_details). Sessions that don't create Customers instead are grouped by [guest customers](https://stripe.com/docs/payments/checkout/guest-customers) in the Dashboard. Promotion codes limited to first time customers will return invalid for these Sessions. Can only be set in `payment` and `setup` mode. """ customer_email: NotRequired[str] """ If provided, this value will be used when the Customer object is created. If not provided, customers will be asked to enter their email address. Use this parameter to prefill customer data if you already have an email on file. To access information about the customer once a session is complete, use the `customer` field. """ customer_update: NotRequired[ "SessionService.CreateParamsCustomerUpdate" ] """ Controls what fields on Customer can be updated by the Checkout Session. Can only be provided when `customer` is provided. """ discounts: NotRequired[List["SessionService.CreateParamsDiscount"]] """ The coupon or promotion code to apply to this Session. Currently, only up to one may be specified. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ expires_at: NotRequired[int] """ The Epoch time in seconds at which the Checkout Session will expire. It can be anywhere from 30 minutes to 24 hours after Checkout Session creation. By default, this value is 24 hours from creation. """ invoice_creation: NotRequired[ "SessionService.CreateParamsInvoiceCreation" ] """ Generate a post-purchase Invoice for one-time payments. """ line_items: NotRequired[List["SessionService.CreateParamsLineItem"]] """ A list of items the customer is purchasing. Use this parameter to pass one-time or recurring [Prices](https://stripe.com/docs/api/prices). For `payment` mode, there is a maximum of 100 line items, however it is recommended to consolidate line items if there are more than a few dozen. For `subscription` mode, there is a maximum of 20 line items with recurring Prices and 20 line items with one-time Prices. Line items with one-time Prices will be on the initial invoice only. """ locale: NotRequired[ Literal[ "auto", "bg", "cs", "da", "de", "el", "en", "en-GB", "es", "es-419", "et", "fi", "fil", "fr", "fr-CA", "hr", "hu", "id", "it", "ja", "ko", "lt", "lv", "ms", "mt", "nb", "nl", "pl", "pt", "pt-BR", "ro", "ru", "sk", "sl", "sv", "th", "tr", "vi", "zh", "zh-HK", "zh-TW", ] ] """ The IETF language tag of the locale Checkout is displayed in. If blank or `auto`, the browser's locale is used. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ mode: NotRequired[Literal["payment", "setup", "subscription"]] """ The mode of the Checkout Session. Pass `subscription` if the Checkout Session includes at least one recurring item. """ payment_intent_data: NotRequired[ "SessionService.CreateParamsPaymentIntentData" ] """ A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in `payment` mode. """ payment_method_collection: NotRequired[ Literal["always", "if_required"] ] """ Specify whether Checkout should collect a payment method. When set to `if_required`, Checkout will not collect a payment method when the total due for the session is 0. This may occur if the Checkout Session includes a free trial or a discount. Can only be set in `subscription` mode. Defaults to `always`. If you'd like information on how to collect a payment method outside of Checkout, read the guide on configuring [subscriptions with a free trial](https://stripe.com/docs/payments/checkout/free-trials). """ payment_method_configuration: NotRequired[str] """ The ID of the payment method configuration to use with this Checkout session. """ payment_method_data: NotRequired[ "SessionService.CreateParamsPaymentMethodData" ] """ This parameter allows you to set some attributes on the payment method created during a Checkout session. """ payment_method_options: NotRequired[ "SessionService.CreateParamsPaymentMethodOptions" ] """ Payment-method-specific configuration. """ payment_method_types: NotRequired[ List[ Literal[ "acss_debit", "affirm", "afterpay_clearpay", "alipay", "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", "blik", "boleto", "card", "cashapp", "customer_balance", "eps", "fpx", "giropay", "grabpay", "ideal", "klarna", "konbini", "link", "mobilepay", "multibanco", "oxxo", "p24", "paynow", "paypal", "pix", "promptpay", "revolut_pay", "sepa_debit", "sofort", "swish", "twint", "us_bank_account", "wechat_pay", "zip", ] ] ] """ A list of the types of payment methods (e.g., `card`) this Checkout Session can accept. You can omit this attribute to manage your payment methods from the [Stripe Dashboard](https://dashboard.stripe.com/settings/payment_methods). See [Dynamic Payment Methods](https://stripe.com/docs/payments/payment-methods/integration-options#using-dynamic-payment-methods) for more details. Read more about the supported payment methods and their requirements in our [payment method details guide](https://stripe.com/docs/payments/checkout/payment-methods). If multiple payment methods are passed, Checkout will dynamically reorder them to prioritize the most relevant payment methods based on the customer's location and other characteristics. """ phone_number_collection: NotRequired[ "SessionService.CreateParamsPhoneNumberCollection" ] """ Controls phone number collection settings for the session. We recommend that you review your privacy policy and check with your legal contacts before using this feature. Learn more about [collecting phone numbers with Checkout](https://stripe.com/docs/payments/checkout/phone-numbers). """ redirect_on_completion: NotRequired[ Literal["always", "if_required", "never"] ] """ This parameter applies to `ui_mode: embedded`. Learn more about the [redirect behavior](https://stripe.com/docs/payments/checkout/custom-redirect-behavior) of embedded sessions. Defaults to `always`. """ return_url: NotRequired[str] """ The URL to redirect your customer back to after they authenticate or cancel their payment on the payment method's app or site. This parameter is required if ui_mode is `embedded` and redirect-based payment methods are enabled on the session. """ saved_payment_method_options: NotRequired[ "SessionService.CreateParamsSavedPaymentMethodOptions" ] """ Controls saved payment method settings for the session. Only available in `payment` and `subscription` mode. """ setup_intent_data: NotRequired[ "SessionService.CreateParamsSetupIntentData" ] """ A subset of parameters to be passed to SetupIntent creation for Checkout Sessions in `setup` mode. """ shipping_address_collection: NotRequired[ "SessionService.CreateParamsShippingAddressCollection" ] """ When set, provides configuration for Checkout to collect a shipping address from a customer. """ shipping_options: NotRequired[ List["SessionService.CreateParamsShippingOption"] ] """ The shipping rate options to apply to this Session. Up to a maximum of 5. """ submit_type: NotRequired[Literal["auto", "book", "donate", "pay"]] """ Describes the type of transaction being performed by Checkout in order to customize relevant text on the page, such as the submit button. `submit_type` can only be specified on Checkout Sessions in `payment` mode. If blank or `auto`, `pay` is used. """ subscription_data: NotRequired[ "SessionService.CreateParamsSubscriptionData" ] """ A subset of parameters to be passed to subscription creation for Checkout Sessions in `subscription` mode. """ success_url: NotRequired[str] """ The URL to which Stripe should send customers when payment or setup is complete. This parameter is not allowed if ui_mode is `embedded`. If you'd like to use information from the successful Checkout Session on your page, read the guide on [customizing your success page](https://stripe.com/docs/payments/checkout/custom-success-page). """ tax_id_collection: NotRequired[ "SessionService.CreateParamsTaxIdCollection" ] """ Controls tax ID collection during checkout. """ ui_mode: NotRequired[Literal["embedded", "hosted"]] """ The UI mode of the Session. Defaults to `hosted`. """ class CreateParamsAfterExpiration(TypedDict): recovery: NotRequired[ "SessionService.CreateParamsAfterExpirationRecovery" ] """ Configure a Checkout Session that can be used to recover an expired session. """ class CreateParamsAfterExpirationRecovery(TypedDict): allow_promotion_codes: NotRequired[bool] """ Enables user redeemable promotion codes on the recovered Checkout Sessions. Defaults to `false` """ enabled: bool """ If `true`, a recovery URL will be generated to recover this Checkout Session if it expires before a successful transaction is completed. It will be attached to the Checkout Session object upon expiration. """ class CreateParamsAutomaticTax(TypedDict): enabled: bool """ Set to true to enable automatic taxes. """ liability: NotRequired[ "SessionService.CreateParamsAutomaticTaxLiability" ] """ The account that's liable for tax. If set, the business address and tax registrations required to perform the tax calculation are loaded from this account. The tax transaction is returned in the report of the connected account. """ class CreateParamsAutomaticTaxLiability(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class CreateParamsConsentCollection(TypedDict): payment_method_reuse_agreement: NotRequired[ "SessionService.CreateParamsConsentCollectionPaymentMethodReuseAgreement" ] """ Determines the display of payment method reuse agreement text in the UI. If set to `hidden`, it will hide legal text related to the reuse of a payment method. """ promotions: NotRequired[Literal["auto", "none"]] """ If set to `auto`, enables the collection of customer consent for promotional communications. The Checkout Session will determine whether to display an option to opt into promotional communication from the merchant depending on the customer's locale. Only available to US merchants. """ terms_of_service: NotRequired[Literal["none", "required"]] """ If set to `required`, it requires customers to check a terms of service checkbox before being able to pay. There must be a valid terms of service URL set in your [Dashboard settings](https://dashboard.stripe.com/settings/public). """ class CreateParamsConsentCollectionPaymentMethodReuseAgreement(TypedDict): position: Literal["auto", "hidden"] """ Determines the position and visibility of the payment method reuse agreement in the UI. When set to `auto`, Stripe's defaults will be used. When set to `hidden`, the payment method reuse agreement text will always be hidden in the UI. """ class CreateParamsCustomField(TypedDict): dropdown: NotRequired["SessionService.CreateParamsCustomFieldDropdown"] """ Configuration for `type=dropdown` fields. """ key: str """ String of your choice that your integration can use to reconcile this field. Must be unique to this field, alphanumeric, and up to 200 characters. """ label: "SessionService.CreateParamsCustomFieldLabel" """ The label for the field, displayed to the customer. """ numeric: NotRequired["SessionService.CreateParamsCustomFieldNumeric"] """ Configuration for `type=numeric` fields. """ optional: NotRequired[bool] """ Whether the customer is required to complete the field before completing the Checkout Session. Defaults to `false`. """ text: NotRequired["SessionService.CreateParamsCustomFieldText"] """ Configuration for `type=text` fields. """ type: Literal["dropdown", "numeric", "text"] """ The type of the field. """ class CreateParamsCustomFieldDropdown(TypedDict): default_value: NotRequired[str] """ The value that will pre-fill the field on the payment page.Must match a `value` in the `options` array. """ options: List["SessionService.CreateParamsCustomFieldDropdownOption"] """ The options available for the customer to select. Up to 200 options allowed. """ class CreateParamsCustomFieldDropdownOption(TypedDict): label: str """ The label for the option, displayed to the customer. Up to 100 characters. """ value: str """ The value for this option, not displayed to the customer, used by your integration to reconcile the option selected by the customer. Must be unique to this option, alphanumeric, and up to 100 characters. """ class CreateParamsCustomFieldLabel(TypedDict): custom: str """ Custom text for the label, displayed to the customer. Up to 50 characters. """ type: Literal["custom"] """ The type of the label. """ class CreateParamsCustomFieldNumeric(TypedDict): default_value: NotRequired[str] """ The value that will pre-fill the field on the payment page. """ maximum_length: NotRequired[int] """ The maximum character length constraint for the customer's input. """ minimum_length: NotRequired[int] """ The minimum character length requirement for the customer's input. """ class CreateParamsCustomFieldText(TypedDict): default_value: NotRequired[str] """ The value that will pre-fill the field on the payment page. """ maximum_length: NotRequired[int] """ The maximum character length constraint for the customer's input. """ minimum_length: NotRequired[int] """ The minimum character length requirement for the customer's input. """ class CreateParamsCustomText(TypedDict): after_submit: NotRequired[ "Literal['']|SessionService.CreateParamsCustomTextAfterSubmit" ] """ Custom text that should be displayed after the payment confirmation button. """ shipping_address: NotRequired[ "Literal['']|SessionService.CreateParamsCustomTextShippingAddress" ] """ Custom text that should be displayed alongside shipping address collection. """ submit: NotRequired[ "Literal['']|SessionService.CreateParamsCustomTextSubmit" ] """ Custom text that should be displayed alongside the payment confirmation button. """ terms_of_service_acceptance: NotRequired[ "Literal['']|SessionService.CreateParamsCustomTextTermsOfServiceAcceptance" ] """ Custom text that should be displayed in place of the default terms of service agreement text. """ class CreateParamsCustomTextAfterSubmit(TypedDict): message: str """ Text may be up to 1200 characters in length. """ class CreateParamsCustomTextShippingAddress(TypedDict): message: str """ Text may be up to 1200 characters in length. """ class CreateParamsCustomTextSubmit(TypedDict): message: str """ Text may be up to 1200 characters in length. """ class CreateParamsCustomTextTermsOfServiceAcceptance(TypedDict): message: str """ Text may be up to 1200 characters in length. """ class CreateParamsCustomerUpdate(TypedDict): address: NotRequired[Literal["auto", "never"]] """ Describes whether Checkout saves the billing address onto `customer.address`. To always collect a full billing address, use `billing_address_collection`. Defaults to `never`. """ name: NotRequired[Literal["auto", "never"]] """ Describes whether Checkout saves the name onto `customer.name`. Defaults to `never`. """ shipping: NotRequired[Literal["auto", "never"]] """ Describes whether Checkout saves shipping information onto `customer.shipping`. To collect shipping information, use `shipping_address_collection`. Defaults to `never`. """ class CreateParamsDiscount(TypedDict): coupon: NotRequired[str] """ The ID of the coupon to apply to this Session. """ promotion_code: NotRequired[str] """ The ID of a promotion code to apply to this Session. """ class CreateParamsInvoiceCreation(TypedDict): enabled: bool """ Set to `true` to enable invoice creation. """ invoice_data: NotRequired[ "SessionService.CreateParamsInvoiceCreationInvoiceData" ] """ Parameters passed when creating invoices for payment-mode Checkout Sessions. """ class CreateParamsInvoiceCreationInvoiceData(TypedDict): account_tax_ids: NotRequired["Literal['']|List[str]"] """ The account tax IDs associated with the invoice. """ custom_fields: NotRequired[ "Literal['']|List[SessionService.CreateParamsInvoiceCreationInvoiceDataCustomField]" ] """ Default custom fields to be displayed on invoices for this customer. """ description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ footer: NotRequired[str] """ Default footer to be displayed on invoices for this customer. """ issuer: NotRequired[ "SessionService.CreateParamsInvoiceCreationInvoiceDataIssuer" ] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ rendering_options: NotRequired[ "Literal['']|SessionService.CreateParamsInvoiceCreationInvoiceDataRenderingOptions" ] """ Default options for invoice PDF rendering for this customer. """ class CreateParamsInvoiceCreationInvoiceDataCustomField(TypedDict): name: str """ The name of the custom field. This may be up to 40 characters. """ value: str """ The value of the custom field. This may be up to 140 characters. """ class CreateParamsInvoiceCreationInvoiceDataIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class CreateParamsInvoiceCreationInvoiceDataRenderingOptions(TypedDict): amount_tax_display: NotRequired[ "Literal['']|Literal['exclude_tax', 'include_inclusive_tax']" ] """ How line-item prices and amounts will be displayed with respect to tax on invoice PDFs. One of `exclude_tax` or `include_inclusive_tax`. `include_inclusive_tax` will include inclusive tax (and exclude exclusive tax) in invoice PDF amounts. `exclude_tax` will exclude all tax (inclusive and exclusive alike) from invoice PDF amounts. """ class CreateParamsLineItem(TypedDict): adjustable_quantity: NotRequired[ "SessionService.CreateParamsLineItemAdjustableQuantity" ] """ When set, provides configuration for this item's quantity to be adjusted by the customer during Checkout. """ dynamic_tax_rates: NotRequired[List[str]] """ The [tax rates](https://stripe.com/docs/api/tax_rates) that will be applied to this line item depending on the customer's billing/shipping address. We currently support the following countries: US, GB, AU, and all countries in the EU. """ price: NotRequired[str] """ The ID of the [Price](https://stripe.com/docs/api/prices) or [Plan](https://stripe.com/docs/api/plans) object. One of `price` or `price_data` is required. """ price_data: NotRequired["SessionService.CreateParamsLineItemPriceData"] """ Data used to generate a new [Price](https://stripe.com/docs/api/prices) object inline. One of `price` or `price_data` is required. """ quantity: NotRequired[int] """ The quantity of the line item being purchased. Quantity should not be defined when `recurring.usage_type=metered`. """ tax_rates: NotRequired[List[str]] """ The [tax rates](https://stripe.com/docs/api/tax_rates) which apply to this line item. """ class CreateParamsLineItemAdjustableQuantity(TypedDict): enabled: bool """ Set to true if the quantity can be adjusted to any non-negative integer. By default customers will be able to remove the line item by setting the quantity to 0. """ maximum: NotRequired[int] """ The maximum quantity the customer can purchase for the Checkout Session. By default this value is 99. You can specify a value up to 999999. """ minimum: NotRequired[int] """ The minimum quantity the customer must purchase for the Checkout Session. By default this value is 0. """ class CreateParamsLineItemPriceData(TypedDict): 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). """ product: NotRequired[str] """ The ID of the product that this price will belong to. One of `product` or `product_data` is required. """ product_data: NotRequired[ "SessionService.CreateParamsLineItemPriceDataProductData" ] """ Data used to generate a new product object inline. One of `product` or `product_data` is required. """ recurring: NotRequired[ "SessionService.CreateParamsLineItemPriceDataRecurring" ] """ The recurring components of a price such as `interval` and `interval_count`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Only required if a [default tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#setting-a-default-tax-behavior-(recommended)) was not provided in the Stripe Tax settings. Specifies whether the price is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. Once specified as either `inclusive` or `exclusive`, it cannot be changed. """ unit_amount: NotRequired[int] """ A non-negative integer in cents (or local equivalent) representing how much to charge. One of `unit_amount` or `unit_amount_decimal` is required. """ unit_amount_decimal: NotRequired[str] """ Same as `unit_amount`, but accepts a decimal value in cents (or local equivalent) with at most 12 decimal places. Only one of `unit_amount` and `unit_amount_decimal` can be set. """ class CreateParamsLineItemPriceDataProductData(TypedDict): description: NotRequired[str] """ The product's description, meant to be displayable to the customer. Use this field to optionally store a long form explanation of the product being sold for your own rendering purposes. """ images: NotRequired[List[str]] """ A list of up to 8 URLs of images for this product, meant to be displayable to the customer. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ name: str """ The product's name, meant to be displayable to the customer. """ tax_code: NotRequired[str] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ class CreateParamsLineItemPriceDataRecurring(TypedDict): interval: Literal["day", "month", "week", "year"] """ Specifies billing frequency. Either `day`, `week`, `month` or `year`. """ interval_count: NotRequired[int] """ The number of intervals between subscription billings. For example, `interval=month` and `interval_count=3` bills every 3 months. Maximum of three years interval allowed (3 years, 36 months, or 156 weeks). """ class CreateParamsPaymentIntentData(TypedDict): application_fee_amount: NotRequired[int] """ The amount of the application fee (if any) that will be requested to be applied to the payment and transferred to the application owner's Stripe account. The amount of the application fee collected will be capped at the total payment amount. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ capture_method: NotRequired[ Literal["automatic", "automatic_async", "manual"] ] """ Controls when the funds will be captured from the customer's account. """ description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ on_behalf_of: NotRequired[str] """ The Stripe account ID for which these funds are intended. For details, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ receipt_email: NotRequired[str] """ Email address that the receipt for the resulting payment will be sent to. If `receipt_email` is specified for a payment in live mode, a receipt will be sent regardless of your [email settings](https://dashboard.stripe.com/account/emails). """ setup_future_usage: NotRequired[Literal["off_session", "on_session"]] """ Indicates that you intend to [make future payments](https://stripe.com/docs/payments/payment-intents#future-usage) with the payment method collected by this Checkout Session. When setting this to `on_session`, Checkout will show a notice to the customer that their payment details will be saved. When setting this to `off_session`, Checkout will show a notice to the customer that their payment details will be saved and used for future payments. If a Customer has been provided or Checkout creates a new Customer, Checkout will attach the payment method to the Customer. If Checkout does not create a Customer, the payment method is not attached to a Customer. To reuse the payment method, you can retrieve it from the Checkout Session's PaymentIntent. When processing card payments, Checkout also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as SCA. """ shipping: NotRequired[ "SessionService.CreateParamsPaymentIntentDataShipping" ] """ Shipping information for this payment. """ statement_descriptor: NotRequired[str] """ Extra information about the payment. This will appear on your customer's statement when this payment succeeds in creating a charge. """ statement_descriptor_suffix: NotRequired[str] """ Provides information about the charge that customers see on their statements. Concatenated with the prefix (shortened descriptor) or statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters for the concatenated descriptor. """ transfer_data: NotRequired[ "SessionService.CreateParamsPaymentIntentDataTransferData" ] """ The parameters used to automatically create a Transfer when the payment succeeds. For more information, see the PaymentIntents [use case for connected accounts](https://stripe.com/docs/payments/connected-accounts). """ transfer_group: NotRequired[str] """ A string that identifies the resulting payment as part of a group. See the PaymentIntents [use case for connected accounts](https://stripe.com/docs/connect/separate-charges-and-transfers) for details. """ class CreateParamsPaymentIntentDataShipping(TypedDict): address: "SessionService.CreateParamsPaymentIntentDataShippingAddress" """ Shipping address. """ carrier: NotRequired[str] """ The delivery service that shipped a physical product, such as Fedex, UPS, USPS, etc. """ name: str """ Recipient name. """ phone: NotRequired[str] """ Recipient phone (including extension). """ tracking_number: NotRequired[str] """ The tracking number for a physical product, obtained from the delivery service. If multiple tracking numbers were generated for this purchase, please separate them with commas. """ class CreateParamsPaymentIntentDataShippingAddress(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: str """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsPaymentIntentDataTransferData(TypedDict): amount: NotRequired[int] """ The amount that will be transferred automatically when a charge succeeds. """ destination: str """ If specified, successful charges will be attributed to the destination account for tax reporting, and the funds from charges will be transferred to the destination account. The ID of the resulting transfer will be returned on the successful charge's `transfer` field. """ class CreateParamsPaymentMethodData(TypedDict): allow_redisplay: NotRequired[ Literal["always", "limited", "unspecified"] ] """ Allow redisplay will be set on the payment method on confirmation and indicates whether this payment method can be shown again to the customer in a checkout flow. Only set this field if you wish to override the allow_redisplay value determined by Checkout. """ class CreateParamsPaymentMethodOptions(TypedDict): acss_debit: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsAcssDebit" ] """ contains details about the ACSS Debit payment method options. """ affirm: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsAffirm" ] """ contains details about the Affirm payment method options. """ afterpay_clearpay: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsAfterpayClearpay" ] """ contains details about the Afterpay Clearpay payment method options. """ alipay: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsAlipay" ] """ contains details about the Alipay payment method options. """ amazon_pay: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsAmazonPay" ] """ contains details about the AmazonPay payment method options. """ au_becs_debit: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsAuBecsDebit" ] """ contains details about the AU Becs Debit payment method options. """ bacs_debit: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsBacsDebit" ] """ contains details about the Bacs Debit payment method options. """ bancontact: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsBancontact" ] """ contains details about the Bancontact payment method options. """ boleto: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsBoleto" ] """ contains details about the Boleto payment method options. """ card: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsCard" ] """ contains details about the Card payment method options. """ cashapp: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsCashapp" ] """ contains details about the Cashapp Pay payment method options. """ customer_balance: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsCustomerBalance" ] """ contains details about the Customer Balance payment method options. """ eps: NotRequired["SessionService.CreateParamsPaymentMethodOptionsEps"] """ contains details about the EPS payment method options. """ fpx: NotRequired["SessionService.CreateParamsPaymentMethodOptionsFpx"] """ contains details about the FPX payment method options. """ giropay: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsGiropay" ] """ contains details about the Giropay payment method options. """ grabpay: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsGrabpay" ] """ contains details about the Grabpay payment method options. """ ideal: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsIdeal" ] """ contains details about the Ideal payment method options. """ klarna: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsKlarna" ] """ contains details about the Klarna payment method options. """ konbini: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsKonbini" ] """ contains details about the Konbini payment method options. """ link: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsLink" ] """ contains details about the Link payment method options. """ mobilepay: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsMobilepay" ] """ contains details about the Mobilepay payment method options. """ multibanco: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsMultibanco" ] """ contains details about the Multibanco payment method options. """ oxxo: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsOxxo" ] """ contains details about the OXXO payment method options. """ p24: NotRequired["SessionService.CreateParamsPaymentMethodOptionsP24"] """ contains details about the P24 payment method options. """ paynow: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsPaynow" ] """ contains details about the PayNow payment method options. """ paypal: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsPaypal" ] """ contains details about the PayPal payment method options. """ pix: NotRequired["SessionService.CreateParamsPaymentMethodOptionsPix"] """ contains details about the Pix payment method options. """ revolut_pay: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsRevolutPay" ] """ contains details about the RevolutPay payment method options. """ sepa_debit: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsSepaDebit" ] """ contains details about the Sepa Debit payment method options. """ sofort: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsSofort" ] """ contains details about the Sofort payment method options. """ swish: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsSwish" ] """ contains details about the Swish payment method options. """ us_bank_account: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsUsBankAccount" ] """ contains details about the Us Bank Account payment method options. """ wechat_pay: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsWechatPay" ] """ contains details about the WeChat Pay payment method options. """ class CreateParamsPaymentMethodOptionsAcssDebit(TypedDict): currency: NotRequired[Literal["cad", "usd"]] """ Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a [supported currency](https://stripe.com/docs/currencies). This is only accepted for Checkout Sessions in `setup` mode. """ mandate_options: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsAcssDebitMandateOptions" ] """ Additional fields for Mandate creation """ setup_future_usage: NotRequired[ Literal["none", "off_session", "on_session"] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ verification_method: NotRequired[ Literal["automatic", "instant", "microdeposits"] ] """ Verification method for the intent """ class CreateParamsPaymentMethodOptionsAcssDebitMandateOptions(TypedDict): custom_mandate_url: NotRequired["Literal['']|str"] """ A URL for custom mandate text to render during confirmation step. The URL will be rendered with additional GET parameters `payment_intent` and `payment_intent_client_secret` when confirming a Payment Intent, or `setup_intent` and `setup_intent_client_secret` when confirming a Setup Intent. """ default_for: NotRequired[List[Literal["invoice", "subscription"]]] """ List of Stripe products where this mandate can be selected automatically. Only usable in `setup` mode. """ interval_description: NotRequired[str] """ Description of the mandate interval. Only required if 'payment_schedule' parameter is 'interval' or 'combined'. """ payment_schedule: NotRequired[ Literal["combined", "interval", "sporadic"] ] """ Payment schedule for the mandate. """ transaction_type: NotRequired[Literal["business", "personal"]] """ Transaction type of the mandate. """ class CreateParamsPaymentMethodOptionsAffirm(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsAfterpayClearpay(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsAlipay(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsAmazonPay(TypedDict): setup_future_usage: NotRequired[Literal["none", "off_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsAuBecsDebit(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsBacsDebit(TypedDict): setup_future_usage: NotRequired[ Literal["none", "off_session", "on_session"] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsBancontact(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsBoleto(TypedDict): expires_after_days: NotRequired[int] """ The number of calendar days before a Boleto voucher expires. For example, if you create a Boleto voucher on Monday and you set expires_after_days to 2, the Boleto invoice will expire on Wednesday at 23:59 America/Sao_Paulo time. """ setup_future_usage: NotRequired[ Literal["none", "off_session", "on_session"] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsCard(TypedDict): installments: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsCardInstallments" ] """ Installment options for card payments """ request_three_d_secure: NotRequired[ Literal["any", "automatic", "challenge"] ] """ 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://stripe.com/docs/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://stripe.com/docs/payments/3d-secure/authentication-flow#manual-three-ds) for more information on how this configuration interacts with Radar and our SCA Engine. """ setup_future_usage: NotRequired[Literal["off_session", "on_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ statement_descriptor_suffix_kana: NotRequired[str] """ Provides information about a card payment that customers see on their statements. Concatenated with the Kana prefix (shortened Kana descriptor) or Kana statement descriptor that's set on the account to form the complete statement descriptor. Maximum 22 characters. On card statements, the *concatenation* of both prefix and suffix (including separators) will appear truncated to 22 characters. """ statement_descriptor_suffix_kanji: NotRequired[str] """ 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. """ class CreateParamsPaymentMethodOptionsCardInstallments(TypedDict): enabled: NotRequired[bool] """ Setting to true enables installments for this Checkout Session. Setting to false will prevent any installment plan from applying to a payment. """ class CreateParamsPaymentMethodOptionsCashapp(TypedDict): setup_future_usage: NotRequired[ Literal["none", "off_session", "on_session"] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsCustomerBalance(TypedDict): bank_transfer: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsCustomerBalanceBankTransfer" ] """ Configuration for the bank transfer funding type, if the `funding_type` is set to `bank_transfer`. """ funding_type: NotRequired[Literal["bank_transfer"]] """ The funding method type to be used when there are not enough funds in the customer balance. Permitted values include: `bank_transfer`. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsCustomerBalanceBankTransfer( TypedDict, ): eu_bank_transfer: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer" ] """ Configuration for eu_bank_transfer funding type. """ requested_address_types: NotRequired[ List[ Literal[ "aba", "iban", "sepa", "sort_code", "spei", "swift", "zengin", ] ] ] """ List of address types that should be returned in the financial_addresses response. If not specified, all valid types will be returned. Permitted values include: `sort_code`, `zengin`, `iban`, or `spei`. """ type: Literal[ "eu_bank_transfer", "gb_bank_transfer", "jp_bank_transfer", "mx_bank_transfer", "us_bank_transfer", ] """ The list of bank transfer types that this PaymentIntent is allowed to use for funding. """ class CreateParamsPaymentMethodOptionsCustomerBalanceBankTransferEuBankTransfer( TypedDict, ): country: str """ The desired country code of the bank account information. Permitted values include: `BE`, `DE`, `ES`, `FR`, `IE`, or `NL`. """ class CreateParamsPaymentMethodOptionsEps(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsFpx(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsGiropay(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsGrabpay(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsIdeal(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsKlarna(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsKonbini(TypedDict): expires_after_days: NotRequired[int] """ The number of calendar days (between 1 and 60) after which Konbini payment instructions will expire. For example, if a PaymentIntent is confirmed with Konbini and `expires_after_days` set to 2 on Monday JST, the instructions will expire on Wednesday 23:59:59 JST. Defaults to 3 days. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsLink(TypedDict): setup_future_usage: NotRequired[Literal["none", "off_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsMobilepay(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsMultibanco(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsOxxo(TypedDict): expires_after_days: NotRequired[int] """ The number of calendar days before an OXXO voucher expires. For example, if you create an OXXO voucher on Monday and you set expires_after_days to 2, the OXXO invoice will expire on Wednesday at 23:59 America/Mexico_City time. """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsP24(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ tos_shown_and_accepted: NotRequired[bool] """ Confirm that the payer has accepted the P24 terms and conditions. """ class CreateParamsPaymentMethodOptionsPaynow(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsPaypal(TypedDict): capture_method: NotRequired["Literal['']|Literal['manual']"] """ Controls when the funds will be captured from the customer's account. """ preferred_locale: NotRequired[ Literal[ "cs-CZ", "da-DK", "de-AT", "de-DE", "de-LU", "el-GR", "en-GB", "en-US", "es-ES", "fi-FI", "fr-BE", "fr-FR", "fr-LU", "hu-HU", "it-IT", "nl-BE", "nl-NL", "pl-PL", "pt-PT", "sk-SK", "sv-SE", ] ] """ [Preferred locale](https://stripe.com/docs/payments/paypal/supported-locales) of the PayPal checkout page that the customer is redirected to. """ reference: NotRequired[str] """ A reference of the PayPal transaction visible to customer which is mapped to PayPal's invoice ID. This must be a globally unique ID if you have configured in your PayPal settings to block multiple payments per invoice ID. """ risk_correlation_id: NotRequired[str] """ The risk correlation ID for an on-session payment using a saved PayPal payment method. """ setup_future_usage: NotRequired[ "Literal['']|Literal['none', 'off_session']" ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). If `setup_future_usage` is already set and you are performing a request using a publishable key, you may only update the value from `on_session` to `off_session`. """ class CreateParamsPaymentMethodOptionsPix(TypedDict): expires_after_seconds: NotRequired[int] """ The number of seconds (between 10 and 1209600) after which Pix payment will expire. Defaults to 86400 seconds. """ class CreateParamsPaymentMethodOptionsRevolutPay(TypedDict): setup_future_usage: NotRequired[Literal["none", "off_session"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsSepaDebit(TypedDict): setup_future_usage: NotRequired[ Literal["none", "off_session", "on_session"] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsSofort(TypedDict): setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPaymentMethodOptionsSwish(TypedDict): reference: NotRequired[str] """ The order reference that will be displayed to customers in the Swish application. Defaults to the `id` of the Payment Intent. """ class CreateParamsPaymentMethodOptionsUsBankAccount(TypedDict): financial_connections: NotRequired[ "SessionService.CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections" ] """ Additional fields for Financial Connections Session creation """ setup_future_usage: NotRequired[ Literal["none", "off_session", "on_session"] ] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ verification_method: NotRequired[Literal["automatic", "instant"]] """ Verification method for the intent """ class CreateParamsPaymentMethodOptionsUsBankAccountFinancialConnections( TypedDict, ): permissions: NotRequired[ List[ Literal[ "balances", "ownership", "payment_method", "transactions" ] ] ] """ The list of permissions to request. If this parameter is passed, the `payment_method` permission must be included. Valid permissions include: `balances`, `ownership`, `payment_method`, and `transactions`. """ prefetch: NotRequired[ List[Literal["balances", "ownership", "transactions"]] ] """ List of data features that you would like to retrieve upon account creation. """ class CreateParamsPaymentMethodOptionsWechatPay(TypedDict): app_id: NotRequired[str] """ The app ID registered with WeChat Pay. Only required when client is ios or android. """ client: Literal["android", "ios", "web"] """ The client type that the end customer will pay from """ setup_future_usage: NotRequired[Literal["none"]] """ Indicates that you intend to make future payments with this PaymentIntent's payment method. Providing this parameter will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. If no Customer was provided, the payment method can still be [attached](https://stripe.com/docs/api/payment_methods/attach) to a Customer after the transaction completes. When processing card payments, Stripe also uses `setup_future_usage` to dynamically optimize your payment flow and comply with regional legislation and network rules, such as [SCA](https://stripe.com/docs/strong-customer-authentication). """ class CreateParamsPhoneNumberCollection(TypedDict): enabled: bool """ Set to `true` to enable phone number collection. """ class CreateParamsSavedPaymentMethodOptions(TypedDict): allow_redisplay_filters: NotRequired[ List[Literal["always", "limited", "unspecified"]] ] """ Uses the `allow_redisplay` value of each saved payment method to filter the set presented to a returning customer. By default, only saved payment methods with 'allow_redisplay: ‘always' are shown in Checkout. """ payment_method_save: NotRequired[Literal["disabled", "enabled"]] """ Enable customers to choose if they wish to save their payment method for future use. Disabled by default. """ class CreateParamsSetupIntentData(TypedDict): description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ on_behalf_of: NotRequired[str] """ The Stripe account for which the setup is intended. """ class CreateParamsShippingAddressCollection(TypedDict): allowed_countries: List[ Literal[ "AC", "AD", "AE", "AF", "AG", "AI", "AL", "AM", "AO", "AQ", "AR", "AT", "AU", "AW", "AX", "AZ", "BA", "BB", "BD", "BE", "BF", "BG", "BH", "BI", "BJ", "BL", "BM", "BN", "BO", "BQ", "BR", "BS", "BT", "BV", "BW", "BY", "BZ", "CA", "CD", "CF", "CG", "CH", "CI", "CK", "CL", "CM", "CN", "CO", "CR", "CV", "CW", "CY", "CZ", "DE", "DJ", "DK", "DM", "DO", "DZ", "EC", "EE", "EG", "EH", "ER", "ES", "ET", "FI", "FJ", "FK", "FO", "FR", "GA", "GB", "GD", "GE", "GF", "GG", "GH", "GI", "GL", "GM", "GN", "GP", "GQ", "GR", "GS", "GT", "GU", "GW", "GY", "HK", "HN", "HR", "HT", "HU", "ID", "IE", "IL", "IM", "IN", "IO", "IQ", "IS", "IT", "JE", "JM", "JO", "JP", "KE", "KG", "KH", "KI", "KM", "KN", "KR", "KW", "KY", "KZ", "LA", "LB", "LC", "LI", "LK", "LR", "LS", "LT", "LU", "LV", "LY", "MA", "MC", "MD", "ME", "MF", "MG", "MK", "ML", "MM", "MN", "MO", "MQ", "MR", "MS", "MT", "MU", "MV", "MW", "MX", "MY", "MZ", "NA", "NC", "NE", "NG", "NI", "NL", "NO", "NP", "NR", "NU", "NZ", "OM", "PA", "PE", "PF", "PG", "PH", "PK", "PL", "PM", "PN", "PR", "PS", "PT", "PY", "QA", "RE", "RO", "RS", "RU", "RW", "SA", "SB", "SC", "SE", "SG", "SH", "SI", "SJ", "SK", "SL", "SM", "SN", "SO", "SR", "SS", "ST", "SV", "SX", "SZ", "TA", "TC", "TD", "TF", "TG", "TH", "TJ", "TK", "TL", "TM", "TN", "TO", "TR", "TT", "TV", "TW", "TZ", "UA", "UG", "US", "UY", "UZ", "VA", "VC", "VE", "VG", "VN", "VU", "WF", "WS", "XK", "YE", "YT", "ZA", "ZM", "ZW", "ZZ", ] ] """ An array of two-letter ISO country codes representing which countries Checkout should provide as options for shipping locations. Unsupported country codes: `AS, CX, CC, CU, HM, IR, KP, MH, FM, NF, MP, PW, SD, SY, UM, VI`. """ class CreateParamsShippingOption(TypedDict): shipping_rate: NotRequired[str] """ The ID of the Shipping Rate to use for this shipping option. """ shipping_rate_data: NotRequired[ "SessionService.CreateParamsShippingOptionShippingRateData" ] """ Parameters to be passed to Shipping Rate creation for this shipping option. """ class CreateParamsShippingOptionShippingRateData(TypedDict): delivery_estimate: NotRequired[ "SessionService.CreateParamsShippingOptionShippingRateDataDeliveryEstimate" ] """ The estimated range for how long shipping will take, meant to be displayable to the customer. This will appear on CheckoutSessions. """ display_name: str """ The name of the shipping rate, meant to be displayable to the customer. This will appear on CheckoutSessions. """ fixed_amount: NotRequired[ "SessionService.CreateParamsShippingOptionShippingRateDataFixedAmount" ] """ Describes a fixed amount to charge for shipping. Must be present if type is `fixed_amount`. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. """ tax_code: NotRequired[str] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. The Shipping tax code is `txcd_92010001`. """ type: NotRequired[Literal["fixed_amount"]] """ The type of calculation to use on the shipping rate. """ class CreateParamsShippingOptionShippingRateDataDeliveryEstimate( TypedDict ): maximum: NotRequired[ "SessionService.CreateParamsShippingOptionShippingRateDataDeliveryEstimateMaximum" ] """ The upper bound of the estimated range. If empty, represents no upper bound i.e., infinite. """ minimum: NotRequired[ "SessionService.CreateParamsShippingOptionShippingRateDataDeliveryEstimateMinimum" ] """ The lower bound of the estimated range. If empty, represents no lower bound. """ class CreateParamsShippingOptionShippingRateDataDeliveryEstimateMaximum( TypedDict, ): unit: Literal["business_day", "day", "hour", "month", "week"] """ A unit of time. """ value: int """ Must be greater than 0. """ class CreateParamsShippingOptionShippingRateDataDeliveryEstimateMinimum( TypedDict, ): unit: Literal["business_day", "day", "hour", "month", "week"] """ A unit of time. """ value: int """ Must be greater than 0. """ class CreateParamsShippingOptionShippingRateDataFixedAmount(TypedDict): amount: int """ A non-negative integer in cents representing how much to charge. """ 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). """ currency_options: NotRequired[ Dict[ str, "SessionService.CreateParamsShippingOptionShippingRateDataFixedAmountCurrencyOptions", ] ] """ Shipping rates defined in each available currency option. Each key must be a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html) and a [supported currency](https://stripe.com/docs/currencies). """ class CreateParamsShippingOptionShippingRateDataFixedAmountCurrencyOptions( TypedDict, ): amount: int """ A non-negative integer in cents representing how much to charge. """ tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "unspecified"] ] """ Specifies whether the rate is considered inclusive of taxes or exclusive of taxes. One of `inclusive`, `exclusive`, or `unspecified`. """ class CreateParamsSubscriptionData(TypedDict): application_fee_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the application owner's Stripe account. To use an application fee percent, the request must be made on behalf of another account, using the `Stripe-Account` header or an OAuth key. For more information, see the application fees [documentation](https://stripe.com/docs/connect/subscriptions#collecting-fees-on-subscriptions). """ billing_cycle_anchor: NotRequired[int] """ A future timestamp to anchor the subscription's billing cycle for new subscriptions. """ default_tax_rates: NotRequired[List[str]] """ The tax rates that will apply to any subscription item that does not have `tax_rates` set. Invoices created will have their `default_tax_rates` populated from the subscription. """ description: NotRequired[str] """ The subscription's description, meant to be displayable to the customer. Use this field to optionally store an explanation of the subscription for rendering in the [customer portal](https://stripe.com/docs/customer-management). """ invoice_settings: NotRequired[ "SessionService.CreateParamsSubscriptionDataInvoiceSettings" ] """ All invoices will be billed using the specified settings. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ on_behalf_of: NotRequired[str] """ The account on behalf of which to charge, for each of the subscription's invoices. """ proration_behavior: NotRequired[Literal["create_prorations", "none"]] """ Determines how to handle prorations resulting from the `billing_cycle_anchor`. If no value is passed, the default is `create_prorations`. """ transfer_data: NotRequired[ "SessionService.CreateParamsSubscriptionDataTransferData" ] """ If specified, the funds from the subscription's invoices will be transferred to the destination and the ID of the resulting transfers will be found on the resulting charges. """ trial_end: NotRequired[int] """ Unix timestamp representing the end of the trial period the customer will get before being charged for the first time. Has to be at least 48 hours in the future. """ trial_period_days: NotRequired[int] """ Integer representing the number of trial period days before the customer is charged for the first time. Has to be at least 1. """ trial_settings: NotRequired[ "SessionService.CreateParamsSubscriptionDataTrialSettings" ] """ Settings related to subscription trials. """ class CreateParamsSubscriptionDataInvoiceSettings(TypedDict): issuer: NotRequired[ "SessionService.CreateParamsSubscriptionDataInvoiceSettingsIssuer" ] """ The connected account that issues the invoice. The invoice is presented with the branding and support information of the specified account. """ class CreateParamsSubscriptionDataInvoiceSettingsIssuer(TypedDict): account: NotRequired[str] """ The connected account being referenced when `type` is `account`. """ type: Literal["account", "self"] """ Type of the account referenced in the request. """ class CreateParamsSubscriptionDataTransferData(TypedDict): amount_percent: NotRequired[float] """ A non-negative decimal between 0 and 100, with at most two decimal places. This represents the percentage of the subscription invoice total that will be transferred to the destination account. By default, the entire amount is transferred to the destination. """ destination: str """ ID of an existing, connected Stripe account. """ class CreateParamsSubscriptionDataTrialSettings(TypedDict): end_behavior: "SessionService.CreateParamsSubscriptionDataTrialSettingsEndBehavior" """ Defines how the subscription should behave when the user's free trial ends. """ class CreateParamsSubscriptionDataTrialSettingsEndBehavior(TypedDict): missing_payment_method: Literal["cancel", "create_invoice", "pause"] """ Indicates how the subscription should change when the trial ends if the user did not provide a payment method. """ class CreateParamsTaxIdCollection(TypedDict): enabled: bool """ Enable tax ID collection during checkout. Defaults to `false`. """ class ExpireParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ListParams(TypedDict): created: NotRequired["SessionService.ListParamsCreated|int"] """ Only return Checkout Sessions that were created during the given date interval. """ customer: NotRequired[str] """ Only return the Checkout Sessions for the Customer specified. """ customer_details: NotRequired[ "SessionService.ListParamsCustomerDetails" ] """ Only return the Checkout Sessions for the Customer details specified. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ payment_intent: NotRequired[str] """ Only return the Checkout Session for the PaymentIntent specified. """ payment_link: NotRequired[str] """ Only return the Checkout Sessions for the Payment Link specified. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[Literal["complete", "expired", "open"]] """ Only return the Checkout Sessions matching the given status. """ subscription: NotRequired[str] """ Only return the Checkout Session for the subscription specified. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsCustomerDetails(TypedDict): email: str """ Customer's email address. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def list( self, params: "SessionService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Session]: """ Returns a list of Checkout Sessions. """ return cast( ListObject[Session], self._request( "get", "/v1/checkout/sessions", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "SessionService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Session]: """ Returns a list of Checkout Sessions. """ return cast( ListObject[Session], await self._request_async( "get", "/v1/checkout/sessions", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "SessionService.CreateParams" = {}, options: RequestOptions = {}, ) -> Session: """ Creates a Session object. """ return cast( Session, self._request( "post", "/v1/checkout/sessions", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "SessionService.CreateParams" = {}, options: RequestOptions = {}, ) -> Session: """ Creates a Session object. """ return cast( Session, await self._request_async( "post", "/v1/checkout/sessions", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, session: str, params: "SessionService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Session: """ Retrieves a Session object. """ return cast( Session, self._request( "get", "/v1/checkout/sessions/{session}".format( session=sanitize_id(session), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, session: str, params: "SessionService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Session: """ Retrieves a Session object. """ return cast( Session, await self._request_async( "get", "/v1/checkout/sessions/{session}".format( session=sanitize_id(session), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def expire( self, session: str, params: "SessionService.ExpireParams" = {}, options: RequestOptions = {}, ) -> Session: """ A Session can be expired when it is in one of these statuses: open After it expires, a customer can't complete a Session and customers loading the Session see a message saying the Session is expired. """ return cast( Session, self._request( "post", "/v1/checkout/sessions/{session}/expire".format( session=sanitize_id(session), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def expire_async( self, session: str, params: "SessionService.ExpireParams" = {}, options: RequestOptions = {}, ) -> Session: """ A Session can be expired when it is in one of these statuses: open After it expires, a customer can't complete a Session and customers loading the Session see a message saying the Session is expired. """ return cast( Session, await self._request_async( "post", "/v1/checkout/sessions/{session}/expire".format( session=sanitize_id(session), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5329404 stripe-10.1.0/stripe/climate/0000755000175100001770000000000014637354616015447 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/climate/__init__.py0000644000175100001770000000070514637354563017563 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe.climate._order import Order as Order from stripe.climate._order_service import OrderService as OrderService from stripe.climate._product import Product as Product from stripe.climate._product_service import ProductService as ProductService from stripe.climate._supplier import Supplier as Supplier from stripe.climate._supplier_service import SupplierService as SupplierService ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/climate/_order.py0000644000175100001770000004552014637354563017302 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, Union, cast, overload from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe.climate._product import Product from stripe.climate._supplier import Supplier class Order( CreateableAPIResource["Order"], ListableAPIResource["Order"], UpdateableAPIResource["Order"], ): """ Orders represent your intent to purchase a particular Climate product. When you create an order, the payment is deducted from your merchant balance. """ OBJECT_NAME: ClassVar[Literal["climate.order"]] = "climate.order" class Beneficiary(StripeObject): public_name: str """ Publicly displayable name for the end beneficiary of carbon removal. """ class DeliveryDetail(StripeObject): class Location(StripeObject): city: Optional[str] """ The city where the supplier is located. """ country: str """ Two-letter ISO code representing the country where the supplier is located. """ latitude: Optional[float] """ The geographic latitude where the supplier is located. """ longitude: Optional[float] """ The geographic longitude where the supplier is located. """ region: Optional[str] """ The state/county/province/region where the supplier is located. """ delivered_at: int """ Time at which the delivery occurred. Measured in seconds since the Unix epoch. """ location: Optional[Location] """ Specific location of this delivery. """ metric_tons: str """ Quantity of carbon removal supplied by this delivery. """ registry_url: Optional[str] """ Once retired, a URL to the registry entry for the tons from this delivery. """ supplier: "Supplier" """ A supplier of carbon removal. """ _inner_class_types = {"location": Location} class CancelParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CreateParams(RequestOptions): amount: NotRequired[int] """ Requested amount of carbon removal units. Either this or `metric_tons` must be specified. """ beneficiary: NotRequired["Order.CreateParamsBeneficiary"] """ Publicly sharable reference for the end beneficiary of carbon removal. Assumed to be the Stripe account if not set. """ currency: NotRequired[str] """ Request currency for the order as a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a supported [settlement currency for your account](https://stripe.com/docs/currencies). If omitted, the account's default currency will be used. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ metric_tons: NotRequired[str] """ Requested number of tons for the order. Either this or `amount` must be specified. """ product: str """ Unique identifier of the Climate product. """ class CreateParamsBeneficiary(TypedDict): public_name: str """ Publicly displayable name for the end beneficiary of carbon removal. """ class ListParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ModifyParams(RequestOptions): beneficiary: NotRequired["Literal['']|Order.ModifyParamsBeneficiary"] """ Publicly sharable reference for the end beneficiary of carbon removal. Assumed to be the Stripe account if not set. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ class ModifyParamsBeneficiary(TypedDict): public_name: Union[Literal[""], str] """ Publicly displayable name for the end beneficiary of carbon removal. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ amount_fees: int """ Total amount of [Frontier](https://frontierclimate.com/)'s service fees in the currency's smallest unit. """ amount_subtotal: int """ Total amount of the carbon removal in the currency's smallest unit. """ amount_total: int """ Total amount of the order including fees in the currency's smallest unit. """ beneficiary: Optional[Beneficiary] canceled_at: Optional[int] """ Time at which the order was canceled. Measured in seconds since the Unix epoch. """ cancellation_reason: Optional[ Literal["expired", "product_unavailable", "requested"] ] """ Reason for the cancellation of this order. """ certificate: Optional[str] """ For delivered orders, a URL to a delivery certificate for the order. """ confirmed_at: Optional[int] """ Time at which the order was confirmed. Measured in seconds since the Unix epoch. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ currency: str """ Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase, representing the currency for this order. """ delayed_at: Optional[int] """ Time at which the order's expected_delivery_year was delayed. Measured in seconds since the Unix epoch. """ delivered_at: Optional[int] """ Time at which the order was delivered. Measured in seconds since the Unix epoch. """ delivery_details: List[DeliveryDetail] """ Details about the delivery of carbon removal for this order. """ expected_delivery_year: int """ The year this order is expected to be delivered. """ id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ metadata: Dict[str, str] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ metric_tons: str """ Quantity of carbon removal that is included in this order. """ object: Literal["climate.order"] """ String representing the object's type. Objects of the same type share the same value. """ product: ExpandableField["Product"] """ Unique ID for the Climate `Product` this order is purchasing. """ product_substituted_at: Optional[int] """ Time at which the order's product was substituted for a different product. Measured in seconds since the Unix epoch. """ status: Literal[ "awaiting_funds", "canceled", "confirmed", "delivered", "open" ] """ The current status of this order. """ @classmethod def _cls_cancel( cls, order: str, **params: Unpack["Order.CancelParams"] ) -> "Order": """ Cancels a Climate order. You can cancel an order within 24 hours of creation. Stripe refunds the reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe provides 90 days advance notice and refunds the amount_total. """ return cast( "Order", cls._static_request( "post", "/v1/climate/orders/{order}/cancel".format( order=sanitize_id(order) ), params=params, ), ) @overload @staticmethod def cancel(order: str, **params: Unpack["Order.CancelParams"]) -> "Order": """ Cancels a Climate order. You can cancel an order within 24 hours of creation. Stripe refunds the reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe provides 90 days advance notice and refunds the amount_total. """ ... @overload def cancel(self, **params: Unpack["Order.CancelParams"]) -> "Order": """ Cancels a Climate order. You can cancel an order within 24 hours of creation. Stripe refunds the reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe provides 90 days advance notice and refunds the amount_total. """ ... @class_method_variant("_cls_cancel") def cancel( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Order.CancelParams"] ) -> "Order": """ Cancels a Climate order. You can cancel an order within 24 hours of creation. Stripe refunds the reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe provides 90 days advance notice and refunds the amount_total. """ return cast( "Order", self._request( "post", "/v1/climate/orders/{order}/cancel".format( order=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_cancel_async( cls, order: str, **params: Unpack["Order.CancelParams"] ) -> "Order": """ Cancels a Climate order. You can cancel an order within 24 hours of creation. Stripe refunds the reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe provides 90 days advance notice and refunds the amount_total. """ return cast( "Order", await cls._static_request_async( "post", "/v1/climate/orders/{order}/cancel".format( order=sanitize_id(order) ), params=params, ), ) @overload @staticmethod async def cancel_async( order: str, **params: Unpack["Order.CancelParams"] ) -> "Order": """ Cancels a Climate order. You can cancel an order within 24 hours of creation. Stripe refunds the reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe provides 90 days advance notice and refunds the amount_total. """ ... @overload async def cancel_async( self, **params: Unpack["Order.CancelParams"] ) -> "Order": """ Cancels a Climate order. You can cancel an order within 24 hours of creation. Stripe refunds the reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe provides 90 days advance notice and refunds the amount_total. """ ... @class_method_variant("_cls_cancel_async") async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Order.CancelParams"] ) -> "Order": """ Cancels a Climate order. You can cancel an order within 24 hours of creation. Stripe refunds the reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe provides 90 days advance notice and refunds the amount_total. """ return cast( "Order", await self._request_async( "post", "/v1/climate/orders/{order}/cancel".format( order=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def create(cls, **params: Unpack["Order.CreateParams"]) -> "Order": """ Creates a Climate order object for a given Climate product. The order will be processed immediately after creation and payment will be deducted your Stripe balance. """ return cast( "Order", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["Order.CreateParams"] ) -> "Order": """ Creates a Climate order object for a given Climate product. The order will be processed immediately after creation and payment will be deducted your Stripe balance. """ return cast( "Order", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def list(cls, **params: Unpack["Order.ListParams"]) -> ListObject["Order"]: """ Lists all Climate order objects. The orders are returned sorted by creation date, with the most recently created orders appearing first. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["Order.ListParams"] ) -> ListObject["Order"]: """ Lists all Climate order objects. The orders are returned sorted by creation date, with the most recently created orders appearing first. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def modify( cls, id: str, **params: Unpack["Order.ModifyParams"] ) -> "Order": """ Updates the specified order by setting the values of the parameters passed. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Order", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["Order.ModifyParams"] ) -> "Order": """ Updates the specified order by setting the values of the parameters passed. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Order", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["Order.RetrieveParams"] ) -> "Order": """ Retrieves the details of a Climate order object with the given ID. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["Order.RetrieveParams"] ) -> "Order": """ Retrieves the details of a Climate order object with the given ID. """ instance = cls(id, **params) await instance.refresh_async() return instance _inner_class_types = { "beneficiary": Beneficiary, "delivery_details": DeliveryDetail, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/climate/_order_service.py0000644000175100001770000002610514637354563021020 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.climate._order import Order from typing import Dict, List, Union, cast from typing_extensions import Literal, NotRequired, TypedDict class OrderService(StripeService): class CancelParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CreateParams(TypedDict): amount: NotRequired[int] """ Requested amount of carbon removal units. Either this or `metric_tons` must be specified. """ beneficiary: NotRequired["OrderService.CreateParamsBeneficiary"] """ Publicly sharable reference for the end beneficiary of carbon removal. Assumed to be the Stripe account if not set. """ currency: NotRequired[str] """ Request currency for the order as a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Must be a supported [settlement currency for your account](https://stripe.com/docs/currencies). If omitted, the account's default currency will be used. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ metric_tons: NotRequired[str] """ Requested number of tons for the order. Either this or `amount` must be specified. """ product: str """ Unique identifier of the Climate product. """ class CreateParamsBeneficiary(TypedDict): public_name: str """ Publicly displayable name for the end beneficiary of carbon removal. """ class ListParams(TypedDict): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): beneficiary: NotRequired[ "Literal['']|OrderService.UpdateParamsBeneficiary" ] """ Publicly sharable reference for the end beneficiary of carbon removal. Assumed to be the Stripe account if not set. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ class UpdateParamsBeneficiary(TypedDict): public_name: Union[Literal[""], str] """ Publicly displayable name for the end beneficiary of carbon removal. """ def list( self, params: "OrderService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Order]: """ Lists all Climate order objects. The orders are returned sorted by creation date, with the most recently created orders appearing first. """ return cast( ListObject[Order], self._request( "get", "/v1/climate/orders", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "OrderService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Order]: """ Lists all Climate order objects. The orders are returned sorted by creation date, with the most recently created orders appearing first. """ return cast( ListObject[Order], await self._request_async( "get", "/v1/climate/orders", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "OrderService.CreateParams", options: RequestOptions = {} ) -> Order: """ Creates a Climate order object for a given Climate product. The order will be processed immediately after creation and payment will be deducted your Stripe balance. """ return cast( Order, self._request( "post", "/v1/climate/orders", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "OrderService.CreateParams", options: RequestOptions = {} ) -> Order: """ Creates a Climate order object for a given Climate product. The order will be processed immediately after creation and payment will be deducted your Stripe balance. """ return cast( Order, await self._request_async( "post", "/v1/climate/orders", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, order: str, params: "OrderService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Order: """ Retrieves the details of a Climate order object with the given ID. """ return cast( Order, self._request( "get", "/v1/climate/orders/{order}".format(order=sanitize_id(order)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, order: str, params: "OrderService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Order: """ Retrieves the details of a Climate order object with the given ID. """ return cast( Order, await self._request_async( "get", "/v1/climate/orders/{order}".format(order=sanitize_id(order)), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, order: str, params: "OrderService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Order: """ Updates the specified order by setting the values of the parameters passed. """ return cast( Order, self._request( "post", "/v1/climate/orders/{order}".format(order=sanitize_id(order)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, order: str, params: "OrderService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Order: """ Updates the specified order by setting the values of the parameters passed. """ return cast( Order, await self._request_async( "post", "/v1/climate/orders/{order}".format(order=sanitize_id(order)), api_mode="V1", base_address="api", params=params, options=options, ), ) def cancel( self, order: str, params: "OrderService.CancelParams" = {}, options: RequestOptions = {}, ) -> Order: """ Cancels a Climate order. You can cancel an order within 24 hours of creation. Stripe refunds the reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe provides 90 days advance notice and refunds the amount_total. """ return cast( Order, self._request( "post", "/v1/climate/orders/{order}/cancel".format( order=sanitize_id(order), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def cancel_async( self, order: str, params: "OrderService.CancelParams" = {}, options: RequestOptions = {}, ) -> Order: """ Cancels a Climate order. You can cancel an order within 24 hours of creation. Stripe refunds the reservation amount_subtotal, but not the amount_fees for user-triggered cancellations. Frontier might cancel reservations if suppliers fail to deliver. If Frontier cancels the reservation, Stripe provides 90 days advance notice and refunds the amount_total. """ return cast( Order, await self._request_async( "post", "/v1/climate/orders/{order}/cancel".format( order=sanitize_id(order), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/climate/_product.py0000644000175100001770000001276314637354563017652 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from typing import ClassVar, Dict, List, Optional from typing_extensions import Literal, NotRequired, Unpack, TYPE_CHECKING if TYPE_CHECKING: from stripe.climate._supplier import Supplier class Product(ListableAPIResource["Product"]): """ A Climate product represents a type of carbon removal unit available for reservation. You can retrieve it to see the current price and availability. """ OBJECT_NAME: ClassVar[Literal["climate.product"]] = "climate.product" class CurrentPricesPerMetricTon(StripeObject): amount_fees: int """ Fees for one metric ton of carbon removal in the currency's smallest unit. """ amount_subtotal: int """ Subtotal for one metric ton of carbon removal (excluding fees) in the currency's smallest unit. """ amount_total: int """ Total for one metric ton of carbon removal (including fees) in the currency's smallest unit. """ class ListParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ current_prices_per_metric_ton: Dict[str, CurrentPricesPerMetricTon] """ Current prices for a metric ton of carbon removal in a currency's smallest unit. """ delivery_year: Optional[int] """ The year in which the carbon removal is expected to be delivered. """ id: str """ Unique identifier for the object. For convenience, Climate product IDs are human-readable strings that start with `climsku_`. See [carbon removal inventory](https://stripe.com/docs/climate/orders/carbon-removal-inventory) for a list of available carbon removal products. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ metric_tons_available: str """ The quantity of metric tons available for reservation. """ name: str """ The Climate product's name. """ object: Literal["climate.product"] """ String representing the object's type. Objects of the same type share the same value. """ suppliers: List["Supplier"] """ The carbon removal suppliers that fulfill orders for this Climate product. """ @classmethod def list( cls, **params: Unpack["Product.ListParams"] ) -> ListObject["Product"]: """ Lists all available Climate product objects. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["Product.ListParams"] ) -> ListObject["Product"]: """ Lists all available Climate product objects. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def retrieve( cls, id: str, **params: Unpack["Product.RetrieveParams"] ) -> "Product": """ Retrieves the details of a Climate product with the given ID. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["Product.RetrieveParams"] ) -> "Product": """ Retrieves the details of a Climate product with the given ID. """ instance = cls(id, **params) await instance.refresh_async() return instance _inner_class_types = { "current_prices_per_metric_ton": CurrentPricesPerMetricTon, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/climate/_product_service.py0000644000175100001770000000765214637354563021373 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.climate._product import Product from typing import List, cast from typing_extensions import NotRequired, TypedDict class ProductService(StripeService): class ListParams(TypedDict): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def list( self, params: "ProductService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Product]: """ Lists all available Climate product objects. """ return cast( ListObject[Product], self._request( "get", "/v1/climate/products", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "ProductService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Product]: """ Lists all available Climate product objects. """ return cast( ListObject[Product], await self._request_async( "get", "/v1/climate/products", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, product: str, params: "ProductService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Product: """ Retrieves the details of a Climate product with the given ID. """ return cast( Product, self._request( "get", "/v1/climate/products/{product}".format( product=sanitize_id(product), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, product: str, params: "ProductService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Product: """ Retrieves the details of a Climate product with the given ID. """ return cast( Product, await self._request_async( "get", "/v1/climate/products/{product}".format( product=sanitize_id(product), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/climate/_supplier.py0000644000175100001770000001156614637354563020035 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from typing import ClassVar, List, Optional from typing_extensions import Literal, NotRequired, Unpack class Supplier(ListableAPIResource["Supplier"]): """ A supplier of carbon removal. """ OBJECT_NAME: ClassVar[Literal["climate.supplier"]] = "climate.supplier" class Location(StripeObject): city: Optional[str] """ The city where the supplier is located. """ country: str """ Two-letter ISO code representing the country where the supplier is located. """ latitude: Optional[float] """ The geographic latitude where the supplier is located. """ longitude: Optional[float] """ The geographic longitude where the supplier is located. """ region: Optional[str] """ The state/county/province/region where the supplier is located. """ class ListParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ id: str """ Unique identifier for the object. """ info_url: str """ Link to a webpage to learn more about the supplier. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ locations: List[Location] """ The locations in which this supplier operates. """ name: str """ Name of this carbon removal supplier. """ object: Literal["climate.supplier"] """ String representing the object's type. Objects of the same type share the same value. """ removal_pathway: Literal[ "biomass_carbon_removal_and_storage", "direct_air_capture", "enhanced_weathering", ] """ The scientific pathway used for carbon removal. """ @classmethod def list( cls, **params: Unpack["Supplier.ListParams"] ) -> ListObject["Supplier"]: """ Lists all available Climate supplier objects. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["Supplier.ListParams"] ) -> ListObject["Supplier"]: """ Lists all available Climate supplier objects. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def retrieve( cls, id: str, **params: Unpack["Supplier.RetrieveParams"] ) -> "Supplier": """ Retrieves a Climate supplier object. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["Supplier.RetrieveParams"] ) -> "Supplier": """ Retrieves a Climate supplier object. """ instance = cls(id, **params) await instance.refresh_async() return instance _inner_class_types = {"locations": Location} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/climate/_supplier_service.py0000644000175100001770000000762514637354563021556 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.climate._supplier import Supplier from typing import List, cast from typing_extensions import NotRequired, TypedDict class SupplierService(StripeService): class ListParams(TypedDict): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def list( self, params: "SupplierService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Supplier]: """ Lists all available Climate supplier objects. """ return cast( ListObject[Supplier], self._request( "get", "/v1/climate/suppliers", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "SupplierService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Supplier]: """ Lists all available Climate supplier objects. """ return cast( ListObject[Supplier], await self._request_async( "get", "/v1/climate/suppliers", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, supplier: str, params: "SupplierService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Supplier: """ Retrieves a Climate supplier object. """ return cast( Supplier, self._request( "get", "/v1/climate/suppliers/{supplier}".format( supplier=sanitize_id(supplier), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, supplier: str, params: "SupplierService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Supplier: """ Retrieves a Climate supplier object. """ return cast( Supplier, await self._request_async( "get", "/v1/climate/suppliers/{supplier}".format( supplier=sanitize_id(supplier), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5329404 stripe-10.1.0/stripe/data/0000755000175100001770000000000014637354616014742 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/data/ca-certificates.crt0000644000175100001770000064447014637354563020522 0ustar00runnerdocker## ## Bundle of CA Root Certificates ## ## Certificate data from Mozilla as of: Tue Apr 26 03:12:05 2022 GMT ## ## This is a bundle of X.509 certificates of public Certificate Authorities ## (CA). These were automatically extracted from Mozilla's root certificates ## file (certdata.txt). This file can be found in the mozilla source tree: ## https://hg.mozilla.org/releases/mozilla-release/raw-file/default/security/nss/lib/ckfw/builtins/certdata.txt ## ## It contains the certificates in PEM format and therefore ## can be directly used with curl / libcurl / php_curl, or with ## an Apache+mod_ssl webserver for SSL client authentication. ## Just configure this file as the SSLCACertificateFile. ## ## Conversion done with mk-ca-bundle.pl version 1.29. ## SHA256: 34a54d5191775c1bd37be6cfd3f09e831e072555dc3a2e51f4a2c4b0f8ada5cc ## GlobalSign Root CA ================== -----BEGIN CERTIFICATE----- MIIDdTCCAl2gAwIBAgILBAAAAAABFUtaw5QwDQYJKoZIhvcNAQEFBQAwVzELMAkGA1UEBhMCQkUx GTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExEDAOBgNVBAsTB1Jvb3QgQ0ExGzAZBgNVBAMTEkds b2JhbFNpZ24gUm9vdCBDQTAeFw05ODA5MDExMjAwMDBaFw0yODAxMjgxMjAwMDBaMFcxCzAJBgNV BAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMRAwDgYDVQQLEwdSb290IENBMRswGQYD VQQDExJHbG9iYWxTaWduIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDa DuaZjc6j40+Kfvvxi4Mla+pIH/EqsLmVEQS98GPR4mdmzxzdzxtIK+6NiY6arymAZavpxy0Sy6sc THAHoT0KMM0VjU/43dSMUBUc71DuxC73/OlS8pF94G3VNTCOXkNz8kHp1Wrjsok6Vjk4bwY8iGlb Kk3Fp1S4bInMm/k8yuX9ifUSPJJ4ltbcdG6TRGHRjcdGsnUOhugZitVtbNV4FpWi6cgKOOvyJBNP c1STE4U6G7weNLWLBYy5d4ux2x8gkasJU26Qzns3dLlwR5EiUWMWea6xrkEmCMgZK9FGqkjWZCrX gzT/LCrBbBlDSgeF59N89iFo7+ryUp9/k5DPAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNV HRMBAf8EBTADAQH/MB0GA1UdDgQWBBRge2YaRQ2XyolQL30EzTSo//z9SzANBgkqhkiG9w0BAQUF AAOCAQEA1nPnfE920I2/7LqivjTFKDK1fPxsnCwrvQmeU79rXqoRSLblCKOzyj1hTdNGCbM+w6Dj Y1Ub8rrvrTnhQ7k4o+YviiY776BQVvnGCv04zcQLcFGUl5gE38NflNUVyRRBnMRddWQVDf9VMOyG j/8N7yy5Y0b2qvzfvGn9LhJIZJrglfCm7ymPAbEVtQwdpf5pLGkkeB6zpxxxYu7KyJesF12KwvhH hm4qxFYxldBniYUr+WymXUadDKqC5JlR3XC321Y9YeRq4VzW9v493kHMB65jUr9TU/Qr6cf9tveC X4XSQRjbgbMEHMUfpIBvFSDJ3gyICh3WZlXi/EjJKSZp4A== -----END CERTIFICATE----- Entrust.net Premium 2048 Secure Server CA ========================================= -----BEGIN CERTIFICATE----- MIIEKjCCAxKgAwIBAgIEOGPe+DANBgkqhkiG9w0BAQUFADCBtDEUMBIGA1UEChMLRW50cnVzdC5u ZXQxQDA+BgNVBAsUN3d3dy5lbnRydXN0Lm5ldC9DUFNfMjA0OCBpbmNvcnAuIGJ5IHJlZi4gKGxp bWl0cyBsaWFiLikxJTAjBgNVBAsTHChjKSAxOTk5IEVudHJ1c3QubmV0IExpbWl0ZWQxMzAxBgNV BAMTKkVudHJ1c3QubmV0IENlcnRpZmljYXRpb24gQXV0aG9yaXR5ICgyMDQ4KTAeFw05OTEyMjQx NzUwNTFaFw0yOTA3MjQxNDE1MTJaMIG0MRQwEgYDVQQKEwtFbnRydXN0Lm5ldDFAMD4GA1UECxQ3 d3d3LmVudHJ1c3QubmV0L0NQU18yMDQ4IGluY29ycC4gYnkgcmVmLiAobGltaXRzIGxpYWIuKTEl MCMGA1UECxMcKGMpIDE5OTkgRW50cnVzdC5uZXQgTGltaXRlZDEzMDEGA1UEAxMqRW50cnVzdC5u ZXQgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgKDIwNDgpMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A MIIBCgKCAQEArU1LqRKGsuqjIAcVFmQqK0vRvwtKTY7tgHalZ7d4QMBzQshowNtTK91euHaYNZOL Gp18EzoOH1u3Hs/lJBQesYGpjX24zGtLA/ECDNyrpUAkAH90lKGdCCmziAv1h3edVc3kw37XamSr hRSGlVuXMlBvPci6Zgzj/L24ScF2iUkZ/cCovYmjZy/Gn7xxGWC4LeksyZB2ZnuU4q941mVTXTzW nLLPKQP5L6RQstRIzgUyVYr9smRMDuSYB3Xbf9+5CFVghTAp+XtIpGmG4zU/HoZdenoVve8AjhUi VBcAkCaTvA5JaJG/+EfTnZVCwQ5N328mz8MYIWJmQ3DW1cAH4QIDAQABo0IwQDAOBgNVHQ8BAf8E BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUVeSB0RGAvtiJuQijMfmhJAkWuXAwDQYJ KoZIhvcNAQEFBQADggEBADubj1abMOdTmXx6eadNl9cZlZD7Bh/KM3xGY4+WZiT6QBshJ8rmcnPy T/4xmf3IDExoU8aAghOY+rat2l098c5u9hURlIIM7j+VrxGrD9cv3h8Dj1csHsm7mhpElesYT6Yf zX1XEC+bBAlahLVu2B064dae0Wx5XnkcFMXj0EyTO2U87d89vqbllRrDtRnDvV5bu/8j72gZyxKT J1wDLW8w0B62GqzeWvfRqqgnpv55gcR5mTNXuhKwqeBCbJPKVt7+bYQLCIt+jerXmCHG8+c8eS9e nNFMFY3h7CI3zJpDC5fcgJCNs2ebb0gIFVbPv/ErfF6adulZkMV8gzURZVE= -----END CERTIFICATE----- Baltimore CyberTrust Root ========================= -----BEGIN CERTIFICATE----- MIIDdzCCAl+gAwIBAgIEAgAAuTANBgkqhkiG9w0BAQUFADBaMQswCQYDVQQGEwJJRTESMBAGA1UE ChMJQmFsdGltb3JlMRMwEQYDVQQLEwpDeWJlclRydXN0MSIwIAYDVQQDExlCYWx0aW1vcmUgQ3li ZXJUcnVzdCBSb290MB4XDTAwMDUxMjE4NDYwMFoXDTI1MDUxMjIzNTkwMFowWjELMAkGA1UEBhMC SUUxEjAQBgNVBAoTCUJhbHRpbW9yZTETMBEGA1UECxMKQ3liZXJUcnVzdDEiMCAGA1UEAxMZQmFs dGltb3JlIEN5YmVyVHJ1c3QgUm9vdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKME uyKrmD1X6CZymrV51Cni4eiVgLGw41uOKymaZN+hXe2wCQVt2yguzmKiYv60iNoS6zjrIZ3AQSsB UnuId9Mcj8e6uYi1agnnc+gRQKfRzMpijS3ljwumUNKoUMMo6vWrJYeKmpYcqWe4PwzV9/lSEy/C G9VwcPCPwBLKBsua4dnKM3p31vjsufFoREJIE9LAwqSuXmD+tqYF/LTdB1kC1FkYmGP1pWPgkAx9 XbIGevOF6uvUA65ehD5f/xXtabz5OTZydc93Uk3zyZAsuT3lySNTPx8kmCFcB5kpvcY67Oduhjpr l3RjM71oGDHweI12v/yejl0qhqdNkNwnGjkCAwEAAaNFMEMwHQYDVR0OBBYEFOWdWTCCR1jMrPoI VDaGezq1BE3wMBIGA1UdEwEB/wQIMAYBAf8CAQMwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEB BQUAA4IBAQCFDF2O5G9RaEIFoN27TyclhAO992T9Ldcw46QQF+vaKSm2eT929hkTI7gQCvlYpNRh cL0EYWoSihfVCr3FvDB81ukMJY2GQE/szKN+OMY3EU/t3WgxjkzSswF07r51XgdIGn9w/xZchMB5 hbgF/X++ZRGjD8ACtPhSNzkE1akxehi/oCr0Epn3o0WC4zxe9Z2etciefC7IpJ5OCBRLbf1wbWsa Y71k5h+3zvDyny67G7fyUIhzksLi4xaNmjICq44Y3ekQEe5+NauQrz4wlHrQMz2nZQ/1/I6eYs9H RCwBXbsdtTLSR9I4LtD+gdwyah617jzV/OeBHRnDJELqYzmp -----END CERTIFICATE----- Entrust Root Certification Authority ==================================== -----BEGIN CERTIFICATE----- MIIEkTCCA3mgAwIBAgIERWtQVDANBgkqhkiG9w0BAQUFADCBsDELMAkGA1UEBhMCVVMxFjAUBgNV BAoTDUVudHJ1c3QsIEluYy4xOTA3BgNVBAsTMHd3dy5lbnRydXN0Lm5ldC9DUFMgaXMgaW5jb3Jw b3JhdGVkIGJ5IHJlZmVyZW5jZTEfMB0GA1UECxMWKGMpIDIwMDYgRW50cnVzdCwgSW5jLjEtMCsG A1UEAxMkRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTA2MTEyNzIwMjM0 MloXDTI2MTEyNzIwNTM0MlowgbAxCzAJBgNVBAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMu MTkwNwYDVQQLEzB3d3cuZW50cnVzdC5uZXQvQ1BTIGlzIGluY29ycG9yYXRlZCBieSByZWZlcmVu Y2UxHzAdBgNVBAsTFihjKSAyMDA2IEVudHJ1c3QsIEluYy4xLTArBgNVBAMTJEVudHJ1c3QgUm9v dCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB ALaVtkNC+sZtKm9I35RMOVcF7sN5EUFoNu3s/poBj6E4KPz3EEZmLk0eGrEaTsbRwJWIsMn/MYsz A9u3g3s+IIRe7bJWKKf44LlAcTfFy0cOlypowCKVYhXbR9n10Cv/gkvJrT7eTNuQgFA/CYqEAOww Cj0Yzfv9KlmaI5UXLEWeH25DeW0MXJj+SKfFI0dcXv1u5x609mhF0YaDW6KKjbHjKYD+JXGIrb68 j6xSlkuqUY3kEzEZ6E5Nn9uss2rVvDlUccp6en+Q3X0dgNmBu1kmwhH+5pPi94DkZfs0Nw4pgHBN rziGLp5/V6+eF67rHMsoIV+2HNjnogQi+dPa2MsCAwEAAaOBsDCBrTAOBgNVHQ8BAf8EBAMCAQYw DwYDVR0TAQH/BAUwAwEB/zArBgNVHRAEJDAigA8yMDA2MTEyNzIwMjM0MlqBDzIwMjYxMTI3MjA1 MzQyWjAfBgNVHSMEGDAWgBRokORnpKZTgMeGZqTx90tD+4S9bTAdBgNVHQ4EFgQUaJDkZ6SmU4DH hmak8fdLQ/uEvW0wHQYJKoZIhvZ9B0EABBAwDhsIVjcuMTo0LjADAgSQMA0GCSqGSIb3DQEBBQUA A4IBAQCT1DCw1wMgKtD5Y+iRDAUgqV8ZyntyTtSx29CW+1RaGSwMCPeyvIWonX9tO1KzKtvn1ISM Y/YPyyYBkVBs9F8U4pN0wBOeMDpQ47RgxRzwIkSNcUesyBrJ6ZuaAGAT/3B+XxFNSRuzFVJ7yVTa v52Vr2ua2J7p8eRDjeIRRDq/r72DQnNSi6q7pynP9WQcCk3RvKqsnyrQ/39/2n3qse0wJcGE2jTS W3iDVuycNsMm4hH2Z0kdkquM++v/eu6FSqdQgPCnXEqULl8FmTxSQeDNtGPPAUO6nIPcj2A781q0 tHuu2guQOHXvgR1m0vdXcDazv/wor3ElhVsT/h5/WrQ8 -----END CERTIFICATE----- Comodo AAA Services root ======================== -----BEGIN CERTIFICATE----- MIIEMjCCAxqgAwIBAgIBATANBgkqhkiG9w0BAQUFADB7MQswCQYDVQQGEwJHQjEbMBkGA1UECAwS R3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHDAdTYWxmb3JkMRowGAYDVQQKDBFDb21vZG8gQ0Eg TGltaXRlZDEhMB8GA1UEAwwYQUFBIENlcnRpZmljYXRlIFNlcnZpY2VzMB4XDTA0MDEwMTAwMDAw MFoXDTI4MTIzMTIzNTk1OVowezELMAkGA1UEBhMCR0IxGzAZBgNVBAgMEkdyZWF0ZXIgTWFuY2hl c3RlcjEQMA4GA1UEBwwHU2FsZm9yZDEaMBgGA1UECgwRQ29tb2RvIENBIExpbWl0ZWQxITAfBgNV BAMMGEFBQSBDZXJ0aWZpY2F0ZSBTZXJ2aWNlczCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC ggEBAL5AnfRu4ep2hxxNRUSOvkbIgwadwSr+GB+O5AL686tdUIoWMQuaBtDFcCLNSS1UY8y2bmhG C1Pqy0wkwLxyTurxFa70VJoSCsN6sjNg4tqJVfMiWPPe3M/vg4aijJRPn2jymJBGhCfHdr/jzDUs i14HZGWCwEiwqJH5YZ92IFCokcdmtet4YgNW8IoaE+oxox6gmf049vYnMlhvB/VruPsUK6+3qszW Y19zjNoFmag4qMsXeDZRrOme9Hg6jc8P2ULimAyrL58OAd7vn5lJ8S3frHRNG5i1R8XlKdH5kBjH Ypy+g8cmez6KJcfA3Z3mNWgQIJ2P2N7Sw4ScDV7oL8kCAwEAAaOBwDCBvTAdBgNVHQ4EFgQUoBEK Iz6W8Qfs4q8p74Klf9AwpLQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wewYDVR0f BHQwcjA4oDagNIYyaHR0cDovL2NybC5jb21vZG9jYS5jb20vQUFBQ2VydGlmaWNhdGVTZXJ2aWNl cy5jcmwwNqA0oDKGMGh0dHA6Ly9jcmwuY29tb2RvLm5ldC9BQUFDZXJ0aWZpY2F0ZVNlcnZpY2Vz LmNybDANBgkqhkiG9w0BAQUFAAOCAQEACFb8AvCb6P+k+tZ7xkSAzk/ExfYAWMymtrwUSWgEdujm 7l3sAg9g1o1QGE8mTgHj5rCl7r+8dFRBv/38ErjHT1r0iWAFf2C3BUrz9vHCv8S5dIa2LX1rzNLz Rt0vxuBqw8M0Ayx9lt1awg6nCpnBBYurDC/zXDrPbDdVCYfeU0BsWO/8tqtlbgT2G9w84FoVxp7Z 8VlIMCFlA2zs6SFz7JsDoeA3raAVGI/6ugLOpyypEBMs1OUIJqsil2D4kF501KKaU73yqWjgom7C 12yxow+ev+to51byrvLjKzg6CYG1a4XXvi3tPxq3smPi9WIsgtRqAEFQ8TmDn5XpNpaYbg== -----END CERTIFICATE----- QuoVadis Root CA 2 ================== -----BEGIN CERTIFICATE----- MIIFtzCCA5+gAwIBAgICBQkwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoT EFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJvb3QgQ0EgMjAeFw0wNjExMjQx ODI3MDBaFw0zMTExMjQxODIzMzNaMEUxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM aW1pdGVkMRswGQYDVQQDExJRdW9WYWRpcyBSb290IENBIDIwggIiMA0GCSqGSIb3DQEBAQUAA4IC DwAwggIKAoICAQCaGMpLlA0ALa8DKYrwD4HIrkwZhR0In6spRIXzL4GtMh6QRr+jhiYaHv5+HBg6 XJxgFyo6dIMzMH1hVBHL7avg5tKifvVrbxi3Cgst/ek+7wrGsxDp3MJGF/hd/aTa/55JWpzmM+Yk lvc/ulsrHHo1wtZn/qtmUIttKGAr79dgw8eTvI02kfN/+NsRE8Scd3bBrrcCaoF6qUWD4gXmuVbB lDePSHFjIuwXZQeVikvfj8ZaCuWw419eaxGrDPmF60Tp+ARz8un+XJiM9XOva7R+zdRcAitMOeGy lZUtQofX1bOQQ7dsE/He3fbE+Ik/0XX1ksOR1YqI0JDs3G3eicJlcZaLDQP9nL9bFqyS2+r+eXyt 66/3FsvbzSUr5R/7mp/iUcw6UwxI5g69ybR2BlLmEROFcmMDBOAENisgGQLodKcftslWZvB1Jdxn wQ5hYIizPtGo/KPaHbDRsSNU30R2be1B2MGyIrZTHN81Hdyhdyox5C315eXbyOD/5YDXC2Og/zOh D7osFRXql7PSorW+8oyWHhqPHWykYTe5hnMz15eWniN9gqRMgeKh0bpnX5UHoycR7hYQe7xFSkyy BNKr79X9DFHOUGoIMfmR2gyPZFwDwzqLID9ujWc9Otb+fVuIyV77zGHcizN300QyNQliBJIWENie J0f7OyHj+OsdWwIDAQABo4GwMIGtMA8GA1UdEwEB/wQFMAMBAf8wCwYDVR0PBAQDAgEGMB0GA1Ud DgQWBBQahGK8SEwzJQTU7tD2A8QZRtGUazBuBgNVHSMEZzBlgBQahGK8SEwzJQTU7tD2A8QZRtGU a6FJpEcwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMT ElF1b1ZhZGlzIFJvb3QgQ0EgMoICBQkwDQYJKoZIhvcNAQEFBQADggIBAD4KFk2fBluornFdLwUv Z+YTRYPENvbzwCYMDbVHZF34tHLJRqUDGCdViXh9duqWNIAXINzng/iN/Ae42l9NLmeyhP3ZRPx3 UIHmfLTJDQtyU/h2BwdBR5YM++CCJpNVjP4iH2BlfF/nJrP3MpCYUNQ3cVX2kiF495V5+vgtJodm VjB3pjd4M1IQWK4/YY7yarHvGH5KWWPKjaJW1acvvFYfzznB4vsKqBUsfU16Y8Zsl0Q80m/DShcK +JDSV6IZUaUtl0HaB0+pUNqQjZRG4T7wlP0QADj1O+hA4bRuVhogzG9Yje0uRY/W6ZM/57Es3zrW IozchLsib9D45MY56QSIPMO661V6bYCZJPVsAfv4l7CUW+v90m/xd2gNNWQjrLhVoQPRTUIZ3Ph1 WVaj+ahJefivDrkRoHy3au000LYmYjgahwz46P0u05B/B5EqHdZ+XIWDmbA4CD/pXvk1B+TJYm5X f6dQlfe6yJvmjqIBxdZmv3lh8zwc4bmCXF2gw+nYSL0ZohEUGW6yhhtoPkg3Goi3XZZenMfvJ2II 4pEZXNLxId26F0KCl3GBUzGpn/Z9Yr9y4aOTHcyKJloJONDO1w2AFrR4pTqHTI2KpdVGl/IsELm8 VCLAAVBpQ570su9t+Oza8eOx79+Rj1QqCyXBJhnEUhAFZdWCEOrCMc0u -----END CERTIFICATE----- QuoVadis Root CA 3 ================== -----BEGIN CERTIFICATE----- MIIGnTCCBIWgAwIBAgICBcYwDQYJKoZIhvcNAQEFBQAwRTELMAkGA1UEBhMCQk0xGTAXBgNVBAoT EFF1b1ZhZGlzIExpbWl0ZWQxGzAZBgNVBAMTElF1b1ZhZGlzIFJvb3QgQ0EgMzAeFw0wNjExMjQx OTExMjNaFw0zMTExMjQxOTA2NDRaMEUxCzAJBgNVBAYTAkJNMRkwFwYDVQQKExBRdW9WYWRpcyBM aW1pdGVkMRswGQYDVQQDExJRdW9WYWRpcyBSb290IENBIDMwggIiMA0GCSqGSIb3DQEBAQUAA4IC DwAwggIKAoICAQDMV0IWVJzmmNPTTe7+7cefQzlKZbPoFog02w1ZkXTPkrgEQK0CSzGrvI2RaNgg DhoB4hp7Thdd4oq3P5kazethq8Jlph+3t723j/z9cI8LoGe+AaJZz3HmDyl2/7FWeUUrH556VOij KTVopAFPD6QuN+8bv+OPEKhyq1hX51SGyMnzW9os2l2ObjyjPtr7guXd8lyyBTNvijbO0BNO/79K DDRMpsMhvVAEVeuxu537RR5kFd5VAYwCdrXLoT9CabwvvWhDFlaJKjdhkf2mrk7AyxRllDdLkgbv BNDInIjbC3uBr7E9KsRlOni27tyAsdLTmZw67mtaa7ONt9XOnMK+pUsvFrGeaDsGb659n/je7Mwp p5ijJUMv7/FfJuGITfhebtfZFG4ZM2mnO4SJk8RTVROhUXhA+LjJou57ulJCg54U7QVSWllWp5f8 nT8KKdjcT5EOE7zelaTfi5m+rJsziO+1ga8bxiJTyPbH7pcUsMV8eFLI8M5ud2CEpukqdiDtWAEX MJPpGovgc2PZapKUSU60rUqFxKMiMPwJ7Wgic6aIDFUhWMXhOp8q3crhkODZc6tsgLjoC2SToJyM Gf+z0gzskSaHirOi4XCPLArlzW1oUevaPwV/izLmE1xr/l9A4iLItLRkT9a6fUg+qGkM17uGcclz uD87nSVL2v9A6wIDAQABo4IBlTCCAZEwDwYDVR0TAQH/BAUwAwEB/zCB4QYDVR0gBIHZMIHWMIHT BgkrBgEEAb5YAAMwgcUwgZMGCCsGAQUFBwICMIGGGoGDQW55IHVzZSBvZiB0aGlzIENlcnRpZmlj YXRlIGNvbnN0aXR1dGVzIGFjY2VwdGFuY2Ugb2YgdGhlIFF1b1ZhZGlzIFJvb3QgQ0EgMyBDZXJ0 aWZpY2F0ZSBQb2xpY3kgLyBDZXJ0aWZpY2F0aW9uIFByYWN0aWNlIFN0YXRlbWVudC4wLQYIKwYB BQUHAgEWIWh0dHA6Ly93d3cucXVvdmFkaXNnbG9iYWwuY29tL2NwczALBgNVHQ8EBAMCAQYwHQYD VR0OBBYEFPLAE+CCQz777i9nMpY1XNu4ywLQMG4GA1UdIwRnMGWAFPLAE+CCQz777i9nMpY1XNu4 ywLQoUmkRzBFMQswCQYDVQQGEwJCTTEZMBcGA1UEChMQUXVvVmFkaXMgTGltaXRlZDEbMBkGA1UE AxMSUXVvVmFkaXMgUm9vdCBDQSAzggIFxjANBgkqhkiG9w0BAQUFAAOCAgEAT62gLEz6wPJv92ZV qyM07ucp2sNbtrCD2dDQ4iH782CnO11gUyeim/YIIirnv6By5ZwkajGxkHon24QRiSemd1o417+s hvzuXYO8BsbRd2sPbSQvS3pspweWyuOEn62Iix2rFo1bZhfZFvSLgNLd+LJ2w/w4E6oM3kJpK27z POuAJ9v1pkQNn1pVWQvVDVJIxa6f8i+AxeoyUDUSly7B4f/xI4hROJ/yZlZ25w9Rl6VSDE1JUZU2 Pb+iSwwQHYaZTKrzchGT5Or2m9qoXadNt54CrnMAyNojA+j56hl0YgCUyyIgvpSnWbWCar6ZeXqp 8kokUvd0/bpO5qgdAm6xDYBEwa7TIzdfu4V8K5Iu6H6li92Z4b8nby1dqnuH/grdS/yO9SbkbnBC bjPsMZ57k8HkyWkaPcBrTiJt7qtYTcbQQcEr6k8Sh17rRdhs9ZgC06DYVYoGmRmioHfRMJ6szHXu g/WwYjnPbFfiTNKRCw51KBuav/0aQ/HKd/s7j2G4aSgWQgRecCocIdiP4b0jWy10QJLZYxkNc91p vGJHvOB0K7Lrfb5BG7XARsWhIstfTsEokt4YutUqKLsRixeTmJlglFwjz1onl14LBQaTNx47aTbr qZ5hHY8y2o4M1nQ+ewkk2gF3R8Q7zTSMmfXK4SVhM7JZG+Ju1zdXtg2pEto= -----END CERTIFICATE----- Security Communication Root CA ============================== -----BEGIN CERTIFICATE----- MIIDWjCCAkKgAwIBAgIBADANBgkqhkiG9w0BAQUFADBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMP U0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEw HhcNMDMwOTMwMDQyMDQ5WhcNMjMwOTMwMDQyMDQ5WjBQMQswCQYDVQQGEwJKUDEYMBYGA1UEChMP U0VDT00gVHJ1c3QubmV0MScwJQYDVQQLEx5TZWN1cml0eSBDb21tdW5pY2F0aW9uIFJvb3RDQTEw ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCzs/5/022x7xZ8V6UMbXaKL0u/ZPtM7orw 8yl89f/uKuDp6bpbZCKamm8sOiZpUQWZJtzVHGpxxpp9Hp3dfGzGjGdnSj74cbAZJ6kJDKaVv0uM DPpVmDvY6CKhS3E4eayXkmmziX7qIWgGmBSWh9JhNrxtJ1aeV+7AwFb9Ms+k2Y7CI9eNqPPYJayX 5HA49LY6tJ07lyZDo6G8SVlyTCMwhwFY9k6+HGhWZq/NQV3Is00qVUarH9oe4kA92819uZKAnDfd DJZkndwi92SL32HeFZRSFaB9UslLqCHJxrHty8OVYNEP8Ktw+N/LTX7s1vqr2b1/VPKl6Xn62dZ2 JChzAgMBAAGjPzA9MB0GA1UdDgQWBBSgc0mZaNyFW2XjmygvV5+9M7wHSDALBgNVHQ8EBAMCAQYw DwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQUFAAOCAQEAaECpqLvkT115swW1F7NgE+vGkl3g 0dNq/vu+m22/xwVtWSDEHPC32oRYAmP6SBbvT6UL90qY8j+eG61Ha2POCEfrUj94nK9NrvjVT8+a mCoQQTlSxN3Zmw7vkwGusi7KaEIkQmywszo+zenaSMQVy+n5Bw+SUEmK3TGXX8npN6o7WWWXlDLJ s58+OmJYxUmtYg5xpTKqL8aJdkNAExNnPaJUJRDL8Try2frbSVa7pv6nQTXD4IhhyYjH3zYQIphZ 6rBK+1YWc26sTfcioU+tHXotRSflMMFe8toTyyVCUZVHA4xsIcx0Qu1T/zOLjw9XARYvz6buyXAi FL39vmwLAw== -----END CERTIFICATE----- XRamp Global CA Root ==================== -----BEGIN CERTIFICATE----- MIIEMDCCAxigAwIBAgIQUJRs7Bjq1ZxN1ZfvdY+grTANBgkqhkiG9w0BAQUFADCBgjELMAkGA1UE BhMCVVMxHjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2Vj dXJpdHkgU2VydmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBB dXRob3JpdHkwHhcNMDQxMTAxMTcxNDA0WhcNMzUwMTAxMDUzNzE5WjCBgjELMAkGA1UEBhMCVVMx HjAcBgNVBAsTFXd3dy54cmFtcHNlY3VyaXR5LmNvbTEkMCIGA1UEChMbWFJhbXAgU2VjdXJpdHkg U2VydmljZXMgSW5jMS0wKwYDVQQDEyRYUmFtcCBHbG9iYWwgQ2VydGlmaWNhdGlvbiBBdXRob3Jp dHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCYJB69FbS638eMpSe2OAtp87ZOqCwu IR1cRN8hXX4jdP5efrRKt6atH67gBhbim1vZZ3RrXYCPKZ2GG9mcDZhtdhAoWORlsH9KmHmf4MMx foArtYzAQDsRhtDLooY2YKTVMIJt2W7QDxIEM5dfT2Fa8OT5kavnHTu86M/0ay00fOJIYRyO82FE zG+gSqmUsE3a56k0enI4qEHMPJQRfevIpoy3hsvKMzvZPTeL+3o+hiznc9cKV6xkmxnr9A8ECIqs AxcZZPRaJSKNNCyy9mgdEm3Tih4U2sSPpuIjhdV6Db1q4Ons7Be7QhtnqiXtRYMh/MHJfNViPvry xS3T/dRlAgMBAAGjgZ8wgZwwEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0PBAQDAgGGMA8GA1Ud EwEB/wQFMAMBAf8wHQYDVR0OBBYEFMZPoj0GY4QJnM5i5ASsjVy16bYbMDYGA1UdHwQvMC0wK6Ap oCeGJWh0dHA6Ly9jcmwueHJhbXBzZWN1cml0eS5jb20vWEdDQS5jcmwwEAYJKwYBBAGCNxUBBAMC AQEwDQYJKoZIhvcNAQEFBQADggEBAJEVOQMBG2f7Shz5CmBbodpNl2L5JFMn14JkTpAuw0kbK5rc /Kh4ZzXxHfARvbdI4xD2Dd8/0sm2qlWkSLoC295ZLhVbO50WfUfXN+pfTXYSNrsf16GBBEYgoyxt qZ4Bfj8pzgCT3/3JknOJiWSe5yvkHJEs0rnOfc5vMZnT5r7SHpDwCRR5XCOrTdLaIR9NmXmd4c8n nxCbHIgNsIpkQTG4DmyQJKSbXHGPurt+HBvbaoAPIbzp26a3QPSyi6mx5O+aGtA9aZnuqCij4Tyz 8LIRnM98QObd50N9otg6tamN8jSZxNQQ4Qb9CYQQO+7ETPTsJ3xCwnR8gooJybQDJbw= -----END CERTIFICATE----- Go Daddy Class 2 CA =================== -----BEGIN CERTIFICATE----- MIIEADCCAuigAwIBAgIBADANBgkqhkiG9w0BAQUFADBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMY VGhlIEdvIERhZGR5IEdyb3VwLCBJbmMuMTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRp ZmljYXRpb24gQXV0aG9yaXR5MB4XDTA0MDYyOTE3MDYyMFoXDTM0MDYyOTE3MDYyMFowYzELMAkG A1UEBhMCVVMxITAfBgNVBAoTGFRoZSBHbyBEYWRkeSBHcm91cCwgSW5jLjExMC8GA1UECxMoR28g RGFkZHkgQ2xhc3MgMiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTCCASAwDQYJKoZIhvcNAQEBBQAD ggENADCCAQgCggEBAN6d1+pXGEmhW+vXX0iG6r7d/+TvZxz0ZWizV3GgXne77ZtJ6XCAPVYYYwhv 2vLM0D9/AlQiVBDYsoHUwHU9S3/Hd8M+eKsaA7Ugay9qK7HFiH7Eux6wwdhFJ2+qN1j3hybX2C32 qRe3H3I2TqYXP2WYktsqbl2i/ojgC95/5Y0V4evLOtXiEqITLdiOr18SPaAIBQi2XKVlOARFmR6j YGB0xUGlcmIbYsUfb18aQr4CUWWoriMYavx4A6lNf4DD+qta/KFApMoZFv6yyO9ecw3ud72a9nmY vLEHZ6IVDd2gWMZEewo+YihfukEHU1jPEX44dMX4/7VpkI+EdOqXG68CAQOjgcAwgb0wHQYDVR0O BBYEFNLEsNKR1EwRcbNhyz2h/t2oatTjMIGNBgNVHSMEgYUwgYKAFNLEsNKR1EwRcbNhyz2h/t2o atTjoWekZTBjMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYVGhlIEdvIERhZGR5IEdyb3VwLCBJbmMu MTEwLwYDVQQLEyhHbyBEYWRkeSBDbGFzcyAyIENlcnRpZmljYXRpb24gQXV0aG9yaXR5ggEAMAwG A1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBADJL87LKPpH8EsahB4yOd6AzBhRckB4Y9wim PQoZ+YeAEW5p5JYXMP80kWNyOO7MHAGjHZQopDH2esRU1/blMVgDoszOYtuURXO1v0XJJLXVggKt I3lpjbi2Tc7PTMozI+gciKqdi0FuFskg5YmezTvacPd+mSYgFFQlq25zheabIZ0KbIIOqPjCDPoQ HmyW74cNxA9hi63ugyuV+I6ShHI56yDqg+2DzZduCLzrTia2cyvk0/ZM/iZx4mERdEr/VxqHD3VI Ls9RaRegAhJhldXRQLIQTO7ErBBDpqWeCtWVYpoNz4iCxTIM5CufReYNnyicsbkqWletNw+vHX/b vZ8= -----END CERTIFICATE----- Starfield Class 2 CA ==================== -----BEGIN CERTIFICATE----- MIIEDzCCAvegAwIBAgIBADANBgkqhkiG9w0BAQUFADBoMQswCQYDVQQGEwJVUzElMCMGA1UEChMc U3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAGA1UECxMpU3RhcmZpZWxkIENsYXNzIDIg Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkwHhcNMDQwNjI5MTczOTE2WhcNMzQwNjI5MTczOTE2WjBo MQswCQYDVQQGEwJVUzElMCMGA1UEChMcU3RhcmZpZWxkIFRlY2hub2xvZ2llcywgSW5jLjEyMDAG A1UECxMpU3RhcmZpZWxkIENsYXNzIDIgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEgMA0GCSqG SIb3DQEBAQUAA4IBDQAwggEIAoIBAQC3Msj+6XGmBIWtDBFk385N78gDGIc/oav7PKaf8MOh2tTY bitTkPskpD6E8J7oX+zlJ0T1KKY/e97gKvDIr1MvnsoFAZMej2YcOadN+lq2cwQlZut3f+dZxkqZ JRRU6ybH838Z1TBwj6+wRir/resp7defqgSHo9T5iaU0X9tDkYI22WY8sbi5gv2cOj4QyDvvBmVm epsZGD3/cVE8MC5fvj13c7JdBmzDI1aaK4UmkhynArPkPw2vCHmCuDY96pzTNbO8acr1zJ3o/WSN F4Azbl5KXZnJHoe0nRrA1W4TNSNe35tfPe/W93bC6j67eA0cQmdrBNj41tpvi/JEoAGrAgEDo4HF MIHCMB0GA1UdDgQWBBS/X7fRzt0fhvRbVazc1xDCDqmI5zCBkgYDVR0jBIGKMIGHgBS/X7fRzt0f hvRbVazc1xDCDqmI56FspGowaDELMAkGA1UEBhMCVVMxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNo bm9sb2dpZXMsIEluYy4xMjAwBgNVBAsTKVN0YXJmaWVsZCBDbGFzcyAyIENlcnRpZmljYXRpb24g QXV0aG9yaXR5ggEAMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAAWdP4id0ckaVaGs afPzWdqbAYcaT1epoXkJKtv3L7IezMdeatiDh6GX70k1PncGQVhiv45YuApnP+yz3SFmH8lU+nLM PUxA2IGvd56Deruix/U0F47ZEUD0/CwqTRV/p2JdLiXTAAsgGh1o+Re49L2L7ShZ3U0WixeDyLJl xy16paq8U4Zt3VekyvggQQto8PT7dL5WXXp59fkdheMtlb71cZBDzI0fmgAKhynpVSJYACPq4xJD KVtHCN2MQWplBqjlIapBtJUhlbl90TSrE9atvNziPTnNvT51cKEYWQPJIrSPnNVeKtelttQKbfi3 QBFGmh95DmK/D5fs4C8fF5Q= -----END CERTIFICATE----- DigiCert Assured ID Root CA =========================== -----BEGIN CERTIFICATE----- MIIDtzCCAp+gAwIBAgIQDOfg5RfYRv6P5WD8G/AwOTANBgkqhkiG9w0BAQUFADBlMQswCQYDVQQG EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQw IgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0EwHhcNMDYxMTEwMDAwMDAwWhcNMzEx MTEwMDAwMDAwWjBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQL ExB3d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgQ0Ew ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCtDhXO5EOAXLGH87dg+XESpa7cJpSIqvTO 9SA5KFhgDPiA2qkVlTJhPLWxKISKityfCgyDF3qPkKyK53lTXDGEKvYPmDI2dsze3Tyoou9q+yHy UmHfnyDXH+Kx2f4YZNISW1/5WBg1vEfNoTb5a3/UsDg+wRvDjDPZ2C8Y/igPs6eD1sNuRMBhNZYW /lmci3Zt1/GiSw0r/wty2p5g0I6QNcZ4VYcgoc/lbQrISXwxmDNsIumH0DJaoroTghHtORedmTpy oeb6pNnVFzF1roV9Iq4/AUaG9ih5yLHa5FcXxH4cDrC0kqZWs72yl+2qp/C3xag/lRbQ/6GW6whf GHdPAgMBAAGjYzBhMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRF 66Kv9JLLgjEtUYunpyGd823IDzAfBgNVHSMEGDAWgBRF66Kv9JLLgjEtUYunpyGd823IDzANBgkq hkiG9w0BAQUFAAOCAQEAog683+Lt8ONyc3pklL/3cmbYMuRCdWKuh+vy1dneVrOfzM4UKLkNl2Bc EkxY5NM9g0lFWJc1aRqoR+pWxnmrEthngYTffwk8lOa4JiwgvT2zKIn3X/8i4peEH+ll74fg38Fn SbNd67IJKusm7Xi+fT8r87cmNW1fiQG2SVufAQWbqz0lwcy2f8Lxb4bG+mRo64EtlOtCt/qMHt1i 8b5QZ7dsvfPxH2sMNgcWfzd8qVttevESRmCD1ycEvkvOl77DZypoEd+A5wwzZr8TDRRu838fYxAe +o0bJW1sj6W3YQGx0qMmoRBxna3iw/nDmVG3KwcIzi7mULKn+gpFL6Lw8g== -----END CERTIFICATE----- DigiCert Global Root CA ======================= -----BEGIN CERTIFICATE----- MIIDrzCCApegAwIBAgIQCDvgVpBCRrGhdWrJWZHHSjANBgkqhkiG9w0BAQUFADBhMQswCQYDVQQG EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAw HgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBDQTAeFw0wNjExMTAwMDAwMDBaFw0zMTExMTAw MDAwMDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3 dy5kaWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IENBMIIBIjANBgkq hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA4jvhEXLeqKTTo1eqUKKPC3eQyaKl7hLOllsBCSDMAZOn TjC3U/dDxGkAV53ijSLdhwZAAIEJzs4bg7/fzTtxRuLWZscFs3YnFo97nh6Vfe63SKMI2tavegw5 BmV/Sl0fvBf4q77uKNd0f3p4mVmFaG5cIzJLv07A6Fpt43C/dxC//AH2hdmoRBBYMql1GNXRor5H 4idq9Joz+EkIYIvUX7Q6hL+hqkpMfT7PT19sdl6gSzeRntwi5m3OFBqOasv+zbMUZBfHWymeMr/y 7vrTC0LUq7dBMtoM1O/4gdW7jVg/tRvoSSiicNoxBN33shbyTApOB6jtSj1etX+jkMOvJwIDAQAB o2MwYTAOBgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA95QNVbRTLtm 8KPiGxvDl7I90VUwHwYDVR0jBBgwFoAUA95QNVbRTLtm8KPiGxvDl7I90VUwDQYJKoZIhvcNAQEF BQADggEBAMucN6pIExIK+t1EnE9SsPTfrgT1eXkIoyQY/EsrhMAtudXH/vTBH1jLuG2cenTnmCmr EbXjcKChzUyImZOMkXDiqw8cvpOp/2PV5Adg06O/nVsJ8dWO41P0jmP6P6fbtGbfYmbW0W5BjfIt tep3Sp+dWOIrWcBAI+0tKIJFPnlUkiaY4IBIqDfv8NZ5YBberOgOzW6sRBc4L0na4UU+Krk2U886 UAb3LujEV0lsYSEY1QSteDwsOoBrp+uvFRTp2InBuThs4pFsiv9kuXclVzDAGySj4dzp30d8tbQk CAUw7C29C79Fv1C5qfPrmAESrciIxpg0X40KPMbp1ZWVbd4= -----END CERTIFICATE----- DigiCert High Assurance EV Root CA ================================== -----BEGIN CERTIFICATE----- MIIDxTCCAq2gAwIBAgIQAqxcJmoLQJuPC3nyrkYldzANBgkqhkiG9w0BAQUFADBsMQswCQYDVQQG EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSsw KQYDVQQDEyJEaWdpQ2VydCBIaWdoIEFzc3VyYW5jZSBFViBSb290IENBMB4XDTA2MTExMDAwMDAw MFoXDTMxMTExMDAwMDAwMFowbDELMAkGA1UEBhMCVVMxFTATBgNVBAoTDERpZ2lDZXJ0IEluYzEZ MBcGA1UECxMQd3d3LmRpZ2ljZXJ0LmNvbTErMCkGA1UEAxMiRGlnaUNlcnQgSGlnaCBBc3N1cmFu Y2UgRVYgUm9vdCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMbM5XPm+9S75S0t Mqbf5YE/yc0lSbZxKsPVlDRnogocsF9ppkCxxLeyj9CYpKlBWTrT3JTWPNt0OKRKzE0lgvdKpVMS OO7zSW1xkX5jtqumX8OkhPhPYlG++MXs2ziS4wblCJEMxChBVfvLWokVfnHoNb9Ncgk9vjo4UFt3 MRuNs8ckRZqnrG0AFFoEt7oT61EKmEFBIk5lYYeBQVCmeVyJ3hlKV9Uu5l0cUyx+mM0aBhakaHPQ NAQTXKFx01p8VdteZOE3hzBWBOURtCmAEvF5OYiiAhF8J2a3iLd48soKqDirCmTCv2ZdlYTBoSUe h10aUAsgEsxBu24LUTi4S8sCAwEAAaNjMGEwDgYDVR0PAQH/BAQDAgGGMA8GA1UdEwEB/wQFMAMB Af8wHQYDVR0OBBYEFLE+w2kD+L9HAdSYJhoIAu9jZCvDMB8GA1UdIwQYMBaAFLE+w2kD+L9HAdSY JhoIAu9jZCvDMA0GCSqGSIb3DQEBBQUAA4IBAQAcGgaX3NecnzyIZgYIVyHbIUf4KmeqvxgydkAQ V8GK83rZEWWONfqe/EW1ntlMMUu4kehDLI6zeM7b41N5cdblIZQB2lWHmiRk9opmzN6cN82oNLFp myPInngiK3BD41VHMWEZ71jFhS9OMPagMRYjyOfiZRYzy78aG6A9+MpeizGLYAiJLQwGXFK3xPkK mNEVX58Svnw2Yzi9RKR/5CYrCsSXaQ3pjOLAEFe4yHYSkVXySGnYvCoCWw9E1CAx2/S6cCZdkGCe vEsXCS+0yx5DaMkHJ8HSXPfqIbloEpw8nL+e/IBcm2PN7EeqJSdnoDfzAIJ9VNep+OkuE6N36B9K -----END CERTIFICATE----- SwissSign Gold CA - G2 ====================== -----BEGIN CERTIFICATE----- MIIFujCCA6KgAwIBAgIJALtAHEP1Xk+wMA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNVBAYTAkNIMRUw EwYDVQQKEwxTd2lzc1NpZ24gQUcxHzAdBgNVBAMTFlN3aXNzU2lnbiBHb2xkIENBIC0gRzIwHhcN MDYxMDI1MDgzMDM1WhcNMzYxMDI1MDgzMDM1WjBFMQswCQYDVQQGEwJDSDEVMBMGA1UEChMMU3dp c3NTaWduIEFHMR8wHQYDVQQDExZTd2lzc1NpZ24gR29sZCBDQSAtIEcyMIICIjANBgkqhkiG9w0B AQEFAAOCAg8AMIICCgKCAgEAr+TufoskDhJuqVAtFkQ7kpJcyrhdhJJCEyq8ZVeCQD5XJM1QiyUq t2/876LQwB8CJEoTlo8jE+YoWACjR8cGp4QjK7u9lit/VcyLwVcfDmJlD909Vopz2q5+bbqBHH5C jCA12UNNhPqE21Is8w4ndwtrvxEvcnifLtg+5hg3Wipy+dpikJKVyh+c6bM8K8vzARO/Ws/BtQpg vd21mWRTuKCWs2/iJneRjOBiEAKfNA+k1ZIzUd6+jbqEemA8atufK+ze3gE/bk3lUIbLtK/tREDF ylqM2tIrfKjuvqblCqoOpd8FUrdVxyJdMmqXl2MT28nbeTZ7hTpKxVKJ+STnnXepgv9VHKVxaSvR AiTysybUa9oEVeXBCsdtMDeQKuSeFDNeFhdVxVu1yzSJkvGdJo+hB9TGsnhQ2wwMC3wLjEHXuend jIj3o02yMszYF9rNt85mndT9Xv+9lz4pded+p2JYryU0pUHHPbwNUMoDAw8IWh+Vc3hiv69yFGkO peUDDniOJihC8AcLYiAQZzlG+qkDzAQ4embvIIO1jEpWjpEA/I5cgt6IoMPiaG59je883WX0XaxR 7ySArqpWl2/5rX3aYT+YdzylkbYcjCbaZaIJbcHiVOO5ykxMgI93e2CaHt+28kgeDrpOVG2Y4OGi GqJ3UM/EY5LsRxmd6+ZrzsECAwEAAaOBrDCBqTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUw AwEB/zAdBgNVHQ4EFgQUWyV7lqRlUX64OfPAeGZe6Drn8O4wHwYDVR0jBBgwFoAUWyV7lqRlUX64 OfPAeGZe6Drn8O4wRgYDVR0gBD8wPTA7BglghXQBWQECAQEwLjAsBggrBgEFBQcCARYgaHR0cDov L3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIBACe645R88a7A3hfm 5djV9VSwg/S7zV4Fe0+fdWavPOhWfvxyeDgD2StiGwC5+OlgzczOUYrHUDFu4Up+GC9pWbY9ZIEr 44OE5iKHjn3g7gKZYbge9LgriBIWhMIxkziWMaa5O1M/wySTVltpkuzFwbs4AOPsF6m43Md8AYOf Mke6UiI0HTJ6CVanfCU2qT1L2sCCbwq7EsiHSycR+R4tx5M/nttfJmtS2S6K8RTGRI0Vqbe/vd6m Gu6uLftIdxf+u+yvGPUqUfA5hJeVbG4bwyvEdGB5JbAKJ9/fXtI5z0V9QkvfsywexcZdylU6oJxp mo/a77KwPJ+HbBIrZXAVUjEaJM9vMSNQH4xPjyPDdEFjHFWoFN0+4FFQz/EbMFYOkrCChdiDyyJk vC24JdVUorgG6q2SpCSgwYa1ShNqR88uC1aVVMvOmttqtKay20EIhid392qgQmwLOM7XdVAyksLf KzAiSNDVQTglXaTpXZ/GlHXQRf0wl0OPkKsKx4ZzYEppLd6leNcG2mqeSz53OiATIgHQv2ieY2Br NU0LbbqhPcCT4H8js1WtciVORvnSFu+wZMEBnunKoGqYDs/YYPIvSbjkQuE4NRb0yG5P94FW6Lqj viOvrv1vA+ACOzB2+httQc8Bsem4yWb02ybzOqR08kkkW8mw0FfB+j564ZfJ -----END CERTIFICATE----- SwissSign Silver CA - G2 ======================== -----BEGIN CERTIFICATE----- MIIFvTCCA6WgAwIBAgIITxvUL1S7L0swDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCQ0gxFTAT BgNVBAoTDFN3aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMB4X DTA2MTAyNTA4MzI0NloXDTM2MTAyNTA4MzI0NlowRzELMAkGA1UEBhMCQ0gxFTATBgNVBAoTDFN3 aXNzU2lnbiBBRzEhMB8GA1UEAxMYU3dpc3NTaWduIFNpbHZlciBDQSAtIEcyMIICIjANBgkqhkiG 9w0BAQEFAAOCAg8AMIICCgKCAgEAxPGHf9N4Mfc4yfjDmUO8x/e8N+dOcbpLj6VzHVxumK4DV644 N0MvFz0fyM5oEMF4rhkDKxD6LHmD9ui5aLlV8gREpzn5/ASLHvGiTSf5YXu6t+WiE7brYT7QbNHm +/pe7R20nqA1W6GSy/BJkv6FCgU+5tkL4k+73JU3/JHpMjUi0R86TieFnbAVlDLaYQ1HTWBCrpJH 6INaUFjpiou5XaHc3ZlKHzZnu0jkg7Y360g6rw9njxcH6ATK72oxh9TAtvmUcXtnZLi2kUpCe2Uu MGoM9ZDulebyzYLs2aFK7PayS+VFheZteJMELpyCbTapxDFkH4aDCyr0NQp4yVXPQbBH6TCfmb5h qAaEuSh6XzjZG6k4sIN/c8HDO0gqgg8hm7jMqDXDhBuDsz6+pJVpATqJAHgE2cn0mRmrVn5bi4Y5 FZGkECwJMoBgs5PAKrYYC51+jUnyEEp/+dVGLxmSo5mnJqy7jDzmDrxHB9xzUfFwZC8I+bRHHTBs ROopN4WSaGa8gzj+ezku01DwH/teYLappvonQfGbGHLy9YR0SslnxFSuSGTfjNFusB3hB48IHpmc celM2KX3RxIfdNFRnobzwqIjQAtz20um53MGjMGg6cFZrEb65i/4z3GcRm25xBWNOHkDRUjvxF3X CO6HOSKGsg0PWEP3calILv3q1h8CAwEAAaOBrDCBqTAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/ BAUwAwEB/zAdBgNVHQ4EFgQUF6DNweRBtjpbO8tFnb0cwpj6hlgwHwYDVR0jBBgwFoAUF6DNweRB tjpbO8tFnb0cwpj6hlgwRgYDVR0gBD8wPTA7BglghXQBWQEDAQEwLjAsBggrBgEFBQcCARYgaHR0 cDovL3JlcG9zaXRvcnkuc3dpc3NzaWduLmNvbS8wDQYJKoZIhvcNAQEFBQADggIBAHPGgeAn0i0P 4JUw4ppBf1AsX19iYamGamkYDHRJ1l2E6kFSGG9YrVBWIGrGvShpWJHckRE1qTodvBqlYJ7YH39F kWnZfrt4csEGDyrOj4VwYaygzQu4OSlWhDJOhrs9xCrZ1x9y7v5RoSJBsXECYxqCsGKrXlcSH9/L 3XWgwF15kIwb4FDm3jH+mHtwX6WQ2K34ArZv02DdQEsixT2tOnqfGhpHkXkzuoLcMmkDlm4fS/Bx /uNncqCxv1yL5PqZIseEuRuNI5c/7SXgz2W79WEE790eslpBIlqhn10s6FvJbakMDHiqYMZWjwFa DGi8aRl5xB9+lwW/xekkUV7U1UtT7dkjWjYDZaPBA61BMPNGG4WQr2W11bHkFlt4dR2Xem1ZqSqP e97Dh4kQmUlzeMg9vVE1dCrV8X5pGyq7O70luJpaPXJhkGaH7gzWTdQRdAtq/gsD/KNVV4n+Ssuu WxcFyPKNIzFTONItaj+CuY0IavdeQXRuwxF+B6wpYJE/OMpXEA29MC/HpeZBoNquBYeaoKRlbEwJ DIm6uNO5wJOKMPqN5ZprFQFOZ6raYlY+hAhm0sQ2fac+EPyI4NSA5QC9qvNOBqN6avlicuMJT+ub DgEj8Z+7fNzcbBGXJbLytGMU0gYqZ4yD9c7qB9iaah7s5Aq7KkzrCWA5zspi2C5u -----END CERTIFICATE----- SecureTrust CA ============== -----BEGIN CERTIFICATE----- MIIDuDCCAqCgAwIBAgIQDPCOXAgWpa1Cf/DrJxhZ0DANBgkqhkiG9w0BAQUFADBIMQswCQYDVQQG EwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xFzAVBgNVBAMTDlNlY3VyZVRy dXN0IENBMB4XDTA2MTEwNzE5MzExOFoXDTI5MTIzMTE5NDA1NVowSDELMAkGA1UEBhMCVVMxIDAe BgNVBAoTF1NlY3VyZVRydXN0IENvcnBvcmF0aW9uMRcwFQYDVQQDEw5TZWN1cmVUcnVzdCBDQTCC ASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAKukgeWVzfX2FI7CT8rU4niVWJxB4Q2ZQCQX OZEzZum+4YOvYlyJ0fwkW2Gz4BERQRwdbvC4u/jep4G6pkjGnx29vo6pQT64lO0pGtSO0gMdA+9t DWccV9cGrcrI9f4Or2YlSASWC12juhbDCE/RRvgUXPLIXgGZbf2IzIaowW8xQmxSPmjL8xk037uH GFaAJsTQ3MBv396gwpEWoGQRS0S8Hvbn+mPeZqx2pHGj7DaUaHp3pLHnDi+BeuK1cobvomuL8A/b 01k/unK8RCSc43Oz969XL0Imnal0ugBS8kvNU3xHCzaFDmapCJcWNFfBZveA4+1wVMeT4C4oFVmH ursCAwEAAaOBnTCBmjATBgkrBgEEAYI3FAIEBh4EAEMAQTALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/ BAUwAwEB/zAdBgNVHQ4EFgQUQjK2FvoE/f5dS3rD/fdMQB1aQ68wNAYDVR0fBC0wKzApoCegJYYj aHR0cDovL2NybC5zZWN1cmV0cnVzdC5jb20vU1RDQS5jcmwwEAYJKwYBBAGCNxUBBAMCAQAwDQYJ KoZIhvcNAQEFBQADggEBADDtT0rhWDpSclu1pqNlGKa7UTt36Z3q059c4EVlew3KW+JwULKUBRSu SceNQQcSc5R+DCMh/bwQf2AQWnL1mA6s7Ll/3XpvXdMc9P+IBWlCqQVxyLesJugutIxq/3HcuLHf mbx8IVQr5Fiiu1cprp6poxkmD5kuCLDv/WnPmRoJjeOnnyvJNjR7JLN4TJUXpAYmHrZkUjZfYGfZ nMUFdAvnZyPSCPyI6a6Lf+Ew9Dd+/cYy2i2eRDAwbO4H3tI0/NL/QPZL9GZGBlSm8jIKYyYwa5vR 3ItHuuG51WLQoqD0ZwV4KWMabwTW+MZMo5qxN7SN5ShLHZ4swrhovO0C7jE= -----END CERTIFICATE----- Secure Global CA ================ -----BEGIN CERTIFICATE----- MIIDvDCCAqSgAwIBAgIQB1YipOjUiolN9BPI8PjqpTANBgkqhkiG9w0BAQUFADBKMQswCQYDVQQG EwJVUzEgMB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xGTAXBgNVBAMTEFNlY3VyZSBH bG9iYWwgQ0EwHhcNMDYxMTA3MTk0MjI4WhcNMjkxMjMxMTk1MjA2WjBKMQswCQYDVQQGEwJVUzEg MB4GA1UEChMXU2VjdXJlVHJ1c3QgQ29ycG9yYXRpb24xGTAXBgNVBAMTEFNlY3VyZSBHbG9iYWwg Q0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCvNS7YrGxVaQZx5RNoJLNP2MwhR/jx YDiJiQPpvepeRlMJ3Fz1Wuj3RSoC6zFh1ykzTM7HfAo3fg+6MpjhHZevj8fcyTiW89sa/FHtaMbQ bqR8JNGuQsiWUGMu4P51/pinX0kuleM5M2SOHqRfkNJnPLLZ/kG5VacJjnIFHovdRIWCQtBJwB1g 8NEXLJXr9qXBkqPFwqcIYA1gBBCWeZ4WNOaptvolRTnIHmX5k/Wq8VLcmZg9pYYaDDUz+kulBAYV HDGA76oYa8J719rO+TMg1fW9ajMtgQT7sFzUnKPiXB3jqUJ1XnvUd+85VLrJChgbEplJL4hL/VBi 0XPnj3pDAgMBAAGjgZ0wgZowEwYJKwYBBAGCNxQCBAYeBABDAEEwCwYDVR0PBAQDAgGGMA8GA1Ud EwEB/wQFMAMBAf8wHQYDVR0OBBYEFK9EBMJBfkiD2045AuzshHrmzsmkMDQGA1UdHwQtMCswKaAn oCWGI2h0dHA6Ly9jcmwuc2VjdXJldHJ1c3QuY29tL1NHQ0EuY3JsMBAGCSsGAQQBgjcVAQQDAgEA MA0GCSqGSIb3DQEBBQUAA4IBAQBjGghAfaReUw132HquHw0LURYD7xh8yOOvaliTFGCRsoTciE6+ OYo68+aCiV0BN7OrJKQVDpI1WkpEXk5X+nXOH0jOZvQ8QCaSmGwb7iRGDBezUqXbpZGRzzfTb+cn CDpOGR86p1hcF895P4vkp9MmI50mD1hp/Ed+stCNi5O/KU9DaXR2Z0vPB4zmAve14bRDtUstFJ/5 3CYNv6ZHdAbYiNE6KTCEztI5gGIbqMdXSbxqVVFnFUq+NQfk1XWYN3kwFNspnWzFacxHVaIw98xc f8LDmBxrThaA63p4ZUWiABqvDA1VZDRIuJK58bRQKfJPIx/abKwfROHdI3hRW8cW -----END CERTIFICATE----- COMODO Certification Authority ============================== -----BEGIN CERTIFICATE----- MIIEHTCCAwWgAwIBAgIQToEtioJl4AsC7j41AkblPTANBgkqhkiG9w0BAQUFADCBgTELMAkGA1UE BhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgG A1UEChMRQ09NT0RPIENBIExpbWl0ZWQxJzAlBgNVBAMTHkNPTU9ETyBDZXJ0aWZpY2F0aW9uIEF1 dGhvcml0eTAeFw0wNjEyMDEwMDAwMDBaFw0yOTEyMzEyMzU5NTlaMIGBMQswCQYDVQQGEwJHQjEb MBkGA1UECBMSR3JlYXRlciBNYW5jaGVzdGVyMRAwDgYDVQQHEwdTYWxmb3JkMRowGAYDVQQKExFD T01PRE8gQ0EgTGltaXRlZDEnMCUGA1UEAxMeQ09NT0RPIENlcnRpZmljYXRpb24gQXV0aG9yaXR5 MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA0ECLi3LjkRv3UcEbVASY06m/weaKXTuH +7uIzg3jLz8GlvCiKVCZrts7oVewdFFxze1CkU1B/qnI2GqGd0S7WWaXUF601CxwRM/aN5VCaTww xHGzUvAhTaHYujl8HJ6jJJ3ygxaYqhZ8Q5sVW7euNJH+1GImGEaaP+vB+fGQV+useg2L23IwambV 4EajcNxo2f8ESIl33rXp+2dtQem8Ob0y2WIC8bGoPW43nOIv4tOiJovGuFVDiOEjPqXSJDlqR6sA 1KGzqSX+DT+nHbrTUcELpNqsOO9VUCQFZUaTNE8tja3G1CEZ0o7KBWFxB3NH5YoZEr0ETc5OnKVI rLsm9wIDAQABo4GOMIGLMB0GA1UdDgQWBBQLWOWLxkwVN6RAqTCpIb5HNlpW/zAOBgNVHQ8BAf8E BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zBJBgNVHR8EQjBAMD6gPKA6hjhodHRwOi8vY3JsLmNvbW9k b2NhLmNvbS9DT01PRE9DZXJ0aWZpY2F0aW9uQXV0aG9yaXR5LmNybDANBgkqhkiG9w0BAQUFAAOC AQEAPpiem/Yb6dc5t3iuHXIYSdOH5EOC6z/JqvWote9VfCFSZfnVDeFs9D6Mk3ORLgLETgdxb8CP OGEIqB6BCsAvIC9Bi5HcSEW88cbeunZrM8gALTFGTO3nnc+IlP8zwFboJIYmuNg4ON8qa90SzMc/ RxdMosIGlgnW2/4/PEZB31jiVg88O8EckzXZOFKs7sjsLjBOlDW0JB9LeGna8gI4zJVSk/BwJVmc IGfE7vmLV2H0knZ9P4SNVbfo5azV8fUZVqZa+5Acr5Pr5RzUZ5ddBA6+C4OmF4O5MBKgxTMVBbkN +8cFduPYSo38NBejxiEovjBFMR7HeL5YYTisO+IBZQ== -----END CERTIFICATE----- Network Solutions Certificate Authority ======================================= -----BEGIN CERTIFICATE----- MIID5jCCAs6gAwIBAgIQV8szb8JcFuZHFhfjkDFo4DANBgkqhkiG9w0BAQUFADBiMQswCQYDVQQG EwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMuMTAwLgYDVQQDEydOZXR3b3Jr IFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwHhcNMDYxMjAxMDAwMDAwWhcNMjkxMjMx MjM1OTU5WjBiMQswCQYDVQQGEwJVUzEhMB8GA1UEChMYTmV0d29yayBTb2x1dGlvbnMgTC5MLkMu MTAwLgYDVQQDEydOZXR3b3JrIFNvbHV0aW9ucyBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkwggEiMA0G CSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDkvH6SMG3G2I4rC7xGzuAnlt7e+foS0zwzc7MEL7xx jOWftiJgPl9dzgn/ggwbmlFQGiaJ3dVhXRncEg8tCqJDXRfQNJIg6nPPOCwGJgl6cvf6UDL4wpPT aaIjzkGxzOTVHzbRijr4jGPiFFlp7Q3Tf2vouAPlT2rlmGNpSAW+Lv8ztumXWWn4Zxmuk2GWRBXT crA/vGp97Eh/jcOrqnErU2lBUzS1sLnFBgrEsEX1QV1uiUV7PTsmjHTC5dLRfbIR1PtYMiKagMnc /Qzpf14Dl847ABSHJ3A4qY5usyd2mFHgBeMhqxrVhSI8KbWaFsWAqPS7azCPL0YCorEMIuDTAgMB AAGjgZcwgZQwHQYDVR0OBBYEFCEwyfsA106Y2oeqKtCnLrFAMadMMA4GA1UdDwEB/wQEAwIBBjAP BgNVHRMBAf8EBTADAQH/MFIGA1UdHwRLMEkwR6BFoEOGQWh0dHA6Ly9jcmwubmV0c29sc3NsLmNv bS9OZXR3b3JrU29sdXRpb25zQ2VydGlmaWNhdGVBdXRob3JpdHkuY3JsMA0GCSqGSIb3DQEBBQUA A4IBAQC7rkvnt1frf6ott3NHhWrB5KUd5Oc86fRZZXe1eltajSU24HqXLjjAV2CDmAaDn7l2em5Q 4LqILPxFzBiwmZVRDuwduIj/h1AcgsLj4DKAv6ALR8jDMe+ZZzKATxcheQxpXN5eNK4CtSbqUN9/ GGUsyfJj4akH/nxxH2szJGoeBfcFaMBqEssuXmHLrijTfsK0ZpEmXzwuJF/LWA/rKOyvEZbz3Htv wKeI8lN3s2Berq4o2jUsbzRF0ybh3uxbTydrFny9RAQYgrOJeRcQcT16ohZO9QHNpGxlaKFJdlxD ydi8NmdspZS11My5vWo1ViHe2MPr+8ukYEywVaCge1ey -----END CERTIFICATE----- COMODO ECC Certification Authority ================================== -----BEGIN CERTIFICATE----- MIICiTCCAg+gAwIBAgIQH0evqmIAcFBUTAGem2OZKjAKBggqhkjOPQQDAzCBhTELMAkGA1UEBhMC R0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UE ChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBB dXRob3JpdHkwHhcNMDgwMzA2MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMCR0Ix GzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UEChMR Q09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBFQ0MgQ2VydGlmaWNhdGlvbiBBdXRo b3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQDR3svdcmCFYX7deSRFtSrYpn1PlILBs5BAH+X 4QokPB0BBO490o0JlwzgdeT6+3eKKvUDYEs2ixYjFq0JcfRK9ChQtP6IHG4/bC8vCVlbpVsLM5ni wz2J+Wos77LTBumjQjBAMB0GA1UdDgQWBBR1cacZSBm8nZ3qQUfflMRId5nTeTAOBgNVHQ8BAf8E BAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjEA7wNbeqy3eApyt4jf/7VG FAkK+qDmfQjGGoe9GKhzvSbKYAydzpmfz1wPMOG+FDHqAjAU9JM8SaczepBGR7NjfRObTrdvGDeA U/7dIOA1mjbRxwG55tzd8/8dLDoWV9mSOdY= -----END CERTIFICATE----- Certigna ======== -----BEGIN CERTIFICATE----- MIIDqDCCApCgAwIBAgIJAP7c4wEPyUj/MA0GCSqGSIb3DQEBBQUAMDQxCzAJBgNVBAYTAkZSMRIw EAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hMB4XDTA3MDYyOTE1MTMwNVoXDTI3 MDYyOTE1MTMwNVowNDELMAkGA1UEBhMCRlIxEjAQBgNVBAoMCURoaW15b3RpczERMA8GA1UEAwwI Q2VydGlnbmEwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDIaPHJ1tazNHUmgh7stL7q XOEm7RFHYeGifBZ4QCHkYJ5ayGPhxLGWkv8YbWkj4Sti993iNi+RB7lIzw7sebYs5zRLcAglozyH GxnygQcPOJAZ0xH+hrTy0V4eHpbNgGzOOzGTtvKg0KmVEn2lmsxryIRWijOp5yIVUxbwzBfsV1/p ogqYCd7jX5xv3EjjhQsVWqa6n6xI4wmy9/Qy3l40vhx4XUJbzg4ij02Q130yGLMLLGq/jj8UEYkg DncUtT2UCIf3JR7VsmAA7G8qKCVuKj4YYxclPz5EIBb2JsglrgVKtOdjLPOMFlN+XPsRGgjBRmKf Irjxwo1p3Po6WAbfAgMBAAGjgbwwgbkwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUGu3+QTmQ tCRZvgHyUtVF9lo53BEwZAYDVR0jBF0wW4AUGu3+QTmQtCRZvgHyUtVF9lo53BGhOKQ2MDQxCzAJ BgNVBAYTAkZSMRIwEAYDVQQKDAlEaGlteW90aXMxETAPBgNVBAMMCENlcnRpZ25hggkA/tzjAQ/J SP8wDgYDVR0PAQH/BAQDAgEGMBEGCWCGSAGG+EIBAQQEAwIABzANBgkqhkiG9w0BAQUFAAOCAQEA hQMeknH2Qq/ho2Ge6/PAD/Kl1NqV5ta+aDY9fm4fTIrv0Q8hbV6lUmPOEvjvKtpv6zf+EwLHyzs+ ImvaYS5/1HI93TDhHkxAGYwP15zRgzB7mFncfca5DClMoTOi62c6ZYTTluLtdkVwj7Ur3vkj1klu PBS1xp81HlDQwY9qcEQCYsuuHWhBp6pX6FOqB9IG9tUUBguRA3UsbHK1YZWaDYu5Def131TN3ubY 1gkIl2PlwS6wt0QmwCbAr1UwnjvVNioZBPRcHv/PLLf/0P2HQBHVESO7SMAhqaQoLf0V+LBOK/Qw WyH8EZE0vkHve52Xdf+XlcCWWC/qu0bXu+TZLg== -----END CERTIFICATE----- ePKI Root Certification Authority ================================= -----BEGIN CERTIFICATE----- MIIFsDCCA5igAwIBAgIQFci9ZUdcr7iXAF7kBtK8nTANBgkqhkiG9w0BAQUFADBeMQswCQYDVQQG EwJUVzEjMCEGA1UECgwaQ2h1bmdod2EgVGVsZWNvbSBDby4sIEx0ZC4xKjAoBgNVBAsMIWVQS0kg Um9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0wNDEyMjAwMjMxMjdaFw0zNDEyMjAwMjMx MjdaMF4xCzAJBgNVBAYTAlRXMSMwIQYDVQQKDBpDaHVuZ2h3YSBUZWxlY29tIENvLiwgTHRkLjEq MCgGA1UECwwhZVBLSSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkqhkiG9w0B AQEFAAOCAg8AMIICCgKCAgEA4SUP7o3biDN1Z82tH306Tm2d0y8U82N0ywEhajfqhFAHSyZbCUNs IZ5qyNUD9WBpj8zwIuQf5/dqIjG3LBXy4P4AakP/h2XGtRrBp0xtInAhijHyl3SJCRImHJ7K2RKi lTza6We/CKBk49ZCt0Xvl/T29de1ShUCWH2YWEtgvM3XDZoTM1PRYfl61dd4s5oz9wCGzh1NlDiv qOx4UXCKXBCDUSH3ET00hl7lSM2XgYI1TBnsZfZrxQWh7kcT1rMhJ5QQCtkkO7q+RBNGMD+XPNjX 12ruOzjjK9SXDrkb5wdJfzcq+Xd4z1TtW0ado4AOkUPB1ltfFLqfpo0kR0BZv3I4sjZsN/+Z0V0O WQqraffAsgRFelQArr5T9rXn4fg8ozHSqf4hUmTFpmfwdQcGlBSBVcYn5AGPF8Fqcde+S/uUWH1+ ETOxQvdibBjWzwloPn9s9h6PYq2lY9sJpx8iQkEeb5mKPtf5P0B6ebClAZLSnT0IFaUQAS2zMnao lQ2zepr7BxB4EW/hj8e6DyUadCrlHJhBmd8hh+iVBmoKs2pHdmX2Os+PYhcZewoozRrSgx4hxyy/ vv9haLdnG7t4TY3OZ+XkwY63I2binZB1NJipNiuKmpS5nezMirH4JYlcWrYvjB9teSSnUmjDhDXi Zo1jDiVN1Rmy5nk3pyKdVDECAwEAAaNqMGgwHQYDVR0OBBYEFB4M97Zn8uGSJglFwFU5Lnc/Qkqi MAwGA1UdEwQFMAMBAf8wOQYEZyoHAAQxMC8wLQIBADAJBgUrDgMCGgUAMAcGBWcqAwAABBRFsMLH ClZ87lt4DJX5GFPBphzYEDANBgkqhkiG9w0BAQUFAAOCAgEACbODU1kBPpVJufGBuvl2ICO1J2B0 1GqZNF5sAFPZn/KmsSQHRGoqxqWOeBLoR9lYGxMqXnmbnwoqZ6YlPwZpVnPDimZI+ymBV3QGypzq KOg4ZyYr8dW1P2WT+DZdjo2NQCCHGervJ8A9tDkPJXtoUHRVnAxZfVo9QZQlUgjgRywVMRnVvwdV xrsStZf0X4OFunHB2WyBEXYKCrC/gpf36j36+uwtqSiUO1bd0lEursC9CBWMd1I0ltabrNMdjmEP NXubrjlpC2JgQCA2j6/7Nu4tCEoduL+bXPjqpRugc6bY+G7gMwRfaKonh+3ZwZCc7b3jajWvY9+r GNm65ulK6lCKD2GTHuItGeIwlDWSXQ62B68ZgI9HkFFLLk3dheLSClIKF5r8GrBQAuUBo2M3IUxE xJtRmREOc5wGj1QupyheRDmHVi03vYVElOEMSyycw5KFNGHLD7ibSkNS/jQ6fbjpKdx2qcgw+BRx gMYeNkh0IkFch4LoGHGLQYlE535YW6i4jRPpp2zDR+2zGp1iro2C6pSe3VkQw63d4k3jMdXH7Ojy sP6SHhYKGvzZ8/gntsm+HbRsZJB/9OTEW9c3rkIO3aQab3yIVMUWbuF6aC74Or8NpDyJO3inTmOD BCEIZ43ygknQW/2xzQ+DhNQ+IIX3Sj0rnP0qCglN6oH4EZw= -----END CERTIFICATE----- certSIGN ROOT CA ================ -----BEGIN CERTIFICATE----- MIIDODCCAiCgAwIBAgIGIAYFFnACMA0GCSqGSIb3DQEBBQUAMDsxCzAJBgNVBAYTAlJPMREwDwYD VQQKEwhjZXJ0U0lHTjEZMBcGA1UECxMQY2VydFNJR04gUk9PVCBDQTAeFw0wNjA3MDQxNzIwMDRa Fw0zMTA3MDQxNzIwMDRaMDsxCzAJBgNVBAYTAlJPMREwDwYDVQQKEwhjZXJ0U0lHTjEZMBcGA1UE CxMQY2VydFNJR04gUk9PVCBDQTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBALczuX7I JUqOtdu0KBuqV5Do0SLTZLrTk+jUrIZhQGpgV2hUhE28alQCBf/fm5oqrl0Hj0rDKH/v+yv6efHH rfAQUySQi2bJqIirr1qjAOm+ukbuW3N7LBeCgV5iLKECZbO9xSsAfsT8AzNXDe3i+s5dRdY4zTW2 ssHQnIFKquSyAVwdj1+ZxLGt24gh65AIgoDzMKND5pCCrlUoSe1b16kQOA7+j0xbm0bqQfWwCHTD 0IgztnzXdN/chNFDDnU5oSVAKOp4yw4sLjmdjItuFhwvJoIQ4uNllAoEwF73XVv4EOLQunpL+943 AAAaWyjj0pxzPjKHmKHJUS/X3qwzs08CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8B Af8EBAMCAcYwHQYDVR0OBBYEFOCMm9slSbPxfIbWskKHC9BroNnkMA0GCSqGSIb3DQEBBQUAA4IB AQA+0hyJLjX8+HXd5n9liPRyTMks1zJO890ZeUe9jjtbkw9QSSQTaxQGcu8J06Gh40CEyecYMnQ8 SG4Pn0vU9x7Tk4ZkVJdjclDVVc/6IJMCopvDI5NOFlV2oHB5bc0hH88vLbwZ44gx+FkagQnIl6Z0 x2DEW8xXjrJ1/RsCCdtZb3KTafcxQdaIOL+Hsr0Wefmq5L6IJd1hJyMctTEHBDa0GpC9oHRxUIlt vBTjD4au8as+x6AJzKNI0eDbZOeStc+vckNwi/nDhDwTqn6Sm1dTk/pwwpEOMfmbZ13pljheX7Nz TogVZ96edhBiIL5VaZVDADlN9u6wWk5JRFRYX0KD -----END CERTIFICATE----- NetLock Arany (Class Gold) Főtanúsítvány ======================================== -----BEGIN CERTIFICATE----- MIIEFTCCAv2gAwIBAgIGSUEs5AAQMA0GCSqGSIb3DQEBCwUAMIGnMQswCQYDVQQGEwJIVTERMA8G A1UEBwwIQnVkYXBlc3QxFTATBgNVBAoMDE5ldExvY2sgS2Z0LjE3MDUGA1UECwwuVGFuw7pzw610 dsOhbnlraWFkw7NrIChDZXJ0aWZpY2F0aW9uIFNlcnZpY2VzKTE1MDMGA1UEAwwsTmV0TG9jayBB cmFueSAoQ2xhc3MgR29sZCkgRsWRdGFuw7pzw610dsOhbnkwHhcNMDgxMjExMTUwODIxWhcNMjgx MjA2MTUwODIxWjCBpzELMAkGA1UEBhMCSFUxETAPBgNVBAcMCEJ1ZGFwZXN0MRUwEwYDVQQKDAxO ZXRMb2NrIEtmdC4xNzA1BgNVBAsMLlRhbsO6c8OtdHbDoW55a2lhZMOzayAoQ2VydGlmaWNhdGlv biBTZXJ2aWNlcykxNTAzBgNVBAMMLE5ldExvY2sgQXJhbnkgKENsYXNzIEdvbGQpIEbFkXRhbsO6 c8OtdHbDoW55MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxCRec75LbRTDofTjl5Bu 0jBFHjzuZ9lk4BqKf8owyoPjIMHj9DrTlF8afFttvzBPhCf2nx9JvMaZCpDyD/V/Q4Q3Y1GLeqVw /HpYzY6b7cNGbIRwXdrzAZAj/E4wqX7hJ2Pn7WQ8oLjJM2P+FpD/sLj916jAwJRDC7bVWaaeVtAk H3B5r9s5VA1lddkVQZQBr17s9o3x/61k/iCa11zr/qYfCGSji3ZVrR47KGAuhyXoqq8fxmRGILdw fzzeSNuWU7c5d+Qa4scWhHaXWy+7GRWF+GmF9ZmnqfI0p6m2pgP8b4Y9VHx2BJtr+UBdADTHLpl1 neWIA6pN+APSQnbAGwIDAKiLo0UwQzASBgNVHRMBAf8ECDAGAQH/AgEEMA4GA1UdDwEB/wQEAwIB BjAdBgNVHQ4EFgQUzPpnk/C2uNClwB7zU/2MU9+D15YwDQYJKoZIhvcNAQELBQADggEBAKt/7hwW qZw8UQCgwBEIBaeZ5m8BiFRhbvG5GK1Krf6BQCOUL/t1fC8oS2IkgYIL9WHxHG64YTjrgfpioTta YtOUZcTh5m2C+C8lcLIhJsFyUR+MLMOEkMNaj7rP9KdlpeuY0fsFskZ1FSNqb4VjMIDw1Z4fKRzC bLBQWV2QWzuoDTDPv31/zvGdg73JRm4gpvlhUbohL3u+pRVjodSVh/GeufOJ8z2FuLjbvrW5Kfna NwUASZQDhETnv0Mxz3WLJdH0pmT1kvarBes96aULNmLazAZfNou2XjG4Kvte9nHfRCaexOYNkbQu dZWAUWpLMKawYqGT8ZvYzsRjdT9ZR7E= -----END CERTIFICATE----- Hongkong Post Root CA 1 ======================= -----BEGIN CERTIFICATE----- MIIDMDCCAhigAwIBAgICA+gwDQYJKoZIhvcNAQEFBQAwRzELMAkGA1UEBhMCSEsxFjAUBgNVBAoT DUhvbmdrb25nIFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3QgUm9vdCBDQSAxMB4XDTAzMDUx NTA1MTMxNFoXDTIzMDUxNTA0NTIyOVowRzELMAkGA1UEBhMCSEsxFjAUBgNVBAoTDUhvbmdrb25n IFBvc3QxIDAeBgNVBAMTF0hvbmdrb25nIFBvc3QgUm9vdCBDQSAxMIIBIjANBgkqhkiG9w0BAQEF AAOCAQ8AMIIBCgKCAQEArP84tulmAknjorThkPlAj3n54r15/gK97iSSHSL22oVyaf7XPwnU3ZG1 ApzQjVrhVcNQhrkpJsLj2aDxaQMoIIBFIi1WpztUlVYiWR8o3x8gPW2iNr4joLFutbEnPzlTCeqr auh0ssJlXI6/fMN4hM2eFvz1Lk8gKgifd/PFHsSaUmYeSF7jEAaPIpjhZY4bXSNmO7ilMlHIhqqh qZ5/dpTCpmy3QfDVyAY45tQM4vM7TG1QjMSDJ8EThFk9nnV0ttgCXjqQesBCNnLsak3c78QA3xMY V18meMjWCnl3v/evt3a5pQuEF10Q6m/hq5URX208o1xNg1vysxmKgIsLhwIDAQABoyYwJDASBgNV HRMBAf8ECDAGAQH/AgEDMA4GA1UdDwEB/wQEAwIBxjANBgkqhkiG9w0BAQUFAAOCAQEADkbVPK7i h9legYsCmEEIjEy82tvuJxuC52pF7BaLT4Wg87JwvVqWuspube5Gi27nKi6Wsxkz67SfqLI37pio l7Yutmcn1KZJ/RyTZXaeQi/cImyaT/JaFTmxcdcrUehtHJjA2Sr0oYJ71clBoiMBdDhViw+5Lmei IAQ32pwL0xch4I+XeTRvhEgCIDMb5jREn5Fw9IBehEPCKdJsEhTkYY2sEJCehFC78JZvRZ+K88ps T/oROhUVRsPNH4NbLUES7VBnQRM9IauUiqpOfMGx+6fWtScvl6tu4B3i0RwsH0Ti/L6RoZz71ilT c4afU9hDDl3WY4JxHYB0yvbiAmvZWg== -----END CERTIFICATE----- SecureSign RootCA11 =================== -----BEGIN CERTIFICATE----- MIIDbTCCAlWgAwIBAgIBATANBgkqhkiG9w0BAQUFADBYMQswCQYDVQQGEwJKUDErMCkGA1UEChMi SmFwYW4gQ2VydGlmaWNhdGlvbiBTZXJ2aWNlcywgSW5jLjEcMBoGA1UEAxMTU2VjdXJlU2lnbiBS b290Q0ExMTAeFw0wOTA0MDgwNDU2NDdaFw0yOTA0MDgwNDU2NDdaMFgxCzAJBgNVBAYTAkpQMSsw KQYDVQQKEyJKYXBhbiBDZXJ0aWZpY2F0aW9uIFNlcnZpY2VzLCBJbmMuMRwwGgYDVQQDExNTZWN1 cmVTaWduIFJvb3RDQTExMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA/XeqpRyQBTvL TJszi1oURaTnkBbR31fSIRCkF/3frNYfp+TbfPfs37gD2pRY/V1yfIw/XwFndBWW4wI8h9uuywGO wvNmxoVF9ALGOrVisq/6nL+k5tSAMJjzDbaTj6nU2DbysPyKyiyhFTOVMdrAG/LuYpmGYz+/3ZMq g6h2uRMft85OQoWPIucuGvKVCbIFtUROd6EgvanyTgp9UK31BQ1FT0Zx/Sg+U/sE2C3XZR1KG/rP O7AxmjVuyIsG0wCR8pQIZUyxNAYAeoni8McDWc/V1uinMrPmmECGxc0nEovMe863ETxiYAcjPitA bpSACW22s293bzUIUPsCh8U+iQIDAQABo0IwQDAdBgNVHQ4EFgQUW/hNT7KlhtQ60vFjmqC+CfZX t94wDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEBAKCh OBZmLqdWHyGcBvod7bkixTgm2E5P7KN/ed5GIaGHd48HCJqypMWvDzKYC3xmKbabfSVSSUOrTC4r bnpwrxYO4wJs+0LmGJ1F2FXI6Dvd5+H0LgscNFxsWEr7jIhQX5Ucv+2rIrVls4W6ng+4reV6G4pQ Oh29Dbx7VFALuUKvVaAYga1lme++5Jy/xIWrQbJUb9wlze144o4MjQlJ3WN7WmmWAiGovVJZ6X01 y8hSyn+B/tlr0/cR7SXf+Of5pPpyl4RTDaXQMhhRdlkUbA/r7F+AjHVDg8OFmP9Mni0N5HeDk061 lgeLKBObjBmNQSdJQO7e5iNEOdyhIta6A/I= -----END CERTIFICATE----- Microsec e-Szigno Root CA 2009 ============================== -----BEGIN CERTIFICATE----- MIIECjCCAvKgAwIBAgIJAMJ+QwRORz8ZMA0GCSqGSIb3DQEBCwUAMIGCMQswCQYDVQQGEwJIVTER MA8GA1UEBwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2VjIEx0ZC4xJzAlBgNVBAMMHk1pY3Jv c2VjIGUtU3ppZ25vIFJvb3QgQ0EgMjAwOTEfMB0GCSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5o dTAeFw0wOTA2MTYxMTMwMThaFw0yOTEyMzAxMTMwMThaMIGCMQswCQYDVQQGEwJIVTERMA8GA1UE BwwIQnVkYXBlc3QxFjAUBgNVBAoMDU1pY3Jvc2VjIEx0ZC4xJzAlBgNVBAMMHk1pY3Jvc2VjIGUt U3ppZ25vIFJvb3QgQ0EgMjAwOTEfMB0GCSqGSIb3DQEJARYQaW5mb0BlLXN6aWduby5odTCCASIw DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAOn4j/NjrdqG2KfgQvvPkd6mJviZpWNwrZuuyjNA fW2WbqEORO7hE52UQlKavXWFdCyoDh2Tthi3jCyoz/tccbna7P7ofo/kLx2yqHWH2Leh5TvPmUpG 0IMZfcChEhyVbUr02MelTTMuhTlAdX4UfIASmFDHQWe4oIBhVKZsTh/gnQ4H6cm6M+f+wFUoLAKA pxn1ntxVUwOXewdI/5n7N4okxFnMUBBjjqqpGrCEGob5X7uxUG6k0QrM1XF+H6cbfPVTbiJfyyvm 1HxdrtbCxkzlBQHZ7Vf8wSN5/PrIJIOV87VqUQHQd9bpEqH5GoP7ghu5sJf0dgYzQ0mg/wu1+rUC AwEAAaOBgDB+MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBTLD8bf QkPMPcu1SCOhGnqmKrs0aDAfBgNVHSMEGDAWgBTLD8bfQkPMPcu1SCOhGnqmKrs0aDAbBgNVHREE FDASgRBpbmZvQGUtc3ppZ25vLmh1MA0GCSqGSIb3DQEBCwUAA4IBAQDJ0Q5eLtXMs3w+y/w9/w0o lZMEyL/azXm4Q5DwpL7v8u8hmLzU1F0G9u5C7DBsoKqpyvGvivo/C3NqPuouQH4frlRheesuCDfX I/OMn74dseGkddug4lQUsbocKaQY9hK6ohQU4zE1yED/t+AFdlfBHFny+L/k7SViXITwfn4fs775 tyERzAMBVnCnEJIeGzSBHq2cGsMEPO0CYdYeBvNfOofyK/FFh+U9rNHHV4S9a67c2Pm2G2JwCz02 yULyMtd6YebS2z3PyKnJm9zbWETXbzivf3jTo60adbocwTZ8jx5tHMN1Rq41Bab2XD0h7lbwyYIi LXpUq3DDfSJlgnCW -----END CERTIFICATE----- GlobalSign Root CA - R3 ======================= -----BEGIN CERTIFICATE----- MIIDXzCCAkegAwIBAgILBAAAAAABIVhTCKIwDQYJKoZIhvcNAQELBQAwTDEgMB4GA1UECxMXR2xv YmFsU2lnbiBSb290IENBIC0gUjMxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkdsb2Jh bFNpZ24wHhcNMDkwMzE4MTAwMDAwWhcNMjkwMzE4MTAwMDAwWjBMMSAwHgYDVQQLExdHbG9iYWxT aWduIFJvb3QgQ0EgLSBSMzETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFsU2ln bjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAMwldpB5BngiFvXAg7aEyiie/QV2EcWt iHL8RgJDx7KKnQRfJMsuS+FggkbhUqsMgUdwbN1k0ev1LKMPgj0MK66X17YUhhB5uzsTgHeMCOFJ 0mpiLx9e+pZo34knlTifBtc+ycsmWQ1z3rDI6SYOgxXG71uL0gRgykmmKPZpO/bLyCiR5Z2KYVc3 rHQU3HTgOu5yLy6c+9C7v/U9AOEGM+iCK65TpjoWc4zdQQ4gOsC0p6Hpsk+QLjJg6VfLuQSSaGjl OCZgdbKfd/+RFO+uIEn8rUAVSNECMWEZXriX7613t2Saer9fwRPvm2L7DWzgVGkWqQPabumDk3F2 xmmFghcCAwEAAaNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYE FI/wS3+oLkUkrk1Q+mOai97i3Ru8MA0GCSqGSIb3DQEBCwUAA4IBAQBLQNvAUKr+yAzv95ZURUm7 lgAJQayzE4aGKAczymvmdLm6AC2upArT9fHxD4q/c2dKg8dEe3jgr25sbwMpjjM5RcOO5LlXbKr8 EpbsU8Yt5CRsuZRj+9xTaGdWPoO4zzUhw8lo/s7awlOqzJCK6fBdRoyV3XpYKBovHd7NADdBj+1E bddTKJd+82cEHhXXipa0095MJ6RMG3NzdvQXmcIfeg7jLQitChws/zyrVQ4PkX4268NXSb7hLi18 YIvDQVETI53O9zJrlAGomecsMx86OyXShkDOOyyGeMlhLxS67ttVb9+E7gUJTb0o2HLO02JQZR7r kpeDMdmztcpHWD9f -----END CERTIFICATE----- Autoridad de Certificacion Firmaprofesional CIF A62634068 ========================================================= -----BEGIN CERTIFICATE----- MIIGFDCCA/ygAwIBAgIIU+w77vuySF8wDQYJKoZIhvcNAQEFBQAwUTELMAkGA1UEBhMCRVMxQjBA BgNVBAMMOUF1dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwgQ0lGIEE2 MjYzNDA2ODAeFw0wOTA1MjAwODM4MTVaFw0zMDEyMzEwODM4MTVaMFExCzAJBgNVBAYTAkVTMUIw QAYDVQQDDDlBdXRvcmlkYWQgZGUgQ2VydGlmaWNhY2lvbiBGaXJtYXByb2Zlc2lvbmFsIENJRiBB NjI2MzQwNjgwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDKlmuO6vj78aI14H9M2uDD Utd9thDIAl6zQyrET2qyyhxdKJp4ERppWVevtSBC5IsP5t9bpgOSL/UR5GLXMnE42QQMcas9UX4P B99jBVzpv5RvwSmCwLTaUbDBPLutN0pcyvFLNg4kq7/DhHf9qFD0sefGL9ItWY16Ck6WaVICqjaY 7Pz6FIMMNx/Jkjd/14Et5cS54D40/mf0PmbR0/RAz15iNA9wBj4gGFrO93IbJWyTdBSTo3OxDqqH ECNZXyAFGUftaI6SEspd/NYrspI8IM/hX68gvqB2f3bl7BqGYTM+53u0P6APjqK5am+5hyZvQWyI plD9amML9ZMWGxmPsu2bm8mQ9QEM3xk9Dz44I8kvjwzRAv4bVdZO0I08r0+k8/6vKtMFnXkIoctX MbScyJCyZ/QYFpM6/EfY0XiWMR+6KwxfXZmtY4laJCB22N/9q06mIqqdXuYnin1oKaPnirjaEbsX LZmdEyRG98Xi2J+Of8ePdG1asuhy9azuJBCtLxTa/y2aRnFHvkLfuwHb9H/TKI8xWVvTyQKmtFLK bpf7Q8UIJm+K9Lv9nyiqDdVF8xM6HdjAeI9BZzwelGSuewvF6NkBiDkal4ZkQdU7hwxu+g/GvUgU vzlN1J5Bto+WHWOWk9mVBngxaJ43BjuAiUVhOSPHG0SjFeUc+JIwuwIDAQABo4HvMIHsMBIGA1Ud EwEB/wQIMAYBAf8CAQEwDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBRlzeurNR4APn7VdMActHNH DhpkLzCBpgYDVR0gBIGeMIGbMIGYBgRVHSAAMIGPMC8GCCsGAQUFBwIBFiNodHRwOi8vd3d3LmZp cm1hcHJvZmVzaW9uYWwuY29tL2NwczBcBggrBgEFBQcCAjBQHk4AUABhAHMAZQBvACAAZABlACAA bABhACAAQgBvAG4AYQBuAG8AdgBhACAANAA3ACAAQgBhAHIAYwBlAGwAbwBuAGEAIAAwADgAMAAx ADcwDQYJKoZIhvcNAQEFBQADggIBABd9oPm03cXF661LJLWhAqvdpYhKsg9VSytXjDvlMd3+xDLx 51tkljYyGOylMnfX40S2wBEqgLk9am58m9Ot/MPWo+ZkKXzR4Tgegiv/J2Wv+xYVxC5xhOW1//qk R71kMrv2JYSiJ0L1ILDCExARzRAVukKQKtJE4ZYm6zFIEv0q2skGz3QeqUvVhyj5eTSSPi5E6PaP T481PyWzOdxjKpBrIF/EUhJOlywqrJ2X3kjyo2bbwtKDlaZmp54lD+kLM5FlClrD2VQS3a/DTg4f Jl4N3LON7NWBcN7STyQF82xO9UxJZo3R/9ILJUFI/lGExkKvgATP0H5kSeTy36LssUzAKh3ntLFl osS88Zj0qnAHY7S42jtM+kAiMFsRpvAFDsYCA0irhpuF3dvd6qJ2gHN99ZwExEWN57kci57q13XR crHedUTnQn3iV2t93Jm8PYMo6oCTjcVMZcFwgbg4/EMxsvYDNEeyrPsiBsse3RdHHF9mudMaotoR saS8I8nkvof/uZS2+F0gStRf571oe2XyFR7SOqkt6dhrJKyXWERHrVkY8SFlcN7ONGCoQPHzPKTD KCOM/iczQ0CgFzzr6juwcqajuUpLXhZI9LK8yIySxZ2frHI2vDSANGupi5LAuBft7HZT9SQBjLMi 6Et8Vcad+qMUu2WFbm5PEn4KPJ2V -----END CERTIFICATE----- Izenpe.com ========== -----BEGIN CERTIFICATE----- MIIF8TCCA9mgAwIBAgIQALC3WhZIX7/hy/WL1xnmfTANBgkqhkiG9w0BAQsFADA4MQswCQYDVQQG EwJFUzEUMBIGA1UECgwLSVpFTlBFIFMuQS4xEzARBgNVBAMMCkl6ZW5wZS5jb20wHhcNMDcxMjEz MTMwODI4WhcNMzcxMjEzMDgyNzI1WjA4MQswCQYDVQQGEwJFUzEUMBIGA1UECgwLSVpFTlBFIFMu QS4xEzARBgNVBAMMCkl6ZW5wZS5jb20wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDJ 03rKDx6sp4boFmVqscIbRTJxldn+EFvMr+eleQGPicPK8lVx93e+d5TzcqQsRNiekpsUOqHnJJAK ClaOxdgmlOHZSOEtPtoKct2jmRXagaKH9HtuJneJWK3W6wyyQXpzbm3benhB6QiIEn6HLmYRY2xU +zydcsC8Lv/Ct90NduM61/e0aL6i9eOBbsFGb12N4E3GVFWJGjMxCrFXuaOKmMPsOzTFlUFpfnXC PCDFYbpRR6AgkJOhkEvzTnyFRVSa0QUmQbC1TR0zvsQDyCV8wXDbO/QJLVQnSKwv4cSsPsjLkkxT OTcj7NMB+eAJRE1NZMDhDVqHIrytG6P+JrUV86f8hBnp7KGItERphIPzidF0BqnMC9bC3ieFUCbK F7jJeodWLBoBHmy+E60QrLUk9TiRodZL2vG70t5HtfG8gfZZa88ZU+mNFctKy6lvROUbQc/hhqfK 0GqfvEyNBjNaooXlkDWgYlwWTvDjovoDGrQscbNYLN57C9saD+veIR8GdwYDsMnvmfzAuU8Lhij+ 0rnq49qlw0dpEuDb8PYZi+17cNcC1u2HGCgsBCRMd+RIihrGO5rUD8r6ddIBQFqNeb+Lz0vPqhbB leStTIo+F5HUsWLlguWABKQDfo2/2n+iD5dPDNMN+9fR5XJ+HMh3/1uaD7euBUbl8agW7EekFwID AQABo4H2MIHzMIGwBgNVHREEgagwgaWBD2luZm9AaXplbnBlLmNvbaSBkTCBjjFHMEUGA1UECgw+ SVpFTlBFIFMuQS4gLSBDSUYgQTAxMzM3MjYwLVJNZXJjLlZpdG9yaWEtR2FzdGVpeiBUMTA1NSBG NjIgUzgxQzBBBgNVBAkMOkF2ZGEgZGVsIE1lZGl0ZXJyYW5lbyBFdG9yYmlkZWEgMTQgLSAwMTAx MCBWaXRvcmlhLUdhc3RlaXowDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0O BBYEFB0cZQ6o8iV7tJHP5LGx5r1VdGwFMA0GCSqGSIb3DQEBCwUAA4ICAQB4pgwWSp9MiDrAyw6l Fn2fuUhfGI8NYjb2zRlrrKvV9pF9rnHzP7MOeIWblaQnIUdCSnxIOvVFfLMMjlF4rJUT3sb9fbga kEyrkgPH7UIBzg/YsfqikuFgba56awmqxinuaElnMIAkejEWOVt+8Rwu3WwJrfIxwYJOubv5vr8q hT/AQKM6WfxZSzwoJNu0FXWuDYi6LnPAvViH5ULy617uHjAimcs30cQhbIHsvm0m5hzkQiCeR7Cs g1lwLDXWrzY0tM07+DKo7+N4ifuNRSzanLh+QBxh5z6ikixL8s36mLYp//Pye6kfLqCTVyvehQP5 aTfLnnhqBbTFMXiJ7HqnheG5ezzevh55hM6fcA5ZwjUukCox2eRFekGkLhObNA5me0mrZJfQRsN5 nXJQY6aYWwa9SG3YOYNw6DXwBdGqvOPbyALqfP2C2sJbUjWumDqtujWTI6cfSN01RpiyEGjkpTHC ClguGYEQyVB1/OpaFs4R1+7vUIgtYf8/QnMFlEPVjjxOAToZpR9GTnfQXeWBIiGH/pR9hNiTrdZo Q0iy2+tzJOeRf1SktoA+naM8THLCV8Sg1Mw4J87VBp6iSNnpn86CcDaTmjvfliHjWbcM2pE38P1Z WrOZyGlsQyYBNWNgVYkDOnXYukrZVP/u3oDYLdE41V4tC5h9Pmzb/CaIxw== -----END CERTIFICATE----- Go Daddy Root Certificate Authority - G2 ======================================== -----BEGIN CERTIFICATE----- MIIDxTCCAq2gAwIBAgIBADANBgkqhkiG9w0BAQsFADCBgzELMAkGA1UEBhMCVVMxEDAOBgNVBAgT B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxGjAYBgNVBAoTEUdvRGFkZHkuY29tLCBJbmMu MTEwLwYDVQQDEyhHbyBEYWRkeSBSb290IENlcnRpZmljYXRlIEF1dGhvcml0eSAtIEcyMB4XDTA5 MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgYMxCzAJBgNVBAYTAlVTMRAwDgYDVQQIEwdBcml6 b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMRowGAYDVQQKExFHb0RhZGR5LmNvbSwgSW5jLjExMC8G A1UEAxMoR28gRGFkZHkgUm9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZI hvcNAQEBBQADggEPADCCAQoCggEBAL9xYgjx+lk09xvJGKP3gElY6SKDE6bFIEMBO4Tx5oVJnyfq 9oQbTqC023CYxzIBsQU+B07u9PpPL1kwIuerGVZr4oAH/PMWdYA5UXvl+TW2dE6pjYIT5LY/qQOD +qK+ihVqf94Lw7YZFAXK6sOoBJQ7RnwyDfMAZiLIjWltNowRGLfTshxgtDj6AozO091GB94KPutd fMh8+7ArU6SSYmlRJQVhGkSBjCypQ5Yj36w6gZoOKcUcqeldHraenjAKOc7xiID7S13MMuyFYkMl NAJWJwGRtDtwKj9useiciAF9n9T521NtYJ2/LOdYq7hfRvzOxBsDPAnrSTFcaUaz4EcCAwEAAaNC MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFDqahQcQZyi27/a9 BUFuIMGU2g/eMA0GCSqGSIb3DQEBCwUAA4IBAQCZ21151fmXWWcDYfF+OwYxdS2hII5PZYe096ac vNjpL9DbWu7PdIxztDhC2gV7+AJ1uP2lsdeu9tfeE8tTEH6KRtGX+rcuKxGrkLAngPnon1rpN5+r 5N9ss4UXnT3ZJE95kTXWXwTrgIOrmgIttRD02JDHBHNA7XIloKmf7J6raBKZV8aPEjoJpL1E/QYV N8Gb5DKj7Tjo2GTzLH4U/ALqn83/B2gX2yKQOC16jdFU8WnjXzPKej17CuPKf1855eJ1usV2GDPO LPAvTK33sefOT6jEm0pUBsV/fdUID+Ic/n4XuKxe9tQWskMJDE32p2u0mYRlynqI4uJEvlz36hz1 -----END CERTIFICATE----- Starfield Root Certificate Authority - G2 ========================================= -----BEGIN CERTIFICATE----- MIID3TCCAsWgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBjzELMAkGA1UEBhMCVVMxEDAOBgNVBAgT B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNobm9s b2dpZXMsIEluYy4xMjAwBgNVBAMTKVN0YXJmaWVsZCBSb290IENlcnRpZmljYXRlIEF1dGhvcml0 eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgY8xCzAJBgNVBAYTAlVTMRAw DgYDVQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxTdGFyZmllbGQg VGVjaG5vbG9naWVzLCBJbmMuMTIwMAYDVQQDEylTdGFyZmllbGQgUm9vdCBDZXJ0aWZpY2F0ZSBB dXRob3JpdHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL3twQP89o/8ArFv W59I2Z154qK3A2FWGMNHttfKPTUuiUP3oWmb3ooa/RMgnLRJdzIpVv257IzdIvpy3Cdhl+72WoTs bhm5iSzchFvVdPtrX8WJpRBSiUZV9Lh1HOZ/5FSuS/hVclcCGfgXcVnrHigHdMWdSL5stPSksPNk N3mSwOxGXn/hbVNMYq/NHwtjuzqd+/x5AJhhdM8mgkBj87JyahkNmcrUDnXMN/uLicFZ8WJ/X7Nf ZTD4p7dNdloedl40wOiWVpmKs/B/pM293DIxfJHP4F8R+GuqSVzRmZTRouNjWwl2tVZi4Ut0HZbU JtQIBFnQmA4O5t78w+wfkPECAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC AQYwHQYDVR0OBBYEFHwMMh+n2TB/xH1oo2Kooc6rB1snMA0GCSqGSIb3DQEBCwUAA4IBAQARWfol TwNvlJk7mh+ChTnUdgWUXuEok21iXQnCoKjUsHU48TRqneSfioYmUeYs0cYtbpUgSpIB7LiKZ3sx 4mcujJUDJi5DnUox9g61DLu34jd/IroAow57UvtruzvE03lRTs2Q9GcHGcg8RnoNAX3FWOdt5oUw F5okxBDgBPfg8n/Uqgr/Qh037ZTlZFkSIHc40zI+OIF1lnP6aI+xy84fxez6nH7PfrHxBy22/L/K pL/QlwVKvOoYKAKQvVR4CSFx09F9HdkWsKlhPdAKACL8x3vLCWRFCztAgfd9fDL1mMpYjn0q7pBZ c2T5NnReJaH1ZgUufzkVqSr7UIuOhWn0 -----END CERTIFICATE----- Starfield Services Root Certificate Authority - G2 ================================================== -----BEGIN CERTIFICATE----- MIID7zCCAtegAwIBAgIBADANBgkqhkiG9w0BAQsFADCBmDELMAkGA1UEBhMCVVMxEDAOBgNVBAgT B0FyaXpvbmExEzARBgNVBAcTClNjb3R0c2RhbGUxJTAjBgNVBAoTHFN0YXJmaWVsZCBUZWNobm9s b2dpZXMsIEluYy4xOzA5BgNVBAMTMlN0YXJmaWVsZCBTZXJ2aWNlcyBSb290IENlcnRpZmljYXRl IEF1dGhvcml0eSAtIEcyMB4XDTA5MDkwMTAwMDAwMFoXDTM3MTIzMTIzNTk1OVowgZgxCzAJBgNV BAYTAlVTMRAwDgYDVQQIEwdBcml6b25hMRMwEQYDVQQHEwpTY290dHNkYWxlMSUwIwYDVQQKExxT dGFyZmllbGQgVGVjaG5vbG9naWVzLCBJbmMuMTswOQYDVQQDEzJTdGFyZmllbGQgU2VydmljZXMg Um9vdCBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkgLSBHMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCC AQoCggEBANUMOsQq+U7i9b4Zl1+OiFOxHz/Lz58gE20pOsgPfTz3a3Y4Y9k2YKibXlwAgLIvWX/2 h/klQ4bnaRtSmpDhcePYLQ1Ob/bISdm28xpWriu2dBTrz/sm4xq6HZYuajtYlIlHVv8loJNwU4Pa hHQUw2eeBGg6345AWh1KTs9DkTvnVtYAcMtS7nt9rjrnvDH5RfbCYM8TWQIrgMw0R9+53pBlbQLP LJGmpufehRhJfGZOozptqbXuNC66DQO4M99H67FrjSXZm86B0UVGMpZwh94CDklDhbZsc7tk6mFB rMnUVN+HL8cisibMn1lUaJ/8viovxFUcdUBgF4UCVTmLfwUCAwEAAaNCMEAwDwYDVR0TAQH/BAUw AwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJxfAN+qAdcwKziIorhtSpzyEZGDMA0GCSqG SIb3DQEBCwUAA4IBAQBLNqaEd2ndOxmfZyMIbw5hyf2E3F/YNoHN2BtBLZ9g3ccaaNnRbobhiCPP E95Dz+I0swSdHynVv/heyNXBve6SbzJ08pGCL72CQnqtKrcgfU28elUSwhXqvfdqlS5sdJ/PHLTy xQGjhdByPq1zqwubdQxtRbeOlKyWN7Wg0I8VRw7j6IPdj/3vQQF3zCepYoUz8jcI73HPdwbeyBkd iEDPfUYd/x7H4c7/I9vG+o1VTqkC50cRRj70/b17KSa7qWFiNyi2LSr2EIZkyXCn0q23KXB56jza YyWf/Wi3MOxw+3WKt21gZ7IeyLnp2KhvAotnDU0mV3HaIPzBSlCNsSi6 -----END CERTIFICATE----- AffirmTrust Commercial ====================== -----BEGIN CERTIFICATE----- MIIDTDCCAjSgAwIBAgIId3cGJyapsXwwDQYJKoZIhvcNAQELBQAwRDELMAkGA1UEBhMCVVMxFDAS BgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBDb21tZXJjaWFsMB4XDTEw MDEyOTE0MDYwNloXDTMwMTIzMTE0MDYwNlowRDELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmly bVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBDb21tZXJjaWFsMIIBIjANBgkqhkiG9w0BAQEF AAOCAQ8AMIIBCgKCAQEA9htPZwcroRX1BiLLHwGy43NFBkRJLLtJJRTWzsO3qyxPxkEylFf6Eqdb DuKPHx6GGaeqtS25Xw2Kwq+FNXkyLbscYjfysVtKPcrNcV/pQr6U6Mje+SJIZMblq8Yrba0F8PrV C8+a5fBQpIs7R6UjW3p6+DM/uO+Zl+MgwdYoic+U+7lF7eNAFxHUdPALMeIrJmqbTFeurCA+ukV6 BfO9m2kVrn1OIGPENXY6BwLJN/3HR+7o8XYdcxXyl6S1yHp52UKqK39c/s4mT6NmgTWvRLpUHhww MmWd5jyTXlBOeuM61G7MGvv50jeuJCqrVwMiKA1JdX+3KNp1v47j3A55MQIDAQABo0IwQDAdBgNV HQ4EFgQUnZPGU4teyq8/nx4P5ZmVvCT2lI8wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC AQYwDQYJKoZIhvcNAQELBQADggEBAFis9AQOzcAN/wr91LoWXym9e2iZWEnStB03TX8nfUYGXUPG hi4+c7ImfU+TqbbEKpqrIZcUsd6M06uJFdhrJNTxFq7YpFzUf1GO7RgBsZNjvbz4YYCanrHOQnDi qX0GJX0nof5v7LMeJNrjS1UaADs1tDvZ110w/YETifLCBivtZ8SOyUOyXGsViQK8YvxO8rUzqrJv 0wqiUOP2O+guRMLbZjipM1ZI8W0bM40NjD9gN53Tym1+NH4Nn3J2ixufcv1SNUFFApYvHLKac0kh sUlHRUe072o0EclNmsxZt9YCnlpOZbWUrhvfKbAW8b8Angc6F2S1BLUjIZkKlTuXfO8= -----END CERTIFICATE----- AffirmTrust Networking ====================== -----BEGIN CERTIFICATE----- MIIDTDCCAjSgAwIBAgIIfE8EORzUmS0wDQYJKoZIhvcNAQEFBQAwRDELMAkGA1UEBhMCVVMxFDAS BgNVBAoMC0FmZmlybVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBOZXR3b3JraW5nMB4XDTEw MDEyOTE0MDgyNFoXDTMwMTIzMTE0MDgyNFowRDELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmly bVRydXN0MR8wHQYDVQQDDBZBZmZpcm1UcnVzdCBOZXR3b3JraW5nMIIBIjANBgkqhkiG9w0BAQEF AAOCAQ8AMIIBCgKCAQEAtITMMxcua5Rsa2FSoOujz3mUTOWUgJnLVWREZY9nZOIG41w3SfYvm4SE Hi3yYJ0wTsyEheIszx6e/jarM3c1RNg1lho9Nuh6DtjVR6FqaYvZ/Ls6rnla1fTWcbuakCNrmreI dIcMHl+5ni36q1Mr3Lt2PpNMCAiMHqIjHNRqrSK6mQEubWXLviRmVSRLQESxG9fhwoXA3hA/Pe24 /PHxI1Pcv2WXb9n5QHGNfb2V1M6+oF4nI979ptAmDgAp6zxG8D1gvz9Q0twmQVGeFDdCBKNwV6gb h+0t+nvujArjqWaJGctB+d1ENmHP4ndGyH329JKBNv3bNPFyfvMMFr20FQIDAQABo0IwQDAdBgNV HQ4EFgQUBx/S55zawm6iQLSwelAQUHTEyL0wDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC AQYwDQYJKoZIhvcNAQEFBQADggEBAIlXshZ6qML91tmbmzTCnLQyFE2npN/svqe++EPbkTfOtDIu UFUaNU52Q3Eg75N3ThVwLofDwR1t3Mu1J9QsVtFSUzpE0nPIxBsFZVpikpzuQY0x2+c06lkh1QF6 12S4ZDnNye2v7UsDSKegmQGA3GWjNq5lWUhPgkvIZfFXHeVZLgo/bNjR9eUJtGxUAArgFU2HdW23 WJZa3W3SAKD0m0i+wzekujbgfIeFlxoVot4uolu9rxj5kFDNcFn4J2dHy8egBzp90SxdbBk6ZrV9 /ZFvgrG+CJPbFEfxojfHRZ48x3evZKiT3/Zpg4Jg8klCNO1aAFSFHBY2kgxc+qatv9s= -----END CERTIFICATE----- AffirmTrust Premium =================== -----BEGIN CERTIFICATE----- MIIFRjCCAy6gAwIBAgIIbYwURrGmCu4wDQYJKoZIhvcNAQEMBQAwQTELMAkGA1UEBhMCVVMxFDAS BgNVBAoMC0FmZmlybVRydXN0MRwwGgYDVQQDDBNBZmZpcm1UcnVzdCBQcmVtaXVtMB4XDTEwMDEy OTE0MTAzNloXDTQwMTIzMTE0MTAzNlowQTELMAkGA1UEBhMCVVMxFDASBgNVBAoMC0FmZmlybVRy dXN0MRwwGgYDVQQDDBNBZmZpcm1UcnVzdCBQcmVtaXVtMIICIjANBgkqhkiG9w0BAQEFAAOCAg8A MIICCgKCAgEAxBLfqV/+Qd3d9Z+K4/as4Tx4mrzY8H96oDMq3I0gW64tb+eT2TZwamjPjlGjhVtn BKAQJG9dKILBl1fYSCkTtuG+kU3fhQxTGJoeJKJPj/CihQvL9Cl/0qRY7iZNyaqoe5rZ+jjeRFcV 5fiMyNlI4g0WJx0eyIOFJbe6qlVBzAMiSy2RjYvmia9mx+n/K+k8rNrSs8PhaJyJ+HoAVt70VZVs +7pk3WKL3wt3MutizCaam7uqYoNMtAZ6MMgpv+0GTZe5HMQxK9VfvFMSF5yZVylmd2EhMQcuJUmd GPLu8ytxjLW6OQdJd/zvLpKQBY0tL3d770O/Nbua2Plzpyzy0FfuKE4mX4+QaAkvuPjcBukumj5R p9EixAqnOEhss/n/fauGV+O61oV4d7pD6kh/9ti+I20ev9E2bFhc8e6kGVQa9QPSdubhjL08s9NI S+LI+H+SqHZGnEJlPqQewQcDWkYtuJfzt9WyVSHvutxMAJf7FJUnM7/oQ0dG0giZFmA7mn7S5u04 6uwBHjxIVkkJx0w3AJ6IDsBz4W9m6XJHMD4Q5QsDyZpCAGzFlH5hxIrff4IaC1nEWTJ3s7xgaVY5 /bQGeyzWZDbZvUjthB9+pSKPKrhC9IK31FOQeE4tGv2Bb0TXOwF0lkLgAOIua+rF7nKsu7/+6qqo +Nz2snmKtmcCAwEAAaNCMEAwHQYDVR0OBBYEFJ3AZ6YMItkm9UWrpmVSESfYRaxjMA8GA1UdEwEB /wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBDAUAA4ICAQCzV00QYk465KzquByv MiPIs0laUZx2KI15qldGF9X1Uva3ROgIRL8YhNILgM3FEv0AVQVhh0HctSSePMTYyPtwni94loMg Nt58D2kTiKV1NpgIpsbfrM7jWNa3Pt668+s0QNiigfV4Py/VpfzZotReBA4Xrf5B8OWycvpEgjNC 6C1Y91aMYj+6QrCcDFx+LmUmXFNPALJ4fqENmS2NuB2OosSw/WDQMKSOyARiqcTtNd56l+0OOF6S L5Nwpamcb6d9Ex1+xghIsV5n61EIJenmJWtSKZGc0jlzCFfemQa0W50QBuHCAKi4HEoCChTQwUHK +4w1IX2COPKpVJEZNZOUbWo6xbLQu4mGk+ibyQ86p3q4ofB4Rvr8Ny/lioTz3/4E2aFooC8k4gmV BtWVyuEklut89pMFu+1z6S3RdTnX5yTb2E5fQ4+e0BQ5v1VwSJlXMbSc7kqYA5YwH2AG7hsj/oFg IxpHYoWlzBk0gG+zrBrjn/B7SK3VAdlntqlyk+otZrWyuOQ9PLLvTIzq6we/qzWaVYa8GKa1qF60 g2xraUDTn9zxw2lrueFtCfTxqlB2Cnp9ehehVZZCmTEJ3WARjQUwfuaORtGdFNrHF+QFlozEJLUb zxQHskD4o55BhrwE0GuWyCqANP2/7waj3VjFhT0+j/6eKeC2uAloGRwYQw== -----END CERTIFICATE----- AffirmTrust Premium ECC ======================= -----BEGIN CERTIFICATE----- MIIB/jCCAYWgAwIBAgIIdJclisc/elQwCgYIKoZIzj0EAwMwRTELMAkGA1UEBhMCVVMxFDASBgNV BAoMC0FmZmlybVRydXN0MSAwHgYDVQQDDBdBZmZpcm1UcnVzdCBQcmVtaXVtIEVDQzAeFw0xMDAx MjkxNDIwMjRaFw00MDEyMzExNDIwMjRaMEUxCzAJBgNVBAYTAlVTMRQwEgYDVQQKDAtBZmZpcm1U cnVzdDEgMB4GA1UEAwwXQWZmaXJtVHJ1c3QgUHJlbWl1bSBFQ0MwdjAQBgcqhkjOPQIBBgUrgQQA IgNiAAQNMF4bFZ0D0KF5Nbc6PJJ6yhUczWLznCZcBz3lVPqj1swS6vQUX+iOGasvLkjmrBhDeKzQ N8O9ss0s5kfiGuZjuD0uL3jET9v0D6RoTFVya5UdThhClXjMNzyR4ptlKymjQjBAMB0GA1UdDgQW BBSaryl6wBE1NSZRMADDav5A1a7WPDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAK BggqhkjOPQQDAwNnADBkAjAXCfOHiFBar8jAQr9HX/VsaobgxCd05DhT1wV/GzTjxi+zygk8N53X 57hG8f2h4nECMEJZh0PUUd+60wkyWs6Iflc9nF9Ca/UHLbXwgpP5WW+uZPpY5Yse42O+tYHNbwKM eQ== -----END CERTIFICATE----- Certum Trusted Network CA ========================= -----BEGIN CERTIFICATE----- MIIDuzCCAqOgAwIBAgIDBETAMA0GCSqGSIb3DQEBBQUAMH4xCzAJBgNVBAYTAlBMMSIwIAYDVQQK ExlVbml6ZXRvIFRlY2hub2xvZ2llcyBTLkEuMScwJQYDVQQLEx5DZXJ0dW0gQ2VydGlmaWNhdGlv biBBdXRob3JpdHkxIjAgBgNVBAMTGUNlcnR1bSBUcnVzdGVkIE5ldHdvcmsgQ0EwHhcNMDgxMDIy MTIwNzM3WhcNMjkxMjMxMTIwNzM3WjB+MQswCQYDVQQGEwJQTDEiMCAGA1UEChMZVW5pemV0byBU ZWNobm9sb2dpZXMgUy5BLjEnMCUGA1UECxMeQ2VydHVtIENlcnRpZmljYXRpb24gQXV0aG9yaXR5 MSIwIAYDVQQDExlDZXJ0dW0gVHJ1c3RlZCBOZXR3b3JrIENBMIIBIjANBgkqhkiG9w0BAQEFAAOC AQ8AMIIBCgKCAQEA4/t9o3K6wvDJFIf1awFO4W5AB7ptJ11/91sts1rHUV+rpDKmYYe2bg+G0jAC l/jXaVehGDldamR5xgFZrDwxSjh80gTSSyjoIF87B6LMTXPb865Px1bVWqeWifrzq2jUI4ZZJ88J J7ysbnKDHDBy3+Ci6dLhdHUZvSqeexVUBBvXQzmtVSjF4hq79MDkrjhJM8x2hZ85RdKknvISjFH4 fOQtf/WsX+sWn7Et0brMkUJ3TCXJkDhv2/DM+44el1k+1WBO5gUo7Ul5E0u6SNsv+XLTOcr+H9g0 cvW0QM8xAcPs3hEtF10fuFDRXhmnad4HMyjKUJX5p1TLVIZQRan5SQIDAQABo0IwQDAPBgNVHRMB Af8EBTADAQH/MB0GA1UdDgQWBBQIds3LB/8k9sXN7buQvOKEN0Z19zAOBgNVHQ8BAf8EBAMCAQYw DQYJKoZIhvcNAQEFBQADggEBAKaorSLOAT2mo/9i0Eidi15ysHhE49wcrwn9I0j6vSrEuVUEtRCj jSfeC4Jj0O7eDDd5QVsisrCaQVymcODU0HfLI9MA4GxWL+FpDQ3Zqr8hgVDZBqWo/5U30Kr+4rP1 mS1FhIrlQgnXdAIv94nYmem8J9RHjboNRhx3zxSkHLmkMcScKHQDNP8zGSal6Q10tz6XxnboJ5aj Zt3hrvJBW8qYVoNzcOSGGtIxQbovvi0TWnZvTuhOgQ4/WwMioBK+ZlgRSssDxLQqKi2WF+A5VLxI 03YnnZotBqbJ7DnSq9ufmgsnAjUpsUCV5/nonFWIGUbWtzT1fs45mtk48VH3Tyw= -----END CERTIFICATE----- TWCA Root Certification Authority ================================= -----BEGIN CERTIFICATE----- MIIDezCCAmOgAwIBAgIBATANBgkqhkiG9w0BAQUFADBfMQswCQYDVQQGEwJUVzESMBAGA1UECgwJ VEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NBIFJvb3QgQ2VydGlmaWNh dGlvbiBBdXRob3JpdHkwHhcNMDgwODI4MDcyNDMzWhcNMzAxMjMxMTU1OTU5WjBfMQswCQYDVQQG EwJUVzESMBAGA1UECgwJVEFJV0FOLUNBMRAwDgYDVQQLDAdSb290IENBMSowKAYDVQQDDCFUV0NB IFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEK AoIBAQCwfnK4pAOU5qfeCTiRShFAh6d8WWQUe7UREN3+v9XAu1bihSX0NXIP+FPQQeFEAcK0HMMx QhZHhTMidrIKbw/lJVBPhYa+v5guEGcevhEFhgWQxFnQfHgQsIBct+HHK3XLfJ+utdGdIzdjp9xC oi2SBBtQwXu4PhvJVgSLL1KbralW6cH/ralYhzC2gfeXRfwZVzsrb+RH9JlF/h3x+JejiB03HFyP 4HYlmlD4oFT/RJB2I9IyxsOrBr/8+7/zrX2SYgJbKdM1o5OaQ2RgXbL6Mv87BK9NQGr5x+PvI/1r y+UPizgN7gr8/g+YnzAx3WxSZfmLgb4i4RxYA7qRG4kHAgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIB BjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRqOFsmjd6LWvJPelSDGRjjCDWmujANBgkqhkiG 9w0BAQUFAAOCAQEAPNV3PdrfibqHDAhUaiBQkr6wQT25JmSDCi/oQMCXKCeCMErJk/9q56YAf4lC mtYR5VPOL8zy2gXE/uJQxDqGfczafhAJO5I1KlOy/usrBdlsXebQ79NqZp4VKIV66IIArB6nCWlW QtNoURi+VJq/REG6Sb4gumlc7rh3zc5sH62Dlhh9DrUUOYTxKOkto557HnpyWoOzeW/vtPzQCqVY T0bf+215WfKEIlKuD8z7fDvnaspHYcN6+NOSBB+4IIThNlQWx0DeO4pz3N/GCUzf7Nr/1FNCocny Yh0igzyXxfkZYiesZSLX0zzG5Y6yU8xJzrww/nsOM5D77dIUkR8Hrw== -----END CERTIFICATE----- Security Communication RootCA2 ============================== -----BEGIN CERTIFICATE----- MIIDdzCCAl+gAwIBAgIBADANBgkqhkiG9w0BAQsFADBdMQswCQYDVQQGEwJKUDElMCMGA1UEChMc U0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEnMCUGA1UECxMeU2VjdXJpdHkgQ29tbXVuaWNh dGlvbiBSb290Q0EyMB4XDTA5MDUyOTA1MDAzOVoXDTI5MDUyOTA1MDAzOVowXTELMAkGA1UEBhMC SlAxJTAjBgNVBAoTHFNFQ09NIFRydXN0IFN5c3RlbXMgQ08uLExURC4xJzAlBgNVBAsTHlNlY3Vy aXR5IENvbW11bmljYXRpb24gUm9vdENBMjCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB ANAVOVKxUrO6xVmCxF1SrjpDZYBLx/KWvNs2l9amZIyoXvDjChz335c9S672XewhtUGrzbl+dp++ +T42NKA7wfYxEUV0kz1XgMX5iZnK5atq1LXaQZAQwdbWQonCv/Q4EpVMVAX3NuRFg3sUZdbcDE3R 3n4MqzvEFb46VqZab3ZpUql6ucjrappdUtAtCms1FgkQhNBqyjoGADdH5H5XTz+L62e4iKrFvlNV spHEfbmwhRkGeC7bYRr6hfVKkaHnFtWOojnflLhwHyg/i/xAXmODPIMqGplrz95Zajv8bxbXH/1K EOtOghY6rCcMU/Gt1SSwawNQwS08Ft1ENCcadfsCAwEAAaNCMEAwHQYDVR0OBBYEFAqFqXdlBZh8 QIH4D5csOPEK7DzPMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEB CwUAA4IBAQBMOqNErLlFsceTfsgLCkLfZOoc7llsCLqJX2rKSpWeeo8HxdpFcoJxDjrSzG+ntKEj u/Ykn8sX/oymzsLS28yN/HH8AynBbF0zX2S2ZTuJbxh2ePXcokgfGT+Ok+vx+hfuzU7jBBJV1uXk 3fs+BXziHV7Gp7yXT2g69ekuCkO2r1dcYmh8t/2jioSgrGK+KwmHNPBqAbubKVY8/gA3zyNs8U6q tnRGEmyR7jTV7JqR50S+kDFy1UkC9gLl9B/rfNmWVan/7Ir5mUf/NVoCqgTLiluHcSmRvaS0eg29 mvVXIwAHIRc/SjnRBUkLp7Y3gaVdjKozXoEofKd9J+sAro03 -----END CERTIFICATE----- Hellenic Academic and Research Institutions RootCA 2011 ======================================================= -----BEGIN CERTIFICATE----- MIIEMTCCAxmgAwIBAgIBADANBgkqhkiG9w0BAQUFADCBlTELMAkGA1UEBhMCR1IxRDBCBgNVBAoT O0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgQ2VydC4gQXV0aG9y aXR5MUAwPgYDVQQDEzdIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25z IFJvb3RDQSAyMDExMB4XDTExMTIwNjEzNDk1MloXDTMxMTIwMTEzNDk1MlowgZUxCzAJBgNVBAYT AkdSMUQwQgYDVQQKEztIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25z IENlcnQuIEF1dGhvcml0eTFAMD4GA1UEAxM3SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJlc2VhcmNo IEluc3RpdHV0aW9ucyBSb290Q0EgMjAxMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEB AKlTAOMupvaO+mDYLZU++CwqVE7NuYRhlFhPjz2L5EPzdYmNUeTDN9KKiE15HrcS3UN4SoqS5tdI 1Q+kOilENbgH9mgdVc04UfCMJDGFr4PJfel3r+0ae50X+bOdOFAPplp5kYCvN66m0zH7tSYJnTxa 71HFK9+WXesyHgLacEnsbgzImjeN9/E2YEsmLIKe0HjzDQ9jpFEw4fkrJxIH2Oq9GGKYsFk3fb7u 8yBRQlqD75O6aRXxYp2fmTmCobd0LovUxQt7L/DICto9eQqakxylKHJzkUOap9FNhYS5qXSPFEDH 3N6sQWRstBmbAmNtJGSPRLIl6s5ddAxjMlyNh+UCAwEAAaOBiTCBhjAPBgNVHRMBAf8EBTADAQH/ MAsGA1UdDwQEAwIBBjAdBgNVHQ4EFgQUppFC/RNhSiOeCKQp5dgTBCPuQSUwRwYDVR0eBEAwPqA8 MAWCAy5ncjAFggMuZXUwBoIELmVkdTAGggQub3JnMAWBAy5ncjAFgQMuZXUwBoEELmVkdTAGgQQu b3JnMA0GCSqGSIb3DQEBBQUAA4IBAQAf73lB4XtuP7KMhjdCSk4cNx6NZrokgclPEg8hwAOXhiVt XdMiKahsog2p6z0GW5k6x8zDmjR/qw7IThzh+uTczQ2+vyT+bOdrwg3IBp5OjWEopmr95fZi6hg8 TqBTnbI6nOulnJEWtk2C4AwFSKls9cz4y51JtPACpf1wA+2KIaWuE4ZJwzNzvoc7dIsXRSZMFpGD /md9zU1jZ/rzAxKWeAaNsWftjj++n08C9bMJL/NMh98qy5V8AcysNnq/onN694/BtZqhFLKPM58N 7yLcZnuEvUUXBj08yrl3NI/K6s8/MT7jiOOASSXIl7WdmplNsDz4SgCbZN2fOUvRJ9e4 -----END CERTIFICATE----- Actalis Authentication Root CA ============================== -----BEGIN CERTIFICATE----- MIIFuzCCA6OgAwIBAgIIVwoRl0LE48wwDQYJKoZIhvcNAQELBQAwazELMAkGA1UEBhMCSVQxDjAM BgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlzIFMucC5BLi8wMzM1ODUyMDk2NzEnMCUGA1UE AwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290IENBMB4XDTExMDkyMjExMjIwMloXDTMwMDky MjExMjIwMlowazELMAkGA1UEBhMCSVQxDjAMBgNVBAcMBU1pbGFuMSMwIQYDVQQKDBpBY3RhbGlz IFMucC5BLi8wMzM1ODUyMDk2NzEnMCUGA1UEAwweQWN0YWxpcyBBdXRoZW50aWNhdGlvbiBSb290 IENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAp8bEpSmkLO/lGMWwUKNvUTufClrJ wkg4CsIcoBh/kbWHuUA/3R1oHwiD1S0eiKD4j1aPbZkCkpAW1V8IbInX4ay8IMKx4INRimlNAJZa by/ARH6jDuSRzVju3PvHHkVH3Se5CAGfpiEd9UEtL0z9KK3giq0itFZljoZUj5NDKd45RnijMCO6 zfB9E1fAXdKDa0hMxKufgFpbOr3JpyI/gCczWw63igxdBzcIy2zSekciRDXFzMwujt0q7bd9Zg1f YVEiVRvjRuPjPdA1YprbrxTIW6HMiRvhMCb8oJsfgadHHwTrozmSBp+Z07/T6k9QnBn+locePGX2 oxgkg4YQ51Q+qDp2JE+BIcXjDwL4k5RHILv+1A7TaLndxHqEguNTVHnd25zS8gebLra8Pu2Fbe8l EfKXGkJh90qX6IuxEAf6ZYGyojnP9zz/GPvG8VqLWeICrHuS0E4UT1lF9gxeKF+w6D9Fz8+vm2/7 hNN3WpVvrJSEnu68wEqPSpP4RCHiMUVhUE4Q2OM1fEwZtN4Fv6MGn8i1zeQf1xcGDXqVdFUNaBr8 EBtiZJ1t4JWgw5QHVw0U5r0F+7if5t+L4sbnfpb2U8WANFAoWPASUHEXMLrmeGO89LKtmyuy/uE5 jF66CyCU3nuDuP/jVo23Eek7jPKxwV2dpAtMK9myGPW1n0sCAwEAAaNjMGEwHQYDVR0OBBYEFFLY iDrIn3hm7YnzezhwlMkCAjbQMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUUtiIOsifeGbt ifN7OHCUyQICNtAwDgYDVR0PAQH/BAQDAgEGMA0GCSqGSIb3DQEBCwUAA4ICAQALe3KHwGCmSUyI WOYdiPcUZEim2FgKDk8TNd81HdTtBjHIgT5q1d07GjLukD0R0i70jsNjLiNmsGe+b7bAEzlgqqI0 JZN1Ut6nna0Oh4lScWoWPBkdg/iaKWW+9D+a2fDzWochcYBNy+A4mz+7+uAwTc+G02UQGRjRlwKx K3JCaKygvU5a2hi/a5iB0P2avl4VSM0RFbnAKVy06Ij3Pjaut2L9HmLecHgQHEhb2rykOLpn7VU+ Xlff1ANATIGk0k9jpwlCCRT8AKnCgHNPLsBA2RF7SOp6AsDT6ygBJlh0wcBzIm2Tlf05fbsq4/aC 4yyXX04fkZT6/iyj2HYauE2yOE+b+h1IYHkm4vP9qdCa6HCPSXrW5b0KDtst842/6+OkfcvHlXHo 2qN8xcL4dJIEG4aspCJTQLas/kx2z/uUMsA1n3Y/buWQbqCmJqK4LL7RK4X9p2jIugErsWx0Hbhz lefut8cl8ABMALJ+tguLHPPAUJ4lueAI3jZm/zel0btUZCzJJ7VLkn5l/9Mt4blOvH+kQSGQQXem OR/qnuOf0GZvBeyqdn6/axag67XH/JJULysRJyU3eExRarDzzFhdFPFqSBX/wge2sY0PjlxQRrM9 vwGYT7JZVEc+NHt4bVaTLnPqZih4zR0Uv6CPLy64Lo7yFIrM6bV8+2ydDKXhlg== -----END CERTIFICATE----- Buypass Class 2 Root CA ======================= -----BEGIN CERTIFICATE----- MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU QnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3MgQ2xhc3MgMiBSb290IENBMB4X DTEwMTAyNjA4MzgwM1oXDTQwMTAyNjA4MzgwM1owTjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1 eXBhc3MgQVMtOTgzMTYzMzI3MSAwHgYDVQQDDBdCdXlwYXNzIENsYXNzIDIgUm9vdCBDQTCCAiIw DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANfHXvfBB9R3+0Mh9PT1aeTuMgHbo4Yf5FkNuud1 g1Lr6hxhFUi7HQfKjK6w3Jad6sNgkoaCKHOcVgb/S2TwDCo3SbXlzwx87vFKu3MwZfPVL4O2fuPn 9Z6rYPnT8Z2SdIrkHJasW4DptfQxh6NR/Md+oW+OU3fUl8FVM5I+GC911K2GScuVr1QGbNgGE41b /+EmGVnAJLqBcXmQRFBoJJRfuLMR8SlBYaNByyM21cHxMlAQTn/0hpPshNOOvEu/XAFOBz3cFIqU CqTqc/sLUegTBxj6DvEr0VQVfTzh97QZQmdiXnfgolXsttlpF9U6r0TtSsWe5HonfOV116rLJeff awrbD02TTqigzXsu8lkBarcNuAeBfos4GzjmCleZPe4h6KP1DBbdi+w0jpwqHAAVF41og9JwnxgI zRFo1clrUs3ERo/ctfPYV3Me6ZQ5BL/T3jjetFPsaRyifsSP5BtwrfKi+fv3FmRmaZ9JUaLiFRhn Bkp/1Wy1TbMz4GHrXb7pmA8y1x1LPC5aAVKRCfLf6o3YBkBjqhHk/sM3nhRSP/TizPJhk9H9Z2vX Uq6/aKtAQ6BXNVN48FP4YUIHZMbXb5tMOA1jrGKvNouicwoN9SG9dKpN6nIDSdvHXx1iY8f93ZHs M+71bbRuMGjeyNYmsHVee7QHIJihdjK4TWxPAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYD VR0OBBYEFMmAd+BikoL1RpzzuvdMw964o605MA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsF AAOCAgEAU18h9bqwOlI5LJKwbADJ784g7wbylp7ppHR/ehb8t/W2+xUbP6umwHJdELFx7rxP462s A20ucS6vxOOto70MEae0/0qyexAQH6dXQbLArvQsWdZHEIjzIVEpMMpghq9Gqx3tOluwlN5E40EI osHsHdb9T7bWR9AUC8rmyrV7d35BH16Dx7aMOZawP5aBQW9gkOLo+fsicdl9sz1Gv7SEr5AcD48S aq/v7h56rgJKihcrdv6sVIkkLE8/trKnToyokZf7KcZ7XC25y2a2t6hbElGFtQl+Ynhw/qlqYLYd DnkM/crqJIByw5c/8nerQyIKx+u2DISCLIBrQYoIwOula9+ZEsuK1V6ADJHgJgg2SMX6OBE1/yWD LfJ6v9r9jv6ly0UsH8SIU653DtmadsWOLB2jutXsMq7Aqqz30XpN69QH4kj3Io6wpJ9qzo6ysmD0 oyLQI+uUWnpp3Q+/QFesa1lQ2aOZ4W7+jQF5JyMV3pKdewlNWudLSDBaGOYKbeaP4NK75t98biGC wWg5TbSYWGZizEqQXsP6JwSxeRV0mcy+rSDeJmAc61ZRpqPq5KM/p/9h3PFaTWwyI0PurKju7koS CTxdccK+efrCh2gdC/1cacwG0Jp9VJkqyTkaGa9LKkPzY11aWOIv4x3kqdbQCtCev9eBCfHJxyYN rJgWVqA= -----END CERTIFICATE----- Buypass Class 3 Root CA ======================= -----BEGIN CERTIFICATE----- MIIFWTCCA0GgAwIBAgIBAjANBgkqhkiG9w0BAQsFADBOMQswCQYDVQQGEwJOTzEdMBsGA1UECgwU QnV5cGFzcyBBUy05ODMxNjMzMjcxIDAeBgNVBAMMF0J1eXBhc3MgQ2xhc3MgMyBSb290IENBMB4X DTEwMTAyNjA4Mjg1OFoXDTQwMTAyNjA4Mjg1OFowTjELMAkGA1UEBhMCTk8xHTAbBgNVBAoMFEJ1 eXBhc3MgQVMtOTgzMTYzMzI3MSAwHgYDVQQDDBdCdXlwYXNzIENsYXNzIDMgUm9vdCBDQTCCAiIw DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAKXaCpUWUOOV8l6ddjEGMnqb8RB2uACatVI2zSRH sJ8YZLya9vrVediQYkwiL944PdbgqOkcLNt4EemOaFEVcsfzM4fkoF0LXOBXByow9c3EN3coTRiR 5r/VUv1xLXA+58bEiuPwKAv0dpihi4dVsjoT/Lc+JzeOIuOoTyrvYLs9tznDDgFHmV0ST9tD+leh 7fmdvhFHJlsTmKtdFoqwNxxXnUX/iJY2v7vKB3tvh2PX0DJq1l1sDPGzbjniazEuOQAnFN44wOwZ ZoYS6J1yFhNkUsepNxz9gjDthBgd9K5c/3ATAOux9TN6S9ZV+AWNS2mw9bMoNlwUxFFzTWsL8TQH 2xc519woe2v1n/MuwU8XKhDzzMro6/1rqy6any2CbgTUUgGTLT2G/H783+9CHaZr77kgxve9oKeV /afmiSTYzIw0bOIjL9kSGiG5VZFvC5F5GQytQIgLcOJ60g7YaEi7ghM5EFjp2CoHxhLbWNvSO1UQ RwUVZ2J+GGOmRj8JDlQyXr8NYnon74Do29lLBlo3WiXQCBJ31G8JUJc9yB3D34xFMFbG02SrZvPA Xpacw8Tvw3xrizp5f7NJzz3iiZ+gMEuFuZyUJHmPfWupRWgPK9Dx2hzLabjKSWJtyNBjYt1gD1iq j6G8BaVmos8bdrKEZLFMOVLAMLrwjEsCsLa3AgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYD VR0OBBYEFEe4zf/lb+74suwvTg75JbCOPGvDMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsF AAOCAgEAACAjQTUEkMJAYmDv4jVM1z+s4jSQuKFvdvoWFqRINyzpkMLyPPgKn9iB5btb2iUspKdV cSQy9sgL8rxq+JOssgfCX5/bzMiKqr5qb+FJEMwx14C7u8jYog5kV+qi9cKpMRXSIGrs/CIBKM+G uIAeqcwRpTzyFrNHnfzSgCHEy9BHcEGhyoMZCCxt8l13nIoUE9Q2HJLw5QY33KbmkJs4j1xrG0aG Q0JfPgEHU1RdZX33inOhmlRaHylDFCfChQ+1iHsaO5S3HWCntZznKWlXWpuTekMwGwPXYshApqr8 ZORK15FTAaggiG6cX0S5y2CBNOxv033aSF/rtJC8LakcC6wc1aJoIIAE1vyxjy+7SjENSoYc6+I2 KSb12tjE8nVhz36udmNKekBlk4f4HoCMhuWG1o8O/FMsYOgWYRqiPkN7zTlgVGr18okmAWiDSKIz 6MkEkbIRNBE+6tBDGR8Dk5AM/1E9V/RBbuHLoL7ryWPNbczk+DaqaJ3tvV2XcEQNtg413OEMXbug UZTLfhbrES+jkkXITHHZvMmZUldGL1DPvTVp9D0VzgalLA8+9oG6lLvDu79leNKGef9JOxqDDPDe eOzI8k1MGt6CKfjBWtrt7uYnXuhF0J0cUahoq0Tj0Itq4/g7u9xN12TyUb7mqqta6THuBrxzvxNi Cp/HuZc= -----END CERTIFICATE----- T-TeleSec GlobalRoot Class 3 ============================ -----BEGIN CERTIFICATE----- MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoM IlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBU cnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDMwHhcNMDgx MDAxMTAyOTU2WhcNMzMxMDAxMjM1OTU5WjCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoMIlQtU3lz dGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBD ZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDMwggEiMA0GCSqGSIb3 DQEBAQUAA4IBDwAwggEKAoIBAQC9dZPwYiJvJK7genasfb3ZJNW4t/zN8ELg63iIVl6bmlQdTQyK 9tPPcPRStdiTBONGhnFBSivwKixVA9ZIw+A5OO3yXDw/RLyTPWGrTs0NvvAgJ1gORH8EGoel15YU NpDQSXuhdfsaa3Ox+M6pCSzyU9XDFES4hqX2iys52qMzVNn6chr3IhUciJFrf2blw2qAsCTz34ZF iP0Zf3WHHx+xGwpzJFu5ZeAsVMhg02YXP+HMVDNzkQI6pn97djmiH5a2OK61yJN0HZ65tOVgnS9W 0eDrXltMEnAMbEQgqxHY9Bn20pxSN+f6tsIxO0rUFJmtxxr1XV/6B7h8DR/Wgx6zAgMBAAGjQjBA MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBS1A/d2O2GCahKqGFPr AyGUv/7OyjANBgkqhkiG9w0BAQsFAAOCAQEAVj3vlNW92nOyWL6ukK2YJ5f+AbGwUgC4TeQbIXQb fsDuXmkqJa9c1h3a0nnJ85cp4IaH3gRZD/FZ1GSFS5mvJQQeyUapl96Cshtwn5z2r3Ex3XsFpSzT ucpH9sry9uetuUg/vBa3wW306gmv7PO15wWeph6KU1HWk4HMdJP2udqmJQV0eVp+QD6CSyYRMG7h P0HHRwA11fXT91Q+gT3aSWqas+8QPebrb9HIIkfLzM8BMZLZGOMivgkeGj5asuRrDFR6fUNOuIml e9eiPZaGzPImNC1qkp2aGtAw4l1OBLBfiyB+d8E9lYLRRpo7PHi4b6HQDWSieB4pTpPDpFQUWw== -----END CERTIFICATE----- D-TRUST Root Class 3 CA 2 2009 ============================== -----BEGIN CERTIFICATE----- MIIEMzCCAxugAwIBAgIDCYPzMA0GCSqGSIb3DQEBCwUAME0xCzAJBgNVBAYTAkRFMRUwEwYDVQQK DAxELVRydXN0IEdtYkgxJzAlBgNVBAMMHkQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgMjAwOTAe Fw0wOTExMDUwODM1NThaFw0yOTExMDUwODM1NThaME0xCzAJBgNVBAYTAkRFMRUwEwYDVQQKDAxE LVRydXN0IEdtYkgxJzAlBgNVBAMMHkQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgMjAwOTCCASIw DQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBANOySs96R+91myP6Oi/WUEWJNTrGa9v+2wBoqOAD ER03UAifTUpolDWzU9GUY6cgVq/eUXjsKj3zSEhQPgrfRlWLJ23DEE0NkVJD2IfgXU42tSHKXzlA BF9bfsyjxiupQB7ZNoTWSPOSHjRGICTBpFGOShrvUD9pXRl/RcPHAY9RySPocq60vFYJfxLLHLGv KZAKyVXMD9O0Gu1HNVpK7ZxzBCHQqr0ME7UAyiZsxGsMlFqVlNpQmvH/pStmMaTJOKDfHR+4CS7z p+hnUquVH+BGPtikw8paxTGA6Eian5Rp/hnd2HN8gcqW3o7tszIFZYQ05ub9VxC1X3a/L7AQDcUC AwEAAaOCARowggEWMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFP3aFMSfMN4hvR5COfyrYyNJ 4PGEMA4GA1UdDwEB/wQEAwIBBjCB0wYDVR0fBIHLMIHIMIGAoH6gfIZ6bGRhcDovL2RpcmVjdG9y eS5kLXRydXN0Lm5ldC9DTj1ELVRSVVNUJTIwUm9vdCUyMENsYXNzJTIwMyUyMENBJTIwMiUyMDIw MDksTz1ELVRydXN0JTIwR21iSCxDPURFP2NlcnRpZmljYXRlcmV2b2NhdGlvbmxpc3QwQ6BBoD+G PWh0dHA6Ly93d3cuZC10cnVzdC5uZXQvY3JsL2QtdHJ1c3Rfcm9vdF9jbGFzc18zX2NhXzJfMjAw OS5jcmwwDQYJKoZIhvcNAQELBQADggEBAH+X2zDI36ScfSF6gHDOFBJpiBSVYEQBrLLpME+bUMJm 2H6NMLVwMeniacfzcNsgFYbQDfC+rAF1hM5+n02/t2A7nPPKHeJeaNijnZflQGDSNiH+0LS4F9p0 o3/U37CYAqxva2ssJSRyoWXuJVrl5jLn8t+rSfrzkGkj2wTZ51xY/GXUl77M/C4KzCUqNQT4YJEV dT1B/yMfGchs64JTBKbkTCJNjYy6zltz7GRUUG3RnFX7acM2w4y8PIWmawomDeCTmGCufsYkl4ph X5GOZpIJhzbNi5stPvZR1FDUWSi9g/LMKHtThm3YJohw1+qRzT65ysCQblrGXnRl11z+o+I= -----END CERTIFICATE----- D-TRUST Root Class 3 CA 2 EV 2009 ================================= -----BEGIN CERTIFICATE----- MIIEQzCCAyugAwIBAgIDCYP0MA0GCSqGSIb3DQEBCwUAMFAxCzAJBgNVBAYTAkRFMRUwEwYDVQQK DAxELVRydXN0IEdtYkgxKjAoBgNVBAMMIUQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgRVYgMjAw OTAeFw0wOTExMDUwODUwNDZaFw0yOTExMDUwODUwNDZaMFAxCzAJBgNVBAYTAkRFMRUwEwYDVQQK DAxELVRydXN0IEdtYkgxKjAoBgNVBAMMIUQtVFJVU1QgUm9vdCBDbGFzcyAzIENBIDIgRVYgMjAw OTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAJnxhDRwui+3MKCOvXwEz75ivJn9gpfS egpnljgJ9hBOlSJzmY3aFS3nBfwZcyK3jpgAvDw9rKFs+9Z5JUut8Mxk2og+KbgPCdM03TP1YtHh zRnp7hhPTFiu4h7WDFsVWtg6uMQYZB7jM7K1iXdODL/ZlGsTl28So/6ZqQTMFexgaDbtCHu39b+T 7WYxg4zGcTSHThfqr4uRjRxWQa4iN1438h3Z0S0NL2lRp75mpoo6Kr3HGrHhFPC+Oh25z1uxav60 sUYgovseO3Dvk5h9jHOW8sXvhXCtKSb8HgQ+HKDYD8tSg2J87otTlZCpV6LqYQXY+U3EJ/pure35 11H3a6UCAwEAAaOCASQwggEgMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFNOUikxiEyoZLsyv cop9NteaHNxnMA4GA1UdDwEB/wQEAwIBBjCB3QYDVR0fBIHVMIHSMIGHoIGEoIGBhn9sZGFwOi8v ZGlyZWN0b3J5LmQtdHJ1c3QubmV0L0NOPUQtVFJVU1QlMjBSb290JTIwQ2xhc3MlMjAzJTIwQ0El MjAyJTIwRVYlMjAyMDA5LE89RC1UcnVzdCUyMEdtYkgsQz1ERT9jZXJ0aWZpY2F0ZXJldm9jYXRp b25saXN0MEagRKBChkBodHRwOi8vd3d3LmQtdHJ1c3QubmV0L2NybC9kLXRydXN0X3Jvb3RfY2xh c3NfM19jYV8yX2V2XzIwMDkuY3JsMA0GCSqGSIb3DQEBCwUAA4IBAQA07XtaPKSUiO8aEXUHL7P+ PPoeUSbrh/Yp3uDx1MYkCenBz1UbtDDZzhr+BlGmFaQt77JLvyAoJUnRpjZ3NOhk31KxEcdzes05 nsKtjHEh8lprr988TlWvsoRlFIm5d8sqMb7Po23Pb0iUMkZv53GMoKaEGTcH8gNFCSuGdXzfX2lX ANtu2KZyIktQ1HWYVt+3GP9DQ1CuekR78HlR10M9p9OB0/DJT7naxpeG0ILD5EJt/rDiZE4OJudA NCa1CInXCGNjOCd1HjPqbqjdn5lPdE2BiYBL3ZqXKVwvvoFBuYz/6n1gBp7N1z3TLqMVvKjmJuVv w9y4AyHqnxbxLFS1 -----END CERTIFICATE----- CA Disig Root R2 ================ -----BEGIN CERTIFICATE----- MIIFaTCCA1GgAwIBAgIJAJK4iNuwisFjMA0GCSqGSIb3DQEBCwUAMFIxCzAJBgNVBAYTAlNLMRMw EQYDVQQHEwpCcmF0aXNsYXZhMRMwEQYDVQQKEwpEaXNpZyBhLnMuMRkwFwYDVQQDExBDQSBEaXNp ZyBSb290IFIyMB4XDTEyMDcxOTA5MTUzMFoXDTQyMDcxOTA5MTUzMFowUjELMAkGA1UEBhMCU0sx EzARBgNVBAcTCkJyYXRpc2xhdmExEzARBgNVBAoTCkRpc2lnIGEucy4xGTAXBgNVBAMTEENBIERp c2lnIFJvb3QgUjIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCio8QACdaFXS1tFPbC w3OeNcJxVX6B+6tGUODBfEl45qt5WDza/3wcn9iXAng+a0EE6UG9vgMsRfYvZNSrXaNHPWSb6Wia xswbP7q+sos0Ai6YVRn8jG+qX9pMzk0DIaPY0jSTVpbLTAwAFjxfGs3Ix2ymrdMxp7zo5eFm1tL7 A7RBZckQrg4FY8aAamkw/dLukO8NJ9+flXP04SXabBbeQTg06ov80egEFGEtQX6sx3dOy1FU+16S GBsEWmjGycT6txOgmLcRK7fWV8x8nhfRyyX+hk4kLlYMeE2eARKmK6cBZW58Yh2EhN/qwGu1pSqV g8NTEQxzHQuyRpDRQjrOQG6Vrf/GlK1ul4SOfW+eioANSW1z4nuSHsPzwfPrLgVv2RvPN3YEyLRa 5Beny912H9AZdugsBbPWnDTYltxhh5EF5EQIM8HauQhl1K6yNg3ruji6DOWbnuuNZt2Zz9aJQfYE koopKW1rOhzndX0CcQ7zwOe9yxndnWCywmZgtrEE7snmhrmaZkCo5xHtgUUDi/ZnWejBBhG93c+A Ak9lQHhcR1DIm+YfgXvkRKhbhZri3lrVx/k6RGZL5DJUfORsnLMOPReisjQS1n6yqEm70XooQL6i Fh/f5DcfEXP7kAplQ6INfPgGAVUzfbANuPT1rqVCV3w2EYx7XsQDnYx5nQIDAQABo0IwQDAPBgNV HRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUtZn4r7CU9eMg1gqtzk5WpC5u Qu0wDQYJKoZIhvcNAQELBQADggIBACYGXnDnZTPIgm7ZnBc6G3pmsgH2eDtpXi/q/075KMOYKmFM tCQSin1tERT3nLXK5ryeJ45MGcipvXrA1zYObYVybqjGom32+nNjf7xueQgcnYqfGopTpti72TVV sRHFqQOzVju5hJMiXn7B9hJSi+osZ7z+Nkz1uM/Rs0mSO9MpDpkblvdhuDvEK7Z4bLQjb/D907Je dR+Zlais9trhxTF7+9FGs9K8Z7RiVLoJ92Owk6Ka+elSLotgEqv89WBW7xBci8QaQtyDW2QOy7W8 1k/BfDxujRNt+3vrMNDcTa/F1balTFtxyegxvug4BkihGuLq0t4SOVga/4AOgnXmt8kHbA7v/zjx mHHEt38OFdAlab0inSvtBfZGR6ztwPDUO+Ls7pZbkBNOHlY667DvlruWIxG68kOGdGSVyCh13x01 utI3gzhTODY7z2zp+WsO0PsE6E9312UBeIYMej4hYvF/Y3EMyZ9E26gnonW+boE+18DrG5gPcFw0 sorMwIUY6256s/daoQe/qUKS82Ail+QUoQebTnbAjn39pCXHR+3/H3OszMOl6W8KjptlwlCFtaOg UxLMVYdh84GuEEZhvUQhuMI9dM9+JDX6HAcOmz0iyu8xL4ysEr3vQCj8KWefshNPZiTEUxnpHikV 7+ZtsH8tZ/3zbBt1RqPlShfppNcL -----END CERTIFICATE----- ACCVRAIZ1 ========= -----BEGIN CERTIFICATE----- MIIH0zCCBbugAwIBAgIIXsO3pkN/pOAwDQYJKoZIhvcNAQEFBQAwQjESMBAGA1UEAwwJQUNDVlJB SVoxMRAwDgYDVQQLDAdQS0lBQ0NWMQ0wCwYDVQQKDARBQ0NWMQswCQYDVQQGEwJFUzAeFw0xMTA1 MDUwOTM3MzdaFw0zMDEyMzEwOTM3MzdaMEIxEjAQBgNVBAMMCUFDQ1ZSQUlaMTEQMA4GA1UECwwH UEtJQUNDVjENMAsGA1UECgwEQUNDVjELMAkGA1UEBhMCRVMwggIiMA0GCSqGSIb3DQEBAQUAA4IC DwAwggIKAoICAQCbqau/YUqXry+XZpp0X9DZlv3P4uRm7x8fRzPCRKPfmt4ftVTdFXxpNRFvu8gM jmoYHtiP2Ra8EEg2XPBjs5BaXCQ316PWywlxufEBcoSwfdtNgM3802/J+Nq2DoLSRYWoG2ioPej0 RGy9ocLLA76MPhMAhN9KSMDjIgro6TenGEyxCQ0jVn8ETdkXhBilyNpAlHPrzg5XPAOBOp0KoVdD aaxXbXmQeOW1tDvYvEyNKKGno6e6Ak4l0Squ7a4DIrhrIA8wKFSVf+DuzgpmndFALW4ir50awQUZ 0m/A8p/4e7MCQvtQqR0tkw8jq8bBD5L/0KIV9VMJcRz/RROE5iZe+OCIHAr8Fraocwa48GOEAqDG WuzndN9wrqODJerWx5eHk6fGioozl2A3ED6XPm4pFdahD9GILBKfb6qkxkLrQaLjlUPTAYVtjrs7 8yM2x/474KElB0iryYl0/wiPgL/AlmXz7uxLaL2diMMxs0Dx6M/2OLuc5NF/1OVYm3z61PMOm3WR 5LpSLhl+0fXNWhn8ugb2+1KoS5kE3fj5tItQo05iifCHJPqDQsGH+tUtKSpacXpkatcnYGMN285J 9Y0fkIkyF/hzQ7jSWpOGYdbhdQrqeWZ2iE9x6wQl1gpaepPluUsXQA+xtrn13k/c4LOsOxFwYIRK Q26ZIMApcQrAZQIDAQABo4ICyzCCAscwfQYIKwYBBQUHAQEEcTBvMEwGCCsGAQUFBzAChkBodHRw Oi8vd3d3LmFjY3YuZXMvZmlsZWFkbWluL0FyY2hpdm9zL2NlcnRpZmljYWRvcy9yYWl6YWNjdjEu Y3J0MB8GCCsGAQUFBzABhhNodHRwOi8vb2NzcC5hY2N2LmVzMB0GA1UdDgQWBBTSh7Tj3zcnk1X2 VuqB5TbMjB4/vTAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFNKHtOPfNyeTVfZW6oHlNsyM Hj+9MIIBcwYDVR0gBIIBajCCAWYwggFiBgRVHSAAMIIBWDCCASIGCCsGAQUFBwICMIIBFB6CARAA QQB1AHQAbwByAGkAZABhAGQAIABkAGUAIABDAGUAcgB0AGkAZgBpAGMAYQBjAGkA8wBuACAAUgBh AO0AegAgAGQAZQAgAGwAYQAgAEEAQwBDAFYAIAAoAEEAZwBlAG4AYwBpAGEAIABkAGUAIABUAGUA YwBuAG8AbABvAGcA7QBhACAAeQAgAEMAZQByAHQAaQBmAGkAYwBhAGMAaQDzAG4AIABFAGwAZQBj AHQAcgDzAG4AaQBjAGEALAAgAEMASQBGACAAUQA0ADYAMAAxADEANQA2AEUAKQAuACAAQwBQAFMA IABlAG4AIABoAHQAdABwADoALwAvAHcAdwB3AC4AYQBjAGMAdgAuAGUAczAwBggrBgEFBQcCARYk aHR0cDovL3d3dy5hY2N2LmVzL2xlZ2lzbGFjaW9uX2MuaHRtMFUGA1UdHwROMEwwSqBIoEaGRGh0 dHA6Ly93d3cuYWNjdi5lcy9maWxlYWRtaW4vQXJjaGl2b3MvY2VydGlmaWNhZG9zL3JhaXphY2N2 MV9kZXIuY3JsMA4GA1UdDwEB/wQEAwIBBjAXBgNVHREEEDAOgQxhY2N2QGFjY3YuZXMwDQYJKoZI hvcNAQEFBQADggIBAJcxAp/n/UNnSEQU5CmH7UwoZtCPNdpNYbdKl02125DgBS4OxnnQ8pdpD70E R9m+27Up2pvZrqmZ1dM8MJP1jaGo/AaNRPTKFpV8M9xii6g3+CfYCS0b78gUJyCpZET/LtZ1qmxN YEAZSUNUY9rizLpm5U9EelvZaoErQNV/+QEnWCzI7UiRfD+mAM/EKXMRNt6GGT6d7hmKG9Ww7Y49 nCrADdg9ZuM8Db3VlFzi4qc1GwQA9j9ajepDvV+JHanBsMyZ4k0ACtrJJ1vnE5Bc5PUzolVt3OAJ TS+xJlsndQAJxGJ3KQhfnlmstn6tn1QwIgPBHnFk/vk4CpYY3QIUrCPLBhwepH2NDd4nQeit2hW3 sCPdK6jT2iWH7ehVRE2I9DZ+hJp4rPcOVkkO1jMl1oRQQmwgEh0q1b688nCBpHBgvgW1m54ERL5h I6zppSSMEYCUWqKiuUnSwdzRp+0xESyeGabu4VXhwOrPDYTkF7eifKXeVSUG7szAh1xA2syVP1Xg Nce4hL60Xc16gwFy7ofmXx2utYXGJt/mwZrpHgJHnyqobalbz+xFd3+YJ5oyXSrjhO7FmGYvliAd 3djDJ9ew+f7Zfc3Qn48LFFhRny+Lwzgt3uiP1o2HpPVWQxaZLPSkVrQ0uGE3ycJYgBugl6H8WY3p EfbRD0tVNEYqi4Y7 -----END CERTIFICATE----- TWCA Global Root CA =================== -----BEGIN CERTIFICATE----- MIIFQTCCAymgAwIBAgICDL4wDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCVFcxEjAQBgNVBAoT CVRBSVdBTi1DQTEQMA4GA1UECxMHUm9vdCBDQTEcMBoGA1UEAxMTVFdDQSBHbG9iYWwgUm9vdCBD QTAeFw0xMjA2MjcwNjI4MzNaFw0zMDEyMzExNTU5NTlaMFExCzAJBgNVBAYTAlRXMRIwEAYDVQQK EwlUQUlXQU4tQ0ExEDAOBgNVBAsTB1Jvb3QgQ0ExHDAaBgNVBAMTE1RXQ0EgR2xvYmFsIFJvb3Qg Q0EwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCwBdvI64zEbooh745NnHEKH1Jw7W2C nJfF10xORUnLQEK1EjRsGcJ0pDFfhQKX7EMzClPSnIyOt7h52yvVavKOZsTuKwEHktSz0ALfUPZV r2YOy+BHYC8rMjk1Ujoog/h7FsYYuGLWRyWRzvAZEk2tY/XTP3VfKfChMBwqoJimFb3u/Rk28OKR Q4/6ytYQJ0lM793B8YVwm8rqqFpD/G2Gb3PpN0Wp8DbHzIh1HrtsBv+baz4X7GGqcXzGHaL3SekV tTzWoWH1EfcFbx39Eb7QMAfCKbAJTibc46KokWofwpFFiFzlmLhxpRUZyXx1EcxwdE8tmx2RRP1W KKD+u4ZqyPpcC1jcxkt2yKsi2XMPpfRaAok/T54igu6idFMqPVMnaR1sjjIsZAAmY2E2TqNGtz99 sy2sbZCilaLOz9qC5wc0GZbpuCGqKX6mOL6OKUohZnkfs8O1CWfe1tQHRvMq2uYiN2DLgbYPoA/p yJV/v1WRBXrPPRXAb94JlAGD1zQbzECl8LibZ9WYkTunhHiVJqRaCPgrdLQABDzfuBSO6N+pjWxn kjMdwLfS7JLIvgm/LCkFbwJrnu+8vyq8W8BQj0FwcYeyTbcEqYSjMq+u7msXi7Kx/mzhkIyIqJdI zshNy/MGz19qCkKxHh53L46g5pIOBvwFItIm4TFRfTLcDwIDAQABoyMwITAOBgNVHQ8BAf8EBAMC AQYwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAgEAXzSBdu+WHdXltdkCY4QWwa6g cFGn90xHNcgL1yg9iXHZqjNB6hQbbCEAwGxCGX6faVsgQt+i0trEfJdLjbDorMjupWkEmQqSpqsn LhpNgb+E1HAerUf+/UqdM+DyucRFCCEK2mlpc3INvjT+lIutwx4116KD7+U4x6WFH6vPNOw/KP4M 8VeGTslV9xzU2KV9Bnpv1d8Q34FOIWWxtuEXeZVFBs5fzNxGiWNoRI2T9GRwoD2dKAXDOXC4Ynsg /eTb6QihuJ49CcdP+yz4k3ZB3lLg4VfSnQO8d57+nile98FRYB/e2guyLXW3Q0iT5/Z5xoRdgFlg lPx4mI88k1HtQJAH32RjJMtOcQWh15QaiDLxInQirqWm2BJpTGCjAu4r7NRjkgtevi92a6O2JryP A9gK8kxkRr05YuWW6zRjESjMlfGt7+/cgFhI6Uu46mWs6fyAtbXIRfmswZ/ZuepiiI7E8UuDEq3m i4TWnsLrgxifarsbJGAzcMzs9zLzXNl5fe+epP7JI8Mk7hWSsT2RTyaGvWZzJBPqpK5jwa19hAM8 EHiGG3njxPPyBJUgriOCxLM6AGK/5jYk4Ve6xx6QddVfP5VhK8E7zeWzaGHQRiapIVJpLesux+t3 zqY6tQMzT3bR51xUAV3LePTJDL/PEo4XLSNolOer/qmyKwbQBM0= -----END CERTIFICATE----- TeliaSonera Root CA v1 ====================== -----BEGIN CERTIFICATE----- MIIFODCCAyCgAwIBAgIRAJW+FqD3LkbxezmCcvqLzZYwDQYJKoZIhvcNAQEFBQAwNzEUMBIGA1UE CgwLVGVsaWFTb25lcmExHzAdBgNVBAMMFlRlbGlhU29uZXJhIFJvb3QgQ0EgdjEwHhcNMDcxMDE4 MTIwMDUwWhcNMzIxMDE4MTIwMDUwWjA3MRQwEgYDVQQKDAtUZWxpYVNvbmVyYTEfMB0GA1UEAwwW VGVsaWFTb25lcmEgUm9vdCBDQSB2MTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMK+ 6yfwIaPzaSZVfp3FVRaRXP3vIb9TgHot0pGMYzHw7CTww6XScnwQbfQ3t+XmfHnqjLWCi65ItqwA 3GV17CpNX8GH9SBlK4GoRz6JI5UwFpB/6FcHSOcZrr9FZ7E3GwYq/t75rH2D+1665I+XZ75Ljo1k B1c4VWk0Nj0TSO9P4tNmHqTPGrdeNjPUtAa9GAH9d4RQAEX1jF3oI7x+/jXh7VB7qTCNGdMJjmhn Xb88lxhTuylixcpecsHHltTbLaC0H2kD7OriUPEMPPCs81Mt8Bz17Ww5OXOAFshSsCPN4D7c3TxH oLs1iuKYaIu+5b9y7tL6pe0S7fyYGKkmdtwoSxAgHNN/Fnct7W+A90m7UwW7XWjH1Mh1Fj+JWov3 F0fUTPHSiXk+TT2YqGHeOh7S+F4D4MHJHIzTjU3TlTazN19jY5szFPAtJmtTfImMMsJu7D0hADnJ oWjiUIMusDor8zagrC/kb2HCUQk5PotTubtn2txTuXZZNp1D5SDgPTJghSJRt8czu90VL6R4pgd7 gUY2BIbdeTXHlSw7sKMXNeVzH7RcWe/a6hBle3rQf5+ztCo3O3CLm1u5K7fsslESl1MpWtTwEhDc TwK7EpIvYtQ/aUN8Ddb8WHUBiJ1YFkveupD/RwGJBmr2X7KQarMCpgKIv7NHfirZ1fpoeDVNAgMB AAGjPzA9MA8GA1UdEwEB/wQFMAMBAf8wCwYDVR0PBAQDAgEGMB0GA1UdDgQWBBTwj1k4ALP1j5qW DNXr+nuqF+gTEjANBgkqhkiG9w0BAQUFAAOCAgEAvuRcYk4k9AwI//DTDGjkk0kiP0Qnb7tt3oNm zqjMDfz1mgbldxSR651Be5kqhOX//CHBXfDkH1e3damhXwIm/9fH907eT/j3HEbAek9ALCI18Bmx 0GtnLLCo4MBANzX2hFxc469CeP6nyQ1Q6g2EdvZR74NTxnr/DlZJLo961gzmJ1TjTQpgcmLNkQfW pb/ImWvtxBnmq0wROMVvMeJuScg/doAmAyYp4Db29iBT4xdwNBedY2gea+zDTYa4EzAvXUYNR0PV G6pZDrlcjQZIrXSHX8f8MVRBE+LHIQ6e4B4N4cB7Q4WQxYpYxmUKeFfyxiMPAdkgS94P+5KFdSpc c41teyWRyu5FrgZLAMzTsVlQ2jqIOylDRl6XK1TOU2+NSueW+r9xDkKLfP0ooNBIytrEgUy7onOT JsjrDNYmiLbAJM+7vVvrdX3pCI6GMyx5dwlppYn8s3CQh3aP0yK7Qs69cwsgJirQmz1wHiRszYd2 qReWt88NkvuOGKmYSdGe/mBEciG5Ge3C9THxOUiIkCR1VBatzvT4aRRkOfujuLpwQMcnHL/EVlP6 Y2XQ8xwOFvVrhlhNGNTkDY6lnVuR3HYkUD/GKvvZt5y11ubQ2egZixVxSK236thZiNSQvxaz2ems WWFUyBy6ysHK4bkgTI86k4mloMy/0/Z1pHWWbVY= -----END CERTIFICATE----- E-Tugra Certification Authority =============================== -----BEGIN CERTIFICATE----- MIIGSzCCBDOgAwIBAgIIamg+nFGby1MwDQYJKoZIhvcNAQELBQAwgbIxCzAJBgNVBAYTAlRSMQ8w DQYDVQQHDAZBbmthcmExQDA+BgNVBAoMN0UtVHXEn3JhIEVCRyBCaWxpxZ9pbSBUZWtub2xvamls ZXJpIHZlIEhpem1ldGxlcmkgQS7Fni4xJjAkBgNVBAsMHUUtVHVncmEgU2VydGlmaWthc3lvbiBN ZXJrZXppMSgwJgYDVQQDDB9FLVR1Z3JhIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MB4XDTEzMDMw NTEyMDk0OFoXDTIzMDMwMzEyMDk0OFowgbIxCzAJBgNVBAYTAlRSMQ8wDQYDVQQHDAZBbmthcmEx QDA+BgNVBAoMN0UtVHXEn3JhIEVCRyBCaWxpxZ9pbSBUZWtub2xvamlsZXJpIHZlIEhpem1ldGxl cmkgQS7Fni4xJjAkBgNVBAsMHUUtVHVncmEgU2VydGlmaWthc3lvbiBNZXJrZXppMSgwJgYDVQQD DB9FLVR1Z3JhIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MIICIjANBgkqhkiG9w0BAQEFAAOCAg8A MIICCgKCAgEA4vU/kwVRHoViVF56C/UYB4Oufq9899SKa6VjQzm5S/fDxmSJPZQuVIBSOTkHS0vd hQd2h8y/L5VMzH2nPbxHD5hw+IyFHnSOkm0bQNGZDbt1bsipa5rAhDGvykPL6ys06I+XawGb1Q5K CKpbknSFQ9OArqGIW66z6l7LFpp3RMih9lRozt6Plyu6W0ACDGQXwLWTzeHxE2bODHnv0ZEoq1+g ElIwcxmOj+GMB6LDu0rw6h8VqO4lzKRG+Bsi77MOQ7osJLjFLFzUHPhdZL3Dk14opz8n8Y4e0ypQ BaNV2cvnOVPAmJ6MVGKLJrD3fY185MaeZkJVgkfnsliNZvcHfC425lAcP9tDJMW/hkd5s3kc91r0 E+xs+D/iWR+V7kI+ua2oMoVJl0b+SzGPWsutdEcf6ZG33ygEIqDUD13ieU/qbIWGvaimzuT6w+Gz rt48Ue7LE3wBf4QOXVGUnhMMti6lTPk5cDZvlsouDERVxcr6XQKj39ZkjFqzAQqptQpHF//vkUAq jqFGOjGY5RH8zLtJVor8udBhmm9lbObDyz51Sf6Pp+KJxWfXnUYTTjF2OySznhFlhqt/7x3U+Lzn rFpct1pHXFXOVbQicVtbC/DP3KBhZOqp12gKY6fgDT+gr9Oq0n7vUaDmUStVkhUXU8u3Zg5mTPj5 dUyQ5xJwx0UCAwEAAaNjMGEwHQYDVR0OBBYEFC7j27JJ0JxUeVz6Jyr+zE7S6E5UMA8GA1UdEwEB /wQFMAMBAf8wHwYDVR0jBBgwFoAULuPbsknQnFR5XPonKv7MTtLoTlQwDgYDVR0PAQH/BAQDAgEG MA0GCSqGSIb3DQEBCwUAA4ICAQAFNzr0TbdF4kV1JI+2d1LoHNgQk2Xz8lkGpD4eKexd0dCrfOAK kEh47U6YA5n+KGCRHTAduGN8qOY1tfrTYXbm1gdLymmasoR6d5NFFxWfJNCYExL/u6Au/U5Mh/jO XKqYGwXgAEZKgoClM4so3O0409/lPun++1ndYYRP0lSWE2ETPo+Aab6TR7U1Q9Jauz1c77NCR807 VRMGsAnb/WP2OogKmW9+4c4bU2pEZiNRCHu8W1Ki/QY3OEBhj0qWuJA3+GbHeJAAFS6LrVE1Uweo a2iu+U48BybNCAVwzDk/dr2l02cmAYamU9JgO3xDf1WKvJUawSg5TB9D0pH0clmKuVb8P7Sd2nCc dlqMQ1DujjByTd//SffGqWfZbawCEeI6FiWnWAjLb1NBnEg4R2gz0dfHj9R0IdTDBZB6/86WiLEV KV0jq9BgoRJP3vQXzTLlyb/IQ639Lo7xr+L0mPoSHyDYwKcMhcWQ9DstliaxLL5Mq+ux0orJ23gT Dx4JnW2PAJ8C2sH6H3p6CcRK5ogql5+Ji/03X186zjhZhkuvcQu02PJwT58yE+Owp1fl2tpDy4Q0 8ijE6m30Ku/Ba3ba+367hTzSU8JNvnHhRdH9I2cNE3X7z2VnIp2usAnRCf8dNL/+I5c30jn6PQ0G C7TbO6Orb1wdtn7os4I07QZcJA== -----END CERTIFICATE----- T-TeleSec GlobalRoot Class 2 ============================ -----BEGIN CERTIFICATE----- MIIDwzCCAqugAwIBAgIBATANBgkqhkiG9w0BAQsFADCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoM IlQtU3lzdGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBU cnVzdCBDZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDIwHhcNMDgx MDAxMTA0MDE0WhcNMzMxMDAxMjM1OTU5WjCBgjELMAkGA1UEBhMCREUxKzApBgNVBAoMIlQtU3lz dGVtcyBFbnRlcnByaXNlIFNlcnZpY2VzIEdtYkgxHzAdBgNVBAsMFlQtU3lzdGVtcyBUcnVzdCBD ZW50ZXIxJTAjBgNVBAMMHFQtVGVsZVNlYyBHbG9iYWxSb290IENsYXNzIDIwggEiMA0GCSqGSIb3 DQEBAQUAA4IBDwAwggEKAoIBAQCqX9obX+hzkeXaXPSi5kfl82hVYAUdAqSzm1nzHoqvNK38DcLZ SBnuaY/JIPwhqgcZ7bBcrGXHX+0CfHt8LRvWurmAwhiCFoT6ZrAIxlQjgeTNuUk/9k9uN0goOA/F vudocP05l03Sx5iRUKrERLMjfTlH6VJi1hKTXrcxlkIF+3anHqP1wvzpesVsqXFP6st4vGCvx970 2cu+fjOlbpSD8DT6IavqjnKgP6TeMFvvhk1qlVtDRKgQFRzlAVfFmPHmBiiRqiDFt1MmUUOyCxGV WOHAD3bZwI18gfNycJ5v/hqO2V81xrJvNHy+SE/iWjnX2J14np+GPgNeGYtEotXHAgMBAAGjQjBA MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBS/WSA2AHmgoCJrjNXy YdK4LMuCSjANBgkqhkiG9w0BAQsFAAOCAQEAMQOiYQsfdOhyNsZt+U2e+iKo4YFWz827n+qrkRk4 r6p8FU3ztqONpfSO9kSpp+ghla0+AGIWiPACuvxhI+YzmzB6azZie60EI4RYZeLbK4rnJVM3YlNf vNoBYimipidx5joifsFvHZVwIEoHNN/q/xWA5brXethbdXwFeilHfkCoMRN3zUA7tFFHei4R40cR 3p1m0IvVVGb6g1XqfMIpiRvpb7PO4gWEyS8+eIVibslfwXhjdFjASBgMmTnrpMwatXlajRWc2BQN 9noHV8cigwUtPJslJj0Ys6lDfMjIq2SPDqO/nBudMNva0Bkuqjzx+zOAduTNrRlPBSeOE6Fuwg== -----END CERTIFICATE----- Atos TrustedRoot 2011 ===================== -----BEGIN CERTIFICATE----- MIIDdzCCAl+gAwIBAgIIXDPLYixfszIwDQYJKoZIhvcNAQELBQAwPDEeMBwGA1UEAwwVQXRvcyBU cnVzdGVkUm9vdCAyMDExMQ0wCwYDVQQKDARBdG9zMQswCQYDVQQGEwJERTAeFw0xMTA3MDcxNDU4 MzBaFw0zMDEyMzEyMzU5NTlaMDwxHjAcBgNVBAMMFUF0b3MgVHJ1c3RlZFJvb3QgMjAxMTENMAsG A1UECgwEQXRvczELMAkGA1UEBhMCREUwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCV hTuXbyo7LjvPpvMpNb7PGKw+qtn4TaA+Gke5vJrf8v7MPkfoepbCJI419KkM/IL9bcFyYie96mvr 54rMVD6QUM+A1JX76LWC1BTFtqlVJVfbsVD2sGBkWXppzwO3bw2+yj5vdHLqqjAqc2K+SZFhyBH+ DgMq92og3AIVDV4VavzjgsG1xZ1kCWyjWZgHJ8cblithdHFsQ/H3NYkQ4J7sVaE3IqKHBAUsR320 HLliKWYoyrfhk/WklAOZuXCFteZI6o1Q/NnezG8HDt0Lcp2AMBYHlT8oDv3FdU9T1nSatCQujgKR z3bFmx5VdJx4IbHwLfELn8LVlhgf8FQieowHAgMBAAGjfTB7MB0GA1UdDgQWBBSnpQaxLKYJYO7R l+lwrrw7GWzbITAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFKelBrEspglg7tGX6XCuvDsZ bNshMBgGA1UdIAQRMA8wDQYLKwYBBAGwLQMEAQEwDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEB CwUAA4IBAQAmdzTblEiGKkGdLD4GkGDEjKwLVLgfuXvTBznk+j57sj1O7Z8jvZfza1zv7v1Apt+h k6EKhqzvINB5Ab149xnYJDE0BAGmuhWawyfc2E8PzBhj/5kPDpFrdRbhIfzYJsdHt6bPWHJxfrrh TZVHO8mvbaG0weyJ9rQPOLXiZNwlz6bb65pcmaHFCN795trV1lpFDMS3wrUU77QR/w4VtfX128a9 61qn8FYiqTxlVMYVqL2Gns2Dlmh6cYGJ4Qvh6hEbaAjMaZ7snkGeRDImeuKHCnE96+RapNLbxc3G 3mB/ufNPRJLvKrcYPqcZ2Qt9sTdBQrC6YB3y/gkRsPCHe6ed -----END CERTIFICATE----- QuoVadis Root CA 1 G3 ===================== -----BEGIN CERTIFICATE----- MIIFYDCCA0igAwIBAgIUeFhfLq0sGUvjNwc1NBMotZbUZZMwDQYJKoZIhvcNAQELBQAwSDELMAkG A1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAcBgNVBAMTFVF1b1ZhZGlzIFJv b3QgQ0EgMSBHMzAeFw0xMjAxMTIxNzI3NDRaFw00MjAxMTIxNzI3NDRaMEgxCzAJBgNVBAYTAkJN MRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMR4wHAYDVQQDExVRdW9WYWRpcyBSb290IENBIDEg RzMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCgvlAQjunybEC0BJyFuTHK3C3kEakE PBtVwedYMB0ktMPvhd6MLOHBPd+C5k+tR4ds7FtJwUrVu4/sh6x/gpqG7D0DmVIB0jWerNrwU8lm PNSsAgHaJNM7qAJGr6Qc4/hzWHa39g6QDbXwz8z6+cZM5cOGMAqNF34168Xfuw6cwI2H44g4hWf6 Pser4BOcBRiYz5P1sZK0/CPTz9XEJ0ngnjybCKOLXSoh4Pw5qlPafX7PGglTvF0FBM+hSo+LdoIN ofjSxxR3W5A2B4GbPgb6Ul5jxaYA/qXpUhtStZI5cgMJYr2wYBZupt0lwgNm3fME0UDiTouG9G/l g6AnhF4EwfWQvTA9xO+oabw4m6SkltFi2mnAAZauy8RRNOoMqv8hjlmPSlzkYZqn0ukqeI1RPToV 7qJZjqlc3sX5kCLliEVx3ZGZbHqfPT2YfF72vhZooF6uCyP8Wg+qInYtyaEQHeTTRCOQiJ/GKubX 9ZqzWB4vMIkIG1SitZgj7Ah3HJVdYdHLiZxfokqRmu8hqkkWCKi9YSgxyXSthfbZxbGL0eUQMk1f iyA6PEkfM4VZDdvLCXVDaXP7a3F98N/ETH3Goy7IlXnLc6KOTk0k+17kBL5yG6YnLUlamXrXXAkg t3+UuU/xDRxeiEIbEbfnkduebPRq34wGmAOtzCjvpUfzUwIDAQABo0IwQDAPBgNVHRMBAf8EBTAD AQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUo5fW816iEOGrRZ88F2Q87gFwnMwwDQYJKoZI hvcNAQELBQADggIBABj6W3X8PnrHX3fHyt/PX8MSxEBd1DKquGrX1RUVRpgjpeaQWxiZTOOtQqOC MTaIzen7xASWSIsBx40Bz1szBpZGZnQdT+3Btrm0DWHMY37XLneMlhwqI2hrhVd2cDMT/uFPpiN3 GPoajOi9ZcnPP/TJF9zrx7zABC4tRi9pZsMbj/7sPtPKlL92CiUNqXsCHKnQO18LwIE6PWThv6ct Tr1NxNgpxiIY0MWscgKCP6o6ojoilzHdCGPDdRS5YCgtW2jgFqlmgiNR9etT2DGbe+m3nUvriBbP +V04ikkwj+3x6xn0dxoxGE1nVGwvb2X52z3sIexe9PSLymBlVNFxZPT5pqOBMzYzcfCkeF9OrYMh 3jRJjehZrJ3ydlo28hP0r+AJx2EqbPfgna67hkooby7utHnNkDPDs3b69fBsnQGQ+p6Q9pxyz0fa wx/kNSBT8lTR32GDpgLiJTjehTItXnOQUl1CxM49S+H5GYQd1aJQzEH7QRTDvdbJWqNjZgKAvQU6 O0ec7AAmTPWIUb+oI38YB7AL7YsmoWTTYUrrXJ/es69nA7Mf3W1daWhpq1467HxpvMc7hU6eFbm0 FU/DlXpY18ls6Wy58yljXrQs8C097Vpl4KlbQMJImYFtnh8GKjwStIsPm6Ik8KaN1nrgS7ZklmOV hMJKzRwuJIczYOXD -----END CERTIFICATE----- QuoVadis Root CA 2 G3 ===================== -----BEGIN CERTIFICATE----- MIIFYDCCA0igAwIBAgIURFc0JFuBiZs18s64KztbpybwdSgwDQYJKoZIhvcNAQELBQAwSDELMAkG A1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAcBgNVBAMTFVF1b1ZhZGlzIFJv b3QgQ0EgMiBHMzAeFw0xMjAxMTIxODU5MzJaFw00MjAxMTIxODU5MzJaMEgxCzAJBgNVBAYTAkJN MRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMR4wHAYDVQQDExVRdW9WYWRpcyBSb290IENBIDIg RzMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQChriWyARjcV4g/Ruv5r+LrI3HimtFh ZiFfqq8nUeVuGxbULX1QsFN3vXg6YOJkApt8hpvWGo6t/x8Vf9WVHhLL5hSEBMHfNrMWn4rjyduY NM7YMxcoRvynyfDStNVNCXJJ+fKH46nafaF9a7I6JaltUkSs+L5u+9ymc5GQYaYDFCDy54ejiK2t oIz/pgslUiXnFgHVy7g1gQyjO/Dh4fxaXc6AcW34Sas+O7q414AB+6XrW7PFXmAqMaCvN+ggOp+o MiwMzAkd056OXbxMmO7FGmh77FOm6RQ1o9/NgJ8MSPsc9PG/Srj61YxxSscfrf5BmrODXfKEVu+l V0POKa2Mq1W/xPtbAd0jIaFYAI7D0GoT7RPjEiuA3GfmlbLNHiJuKvhB1PLKFAeNilUSxmn1uIZo L1NesNKqIcGY5jDjZ1XHm26sGahVpkUG0CM62+tlXSoREfA7T8pt9DTEceT/AFr2XK4jYIVz8eQQ sSWu1ZK7E8EM4DnatDlXtas1qnIhO4M15zHfeiFuuDIIfR0ykRVKYnLP43ehvNURG3YBZwjgQQvD 6xVu+KQZ2aKrr+InUlYrAoosFCT5v0ICvybIxo/gbjh9Uy3l7ZizlWNof/k19N+IxWA1ksB8aRxh lRbQ694Lrz4EEEVlWFA4r0jyWbYW8jwNkALGcC4BrTwV1wIDAQABo0IwQDAPBgNVHRMBAf8EBTAD AQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQU7edvdlq/YOxJW8ald7tyFnGbxD0wDQYJKoZI hvcNAQELBQADggIBAJHfgD9DCX5xwvfrs4iP4VGyvD11+ShdyLyZm3tdquXK4Qr36LLTn91nMX66 AarHakE7kNQIXLJgapDwyM4DYvmL7ftuKtwGTTwpD4kWilhMSA/ohGHqPHKmd+RCroijQ1h5fq7K pVMNqT1wvSAZYaRsOPxDMuHBR//47PERIjKWnML2W2mWeyAMQ0GaW/ZZGYjeVYg3UQt4XAoeo0L9 x52ID8DyeAIkVJOviYeIyUqAHerQbj5hLja7NQ4nlv1mNDthcnPxFlxHBlRJAHpYErAK74X9sbgz dWqTHBLmYF5vHX/JHyPLhGGfHoJE+V+tYlUkmlKY7VHnoX6XOuYvHxHaU4AshZ6rNRDbIl9qxV6X U/IyAgkwo1jwDQHVcsaxfGl7w/U2Rcxhbl5MlMVerugOXou/983g7aEOGzPuVBj+D77vfoRrQ+Nw mNtddbINWQeFFSM51vHfqSYP1kjHs6Yi9TM3WpVHn3u6GBVv/9YUZINJ0gpnIdsPNWNgKCLjsZWD zYWm3S8P52dSbrsvhXz1SnPnxT7AvSESBT/8twNJAlvIJebiVDj1eYeMHVOyToV7BjjHLPj4sHKN JeV3UvQDHEimUF+IIDBu8oJDqz2XhOdT+yHBTw8imoa4WSr2Rz0ZiC3oheGe7IUIarFsNMkd7Egr O3jtZsSOeWmD3n+M -----END CERTIFICATE----- QuoVadis Root CA 3 G3 ===================== -----BEGIN CERTIFICATE----- MIIFYDCCA0igAwIBAgIULvWbAiin23r/1aOp7r0DoM8Sah0wDQYJKoZIhvcNAQELBQAwSDELMAkG A1UEBhMCQk0xGTAXBgNVBAoTEFF1b1ZhZGlzIExpbWl0ZWQxHjAcBgNVBAMTFVF1b1ZhZGlzIFJv b3QgQ0EgMyBHMzAeFw0xMjAxMTIyMDI2MzJaFw00MjAxMTIyMDI2MzJaMEgxCzAJBgNVBAYTAkJN MRkwFwYDVQQKExBRdW9WYWRpcyBMaW1pdGVkMR4wHAYDVQQDExVRdW9WYWRpcyBSb290IENBIDMg RzMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCzyw4QZ47qFJenMioKVjZ/aEzHs286 IxSR/xl/pcqs7rN2nXrpixurazHb+gtTTK/FpRp5PIpM/6zfJd5O2YIyC0TeytuMrKNuFoM7pmRL Mon7FhY4futD4tN0SsJiCnMK3UmzV9KwCoWdcTzeo8vAMvMBOSBDGzXRU7Ox7sWTaYI+FrUoRqHe 6okJ7UO4BUaKhvVZR74bbwEhELn9qdIoyhA5CcoTNs+cra1AdHkrAj80//ogaX3T7mH1urPnMNA3 I4ZyYUUpSFlob3emLoG+B01vr87ERRORFHAGjx+f+IdpsQ7vw4kZ6+ocYfx6bIrc1gMLnia6Et3U VDmrJqMz6nWB2i3ND0/kA9HvFZcba5DFApCTZgIhsUfei5pKgLlVj7WiL8DWM2fafsSntARE60f7 5li59wzweyuxwHApw0BiLTtIadwjPEjrewl5qW3aqDCYz4ByA4imW0aucnl8CAMhZa634RylsSqi Md5mBPfAdOhx3v89WcyWJhKLhZVXGqtrdQtEPREoPHtht+KPZ0/l7DxMYIBpVzgeAVuNVejH38DM dyM0SXV89pgR6y3e7UEuFAUCf+D+IOs15xGsIs5XPd7JMG0QA4XN8f+MFrXBsj6IbGB/kE+V9/Yt rQE5BwT6dYB9v0lQ7e/JxHwc64B+27bQ3RP+ydOc17KXqQIDAQABo0IwQDAPBgNVHRMBAf8EBTAD AQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUxhfQvKjqAkPyGwaZXSuQILnXnOQwDQYJKoZI hvcNAQELBQADggIBADRh2Va1EodVTd2jNTFGu6QHcrxfYWLopfsLN7E8trP6KZ1/AvWkyaiTt3px KGmPc+FSkNrVvjrlt3ZqVoAh313m6Tqe5T72omnHKgqwGEfcIHB9UqM+WXzBusnIFUBhynLWcKzS t/Ac5IYp8M7vaGPQtSCKFWGafoaYtMnCdvvMujAWzKNhxnQT5WvvoxXqA/4Ti2Tk08HS6IT7SdEQ TXlm66r99I0xHnAUrdzeZxNMgRVhvLfZkXdxGYFgu/BYpbWcC/ePIlUnwEsBbTuZDdQdm2NnL9Du DcpmvJRPpq3t/O5jrFc/ZSXPsoaP0Aj/uHYUbt7lJ+yreLVTubY/6CD50qi+YUbKh4yE8/nxoGib Ih6BJpsQBJFxwAYf3KDTuVan45gtf4Od34wrnDKOMpTwATwiKp9Dwi7DmDkHOHv8XgBCH/MyJnmD hPbl8MFREsALHgQjDFSlTC9JxUrRtm5gDWv8a4uFJGS3iQ6rJUdbPM9+Sb3H6QrG2vd+DhcI00iX 0HGS8A85PjRqHH3Y8iKuu2n0M7SmSFXRDw4m6Oy2Cy2nhTXN/VnIn9HNPlopNLk9hM6xZdRZkZFW dSHBd575euFgndOtBBj0fOtek49TSiIp+EgrPk2GrFt/ywaZWWDYWGWVjUTR939+J399roD1B0y2 PpxxVJkES/1Y+Zj0 -----END CERTIFICATE----- DigiCert Assured ID Root G2 =========================== -----BEGIN CERTIFICATE----- MIIDljCCAn6gAwIBAgIQC5McOtY5Z+pnI7/Dr5r0SzANBgkqhkiG9w0BAQsFADBlMQswCQYDVQQG EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQw IgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzIwHhcNMTMwODAxMTIwMDAwWhcNMzgw MTE1MTIwMDAwWjBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQL ExB3d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzIw ggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDZ5ygvUj82ckmIkzTz+GoeMVSAn61UQbVH 35ao1K+ALbkKz3X9iaV9JPrjIgwrvJUXCzO/GU1BBpAAvQxNEP4HteccbiJVMWWXvdMX0h5i89vq bFCMP4QMls+3ywPgym2hFEwbid3tALBSfK+RbLE4E9HpEgjAALAcKxHad3A2m67OeYfcgnDmCXRw VWmvo2ifv922ebPynXApVfSr/5Vh88lAbx3RvpO704gqu52/clpWcTs/1PPRCv4o76Pu2ZmvA9OP YLfykqGxvYmJHzDNw6YuYjOuFgJ3RFrngQo8p0Quebg/BLxcoIfhG69Rjs3sLPr4/m3wOnyqi+Rn lTGNAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBTO w0q5mVXyuNtgv6l+vVa1lzan1jANBgkqhkiG9w0BAQsFAAOCAQEAyqVVjOPIQW5pJ6d1Ee88hjZv 0p3GeDgdaZaikmkuOGybfQTUiaWxMTeKySHMq2zNixya1r9I0jJmwYrA8y8678Dj1JGG0VDjA9tz d29KOVPt3ibHtX2vK0LRdWLjSisCx1BL4GnilmwORGYQRI+tBev4eaymG+g3NJ1TyWGqolKvSnAW hsI6yLETcDbYz+70CjTVW0z9B5yiutkBclzzTcHdDrEcDcRjvq30FPuJ7KJBDkzMyFdA0G4Dqs0M jomZmWzwPDCvON9vvKO+KSAnq3T/EyJ43pdSVR6DtVQgA+6uwE9W3jfMw3+qBCe703e4YtsXfJwo IhNzbM8m9Yop5w== -----END CERTIFICATE----- DigiCert Assured ID Root G3 =========================== -----BEGIN CERTIFICATE----- MIICRjCCAc2gAwIBAgIQC6Fa+h3foLVJRK/NJKBs7DAKBggqhkjOPQQDAzBlMQswCQYDVQQGEwJV UzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSQwIgYD VQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzMwHhcNMTMwODAxMTIwMDAwWhcNMzgwMTE1 MTIwMDAwWjBlMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 d3cuZGlnaWNlcnQuY29tMSQwIgYDVQQDExtEaWdpQ2VydCBBc3N1cmVkIElEIFJvb3QgRzMwdjAQ BgcqhkjOPQIBBgUrgQQAIgNiAAQZ57ysRGXtzbg/WPuNsVepRC0FFfLvC/8QdJ+1YlJfZn4f5dwb RXkLzMZTCp2NXQLZqVneAlr2lSoOjThKiknGvMYDOAdfVdp+CW7if17QRSAPWXYQ1qAk8C3eNvJs KTmjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBTL0L2p4ZgF UaFNN6KDec6NHSrkhDAKBggqhkjOPQQDAwNnADBkAjAlpIFFAmsSS3V0T8gj43DydXLefInwz5Fy YZ5eEJJZVrmDxxDnOOlYJjZ91eQ0hjkCMHw2U/Aw5WJjOpnitqM7mzT6HtoQknFekROn3aRukswy 1vUhZscv6pZjamVFkpUBtA== -----END CERTIFICATE----- DigiCert Global Root G2 ======================= -----BEGIN CERTIFICATE----- MIIDjjCCAnagAwIBAgIQAzrx5qcRqaC7KGSxHQn65TANBgkqhkiG9w0BAQsFADBhMQswCQYDVQQG EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAw HgYDVQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBHMjAeFw0xMzA4MDExMjAwMDBaFw0zODAxMTUx MjAwMDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3 dy5kaWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IEcyMIIBIjANBgkq hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAuzfNNNx7a8myaJCtSnX/RrohCgiN9RlUyfuI2/Ou8jqJ kTx65qsGGmvPrC3oXgkkRLpimn7Wo6h+4FR1IAWsULecYxpsMNzaHxmx1x7e/dfgy5SDN67sH0NO 3Xss0r0upS/kqbitOtSZpLYl6ZtrAGCSYP9PIUkY92eQq2EGnI/yuum06ZIya7XzV+hdG82MHauV BJVJ8zUtluNJbd134/tJS7SsVQepj5WztCO7TG1F8PapspUwtP1MVYwnSlcUfIKdzXOS0xZKBgyM UNGPHgm+F6HmIcr9g+UQvIOlCsRnKPZzFBQ9RnbDhxSJITRNrw9FDKZJobq7nMWxM4MphQIDAQAB o0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUTiJUIBiV5uNu 5g/6+rkS7QYXjzkwDQYJKoZIhvcNAQELBQADggEBAGBnKJRvDkhj6zHd6mcY1Yl9PMWLSn/pvtsr F9+wX3N3KjITOYFnQoQj8kVnNeyIv/iPsGEMNKSuIEyExtv4NeF22d+mQrvHRAiGfzZ0JFrabA0U WTW98kndth/Jsw1HKj2ZL7tcu7XUIOGZX1NGFdtom/DzMNU+MeKNhJ7jitralj41E6Vf8PlwUHBH QRFXGU7Aj64GxJUTFy8bJZ918rGOmaFvE7FBcf6IKshPECBV1/MUReXgRPTqh5Uykw7+U0b6LJ3/ iyK5S9kJRaTepLiaWN0bfVKfjllDiIGknibVb63dDcY3fe0Dkhvld1927jyNxF1WW6LZZm6zNTfl MrY= -----END CERTIFICATE----- DigiCert Global Root G3 ======================= -----BEGIN CERTIFICATE----- MIICPzCCAcWgAwIBAgIQBVVWvPJepDU1w6QP1atFcjAKBggqhkjOPQQDAzBhMQswCQYDVQQGEwJV UzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSAwHgYD VQQDExdEaWdpQ2VydCBHbG9iYWwgUm9vdCBHMzAeFw0xMzA4MDExMjAwMDBaFw0zODAxMTUxMjAw MDBaMGExCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwxEaWdpQ2VydCBJbmMxGTAXBgNVBAsTEHd3dy5k aWdpY2VydC5jb20xIDAeBgNVBAMTF0RpZ2lDZXJ0IEdsb2JhbCBSb290IEczMHYwEAYHKoZIzj0C AQYFK4EEACIDYgAE3afZu4q4C/sLfyHS8L6+c/MzXRq8NOrexpu80JX28MzQC7phW1FGfp4tn+6O YwwX7Adw9c+ELkCDnOg/QW07rdOkFFk2eJ0DQ+4QE2xy3q6Ip6FrtUPOZ9wj/wMco+I+o0IwQDAP BgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjAdBgNVHQ4EFgQUs9tIpPmhxdiuNkHMEWNp Yim8S8YwCgYIKoZIzj0EAwMDaAAwZQIxAK288mw/EkrRLTnDCgmXc/SINoyIJ7vmiI1Qhadj+Z4y 3maTD/HMsQmP3Wyr+mt/oAIwOWZbwmSNuJ5Q3KjVSaLtx9zRSX8XAbjIho9OjIgrqJqpisXRAL34 VOKa5Vt8sycX -----END CERTIFICATE----- DigiCert Trusted Root G4 ======================== -----BEGIN CERTIFICATE----- MIIFkDCCA3igAwIBAgIQBZsbV56OITLiOQe9p3d1XDANBgkqhkiG9w0BAQwFADBiMQswCQYDVQQG EwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3d3cuZGlnaWNlcnQuY29tMSEw HwYDVQQDExhEaWdpQ2VydCBUcnVzdGVkIFJvb3QgRzQwHhcNMTMwODAxMTIwMDAwWhcNMzgwMTE1 MTIwMDAwWjBiMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMRGlnaUNlcnQgSW5jMRkwFwYDVQQLExB3 d3cuZGlnaWNlcnQuY29tMSEwHwYDVQQDExhEaWdpQ2VydCBUcnVzdGVkIFJvb3QgRzQwggIiMA0G CSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC/5pBzaN675F1KPDAiMGkz7MKnJS7JIT3yithZwuEp pz1Yq3aaza57G4QNxDAf8xukOBbrVsaXbR2rsnnyyhHS5F/WBTxSD1Ifxp4VpX6+n6lXFllVcq9o k3DCsrp1mWpzMpTREEQQLt+C8weE5nQ7bXHiLQwb7iDVySAdYyktzuxeTsiT+CFhmzTrBcZe7Fsa vOvJz82sNEBfsXpm7nfISKhmV1efVFiODCu3T6cw2Vbuyntd463JT17lNecxy9qTXtyOj4DatpGY QJB5w3jHtrHEtWoYOAMQjdjUN6QuBX2I9YI+EJFwq1WCQTLX2wRzKm6RAXwhTNS8rhsDdV14Ztk6 MUSaM0C/CNdaSaTC5qmgZ92kJ7yhTzm1EVgX9yRcRo9k98FpiHaYdj1ZXUJ2h4mXaXpI8OCiEhtm mnTK3kse5w5jrubU75KSOp493ADkRSWJtppEGSt+wJS00mFt6zPZxd9LBADMfRyVw4/3IbKyEbe7 f/LVjHAsQWCqsWMYRJUadmJ+9oCw++hkpjPRiQfhvbfmQ6QYuKZ3AeEPlAwhHbJUKSWJbOUOUlFH dL4mrLZBdd56rF+NP8m800ERElvlEFDrMcXKchYiCd98THU/Y+whX8QgUWtvsauGi0/C1kVfnSD8 oR7FwI+isX4KJpn15GkvmB0t9dmpsh3lGwIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1Ud DwEB/wQEAwIBhjAdBgNVHQ4EFgQU7NfjgtJxXWRM3y5nP+e6mK4cD08wDQYJKoZIhvcNAQEMBQAD ggIBALth2X2pbL4XxJEbw6GiAI3jZGgPVs93rnD5/ZpKmbnJeFwMDF/k5hQpVgs2SV1EY+CtnJYY ZhsjDT156W1r1lT40jzBQ0CuHVD1UvyQO7uYmWlrx8GnqGikJ9yd+SeuMIW59mdNOj6PWTkiU0Tr yF0Dyu1Qen1iIQqAyHNm0aAFYF/opbSnr6j3bTWcfFqK1qI4mfN4i/RN0iAL3gTujJtHgXINwBQy 7zBZLq7gcfJW5GqXb5JQbZaNaHqasjYUegbyJLkJEVDXCLG4iXqEI2FCKeWjzaIgQdfRnGTZ6iah ixTXTBmyUEFxPT9NcCOGDErcgdLMMpSEDQgJlxxPwO5rIHQw0uA5NBCFIRUBCOhVMt5xSdkoF1BN 5r5N0XWs0Mr7QbhDparTwwVETyw2m+L64kW4I1NsBm9nVX9GtUw/bihaeSbSpKhil9Ie4u1Ki7wb /UdKDd9nZn6yW0HQO+T0O/QEY+nvwlQAUaCKKsnOeMzV6ocEGLPOr0mIr/OSmbaz5mEP0oUA51Aa 5BuVnRmhuZyxm7EAHu/QD09CbMkKvO5D+jpxpchNJqU1/YldvIViHTLSoCtU7ZpXwdv6EM8Zt4tK G48BtieVU+i2iW1bvGjUI+iLUaJW+fCmgKDWHrO8Dw9TdSmq6hN35N6MgSGtBxBHEa2HPQfRdbzP 82Z+ -----END CERTIFICATE----- COMODO RSA Certification Authority ================================== -----BEGIN CERTIFICATE----- MIIF2DCCA8CgAwIBAgIQTKr5yttjb+Af907YWwOGnTANBgkqhkiG9w0BAQwFADCBhTELMAkGA1UE BhMCR0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgG A1UEChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNhdGlv biBBdXRob3JpdHkwHhcNMTAwMTE5MDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBhTELMAkGA1UEBhMC R0IxGzAZBgNVBAgTEkdyZWF0ZXIgTWFuY2hlc3RlcjEQMA4GA1UEBxMHU2FsZm9yZDEaMBgGA1UE ChMRQ09NT0RPIENBIExpbWl0ZWQxKzApBgNVBAMTIkNPTU9ETyBSU0EgQ2VydGlmaWNhdGlvbiBB dXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCR6FSS0gpWsawNJN3Fz0Rn dJkrN6N9I3AAcbxT38T6KhKPS38QVr2fcHK3YX/JSw8Xpz3jsARh7v8Rl8f0hj4K+j5c+ZPmNHrZ FGvnnLOFoIJ6dq9xkNfs/Q36nGz637CC9BR++b7Epi9Pf5l/tfxnQ3K9DADWietrLNPtj5gcFKt+ 5eNu/Nio5JIk2kNrYrhV/erBvGy2i/MOjZrkm2xpmfh4SDBF1a3hDTxFYPwyllEnvGfDyi62a+pG x8cgoLEfZd5ICLqkTqnyg0Y3hOvozIFIQ2dOciqbXL1MGyiKXCJ7tKuY2e7gUYPDCUZObT6Z+pUX 2nwzV0E8jVHtC7ZcryxjGt9XyD+86V3Em69FmeKjWiS0uqlWPc9vqv9JWL7wqP/0uK3pN/u6uPQL OvnoQ0IeidiEyxPx2bvhiWC4jChWrBQdnArncevPDt09qZahSL0896+1DSJMwBGB7FY79tOi4lu3 sgQiUpWAk2nojkxl8ZEDLXB0AuqLZxUpaVICu9ffUGpVRr+goyhhf3DQw6KqLCGqR84onAZFdr+C GCe01a60y1Dma/RMhnEw6abfFobg2P9A3fvQQoh/ozM6LlweQRGBY84YcWsr7KaKtzFcOmpH4MN5 WdYgGq/yapiqcrxXStJLnbsQ/LBMQeXtHT1eKJ2czL+zUdqnR+WEUwIDAQABo0IwQDAdBgNVHQ4E FgQUu69+Aj36pvE8hI6t7jiY7NkyMtQwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8w DQYJKoZIhvcNAQEMBQADggIBAArx1UaEt65Ru2yyTUEUAJNMnMvlwFTPoCWOAvn9sKIN9SCYPBMt rFaisNZ+EZLpLrqeLppysb0ZRGxhNaKatBYSaVqM4dc+pBroLwP0rmEdEBsqpIt6xf4FpuHA1sj+ nq6PK7o9mfjYcwlYRm6mnPTXJ9OV2jeDchzTc+CiR5kDOF3VSXkAKRzH7JsgHAckaVd4sjn8OoSg tZx8jb8uk2IntznaFxiuvTwJaP+EmzzV1gsD41eeFPfR60/IvYcjt7ZJQ3mFXLrrkguhxuhoqEwW sRqZCuhTLJK7oQkYdQxlqHvLI7cawiiFwxv/0Cti76R7CZGYZ4wUAc1oBmpjIXUDgIiKboHGhfKp pC3n9KUkEEeDys30jXlYsQab5xoq2Z0B15R97QNKyvDb6KkBPvVWmckejkk9u+UJueBPSZI9FoJA zMxZxuY67RIuaTxslbH9qh17f4a+Hg4yRvv7E491f0yLS0Zj/gA0QHDBw7mh3aZw4gSzQbzpgJHq ZJx64SIDqZxubw5lT2yHh17zbqD5daWbQOhTsiedSrnAdyGN/4fy3ryM7xfft0kL0fJuMAsaDk52 7RH89elWsn2/x20Kk4yl0MC2Hb46TpSi125sC8KKfPog88Tk5c0NqMuRkrF8hey1FGlmDoLnzc7I LaZRfyHBNVOFBkpdn627G190 -----END CERTIFICATE----- USERTrust RSA Certification Authority ===================================== -----BEGIN CERTIFICATE----- MIIF3jCCA8agAwIBAgIQAf1tMPyjylGoG7xkDjUDLTANBgkqhkiG9w0BAQwFADCBiDELMAkGA1UE BhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQK ExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNh dGlvbiBBdXRob3JpdHkwHhcNMTAwMjAxMDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBiDELMAkGA1UE BhMCVVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQK ExVUaGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBSU0EgQ2VydGlmaWNh dGlvbiBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCAEmUXNg7D2wiz 0KxXDXbtzSfTTK1Qg2HiqiBNCS1kCdzOiZ/MPans9s/B3PHTsdZ7NygRK0faOca8Ohm0X6a9fZ2j Y0K2dvKpOyuR+OJv0OwWIJAJPuLodMkYtJHUYmTbf6MG8YgYapAiPLz+E/CHFHv25B+O1ORRxhFn RghRy4YUVD+8M/5+bJz/Fp0YvVGONaanZshyZ9shZrHUm3gDwFA66Mzw3LyeTP6vBZY1H1dat//O +T23LLb2VN3I5xI6Ta5MirdcmrS3ID3KfyI0rn47aGYBROcBTkZTmzNg95S+UzeQc0PzMsNT79uq /nROacdrjGCT3sTHDN/hMq7MkztReJVni+49Vv4M0GkPGw/zJSZrM233bkf6c0Plfg6lZrEpfDKE Y1WJxA3Bk1QwGROs0303p+tdOmw1XNtB1xLaqUkL39iAigmTYo61Zs8liM2EuLE/pDkP2QKe6xJM lXzzawWpXhaDzLhn4ugTncxbgtNMs+1b/97lc6wjOy0AvzVVdAlJ2ElYGn+SNuZRkg7zJn0cTRe8 yexDJtC/QV9AqURE9JnnV4eeUB9XVKg+/XRjL7FQZQnmWEIuQxpMtPAlR1n6BB6T1CZGSlCBst6+ eLf8ZxXhyVeEHg9j1uliutZfVS7qXMYoCAQlObgOK6nyTJccBz8NUvXt7y+CDwIDAQABo0IwQDAd BgNVHQ4EFgQUU3m/WqorSs9UgOHYm8Cd8rIDZsswDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQF MAMBAf8wDQYJKoZIhvcNAQEMBQADggIBAFzUfA3P9wF9QZllDHPFUp/L+M+ZBn8b2kMVn54CVVeW FPFSPCeHlCjtHzoBN6J2/FNQwISbxmtOuowhT6KOVWKR82kV2LyI48SqC/3vqOlLVSoGIG1VeCkZ 7l8wXEskEVX/JJpuXior7gtNn3/3ATiUFJVDBwn7YKnuHKsSjKCaXqeYalltiz8I+8jRRa8YFWSQ Eg9zKC7F4iRO/Fjs8PRF/iKz6y+O0tlFYQXBl2+odnKPi4w2r78NBc5xjeambx9spnFixdjQg3IM 8WcRiQycE0xyNN+81XHfqnHd4blsjDwSXWXavVcStkNr/+XeTWYRUc+ZruwXtuhxkYzeSf7dNXGi FSeUHM9h4ya7b6NnJSFd5t0dCy5oGzuCr+yDZ4XUmFF0sbmZgIn/f3gZXHlKYC6SQK5MNyosycdi yA5d9zZbyuAlJQG03RoHnHcAP9Dc1ew91Pq7P8yF1m9/qS3fuQL39ZeatTXaw2ewh0qpKJ4jjv9c J2vhsE/zB+4ALtRZh8tSQZXq9EfX7mRBVXyNWQKV3WKdwrnuWih0hKWbt5DHDAff9Yk2dDLWKMGw sAvgnEzDHNb842m1R0aBL6KCq9NjRHDEjf8tM7qtj3u1cIiuPhnPQCjY/MiQu12ZIvVS5ljFH4gx Q+6IHdfGjjxDah2nGN59PRbxYvnKkKj9 -----END CERTIFICATE----- USERTrust ECC Certification Authority ===================================== -----BEGIN CERTIFICATE----- MIICjzCCAhWgAwIBAgIQXIuZxVqUxdJxVt7NiYDMJjAKBggqhkjOPQQDAzCBiDELMAkGA1UEBhMC VVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQKExVU aGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBFQ0MgQ2VydGlmaWNhdGlv biBBdXRob3JpdHkwHhcNMTAwMjAxMDAwMDAwWhcNMzgwMTE4MjM1OTU5WjCBiDELMAkGA1UEBhMC VVMxEzARBgNVBAgTCk5ldyBKZXJzZXkxFDASBgNVBAcTC0plcnNleSBDaXR5MR4wHAYDVQQKExVU aGUgVVNFUlRSVVNUIE5ldHdvcmsxLjAsBgNVBAMTJVVTRVJUcnVzdCBFQ0MgQ2VydGlmaWNhdGlv biBBdXRob3JpdHkwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQarFRaqfloI+d61SRvU8Za2EurxtW2 0eZzca7dnNYMYf3boIkDuAUU7FfO7l0/4iGzzvfUinngo4N+LZfQYcTxmdwlkWOrfzCjtHDix6Ez nPO/LlxTsV+zfTJ/ijTjeXmjQjBAMB0GA1UdDgQWBBQ64QmG1M8ZwpZ2dEl23OA1xmNjmjAOBgNV HQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAwNoADBlAjA2Z6EWCNzklwBB HU6+4WMBzzuqQhFkoJ2UOQIReVx7Hfpkue4WQrO/isIJxOzksU0CMQDpKmFHjFJKS04YcPbWRNZu 9YO6bVi9JNlWSOrvxKJGgYhqOkbRqZtNyWHa0V1Xahg= -----END CERTIFICATE----- GlobalSign ECC Root CA - R5 =========================== -----BEGIN CERTIFICATE----- MIICHjCCAaSgAwIBAgIRYFlJ4CYuu1X5CneKcflK2GwwCgYIKoZIzj0EAwMwUDEkMCIGA1UECxMb R2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI1MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQD EwpHbG9iYWxTaWduMB4XDTEyMTExMzAwMDAwMFoXDTM4MDExOTAzMTQwN1owUDEkMCIGA1UECxMb R2xvYmFsU2lnbiBFQ0MgUm9vdCBDQSAtIFI1MRMwEQYDVQQKEwpHbG9iYWxTaWduMRMwEQYDVQQD EwpHbG9iYWxTaWduMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAER0UOlvt9Xb/pOdEh+J8LttV7HpI6 SFkc8GIxLcB6KP4ap1yztsyX50XUWPrRd21DosCHZTQKH3rd6zwzocWdTaRvQZU4f8kehOvRnkmS h5SHDDqFSmafnVmTTZdhBoZKo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAd BgNVHQ4EFgQUPeYpSJvqB8ohREom3m7e0oPQn1kwCgYIKoZIzj0EAwMDaAAwZQIxAOVpEslu28Yx uglB4Zf4+/2a4n0Sye18ZNPLBSWLVtmg515dTguDnFt2KaAJJiFqYgIwcdK1j1zqO+F4CYWodZI7 yFz9SO8NdCKoCOJuxUnOxwy8p2Fp8fc74SrL+SvzZpA3 -----END CERTIFICATE----- Staat der Nederlanden EV Root CA ================================ -----BEGIN CERTIFICATE----- MIIFcDCCA1igAwIBAgIEAJiWjTANBgkqhkiG9w0BAQsFADBYMQswCQYDVQQGEwJOTDEeMBwGA1UE CgwVU3RhYXQgZGVyIE5lZGVybGFuZGVuMSkwJwYDVQQDDCBTdGFhdCBkZXIgTmVkZXJsYW5kZW4g RVYgUm9vdCBDQTAeFw0xMDEyMDgxMTE5MjlaFw0yMjEyMDgxMTEwMjhaMFgxCzAJBgNVBAYTAk5M MR4wHAYDVQQKDBVTdGFhdCBkZXIgTmVkZXJsYW5kZW4xKTAnBgNVBAMMIFN0YWF0IGRlciBOZWRl cmxhbmRlbiBFViBSb290IENBMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA48d+ifkk SzrSM4M1LGns3Amk41GoJSt5uAg94JG6hIXGhaTK5skuU6TJJB79VWZxXSzFYGgEt9nCUiY4iKTW O0Cmws0/zZiTs1QUWJZV1VD+hq2kY39ch/aO5ieSZxeSAgMs3NZmdO3dZ//BYY1jTw+bbRcwJu+r 0h8QoPnFfxZpgQNH7R5ojXKhTbImxrpsX23Wr9GxE46prfNeaXUmGD5BKyF/7otdBwadQ8QpCiv8 Kj6GyzyDOvnJDdrFmeK8eEEzduG/L13lpJhQDBXd4Pqcfzho0LKmeqfRMb1+ilgnQ7O6M5HTp5gV XJrm0w912fxBmJc+qiXbj5IusHsMX/FjqTf5m3VpTCgmJdrV8hJwRVXj33NeN/UhbJCONVrJ0yPr 08C+eKxCKFhmpUZtcALXEPlLVPxdhkqHz3/KRawRWrUgUY0viEeXOcDPusBCAUCZSCELa6fS/ZbV 0b5GnUngC6agIk440ME8MLxwjyx1zNDFjFE7PZQIZCZhfbnDZY8UnCHQqv0XcgOPvZuM5l5Tnrmd 74K74bzickFbIZTTRTeU0d8JOV3nI6qaHcptqAqGhYqCvkIH1vI4gnPah1vlPNOePqc7nvQDs/nx fRN0Av+7oeX6AHkcpmZBiFxgV6YuCcS6/ZrPpx9Aw7vMWgpVSzs4dlG4Y4uElBbmVvMCAwEAAaNC MEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFP6rAJCYniT8qcwa ivsnuL8wbqg7MA0GCSqGSIb3DQEBCwUAA4ICAQDPdyxuVr5Os7aEAJSrR8kN0nbHhp8dB9O2tLsI eK9p0gtJ3jPFrK3CiAJ9Brc1AsFgyb/E6JTe1NOpEyVa/m6irn0F3H3zbPB+po3u2dfOWBfoqSmu c0iH55vKbimhZF8ZE/euBhD/UcabTVUlT5OZEAFTdfETzsemQUHSv4ilf0X8rLiltTMMgsT7B/Zq 5SWEXwbKwYY5EdtYzXc7LMJMD16a4/CrPmEbUCTCwPTxGfARKbalGAKb12NMcIxHowNDXLldRqAN b/9Zjr7dn3LDWyvfjFvO5QxGbJKyCqNMVEIYFRIYvdr8unRu/8G2oGTYqV9Vrp9canaW2HNnh/tN f1zuacpzEPuKqf2evTY4SUmH9A4U8OmHuD+nT3pajnnUk+S7aFKErGzp85hwVXIy+TSrK0m1zSBi 5Dp6Z2Orltxtrpfs/J92VoguZs9btsmksNcFuuEnL5O7Jiqik7Ab846+HUCjuTaPPoIaGl6I6lD4 WeKDRikL40Rc4ZW2aZCaFG+XroHPaO+Zmr615+F/+PoTRxZMzG0IQOeLeG9QgkRQP2YGiqtDhFZK DyAthg710tvSeopLzaXoTvFeJiUBWSOgftL2fiFX1ye8FVdMpEbB4IMeDExNH08GGeL5qPQ6gqGy eUN51q1veieQA6TqJIc/2b3Z6fJfUEkc7uzXLg== -----END CERTIFICATE----- IdenTrust Commercial Root CA 1 ============================== -----BEGIN CERTIFICATE----- MIIFYDCCA0igAwIBAgIQCgFCgAAAAUUjyES1AAAAAjANBgkqhkiG9w0BAQsFADBKMQswCQYDVQQG EwJVUzESMBAGA1UEChMJSWRlblRydXN0MScwJQYDVQQDEx5JZGVuVHJ1c3QgQ29tbWVyY2lhbCBS b290IENBIDEwHhcNMTQwMTE2MTgxMjIzWhcNMzQwMTE2MTgxMjIzWjBKMQswCQYDVQQGEwJVUzES MBAGA1UEChMJSWRlblRydXN0MScwJQYDVQQDEx5JZGVuVHJ1c3QgQ29tbWVyY2lhbCBSb290IENB IDEwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCnUBneP5k91DNG8W9RYYKyqU+PZ4ld hNlT3Qwo2dfw/66VQ3KZ+bVdfIrBQuExUHTRgQ18zZshq0PirK1ehm7zCYofWjK9ouuU+ehcCuz/ mNKvcbO0U59Oh++SvL3sTzIwiEsXXlfEU8L2ApeN2WIrvyQfYo3fw7gpS0l4PJNgiCL8mdo2yMKi 1CxUAGc1bnO/AljwpN3lsKImesrgNqUZFvX9t++uP0D1bVoE/c40yiTcdCMbXTMTEl3EASX2MN0C XZ/g1Ue9tOsbobtJSdifWwLziuQkkORiT0/Br4sOdBeo0XKIanoBScy0RnnGF7HamB4HWfp1IYVl 3ZBWzvurpWCdxJ35UrCLvYf5jysjCiN2O/cz4ckA82n5S6LgTrx+kzmEB/dEcH7+B1rlsazRGMzy NeVJSQjKVsk9+w8YfYs7wRPCTY/JTw436R+hDmrfYi7LNQZReSzIJTj0+kuniVyc0uMNOYZKdHzV WYfCP04MXFL0PfdSgvHqo6z9STQaKPNBiDoT7uje/5kdX7rL6B7yuVBgwDHTc+XvvqDtMwt0viAg xGds8AgDelWAf0ZOlqf0Hj7h9tgJ4TNkK2PXMl6f+cB7D3hvl7yTmvmcEpB4eoCHFddydJxVdHix uuFucAS6T6C6aMN7/zHwcz09lCqxC0EOoP5NiGVreTO01wIDAQABo0IwQDAOBgNVHQ8BAf8EBAMC AQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU7UQZwNPwBovupHu+QucmVMiONnYwDQYJKoZI hvcNAQELBQADggIBAA2ukDL2pkt8RHYZYR4nKM1eVO8lvOMIkPkp165oCOGUAFjvLi5+U1KMtlwH 6oi6mYtQlNeCgN9hCQCTrQ0U5s7B8jeUeLBfnLOic7iPBZM4zY0+sLj7wM+x8uwtLRvM7Kqas6pg ghstO8OEPVeKlh6cdbjTMM1gCIOQ045U8U1mwF10A0Cj7oV+wh93nAbowacYXVKV7cndJZ5t+qnt ozo00Fl72u1Q8zW/7esUTTHHYPTa8Yec4kjixsU3+wYQ+nVZZjFHKdp2mhzpgq7vmrlR94gjmmmV YjzlVYA211QC//G5Xc7UI2/YRYRKW2XviQzdFKcgyxilJbQN+QHwotL0AMh0jqEqSI5l2xPE4iUX feu+h1sXIFRRk0pTAwvsXcoz7WL9RccvW9xYoIA55vrX/hMUpu09lEpCdNTDd1lzzY9GvlU47/ro kTLql1gEIt44w8y8bckzOmoKaT+gyOpyj4xjhiO9bTyWnpXgSUyqorkqG5w2gXjtw+hG4iZZRHUe 2XWJUc0QhJ1hYMtd+ZciTY6Y5uN/9lu7rs3KSoFrXgvzUeF0K+l+J6fZmUlO+KWA2yUPHGNiiskz Z2s8EIPGrd6ozRaOjfAHN3Gf8qv8QfXBi+wAN10J5U6A7/qxXDgGpRtK4dw4LTzcqx+QGtVKnO7R cGzM7vRX+Bi6hG6H -----END CERTIFICATE----- IdenTrust Public Sector Root CA 1 ================================= -----BEGIN CERTIFICATE----- MIIFZjCCA06gAwIBAgIQCgFCgAAAAUUjz0Z8AAAAAjANBgkqhkiG9w0BAQsFADBNMQswCQYDVQQG EwJVUzESMBAGA1UEChMJSWRlblRydXN0MSowKAYDVQQDEyFJZGVuVHJ1c3QgUHVibGljIFNlY3Rv ciBSb290IENBIDEwHhcNMTQwMTE2MTc1MzMyWhcNMzQwMTE2MTc1MzMyWjBNMQswCQYDVQQGEwJV UzESMBAGA1UEChMJSWRlblRydXN0MSowKAYDVQQDEyFJZGVuVHJ1c3QgUHVibGljIFNlY3RvciBS b290IENBIDEwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC2IpT8pEiv6EdrCvsnduTy P4o7ekosMSqMjbCpwzFrqHd2hCa2rIFCDQjrVVi7evi8ZX3yoG2LqEfpYnYeEe4IFNGyRBb06tD6 Hi9e28tzQa68ALBKK0CyrOE7S8ItneShm+waOh7wCLPQ5CQ1B5+ctMlSbdsHyo+1W/CD80/HLaXI rcuVIKQxKFdYWuSNG5qrng0M8gozOSI5Cpcu81N3uURF/YTLNiCBWS2ab21ISGHKTN9T0a9SvESf qy9rg3LvdYDaBjMbXcjaY8ZNzaxmMc3R3j6HEDbhuaR672BQssvKplbgN6+rNBM5Jeg5ZuSYeqoS mJxZZoY+rfGwyj4GD3vwEUs3oERte8uojHH01bWRNszwFcYr3lEXsZdMUD2xlVl8BX0tIdUAvwFn ol57plzy9yLxkA2T26pEUWbMfXYD62qoKjgZl3YNa4ph+bz27nb9cCvdKTz4Ch5bQhyLVi9VGxyh LrXHFub4qjySjmm2AcG1hp2JDws4lFTo6tyePSW8Uybt1as5qsVATFSrsrTZ2fjXctscvG29ZV/v iDUqZi/u9rNl8DONfJhBaUYPQxxp+pu10GFqzcpL2UyQRqsVWaFHVCkugyhfHMKiq3IXAAaOReyL 4jM9f9oZRORicsPfIsbyVtTdX5Vy7W1f90gDW/3FKqD2cyOEEBsB5wIDAQABo0IwQDAOBgNVHQ8B Af8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU43HgntinQtnbcZFrlJPrw6PRFKMw DQYJKoZIhvcNAQELBQADggIBAEf63QqwEZE4rU1d9+UOl1QZgkiHVIyqZJnYWv6IAcVYpZmxI1Qj t2odIFflAWJBF9MJ23XLblSQdf4an4EKwt3X9wnQW3IV5B4Jaj0z8yGa5hV+rVHVDRDtfULAj+7A mgjVQdZcDiFpboBhDhXAuM/FSRJSzL46zNQuOAXeNf0fb7iAaJg9TaDKQGXSc3z1i9kKlT/YPyNt GtEqJBnZhbMX73huqVjRI9PHE+1yJX9dsXNw0H8GlwmEKYBhHfpe/3OsoOOJuBxxFcbeMX8S3OFt m6/n6J91eEyrRjuazr8FGF1NFTwWmhlQBJqymm9li1JfPFgEKCXAZmExfrngdbkaqIHWchezxQMx NRF4eKLg6TCMf4DfWN88uieW4oA0beOY02QnrEh+KHdcxiVhJfiFDGX6xDIvpZgF5PgLZxYWxoK4 Mhn5+bl53B/N66+rDt0b20XkeucC4pVd/GnwU2lhlXV5C15V5jgclKlZM57IcXR5f1GJtshquDDI ajjDbp7hNxbqBWJMWxJH7ae0s1hWx0nzfxJoCTFx8G34Tkf71oXuxVhAGaQdp/lLQzfcaFpPz+vC ZHTetBXZ9FRUGi8c15dxVJCO2SCdUyt/q4/i6jC8UDfv8Ue1fXwsBOxonbRJRBD0ckscZOf85muQ 3Wl9af0AVqW3rLatt8o+Ae+c -----END CERTIFICATE----- Entrust Root Certification Authority - G2 ========================================= -----BEGIN CERTIFICATE----- MIIEPjCCAyagAwIBAgIESlOMKDANBgkqhkiG9w0BAQsFADCBvjELMAkGA1UEBhMCVVMxFjAUBgNV BAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVy bXMxOTA3BgNVBAsTMChjKSAyMDA5IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ug b25seTEyMDAGA1UEAxMpRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzIw HhcNMDkwNzA3MTcyNTU0WhcNMzAxMjA3MTc1NTU0WjCBvjELMAkGA1UEBhMCVVMxFjAUBgNVBAoT DUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50cnVzdC5uZXQvbGVnYWwtdGVybXMx OTA3BgNVBAsTMChjKSAyMDA5IEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXplZCB1c2Ugb25s eTEyMDAGA1UEAxMpRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IC0gRzIwggEi MA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC6hLZy254Ma+KZ6TABp3bqMriVQRrJ2mFOWHLP /vaCeb9zYQYKpSfYs1/TRU4cctZOMvJyig/3gxnQaoCAAEUesMfnmr8SVycco2gvCoe9amsOXmXz HHfV1IWNcCG0szLni6LVhjkCsbjSR87kyUnEO6fe+1R9V77w6G7CebI6C1XiUJgWMhNcL3hWwcKU s/Ja5CeanyTXxuzQmyWC48zCxEXFjJd6BmsqEZ+pCm5IO2/b1BEZQvePB7/1U1+cPvQXLOZprE4y TGJ36rfo5bs0vBmLrpxR57d+tVOxMyLlbc9wPBr64ptntoP0jaWvYkxN4FisZDQSA/i2jZRjJKRx AgMBAAGjQjBAMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBRqciZ6 0B7vfec7aVHUbI2fkBJmqzANBgkqhkiG9w0BAQsFAAOCAQEAeZ8dlsa2eT8ijYfThwMEYGprmi5Z iXMRrEPR9RP/jTkrwPK9T3CMqS/qF8QLVJ7UG5aYMzyorWKiAHarWWluBh1+xLlEjZivEtRh2woZ Rkfz6/djwUAFQKXSt/S1mja/qYh2iARVBCuch38aNzx+LaUa2NSJXsq9rD1s2G2v1fN2D807iDgi nWyTmsQ9v4IbZT+mD12q/OWyFcq1rca8PdCE6OoGcrBNOTJ4vz4RnAuknZoh8/CbCzB428Hch0P+ vGOaysXCHMnHjf87ElgI5rY97HosTvuDls4MPGmHVHOkc8KT/1EQrBVUAdj8BbGJoX90g5pJ19xO e4pIb4tF9g== -----END CERTIFICATE----- Entrust Root Certification Authority - EC1 ========================================== -----BEGIN CERTIFICATE----- MIIC+TCCAoCgAwIBAgINAKaLeSkAAAAAUNCR+TAKBggqhkjOPQQDAzCBvzELMAkGA1UEBhMCVVMx FjAUBgNVBAoTDUVudHJ1c3QsIEluYy4xKDAmBgNVBAsTH1NlZSB3d3cuZW50cnVzdC5uZXQvbGVn YWwtdGVybXMxOTA3BgNVBAsTMChjKSAyMDEyIEVudHJ1c3QsIEluYy4gLSBmb3IgYXV0aG9yaXpl ZCB1c2Ugb25seTEzMDEGA1UEAxMqRW50cnVzdCBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5 IC0gRUMxMB4XDTEyMTIxODE1MjUzNloXDTM3MTIxODE1NTUzNlowgb8xCzAJBgNVBAYTAlVTMRYw FAYDVQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQLEx9TZWUgd3d3LmVudHJ1c3QubmV0L2xlZ2Fs LXRlcm1zMTkwNwYDVQQLEzAoYykgMjAxMiBFbnRydXN0LCBJbmMuIC0gZm9yIGF1dGhvcml6ZWQg dXNlIG9ubHkxMzAxBgNVBAMTKkVudHJ1c3QgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSAt IEVDMTB2MBAGByqGSM49AgEGBSuBBAAiA2IABIQTydC6bUF74mzQ61VfZgIaJPRbiWlH47jCffHy AsWfoPZb1YsGGYZPUxBtByQnoaD41UcZYUx9ypMn6nQM72+WCf5j7HBdNq1nd67JnXxVRDqiY1Ef 9eNi1KlHBz7MIKNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYE FLdj5xrdjekIplWDpOBqUEFlEUJJMAoGCCqGSM49BAMDA2cAMGQCMGF52OVCR98crlOZF7ZvHH3h vxGU0QOIdeSNiaSKd0bebWHvAvX7td/M/k7//qnmpwIwW5nXhTcGtXsI/esni0qU+eH6p44mCOh8 kmhtc9hvJqwhAriZtyZBWyVgrtBIGu4G -----END CERTIFICATE----- CFCA EV ROOT ============ -----BEGIN CERTIFICATE----- MIIFjTCCA3WgAwIBAgIEGErM1jANBgkqhkiG9w0BAQsFADBWMQswCQYDVQQGEwJDTjEwMC4GA1UE CgwnQ2hpbmEgRmluYW5jaWFsIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRUwEwYDVQQDDAxDRkNB IEVWIFJPT1QwHhcNMTIwODA4MDMwNzAxWhcNMjkxMjMxMDMwNzAxWjBWMQswCQYDVQQGEwJDTjEw MC4GA1UECgwnQ2hpbmEgRmluYW5jaWFsIENlcnRpZmljYXRpb24gQXV0aG9yaXR5MRUwEwYDVQQD DAxDRkNBIEVWIFJPT1QwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDXXWvNED8fBVnV BU03sQ7smCuOFR36k0sXgiFxEFLXUWRwFsJVaU2OFW2fvwwbwuCjZ9YMrM8irq93VCpLTIpTUnrD 7i7es3ElweldPe6hL6P3KjzJIx1qqx2hp/Hz7KDVRM8Vz3IvHWOX6Jn5/ZOkVIBMUtRSqy5J35DN uF++P96hyk0g1CXohClTt7GIH//62pCfCqktQT+x8Rgp7hZZLDRJGqgG16iI0gNyejLi6mhNbiyW ZXvKWfry4t3uMCz7zEasxGPrb382KzRzEpR/38wmnvFyXVBlWY9ps4deMm/DGIq1lY+wejfeWkU7 xzbh72fROdOXW3NiGUgthxwG+3SYIElz8AXSG7Ggo7cbcNOIabla1jj0Ytwli3i/+Oh+uFzJlU9f py25IGvPa931DfSCt/SyZi4QKPaXWnuWFo8BGS1sbn85WAZkgwGDg8NNkt0yxoekN+kWzqotaK8K gWU6cMGbrU1tVMoqLUuFG7OA5nBFDWteNfB/O7ic5ARwiRIlk9oKmSJgamNgTnYGmE69g60dWIol hdLHZR4tjsbftsbhf4oEIRUpdPA+nJCdDC7xij5aqgwJHsfVPKPtl8MeNPo4+QgO48BdK4PRVmrJ tqhUUy54Mmc9gn900PvhtgVguXDbjgv5E1hvcWAQUhC5wUEJ73IfZzF4/5YFjQIDAQABo2MwYTAf BgNVHSMEGDAWgBTj/i39KNALtbq2osS/BqoFjJP7LzAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB /wQEAwIBBjAdBgNVHQ4EFgQU4/4t/SjQC7W6tqLEvwaqBYyT+y8wDQYJKoZIhvcNAQELBQADggIB ACXGumvrh8vegjmWPfBEp2uEcwPenStPuiB/vHiyz5ewG5zz13ku9Ui20vsXiObTej/tUxPQ4i9q ecsAIyjmHjdXNYmEwnZPNDatZ8POQQaIxffu2Bq41gt/UP+TqhdLjOztUmCypAbqTuv0axn96/Ua 4CUqmtzHQTb3yHQFhDmVOdYLO6Qn+gjYXB74BGBSESgoA//vU2YApUo0FmZ8/Qmkrp5nGm9BC2sG E5uPhnEFtC+NiWYzKXZUmhH4J/qyP5Hgzg0b8zAarb8iXRvTvyUFTeGSGn+ZnzxEk8rUQElsgIfX BDrDMlI1Dlb4pd19xIsNER9Tyx6yF7Zod1rg1MvIB671Oi6ON7fQAUtDKXeMOZePglr4UeWJoBjn aH9dCi77o0cOPaYjesYBx4/IXr9tgFa+iiS6M+qf4TIRnvHST4D2G0CvOJ4RUHlzEhLN5mydLIhy PDCBBpEi6lmt2hkuIsKNuYyH4Ga8cyNfIWRjgEj1oDwYPZTISEEdQLpe/v5WOaHIz16eGWRGENoX kbcFgKyLmZJ956LYBws2J+dIeWCKw9cTXPhyQN9Ky8+ZAAoACxGV2lZFA4gKn2fQ1XmxqI1AbQ3C ekD6819kR5LLU7m7Wc5P/dAVUwHY3+vZ5nbv0CO7O6l5s9UCKc2Jo5YPSjXnTkLAdc0Hz+Ys63su -----END CERTIFICATE----- OISTE WISeKey Global Root GB CA =============================== -----BEGIN CERTIFICATE----- MIIDtTCCAp2gAwIBAgIQdrEgUnTwhYdGs/gjGvbCwDANBgkqhkiG9w0BAQsFADBtMQswCQYDVQQG EwJDSDEQMA4GA1UEChMHV0lTZUtleTEiMCAGA1UECxMZT0lTVEUgRm91bmRhdGlvbiBFbmRvcnNl ZDEoMCYGA1UEAxMfT0lTVEUgV0lTZUtleSBHbG9iYWwgUm9vdCBHQiBDQTAeFw0xNDEyMDExNTAw MzJaFw0zOTEyMDExNTEwMzFaMG0xCzAJBgNVBAYTAkNIMRAwDgYDVQQKEwdXSVNlS2V5MSIwIAYD VQQLExlPSVNURSBGb3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBXSVNlS2V5IEds b2JhbCBSb290IEdCIENBMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA2Be3HEokKtaX scriHvt9OO+Y9bI5mE4nuBFde9IllIiCFSZqGzG7qFshISvYD06fWvGxWuR51jIjK+FTzJlFXHtP rby/h0oLS5daqPZI7H17Dc0hBt+eFf1Biki3IPShehtX1F1Q/7pn2COZH8g/497/b1t3sWtuuMlk 9+HKQUYOKXHQuSP8yYFfTvdv37+ErXNku7dCjmn21HYdfp2nuFeKUWdy19SouJVUQHMD9ur06/4o Qnc/nSMbsrY9gBQHTC5P99UKFg29ZkM3fiNDecNAhvVMKdqOmq0NpQSHiB6F4+lT1ZvIiwNjeOvg GUpuuy9rM2RYk61pv48b74JIxwIDAQABo1EwTzALBgNVHQ8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB /zAdBgNVHQ4EFgQUNQ/INmNe4qPs+TtmFc5RUuORmj0wEAYJKwYBBAGCNxUBBAMCAQAwDQYJKoZI hvcNAQELBQADggEBAEBM+4eymYGQfp3FsLAmzYh7KzKNbrghcViXfa43FK8+5/ea4n32cZiZBKpD dHij40lhPnOMTZTg+XHEthYOU3gf1qKHLwI5gSk8rxWYITD+KJAAjNHhy/peyP34EEY7onhCkRd0 VQreUGdNZtGn//3ZwLWoo4rOZvUPQ82nK1d7Y0Zqqi5S2PTt4W2tKZB4SLrhI6qjiey1q5bAtEui HZeeevJuQHHfaPFlTc58Bd9TZaml8LGXBHAVRgOY1NK/VLSgWH1Sb9pWJmLU2NuJMW8c8CLC02Ic Nc1MaRVUGpCY3useX8p3x8uOPUNpnJpY0CQ73xtAln41rYHHTnG6iBM= -----END CERTIFICATE----- SZAFIR ROOT CA2 =============== -----BEGIN CERTIFICATE----- MIIDcjCCAlqgAwIBAgIUPopdB+xV0jLVt+O2XwHrLdzk1uQwDQYJKoZIhvcNAQELBQAwUTELMAkG A1UEBhMCUEwxKDAmBgNVBAoMH0tyYWpvd2EgSXpiYSBSb3psaWN6ZW5pb3dhIFMuQS4xGDAWBgNV BAMMD1NaQUZJUiBST09UIENBMjAeFw0xNTEwMTkwNzQzMzBaFw0zNTEwMTkwNzQzMzBaMFExCzAJ BgNVBAYTAlBMMSgwJgYDVQQKDB9LcmFqb3dhIEl6YmEgUm96bGljemVuaW93YSBTLkEuMRgwFgYD VQQDDA9TWkFGSVIgUk9PVCBDQTIwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQC3vD5Q qEvNQLXOYeeWyrSh2gwisPq1e3YAd4wLz32ohswmUeQgPYUM1ljj5/QqGJ3a0a4m7utT3PSQ1hNK DJA8w/Ta0o4NkjrcsbH/ON7Dui1fgLkCvUqdGw+0w8LBZwPd3BucPbOw3gAeqDRHu5rr/gsUvTaE 2g0gv/pby6kWIK05YO4vdbbnl5z5Pv1+TW9NL++IDWr63fE9biCloBK0TXC5ztdyO4mTp4CEHCdJ ckm1/zuVnsHMyAHs6A6KCpbns6aH5db5BSsNl0BwPLqsdVqc1U2dAgrSS5tmS0YHF2Wtn2yIANwi ieDhZNRnvDF5YTy7ykHNXGoAyDw4jlivAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0P AQH/BAQDAgEGMB0GA1UdDgQWBBQuFqlKGLXLzPVvUPMjX/hd56zwyDANBgkqhkiG9w0BAQsFAAOC AQEAtXP4A9xZWx126aMqe5Aosk3AM0+qmrHUuOQn/6mWmc5G4G18TKI4pAZw8PRBEew/R40/cof5 O/2kbytTAOD/OblqBw7rHRz2onKQy4I9EYKL0rufKq8h5mOGnXkZ7/e7DDWQw4rtTw/1zBLZpD67 oPwglV9PJi8RI4NOdQcPv5vRtB3pEAT+ymCPoky4rc/hkA/NrgrHXXu3UNLUYfrVFdvXn4dRVOul 4+vJhaAlIDf7js4MNIThPIGyd05DpYhfhmehPea0XGG2Ptv+tyjFogeutcrKjSoS75ftwjCkySp6 +/NNIxuZMzSgLvWpCz/UXeHPhJ/iGcJfitYgHuNztw== -----END CERTIFICATE----- Certum Trusted Network CA 2 =========================== -----BEGIN CERTIFICATE----- MIIF0jCCA7qgAwIBAgIQIdbQSk8lD8kyN/yqXhKN6TANBgkqhkiG9w0BAQ0FADCBgDELMAkGA1UE BhMCUEwxIjAgBgNVBAoTGVVuaXpldG8gVGVjaG5vbG9naWVzIFMuQS4xJzAlBgNVBAsTHkNlcnR1 bSBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEkMCIGA1UEAxMbQ2VydHVtIFRydXN0ZWQgTmV0d29y ayBDQSAyMCIYDzIwMTExMDA2MDgzOTU2WhgPMjA0NjEwMDYwODM5NTZaMIGAMQswCQYDVQQGEwJQ TDEiMCAGA1UEChMZVW5pemV0byBUZWNobm9sb2dpZXMgUy5BLjEnMCUGA1UECxMeQ2VydHVtIENl cnRpZmljYXRpb24gQXV0aG9yaXR5MSQwIgYDVQQDExtDZXJ0dW0gVHJ1c3RlZCBOZXR3b3JrIENB IDIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC9+Xj45tWADGSdhhuWZGc/IjoedQF9 7/tcZ4zJzFxrqZHmuULlIEub2pt7uZld2ZuAS9eEQCsn0+i6MLs+CRqnSZXvK0AkwpfHp+6bJe+o CgCXhVqqndwpyeI1B+twTUrWwbNWuKFBOJvR+zF/j+Bf4bE/D44WSWDXBo0Y+aomEKsq09DRZ40b Rr5HMNUuctHFY9rnY3lEfktjJImGLjQ/KUxSiyqnwOKRKIm5wFv5HdnnJ63/mgKXwcZQkpsCLL2p uTRZCr+ESv/f/rOf69me4Jgj7KZrdxYq28ytOxykh9xGc14ZYmhFV+SQgkK7QtbwYeDBoz1mo130 GO6IyY0XRSmZMnUCMe4pJshrAua1YkV/NxVaI2iJ1D7eTiew8EAMvE0Xy02isx7QBlrd9pPPV3WZ 9fqGGmd4s7+W/jTcvedSVuWz5XV710GRBdxdaeOVDUO5/IOWOZV7bIBaTxNyxtd9KXpEulKkKtVB Rgkg/iKgtlswjbyJDNXXcPiHUv3a76xRLgezTv7QCdpw75j6VuZt27VXS9zlLCUVyJ4ueE742pye hizKV/Ma5ciSixqClnrDvFASadgOWkaLOusm+iPJtrCBvkIApPjW/jAux9JG9uWOdf3yzLnQh1vM BhBgu4M1t15n3kfsmUjxpKEV/q2MYo45VU85FrmxY53/twIDAQABo0IwQDAPBgNVHRMBAf8EBTAD AQH/MB0GA1UdDgQWBBS2oVQ5AsOgP46KvPrU+Bym0ToO/TAOBgNVHQ8BAf8EBAMCAQYwDQYJKoZI hvcNAQENBQADggIBAHGlDs7k6b8/ONWJWsQCYftMxRQXLYtPU2sQF/xlhMcQSZDe28cmk4gmb3DW Al45oPePq5a1pRNcgRRtDoGCERuKTsZPpd1iHkTfCVn0W3cLN+mLIMb4Ck4uWBzrM9DPhmDJ2vuA L55MYIR4PSFk1vtBHxgP58l1cb29XN40hz5BsA72udY/CROWFC/emh1auVbONTqwX3BNXuMp8SMo clm2q8KMZiYcdywmdjWLKKdpoPk79SPdhRB0yZADVpHnr7pH1BKXESLjokmUbOe3lEu6LaTaM4tM pkT/WjzGHWTYtTHkpjx6qFcL2+1hGsvxznN3Y6SHb0xRONbkX8eftoEq5IVIeVheO/jbAoJnwTnb w3RLPTYe+SmTiGhbqEQZIfCn6IENLOiTNrQ3ssqwGyZ6miUfmpqAnksqP/ujmv5zMnHCnsZy4Ypo J/HkD7TETKVhk/iXEAcqMCWpuchxuO9ozC1+9eB+D4Kob7a6bINDd82Kkhehnlt4Fj1F4jNy3eFm ypnTycUm/Q1oBEauttmbjL4ZvrHG8hnjXALKLNhvSgfZyTXaQHXyxKcZb55CEJh15pWLYLztxRLX is7VmFxWlgPF7ncGNf/P5O4/E2Hu29othfDNrp2yGAlFw5Khchf8R7agCyzxxN5DaAhqXzvwdmP7 zAYspsbiDrW5viSP -----END CERTIFICATE----- Hellenic Academic and Research Institutions RootCA 2015 ======================================================= -----BEGIN CERTIFICATE----- MIIGCzCCA/OgAwIBAgIBADANBgkqhkiG9w0BAQsFADCBpjELMAkGA1UEBhMCR1IxDzANBgNVBAcT BkF0aGVuczFEMEIGA1UEChM7SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJlc2VhcmNoIEluc3RpdHV0 aW9ucyBDZXJ0LiBBdXRob3JpdHkxQDA+BgNVBAMTN0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNl YXJjaCBJbnN0aXR1dGlvbnMgUm9vdENBIDIwMTUwHhcNMTUwNzA3MTAxMTIxWhcNNDAwNjMwMTAx MTIxWjCBpjELMAkGA1UEBhMCR1IxDzANBgNVBAcTBkF0aGVuczFEMEIGA1UEChM7SGVsbGVuaWMg QWNhZGVtaWMgYW5kIFJlc2VhcmNoIEluc3RpdHV0aW9ucyBDZXJ0LiBBdXRob3JpdHkxQDA+BgNV BAMTN0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgUm9vdENBIDIw MTUwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDC+Kk/G4n8PDwEXT2QNrCROnk8Zlrv bTkBSRq0t89/TSNTt5AA4xMqKKYx8ZEA4yjsriFBzh/a/X0SWwGDD7mwX5nh8hKDgE0GPt+sr+eh iGsxr/CL0BgzuNtFajT0AoAkKAoCFZVedioNmToUW/bLy1O8E00BiDeUJRtCvCLYjqOWXjrZMts+ 6PAQZe104S+nfK8nNLspfZu2zwnI5dMK/IhlZXQK3HMcXM1AsRzUtoSMTFDPaI6oWa7CJ06CojXd FPQf/7J31Ycvqm59JCfnxssm5uX+Zwdj2EUN3TpZZTlYepKZcj2chF6IIbjV9Cz82XBST3i4vTwr i5WY9bPRaM8gFH5MXF/ni+X1NYEZN9cRCLdmvtNKzoNXADrDgfgXy5I2XdGj2HUb4Ysn6npIQf1F GQatJ5lOwXBH3bWfgVMS5bGMSF0xQxfjjMZ6Y5ZLKTBOhE5iGV48zpeQpX8B653g+IuJ3SWYPZK2 fu/Z8VFRfS0myGlZYeCsargqNhEEelC9MoS+L9xy1dcdFkfkR2YgP/SWxa+OAXqlD3pk9Q0Yh9mu iNX6hME6wGkoLfINaFGq46V3xqSQDqE3izEjR8EJCOtu93ib14L8hCCZSRm2Ekax+0VVFqmjZayc Bw/qa9wfLgZy7IaIEuQt218FL+TwA9MmM+eAws1CoRc0CwIDAQABo0IwQDAPBgNVHRMBAf8EBTAD AQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4EFgQUcRVnyMjJvXVdctA4GGqd83EkVAswDQYJKoZI hvcNAQELBQADggIBAHW7bVRLqhBYRjTyYtcWNl0IXtVsyIe9tC5G8jH4fOpCtZMWVdyhDBKg2mF+ D1hYc2Ryx+hFjtyp8iY/xnmMsVMIM4GwVhO+5lFc2JsKT0ucVlMC6U/2DWDqTUJV6HwbISHTGzrM d/K4kPFox/la/vot9L/J9UUbzjgQKjeKeaO04wlshYaT/4mWJ3iBj2fjRnRUjtkNaeJK9E10A/+y d+2VZ5fkscWrv2oj6NSU4kQoYsRL4vDY4ilrGnB+JGGTe08DMiUNRSQrlrRGar9KC/eaj8GsGsVn 82800vpzY4zvFrCopEYq+OsS7HK07/grfoxSwIuEVPkvPuNVqNxmsdnhX9izjFk0WaSrT2y7Hxjb davYy5LNlDhhDgcGH0tGEPEVvo2FXDtKK4F5D7Rpn0lQl033DlZdwJVqwjbDG2jJ9SrcR5q+ss7F Jej6A7na+RZukYT1HCjI/CbM1xyQVqdfbzoEvM14iQuODy+jqk+iGxI9FghAD/FGTNeqewjBCvVt J94Cj8rDtSvK6evIIVM4pcw72Hc3MKJP2W/R8kCtQXoXxdZKNYm3QdV8hn9VTYNKpXMgwDqvkPGa JI7ZjnHKe7iG2rKPmT4dEw0SEe7Uq/DpFXYC5ODfqiAeW2GFZECpkJcNrVPSWh2HagCXZWK0vm9q p/UsQu0yrbYhnr68 -----END CERTIFICATE----- Hellenic Academic and Research Institutions ECC RootCA 2015 =========================================================== -----BEGIN CERTIFICATE----- MIICwzCCAkqgAwIBAgIBADAKBggqhkjOPQQDAjCBqjELMAkGA1UEBhMCR1IxDzANBgNVBAcTBkF0 aGVuczFEMEIGA1UEChM7SGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJlc2VhcmNoIEluc3RpdHV0aW9u cyBDZXJ0LiBBdXRob3JpdHkxRDBCBgNVBAMTO0hlbGxlbmljIEFjYWRlbWljIGFuZCBSZXNlYXJj aCBJbnN0aXR1dGlvbnMgRUNDIFJvb3RDQSAyMDE1MB4XDTE1MDcwNzEwMzcxMloXDTQwMDYzMDEw MzcxMlowgaoxCzAJBgNVBAYTAkdSMQ8wDQYDVQQHEwZBdGhlbnMxRDBCBgNVBAoTO0hlbGxlbmlj IEFjYWRlbWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgQ2VydC4gQXV0aG9yaXR5MUQwQgYD VQQDEztIZWxsZW5pYyBBY2FkZW1pYyBhbmQgUmVzZWFyY2ggSW5zdGl0dXRpb25zIEVDQyBSb290 Q0EgMjAxNTB2MBAGByqGSM49AgEGBSuBBAAiA2IABJKgQehLgoRc4vgxEZmGZE4JJS+dQS8KrjVP dJWyUWRrjWvmP3CV8AVER6ZyOFB2lQJajq4onvktTpnvLEhvTCUp6NFxW98dwXU3tNf6e3pCnGoK Vlp8aQuqgAkkbH7BRqNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0O BBYEFLQiC4KZJAEOnLvkDv2/+5cgk5kqMAoGCCqGSM49BAMCA2cAMGQCMGfOFmI4oqxiRaeplSTA GiecMjvAwNW6qef4BENThe5SId6d9SWDPp5YSy/XZxMOIQIwBeF1Ad5o7SofTUwJCA3sS61kFyjn dc5FZXIhF8siQQ6ME5g4mlRtm8rifOoCWCKR -----END CERTIFICATE----- ISRG Root X1 ============ -----BEGIN CERTIFICATE----- MIIFazCCA1OgAwIBAgIRAIIQz7DSQONZRGPgu2OCiwAwDQYJKoZIhvcNAQELBQAwTzELMAkGA1UE BhMCVVMxKTAnBgNVBAoTIEludGVybmV0IFNlY3VyaXR5IFJlc2VhcmNoIEdyb3VwMRUwEwYDVQQD EwxJU1JHIFJvb3QgWDEwHhcNMTUwNjA0MTEwNDM4WhcNMzUwNjA0MTEwNDM4WjBPMQswCQYDVQQG EwJVUzEpMCcGA1UEChMgSW50ZXJuZXQgU2VjdXJpdHkgUmVzZWFyY2ggR3JvdXAxFTATBgNVBAMT DElTUkcgUm9vdCBYMTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAK3oJHP0FDfzm54r Vygch77ct984kIxuPOZXoHj3dcKi/vVqbvYATyjb3miGbESTtrFj/RQSa78f0uoxmyF+0TM8ukj1 3Xnfs7j/EvEhmkvBioZxaUpmZmyPfjxwv60pIgbz5MDmgK7iS4+3mX6UA5/TR5d8mUgjU+g4rk8K b4Mu0UlXjIB0ttov0DiNewNwIRt18jA8+o+u3dpjq+sWT8KOEUt+zwvo/7V3LvSye0rgTBIlDHCN Aymg4VMk7BPZ7hm/ELNKjD+Jo2FR3qyHB5T0Y3HsLuJvW5iB4YlcNHlsdu87kGJ55tukmi8mxdAQ 4Q7e2RCOFvu396j3x+UCB5iPNgiV5+I3lg02dZ77DnKxHZu8A/lJBdiB3QW0KtZB6awBdpUKD9jf 1b0SHzUvKBds0pjBqAlkd25HN7rOrFleaJ1/ctaJxQZBKT5ZPt0m9STJEadao0xAH0ahmbWnOlFu hjuefXKnEgV4We0+UXgVCwOPjdAvBbI+e0ocS3MFEvzG6uBQE3xDk3SzynTnjh8BCNAw1FtxNrQH usEwMFxIt4I7mKZ9YIqioymCzLq9gwQbooMDQaHWBfEbwrbwqHyGO0aoSCqI3Haadr8faqU9GY/r OPNk3sgrDQoo//fb4hVC1CLQJ13hef4Y53CIrU7m2Ys6xt0nUW7/vGT1M0NPAgMBAAGjQjBAMA4G A1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBR5tFnme7bl5AFzgAiIyBpY 9umbbjANBgkqhkiG9w0BAQsFAAOCAgEAVR9YqbyyqFDQDLHYGmkgJykIrGF1XIpu+ILlaS/V9lZL ubhzEFnTIZd+50xx+7LSYK05qAvqFyFWhfFQDlnrzuBZ6brJFe+GnY+EgPbk6ZGQ3BebYhtF8GaV 0nxvwuo77x/Py9auJ/GpsMiu/X1+mvoiBOv/2X/qkSsisRcOj/KKNFtY2PwByVS5uCbMiogziUwt hDyC3+6WVwW6LLv3xLfHTjuCvjHIInNzktHCgKQ5ORAzI4JMPJ+GslWYHb4phowim57iaztXOoJw TdwJx4nLCgdNbOhdjsnvzqvHu7UrTkXWStAmzOVyyghqpZXjFaH3pO3JLF+l+/+sKAIuvtd7u+Nx e5AW0wdeRlN8NwdCjNPElpzVmbUq4JUagEiuTDkHzsxHpFKVK7q4+63SM1N95R1NbdWhscdCb+ZA JzVcoyi3B43njTOQ5yOf+1CceWxG1bQVs5ZufpsMljq4Ui0/1lvh+wjChP4kqKOJ2qxq4RgqsahD YVvTH9w7jXbyLeiNdd8XM2w9U/t7y0Ff/9yi0GE44Za4rF2LN9d11TPAmRGunUHBcnWEvgJBQl9n JEiU0Zsnvgc/ubhPgXRR4Xq37Z0j4r7g1SgEEzwxA57demyPxgcYxn/eR44/KJ4EBs+lVDR3veyJ m+kXQ99b21/+jh5Xos1AnX5iItreGCc= -----END CERTIFICATE----- AC RAIZ FNMT-RCM ================ -----BEGIN CERTIFICATE----- MIIFgzCCA2ugAwIBAgIPXZONMGc2yAYdGsdUhGkHMA0GCSqGSIb3DQEBCwUAMDsxCzAJBgNVBAYT AkVTMREwDwYDVQQKDAhGTk1ULVJDTTEZMBcGA1UECwwQQUMgUkFJWiBGTk1ULVJDTTAeFw0wODEw MjkxNTU5NTZaFw0zMDAxMDEwMDAwMDBaMDsxCzAJBgNVBAYTAkVTMREwDwYDVQQKDAhGTk1ULVJD TTEZMBcGA1UECwwQQUMgUkFJWiBGTk1ULVJDTTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoC ggIBALpxgHpMhm5/yBNtwMZ9HACXjywMI7sQmkCpGreHiPibVmr75nuOi5KOpyVdWRHbNi63URcf qQgfBBckWKo3Shjf5TnUV/3XwSyRAZHiItQDwFj8d0fsjz50Q7qsNI1NOHZnjrDIbzAzWHFctPVr btQBULgTfmxKo0nRIBnuvMApGGWn3v7v3QqQIecaZ5JCEJhfTzC8PhxFtBDXaEAUwED653cXeuYL j2VbPNmaUtu1vZ5Gzz3rkQUCwJaydkxNEJY7kvqcfw+Z374jNUUeAlz+taibmSXaXvMiwzn15Cou 08YfxGyqxRxqAQVKL9LFwag0Jl1mpdICIfkYtwb1TplvqKtMUejPUBjFd8g5CSxJkjKZqLsXF3mw WsXmo8RZZUc1g16p6DULmbvkzSDGm0oGObVo/CK67lWMK07q87Hj/LaZmtVC+nFNCM+HHmpxffnT tOmlcYF7wk5HlqX2doWjKI/pgG6BU6VtX7hI+cL5NqYuSf+4lsKMB7ObiFj86xsc3i1w4peSMKGJ 47xVqCfWS+2QrYv6YyVZLag13cqXM7zlzced0ezvXg5KkAYmY6252TUtB7p2ZSysV4999AeU14EC ll2jB0nVetBX+RvnU0Z1qrB5QstocQjpYL05ac70r8NWQMetUqIJ5G+GR4of6ygnXYMgrwTJbFaa i0b1AgMBAAGjgYMwgYAwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYE FPd9xf3E6Jobd2Sn9R2gzL+HYJptMD4GA1UdIAQ3MDUwMwYEVR0gADArMCkGCCsGAQUFBwIBFh1o dHRwOi8vd3d3LmNlcnQuZm5tdC5lcy9kcGNzLzANBgkqhkiG9w0BAQsFAAOCAgEAB5BK3/MjTvDD nFFlm5wioooMhfNzKWtN/gHiqQxjAb8EZ6WdmF/9ARP67Jpi6Yb+tmLSbkyU+8B1RXxlDPiyN8+s D8+Nb/kZ94/sHvJwnvDKuO+3/3Y3dlv2bojzr2IyIpMNOmqOFGYMLVN0V2Ue1bLdI4E7pWYjJ2cJ j+F3qkPNZVEI7VFY/uY5+ctHhKQV8Xa7pO6kO8Rf77IzlhEYt8llvhjho6Tc+hj507wTmzl6NLrT Qfv6MooqtyuGC2mDOL7Nii4LcK2NJpLuHvUBKwrZ1pebbuCoGRw6IYsMHkCtA+fdZn71uSANA+iW +YJF1DngoABd15jmfZ5nc8OaKveri6E6FO80vFIOiZiaBECEHX5FaZNXzuvO+FB8TxxuBEOb+dY7 Ixjp6o7RTUaN8Tvkasq6+yO3m/qZASlaWFot4/nUbQ4mrcFuNLwy+AwF+mWj2zs3gyLp1txyM/1d 8iC9djwj2ij3+RvrWWTV3F9yfiD8zYm1kGdNYno/Tq0dwzn+evQoFt9B9kiABdcPUXmsEKvU7ANm 5mqwujGSQkBqvjrTcuFqN1W8rB2Vt2lh8kORdOag0wokRqEIr9baRRmW1FMdW4R58MD3R++Lj8UG rp1MYp3/RgT408m2ECVAdf4WqslKYIYvuu8wd+RU4riEmViAqhOLUTpPSPaLtrM= -----END CERTIFICATE----- Amazon Root CA 1 ================ -----BEGIN CERTIFICATE----- MIIDQTCCAimgAwIBAgITBmyfz5m/jAo54vB4ikPmljZbyjANBgkqhkiG9w0BAQsFADA5MQswCQYD VQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24gUm9vdCBDQSAxMB4XDTE1 MDUyNjAwMDAwMFoXDTM4MDExNzAwMDAwMFowOTELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpv bjEZMBcGA1UEAxMQQW1hem9uIFJvb3QgQ0EgMTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC ggEBALJ4gHHKeNXjca9HgFB0fW7Y14h29Jlo91ghYPl0hAEvrAIthtOgQ3pOsqTQNroBvo3bSMgH FzZM9O6II8c+6zf1tRn4SWiw3te5djgdYZ6k/oI2peVKVuRF4fn9tBb6dNqcmzU5L/qwIFAGbHrQ gLKm+a/sRxmPUDgH3KKHOVj4utWp+UhnMJbulHheb4mjUcAwhmahRWa6VOujw5H5SNz/0egwLX0t dHA114gk957EWW67c4cX8jJGKLhD+rcdqsq08p8kDi1L93FcXmn/6pUCyziKrlA4b9v7LWIbxcce VOF34GfID5yHI9Y/QCB/IIDEgEw+OyQmjgSubJrIqg0CAwEAAaNCMEAwDwYDVR0TAQH/BAUwAwEB /zAOBgNVHQ8BAf8EBAMCAYYwHQYDVR0OBBYEFIQYzIU07LwMlJQuCFmcx7IQTgoIMA0GCSqGSIb3 DQEBCwUAA4IBAQCY8jdaQZChGsV2USggNiMOruYou6r4lK5IpDB/G/wkjUu0yKGX9rbxenDIU5PM CCjjmCXPI6T53iHTfIUJrU6adTrCC2qJeHZERxhlbI1Bjjt/msv0tadQ1wUsN+gDS63pYaACbvXy 8MWy7Vu33PqUXHeeE6V/Uq2V8viTO96LXFvKWlJbYK8U90vvo/ufQJVtMVT8QtPHRh8jrdkPSHCa 2XV4cdFyQzR1bldZwgJcJmApzyMZFo6IQ6XU5MsI+yMRQ+hDKXJioaldXgjUkK642M4UwtBV8ob2 xJNDd2ZhwLnoQdeXeGADbkpyrqXRfboQnoZsG4q5WTP468SQvvG5 -----END CERTIFICATE----- Amazon Root CA 2 ================ -----BEGIN CERTIFICATE----- MIIFQTCCAymgAwIBAgITBmyf0pY1hp8KD+WGePhbJruKNzANBgkqhkiG9w0BAQwFADA5MQswCQYD VQQGEwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24gUm9vdCBDQSAyMB4XDTE1 MDUyNjAwMDAwMFoXDTQwMDUyNjAwMDAwMFowOTELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpv bjEZMBcGA1UEAxMQQW1hem9uIFJvb3QgQ0EgMjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoC ggIBAK2Wny2cSkxKgXlRmeyKy2tgURO8TW0G/LAIjd0ZEGrHJgw12MBvIITplLGbhQPDW9tK6Mj4 kHbZW0/jTOgGNk3Mmqw9DJArktQGGWCsN0R5hYGCrVo34A3MnaZMUnbqQ523BNFQ9lXg1dKmSYXp N+nKfq5clU1Imj+uIFptiJXZNLhSGkOQsL9sBbm2eLfq0OQ6PBJTYv9K8nu+NQWpEjTj82R0Yiw9 AElaKP4yRLuH3WUnAnE72kr3H9rN9yFVkE8P7K6C4Z9r2UXTu/Bfh+08LDmG2j/e7HJV63mjrdvd fLC6HM783k81ds8P+HgfajZRRidhW+mez/CiVX18JYpvL7TFz4QuK/0NURBs+18bvBt+xa47mAEx kv8LV/SasrlX6avvDXbR8O70zoan4G7ptGmh32n2M8ZpLpcTnqWHsFcQgTfJU7O7f/aS0ZzQGPSS btqDT6ZjmUyl+17vIWR6IF9sZIUVyzfpYgwLKhbcAS4y2j5L9Z469hdAlO+ekQiG+r5jqFoz7Mt0 Q5X5bGlSNscpb/xVA1wf+5+9R+vnSUeVC06JIglJ4PVhHvG/LopyboBZ/1c6+XUyo05f7O0oYtlN c/LMgRdg7c3r3NunysV+Ar3yVAhU/bQtCSwXVEqY0VThUWcI0u1ufm8/0i2BWSlmy5A5lREedCf+ 3euvAgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBSw DPBMMPQFWAJI/TPlUq9LhONmUjANBgkqhkiG9w0BAQwFAAOCAgEAqqiAjw54o+Ci1M3m9Zh6O+oA A7CXDpO8Wqj2LIxyh6mx/H9z/WNxeKWHWc8w4Q0QshNabYL1auaAn6AFC2jkR2vHat+2/XcycuUY +gn0oJMsXdKMdYV2ZZAMA3m3MSNjrXiDCYZohMr/+c8mmpJ5581LxedhpxfL86kSk5Nrp+gvU5LE YFiwzAJRGFuFjWJZY7attN6a+yb3ACfAXVU3dJnJUH/jWS5E4ywl7uxMMne0nxrpS10gxdr9HIcW xkPo1LsmmkVwXqkLN1PiRnsn/eBG8om3zEK2yygmbtmlyTrIQRNg91CMFa6ybRoVGld45pIq2WWQ gj9sAq+uEjonljYE1x2igGOpm/HlurR8FLBOybEfdF849lHqm/osohHUqS0nGkWxr7JOcQ3AWEbW aQbLU8uz/mtBzUF+fUwPfHJ5elnNXkoOrJupmHN5fLT0zLm4BwyydFy4x2+IoZCn9Kr5v2c69BoV Yh63n749sSmvZ6ES8lgQGVMDMBu4Gon2nL2XA46jCfMdiyHxtN/kHNGfZQIG6lzWE7OE76KlXIx3 KadowGuuQNKotOrN8I1LOJwZmhsoVLiJkO/KdYE+HvJkJMcYr07/R54H9jVlpNMKVv/1F2Rs76gi JUmTtt8AF9pYfl3uxRuw0dFfIRDH+fO6AgonB8Xx1sfT4PsJYGw= -----END CERTIFICATE----- Amazon Root CA 3 ================ -----BEGIN CERTIFICATE----- MIIBtjCCAVugAwIBAgITBmyf1XSXNmY/Owua2eiedgPySjAKBggqhkjOPQQDAjA5MQswCQYDVQQG EwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24gUm9vdCBDQSAzMB4XDTE1MDUy NjAwMDAwMFoXDTQwMDUyNjAwMDAwMFowOTELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZ MBcGA1UEAxMQQW1hem9uIFJvb3QgQ0EgMzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABCmXp8ZB f8ANm+gBG1bG8lKlui2yEujSLtf6ycXYqm0fc4E7O5hrOXwzpcVOho6AF2hiRVd9RFgdszflZwjr Zt6jQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMB0GA1UdDgQWBBSrttvXBp43 rDCGB5Fwx5zEGbF4wDAKBggqhkjOPQQDAgNJADBGAiEA4IWSoxe3jfkrBqWTrBqYaGFy+uGh0Psc eGCmQ5nFuMQCIQCcAu/xlJyzlvnrxir4tiz+OpAUFteMYyRIHN8wfdVoOw== -----END CERTIFICATE----- Amazon Root CA 4 ================ -----BEGIN CERTIFICATE----- MIIB8jCCAXigAwIBAgITBmyf18G7EEwpQ+Vxe3ssyBrBDjAKBggqhkjOPQQDAzA5MQswCQYDVQQG EwJVUzEPMA0GA1UEChMGQW1hem9uMRkwFwYDVQQDExBBbWF6b24gUm9vdCBDQSA0MB4XDTE1MDUy NjAwMDAwMFoXDTQwMDUyNjAwMDAwMFowOTELMAkGA1UEBhMCVVMxDzANBgNVBAoTBkFtYXpvbjEZ MBcGA1UEAxMQQW1hem9uIFJvb3QgQ0EgNDB2MBAGByqGSM49AgEGBSuBBAAiA2IABNKrijdPo1MN /sGKe0uoe0ZLY7Bi9i0b2whxIdIA6GO9mif78DluXeo9pcmBqqNbIJhFXRbb/egQbeOc4OO9X4Ri 83BkM6DLJC9wuoihKqB1+IGuYgbEgds5bimwHvouXKNCMEAwDwYDVR0TAQH/BAUwAwEB/zAOBgNV HQ8BAf8EBAMCAYYwHQYDVR0OBBYEFNPsxzplbszh2naaVvuc84ZtV+WBMAoGCCqGSM49BAMDA2gA MGUCMDqLIfG9fhGt0O9Yli/W651+kI0rz2ZVwyzjKKlwCkcO8DdZEv8tmZQoTipPNU0zWgIxAOp1 AE47xDqUEpHJWEadIRNyp4iciuRMStuW1KyLa2tJElMzrdfkviT8tQp21KW8EA== -----END CERTIFICATE----- TUBITAK Kamu SM SSL Kok Sertifikasi - Surum 1 ============================================= -----BEGIN CERTIFICATE----- MIIEYzCCA0ugAwIBAgIBATANBgkqhkiG9w0BAQsFADCB0jELMAkGA1UEBhMCVFIxGDAWBgNVBAcT D0dlYnplIC0gS29jYWVsaTFCMEAGA1UEChM5VHVya2l5ZSBCaWxpbXNlbCB2ZSBUZWtub2xvamlr IEFyYXN0aXJtYSBLdXJ1bXUgLSBUVUJJVEFLMS0wKwYDVQQLEyRLYW11IFNlcnRpZmlrYXN5b24g TWVya2V6aSAtIEthbXUgU00xNjA0BgNVBAMTLVRVQklUQUsgS2FtdSBTTSBTU0wgS29rIFNlcnRp ZmlrYXNpIC0gU3VydW0gMTAeFw0xMzExMjUwODI1NTVaFw00MzEwMjUwODI1NTVaMIHSMQswCQYD VQQGEwJUUjEYMBYGA1UEBxMPR2ViemUgLSBLb2NhZWxpMUIwQAYDVQQKEzlUdXJraXllIEJpbGlt c2VsIHZlIFRla25vbG9qaWsgQXJhc3Rpcm1hIEt1cnVtdSAtIFRVQklUQUsxLTArBgNVBAsTJEth bXUgU2VydGlmaWthc3lvbiBNZXJrZXppIC0gS2FtdSBTTTE2MDQGA1UEAxMtVFVCSVRBSyBLYW11 IFNNIFNTTCBLb2sgU2VydGlmaWthc2kgLSBTdXJ1bSAxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A MIIBCgKCAQEAr3UwM6q7a9OZLBI3hNmNe5eA027n/5tQlT6QlVZC1xl8JoSNkvoBHToP4mQ4t4y8 6Ij5iySrLqP1N+RAjhgleYN1Hzv/bKjFxlb4tO2KRKOrbEz8HdDc72i9z+SqzvBV96I01INrN3wc wv61A+xXzry0tcXtAA9TNypN9E8Mg/uGz8v+jE69h/mniyFXnHrfA2eJLJ2XYacQuFWQfw4tJzh0 3+f92k4S400VIgLI4OD8D62K18lUUMw7D8oWgITQUVbDjlZ/iSIzL+aFCr2lqBs23tPcLG07xxO9 WSMs5uWk99gL7eqQQESolbuT1dCANLZGeA4fAJNG4e7p+exPFwIDAQABo0IwQDAdBgNVHQ4EFgQU ZT/HiobGPN08VFw1+DrtUgxHV8gwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJ KoZIhvcNAQELBQADggEBACo/4fEyjq7hmFxLXs9rHmoJ0iKpEsdeV31zVmSAhHqT5Am5EM2fKifh AHe+SMg1qIGf5LgsyX8OsNJLN13qudULXjS99HMpw+0mFZx+CFOKWI3QSyjfwbPfIPP54+M638yc lNhOT8NrF7f3cuitZjO1JVOr4PhMqZ398g26rrnZqsZr+ZO7rqu4lzwDGrpDxpa5RXI4s6ehlj2R e37AIVNMh+3yC1SVUZPVIqUNivGTDj5UDrDYyU7c8jEyVupk+eq1nRZmQnLzf9OxMUP8pI4X8W0j q5Rm+K37DwhuJi1/FwcJsoz7UMCflo3Ptv0AnVoUmr8CRPXBwp8iXqIPoeM= -----END CERTIFICATE----- GDCA TrustAUTH R5 ROOT ====================== -----BEGIN CERTIFICATE----- MIIFiDCCA3CgAwIBAgIIfQmX/vBH6nowDQYJKoZIhvcNAQELBQAwYjELMAkGA1UEBhMCQ04xMjAw BgNVBAoMKUdVQU5HIERPTkcgQ0VSVElGSUNBVEUgQVVUSE9SSVRZIENPLixMVEQuMR8wHQYDVQQD DBZHRENBIFRydXN0QVVUSCBSNSBST09UMB4XDTE0MTEyNjA1MTMxNVoXDTQwMTIzMTE1NTk1OVow YjELMAkGA1UEBhMCQ04xMjAwBgNVBAoMKUdVQU5HIERPTkcgQ0VSVElGSUNBVEUgQVVUSE9SSVRZ IENPLixMVEQuMR8wHQYDVQQDDBZHRENBIFRydXN0QVVUSCBSNSBST09UMIICIjANBgkqhkiG9w0B AQEFAAOCAg8AMIICCgKCAgEA2aMW8Mh0dHeb7zMNOwZ+Vfy1YI92hhJCfVZmPoiC7XJjDp6L3TQs AlFRwxn9WVSEyfFrs0yw6ehGXTjGoqcuEVe6ghWinI9tsJlKCvLriXBjTnnEt1u9ol2x8kECK62p OqPseQrsXzrj/e+APK00mxqriCZ7VqKChh/rNYmDf1+uKU49tm7srsHwJ5uu4/Ts765/94Y9cnrr pftZTqfrlYwiOXnhLQiPzLyRuEH3FMEjqcOtmkVEs7LXLM3GKeJQEK5cy4KOFxg2fZfmiJqwTTQJ 9Cy5WmYqsBebnh52nUpmMUHfP/vFBu8btn4aRjb3ZGM74zkYI+dndRTVdVeSN72+ahsmUPI2JgaQ xXABZG12ZuGR224HwGGALrIuL4xwp9E7PLOR5G62xDtw8mySlwnNR30YwPO7ng/Wi64HtloPzgsM R6flPri9fcebNaBhlzpBdRfMK5Z3KpIhHtmVdiBnaM8Nvd/WHwlqmuLMc3GkL30SgLdTMEZeS1SZ D2fJpcjyIMGC7J0R38IC+xo70e0gmu9lZJIQDSri3nDxGGeCjGHeuLzRL5z7D9Ar7Rt2ueQ5Vfj4 oR24qoAATILnsn8JuLwwoC8N9VKejveSswoAHQBUlwbgsQfZxw9cZX08bVlX5O2ljelAU58VS6Bx 9hoh49pwBiFYFIeFd3mqgnkCAwEAAaNCMEAwHQYDVR0OBBYEFOLJQJ9NzuiaoXzPDj9lxSmIahlR MA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEBCwUAA4ICAQDRSVfg p8xoWLoBDysZzY2wYUWsEe1jUGn4H3++Fo/9nesLqjJHdtJnJO29fDMylyrHBYZmDRd9FBUb1Ov9 H5r2XpdptxolpAqzkT9fNqyL7FeoPueBihhXOYV0GkLH6VsTX4/5COmSdI31R9KrO9b7eGZONn35 6ZLpBN79SWP8bfsUcZNnL0dKt7n/HipzcEYwv1ryL3ml4Y0M2fmyYzeMN2WFcGpcWwlyua1jPLHd +PwyvzeG5LuOmCd+uh8W4XAR8gPfJWIyJyYYMoSf/wA6E7qaTfRPuBRwIrHKK5DOKcFw9C+df/KQ HtZa37dG/OaG+svgIHZ6uqbL9XzeYqWxi+7egmaKTjowHz+Ay60nugxe19CxVsp3cbK1daFQqUBD F8Io2c9Si1vIY9RCPqAzekYu9wogRlR+ak8x8YF+QnQ4ZXMn7sZ8uI7XpTrXmKGcjBBV09tL7ECQ 8s1uV9JiDnxXk7Gnbc2dg7sq5+W2O3FYrf3RRbxake5TFW/TRQl1brqQXR4EzzffHqhmsYzmIGrv /EhOdJhCrylvLmrH+33RZjEizIYAfmaDDEL0vTSSwxrqT8p+ck0LcIymSLumoRT2+1hEmRSuqguT aaApJUqlyyvdimYHFngVV3Eb7PVHhPOeMTd61X8kreS8/f3MboPoDKi3QWwH3b08hpcv0g== -----END CERTIFICATE----- TrustCor RootCert CA-1 ====================== -----BEGIN CERTIFICATE----- MIIEMDCCAxigAwIBAgIJANqb7HHzA7AZMA0GCSqGSIb3DQEBCwUAMIGkMQswCQYDVQQGEwJQQTEP MA0GA1UECAwGUGFuYW1hMRQwEgYDVQQHDAtQYW5hbWEgQ2l0eTEkMCIGA1UECgwbVHJ1c3RDb3Ig U3lzdGVtcyBTLiBkZSBSLkwuMScwJQYDVQQLDB5UcnVzdENvciBDZXJ0aWZpY2F0ZSBBdXRob3Jp dHkxHzAdBgNVBAMMFlRydXN0Q29yIFJvb3RDZXJ0IENBLTEwHhcNMTYwMjA0MTIzMjE2WhcNMjkx MjMxMTcyMzE2WjCBpDELMAkGA1UEBhMCUEExDzANBgNVBAgMBlBhbmFtYTEUMBIGA1UEBwwLUGFu YW1hIENpdHkxJDAiBgNVBAoMG1RydXN0Q29yIFN5c3RlbXMgUy4gZGUgUi5MLjEnMCUGA1UECwwe VHJ1c3RDb3IgQ2VydGlmaWNhdGUgQXV0aG9yaXR5MR8wHQYDVQQDDBZUcnVzdENvciBSb290Q2Vy dCBDQS0xMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAv463leLCJhJrMxnHQFgKq1mq jQCj/IDHUHuO1CAmujIS2CNUSSUQIpidRtLByZ5OGy4sDjjzGiVoHKZaBeYei0i/mJZ0PmnK6bV4 pQa81QBeCQryJ3pS/C3Vseq0iWEk8xoT26nPUu0MJLq5nux+AHT6k61sKZKuUbS701e/s/OojZz0 JEsq1pme9J7+wH5COucLlVPat2gOkEz7cD+PSiyU8ybdY2mplNgQTsVHCJCZGxdNuWxu72CVEY4h gLW9oHPY0LJ3xEXqWib7ZnZ2+AYfYW0PVcWDtxBWcgYHpfOxGgMFZA6dWorWhnAbJN7+KIor0Gqw /Hqi3LJ5DotlDwIDAQABo2MwYTAdBgNVHQ4EFgQU7mtJPHo/DeOxCbeKyKsZn3MzUOcwHwYDVR0j BBgwFoAU7mtJPHo/DeOxCbeKyKsZn3MzUOcwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMC AYYwDQYJKoZIhvcNAQELBQADggEBACUY1JGPE+6PHh0RU9otRCkZoB5rMZ5NDp6tPVxBb5UrJKF5 mDo4Nvu7Zp5I/5CQ7z3UuJu0h3U/IJvOcs+hVcFNZKIZBqEHMwwLKeXx6quj7LUKdJDHfXLy11yf ke+Ri7fc7Waiz45mO7yfOgLgJ90WmMCV1Aqk5IGadZQ1nJBfiDcGrVmVCrDRZ9MZyonnMlo2HD6C qFqTvsbQZJG2z9m2GM/bftJlo6bEjhcxwft+dtvTheNYsnd6djtsL1Ac59v2Z3kf9YKVmgenFK+P 3CghZwnS1k1aHBkcjndcw5QkPTJrS37UeJSDvjdNzl/HHk484IkzlQsPpTLWPFp5LBk= -----END CERTIFICATE----- TrustCor RootCert CA-2 ====================== -----BEGIN CERTIFICATE----- MIIGLzCCBBegAwIBAgIIJaHfyjPLWQIwDQYJKoZIhvcNAQELBQAwgaQxCzAJBgNVBAYTAlBBMQ8w DQYDVQQIDAZQYW5hbWExFDASBgNVBAcMC1BhbmFtYSBDaXR5MSQwIgYDVQQKDBtUcnVzdENvciBT eXN0ZW1zIFMuIGRlIFIuTC4xJzAlBgNVBAsMHlRydXN0Q29yIENlcnRpZmljYXRlIEF1dGhvcml0 eTEfMB0GA1UEAwwWVHJ1c3RDb3IgUm9vdENlcnQgQ0EtMjAeFw0xNjAyMDQxMjMyMjNaFw0zNDEy MzExNzI2MzlaMIGkMQswCQYDVQQGEwJQQTEPMA0GA1UECAwGUGFuYW1hMRQwEgYDVQQHDAtQYW5h bWEgQ2l0eTEkMCIGA1UECgwbVHJ1c3RDb3IgU3lzdGVtcyBTLiBkZSBSLkwuMScwJQYDVQQLDB5U cnVzdENvciBDZXJ0aWZpY2F0ZSBBdXRob3JpdHkxHzAdBgNVBAMMFlRydXN0Q29yIFJvb3RDZXJ0 IENBLTIwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCnIG7CKqJiJJWQdsg4foDSq8Gb ZQWU9MEKENUCrO2fk8eHyLAnK0IMPQo+QVqedd2NyuCb7GgypGmSaIwLgQ5WoD4a3SwlFIIvl9Nk RvRUqdw6VC0xK5mC8tkq1+9xALgxpL56JAfDQiDyitSSBBtlVkxs1Pu2YVpHI7TYabS3OtB0PAx1 oYxOdqHp2yqlO/rOsP9+aij9JxzIsekp8VduZLTQwRVtDr4uDkbIXvRR/u8OYzo7cbrPb1nKDOOb XUm4TOJXsZiKQlecdu/vvdFoqNL0Cbt3Nb4lggjEFixEIFapRBF37120Hapeaz6LMvYHL1cEksr1 /p3C6eizjkxLAjHZ5DxIgif3GIJ2SDpxsROhOdUuxTTCHWKF3wP+TfSvPd9cW436cOGlfifHhi5q jxLGhF5DUVCcGZt45vz27Ud+ez1m7xMTiF88oWP7+ayHNZ/zgp6kPwqcMWmLmaSISo5uZk3vFsQP eSghYA2FFn3XVDjxklb9tTNMg9zXEJ9L/cb4Qr26fHMC4P99zVvh1Kxhe1fVSntb1IVYJ12/+Ctg rKAmrhQhJ8Z3mjOAPF5GP/fDsaOGM8boXg25NSyqRsGFAnWAoOsk+xWq5Gd/bnc/9ASKL3x74xdh 8N0JqSDIvgmk0H5Ew7IwSjiqqewYmgeCK9u4nBit2uBGF6zPXQIDAQABo2MwYTAdBgNVHQ4EFgQU 2f4hQG6UnrybPZx9mCAZ5YwwYrIwHwYDVR0jBBgwFoAU2f4hQG6UnrybPZx9mCAZ5YwwYrIwDwYD VR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAYYwDQYJKoZIhvcNAQELBQADggIBAJ5Fngw7tu/h Osh80QA9z+LqBrWyOrsGS2h60COXdKcs8AjYeVrXWoSK2BKaG9l9XE1wxaX5q+WjiYndAfrs3fnp kpfbsEZC89NiqpX+MWcUaViQCqoL7jcjx1BRtPV+nuN79+TMQjItSQzL/0kMmx40/W5ulop5A7Zv 2wnL/V9lFDfhOPXzYRZY5LVtDQsEGz9QLX+zx3oaFoBg+Iof6Rsqxvm6ARppv9JYx1RXCI/hOWB3 S6xZhBqI8d3LT3jX5+EzLfzuQfogsL7L9ziUwOHQhQ+77Sxzq+3+knYaZH9bDTMJBzN7Bj8RpFxw PIXAz+OQqIN3+tvmxYxoZxBnpVIt8MSZj3+/0WvitUfW2dCFmU2Umw9Lje4AWkcdEQOsQRivh7dv DDqPys/cA8GiCcjl/YBeyGBCARsaU1q7N6a3vLqE6R5sGtRk2tRD/pOLS/IseRYQ1JMLiI+h2IYU RpFHmygk71dSTlxCnKr3Sewn6EAes6aJInKc9Q0ztFijMDvd1GpUk74aTfOTlPf8hAs/hCBcNANE xdqtvArBAs8e5ZTZ845b2EzwnexhF7sUMlQMAimTHpKG9n/v55IFDlndmQguLvqcAFLTxWYp5KeX RKQOKIETNcX2b2TmQcTVL8w0RSXPQQCWPUouwpaYT05KnJe32x+SMsj/D1Fu1uwJ -----END CERTIFICATE----- TrustCor ECA-1 ============== -----BEGIN CERTIFICATE----- MIIEIDCCAwigAwIBAgIJAISCLF8cYtBAMA0GCSqGSIb3DQEBCwUAMIGcMQswCQYDVQQGEwJQQTEP MA0GA1UECAwGUGFuYW1hMRQwEgYDVQQHDAtQYW5hbWEgQ2l0eTEkMCIGA1UECgwbVHJ1c3RDb3Ig U3lzdGVtcyBTLiBkZSBSLkwuMScwJQYDVQQLDB5UcnVzdENvciBDZXJ0aWZpY2F0ZSBBdXRob3Jp dHkxFzAVBgNVBAMMDlRydXN0Q29yIEVDQS0xMB4XDTE2MDIwNDEyMzIzM1oXDTI5MTIzMTE3Mjgw N1owgZwxCzAJBgNVBAYTAlBBMQ8wDQYDVQQIDAZQYW5hbWExFDASBgNVBAcMC1BhbmFtYSBDaXR5 MSQwIgYDVQQKDBtUcnVzdENvciBTeXN0ZW1zIFMuIGRlIFIuTC4xJzAlBgNVBAsMHlRydXN0Q29y IENlcnRpZmljYXRlIEF1dGhvcml0eTEXMBUGA1UEAwwOVHJ1c3RDb3IgRUNBLTEwggEiMA0GCSqG SIb3DQEBAQUAA4IBDwAwggEKAoIBAQDPj+ARtZ+odnbb3w9U73NjKYKtR8aja+3+XzP4Q1HpGjOR MRegdMTUpwHmspI+ap3tDvl0mEDTPwOABoJA6LHip1GnHYMma6ve+heRK9jGrB6xnhkB1Zem6g23 xFUfJ3zSCNV2HykVh0A53ThFEXXQmqc04L/NyFIduUd+Dbi7xgz2c1cWWn5DkR9VOsZtRASqnKmc p0yJF4OuowReUoCLHhIlERnXDH19MURB6tuvsBzvgdAsxZohmz3tQjtQJvLsznFhBmIhVE5/wZ0+ fyCMgMsq2JdiyIMzkX2woloPV+g7zPIlstR8L+xNxqE6FXrntl019fZISjZFZtS6mFjBAgMBAAGj YzBhMB0GA1UdDgQWBBREnkj1zG1I1KBLf/5ZJC+Dl5mahjAfBgNVHSMEGDAWgBREnkj1zG1I1KBL f/5ZJC+Dl5mahjAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBhjANBgkqhkiG9w0BAQsF AAOCAQEABT41XBVwm8nHc2FvcivUwo/yQ10CzsSUuZQRg2dd4mdsdXa/uwyqNsatR5Nj3B5+1t4u /ukZMjgDfxT2AHMsWbEhBuH7rBiVDKP/mZb3Kyeb1STMHd3BOuCYRLDE5D53sXOpZCz2HAF8P11F hcCF5yWPldwX8zyfGm6wyuMdKulMY/okYWLW2n62HGz1Ah3UKt1VkOsqEUc8Ll50soIipX1TH0Xs J5F95yIW6MBoNtjG8U+ARDL54dHRHareqKucBK+tIA5kmE2la8BIWJZpTdwHjFGTot+fDz2LYLSC jaoITmJF4PkL0uDgPFveXHEnJcLmA4GLEFPjx1WitJ/X5g== -----END CERTIFICATE----- SSL.com Root Certification Authority RSA ======================================== -----BEGIN CERTIFICATE----- MIIF3TCCA8WgAwIBAgIIeyyb0xaAMpkwDQYJKoZIhvcNAQELBQAwfDELMAkGA1UEBhMCVVMxDjAM BgNVBAgMBVRleGFzMRAwDgYDVQQHDAdIb3VzdG9uMRgwFgYDVQQKDA9TU0wgQ29ycG9yYXRpb24x MTAvBgNVBAMMKFNTTC5jb20gUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSBSU0EwHhcNMTYw MjEyMTczOTM5WhcNNDEwMjEyMTczOTM5WjB8MQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMx EDAOBgNVBAcMB0hvdXN0b24xGDAWBgNVBAoMD1NTTCBDb3Jwb3JhdGlvbjExMC8GA1UEAwwoU1NM LmNvbSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IFJTQTCCAiIwDQYJKoZIhvcNAQEBBQAD ggIPADCCAgoCggIBAPkP3aMrfcvQKv7sZ4Wm5y4bunfh4/WvpOz6Sl2RxFdHaxh3a3by/ZPkPQ/C Fp4LZsNWlJ4Xg4XOVu/yFv0AYvUiCVToZRdOQbngT0aXqhvIuG5iXmmxX9sqAn78bMrzQdjt0Oj8 P2FI7bADFB0QDksZ4LtO7IZl/zbzXmcCC52GVWH9ejjt/uIZALdvoVBidXQ8oPrIJZK0bnoix/ge oeOy3ZExqysdBP+lSgQ36YWkMyv94tZVNHwZpEpox7Ko07fKoZOI68GXvIz5HdkihCR0xwQ9aqkp k8zruFvh/l8lqjRYyMEjVJ0bmBHDOJx+PYZspQ9AhnwC9FwCTyjLrnGfDzrIM/4RJTXq/LrFYD3Z fBjVsqnTdXgDciLKOsMf7yzlLqn6niy2UUb9rwPW6mBo6oUWNmuF6R7As93EJNyAKoFBbZQ+yODJ gUEAnl6/f8UImKIYLEJAs/lvOCdLToD0PYFH4Ih86hzOtXVcUS4cK38acijnALXRdMbX5J+tB5O2 UzU1/Dfkw/ZdFr4hc96SCvigY2q8lpJqPvi8ZVWb3vUNiSYE/CUapiVpy8JtynziWV+XrOvvLsi8 1xtZPCvM8hnIk2snYxnP/Okm+Mpxm3+T/jRnhE6Z6/yzeAkzcLpmpnbtG3PrGqUNxCITIJRWCk4s bE6x/c+cCbqiM+2HAgMBAAGjYzBhMB0GA1UdDgQWBBTdBAkHovV6fVJTEpKV7jiAJQ2mWTAPBgNV HRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFN0ECQei9Xp9UlMSkpXuOIAlDaZZMA4GA1UdDwEB/wQE AwIBhjANBgkqhkiG9w0BAQsFAAOCAgEAIBgRlCn7Jp0cHh5wYfGVcpNxJK1ok1iOMq8bs3AD/CUr dIWQPXhq9LmLpZc7tRiRux6n+UBbkflVma8eEdBcHadm47GUBwwyOabqG7B52B2ccETjit3E+ZUf ijhDPwGFpUenPUayvOUiaPd7nNgsPgohyC0zrL/FgZkxdMF1ccW+sfAjRfSda/wZY52jvATGGAsl u1OJD7OAUN5F7kR/q5R4ZJjT9ijdh9hwZXT7DrkT66cPYakylszeu+1jTBi7qUD3oFRuIIhxdRjq erQ0cuAjJ3dctpDqhiVAq+8zD8ufgr6iIPv2tS0a5sKFsXQP+8hlAqRSAUfdSSLBv9jra6x+3uxj MxW3IwiPxg+NQVrdjsW5j+VFP3jbutIbQLH+cU0/4IGiul607BXgk90IH37hVZkLId6Tngr75qNJ vTYw/ud3sqB1l7UtgYgXZSD32pAAn8lSzDLKNXz1PQ/YK9f1JmzJBjSWFupwWRoyeXkLtoh/D1JI Pb9s2KJELtFOt3JY04kTlf5Eq/jXixtunLwsoFvVagCvXzfh1foQC5ichucmj87w7G6KVwuA406y wKBjYZC6VWg3dGq2ktufoYYitmUnDuy2n0Jg5GfCtdpBC8TTi2EbvPofkSvXRAdeuims2cXp71NI WuuA8ShYIc2wBlX7Jz9TkHCpBB5XJ7k= -----END CERTIFICATE----- SSL.com Root Certification Authority ECC ======================================== -----BEGIN CERTIFICATE----- MIICjTCCAhSgAwIBAgIIdebfy8FoW6gwCgYIKoZIzj0EAwIwfDELMAkGA1UEBhMCVVMxDjAMBgNV BAgMBVRleGFzMRAwDgYDVQQHDAdIb3VzdG9uMRgwFgYDVQQKDA9TU0wgQ29ycG9yYXRpb24xMTAv BgNVBAMMKFNTTC5jb20gUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSBFQ0MwHhcNMTYwMjEy MTgxNDAzWhcNNDEwMjEyMTgxNDAzWjB8MQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMxEDAO BgNVBAcMB0hvdXN0b24xGDAWBgNVBAoMD1NTTCBDb3Jwb3JhdGlvbjExMC8GA1UEAwwoU1NMLmNv bSBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IEVDQzB2MBAGByqGSM49AgEGBSuBBAAiA2IA BEVuqVDEpiM2nl8ojRfLliJkP9x6jh3MCLOicSS6jkm5BBtHllirLZXI7Z4INcgn64mMU1jrYor+ 8FsPazFSY0E7ic3s7LaNGdM0B9y7xgZ/wkWV7Mt/qCPgCemB+vNH06NjMGEwHQYDVR0OBBYEFILR hXMw5zUE044CkvvlpNHEIejNMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUgtGFczDnNQTT jgKS++Wk0cQh6M0wDgYDVR0PAQH/BAQDAgGGMAoGCCqGSM49BAMCA2cAMGQCMG/n61kRpGDPYbCW e+0F+S8Tkdzt5fxQaxFGRrMcIQBiu77D5+jNB5n5DQtdcj7EqgIwH7y6C+IwJPt8bYBVCpk+gA0z 5Wajs6O7pdWLjwkspl1+4vAHCGht0nxpbl/f5Wpl -----END CERTIFICATE----- SSL.com EV Root Certification Authority RSA R2 ============================================== -----BEGIN CERTIFICATE----- MIIF6zCCA9OgAwIBAgIIVrYpzTS8ePYwDQYJKoZIhvcNAQELBQAwgYIxCzAJBgNVBAYTAlVTMQ4w DAYDVQQIDAVUZXhhczEQMA4GA1UEBwwHSG91c3RvbjEYMBYGA1UECgwPU1NMIENvcnBvcmF0aW9u MTcwNQYDVQQDDC5TU0wuY29tIEVWIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgUlNBIFIy MB4XDTE3MDUzMTE4MTQzN1oXDTQyMDUzMDE4MTQzN1owgYIxCzAJBgNVBAYTAlVTMQ4wDAYDVQQI DAVUZXhhczEQMA4GA1UEBwwHSG91c3RvbjEYMBYGA1UECgwPU1NMIENvcnBvcmF0aW9uMTcwNQYD VQQDDC5TU0wuY29tIEVWIFJvb3QgQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkgUlNBIFIyMIICIjAN BgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAjzZlQOHWTcDXtOlG2mvqM0fNTPl9fb69LT3w23jh hqXZuglXaO1XPqDQCEGD5yhBJB/jchXQARr7XnAjssufOePPxU7Gkm0mxnu7s9onnQqG6YE3Bf7w cXHswxzpY6IXFJ3vG2fThVUCAtZJycxa4bH3bzKfydQ7iEGonL3Lq9ttewkfokxykNorCPzPPFTO Zw+oz12WGQvE43LrrdF9HSfvkusQv1vrO6/PgN3B0pYEW3p+pKk8OHakYo6gOV7qd89dAFmPZiw+ B6KjBSYRaZfqhbcPlgtLyEDhULouisv3D5oi53+aNxPN8k0TayHRwMwi8qFG9kRpnMphNQcAb9Zh CBHqurj26bNg5U257J8UZslXWNvNh2n4ioYSA0e/ZhN2rHd9NCSFg83XqpyQGp8hLH94t2S42Oim 9HizVcuE0jLEeK6jj2HdzghTreyI/BXkmg3mnxp3zkyPuBQVPWKchjgGAGYS5Fl2WlPAApiiECto RHuOec4zSnaqW4EWG7WK2NAAe15itAnWhmMOpgWVSbooi4iTsjQc2KRVbrcc0N6ZVTsj9CLg+Slm JuwgUHfbSguPvuUCYHBBXtSuUDkiFCbLsjtzdFVHB3mBOagwE0TlBIqulhMlQg+5U8Sb/M3kHN48 +qvWBkofZ6aYMBzdLNvcGJVXZsb/XItW9XcCAwEAAaNjMGEwDwYDVR0TAQH/BAUwAwEB/zAfBgNV HSMEGDAWgBT5YLvU49U09rj1BoAlp3PbRmmonjAdBgNVHQ4EFgQU+WC71OPVNPa49QaAJadz20Zp qJ4wDgYDVR0PAQH/BAQDAgGGMA0GCSqGSIb3DQEBCwUAA4ICAQBWs47LCp1Jjr+kxJG7ZhcFUZh1 ++VQLHqe8RT6q9OKPv+RKY9ji9i0qVQBDb6Thi/5Sm3HXvVX+cpVHBK+Rw82xd9qt9t1wkclf7nx Y/hoLVUE0fKNsKTPvDxeH3jnpaAgcLAExbf3cqfeIg29MyVGjGSSJuM+LmOW2puMPfgYCdcDzH2G guDKBAdRUNf/ktUM79qGn5nX67evaOI5JpS6aLe/g9Pqemc9YmeuJeVy6OLk7K4S9ksrPJ/psEDz OFSz/bdoyNrGj1E8svuR3Bznm53htw1yj+KkxKl4+esUrMZDBcJlOSgYAsOCsp0FvmXtll9ldDz7 CTUue5wT/RsPXcdtgTpWD8w74a8CLyKsRspGPKAcTNZEtF4uXBVmCeEmKf7GUmG6sXP/wwyc5Wxq lD8UykAWlYTzWamsX0xhk23RO8yilQwipmdnRC652dKKQbNmC1r7fSOl8hqw/96bg5Qu0T/fkreR rwU7ZcegbLHNYhLDkBvjJc40vG93drEQw/cFGsDWr3RiSBd3kmmQYRzelYB0VI8YHMPzA9C/pEN1 hlMYegouCRw2n5H9gooiS9EOUCXdywMMF8mDAAhONU2Ki+3wApRmLER/y5UnlhetCTCstnEXbosX 9hwJ1C07mKVx01QT2WDz9UtmT/rx7iASjbSsV7FFY6GsdqnC+w== -----END CERTIFICATE----- SSL.com EV Root Certification Authority ECC =========================================== -----BEGIN CERTIFICATE----- MIIClDCCAhqgAwIBAgIILCmcWxbtBZUwCgYIKoZIzj0EAwIwfzELMAkGA1UEBhMCVVMxDjAMBgNV BAgMBVRleGFzMRAwDgYDVQQHDAdIb3VzdG9uMRgwFgYDVQQKDA9TU0wgQ29ycG9yYXRpb24xNDAy BgNVBAMMK1NTTC5jb20gRVYgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eSBFQ0MwHhcNMTYw MjEyMTgxNTIzWhcNNDEwMjEyMTgxNTIzWjB/MQswCQYDVQQGEwJVUzEOMAwGA1UECAwFVGV4YXMx EDAOBgNVBAcMB0hvdXN0b24xGDAWBgNVBAoMD1NTTCBDb3Jwb3JhdGlvbjE0MDIGA1UEAwwrU1NM LmNvbSBFViBSb290IENlcnRpZmljYXRpb24gQXV0aG9yaXR5IEVDQzB2MBAGByqGSM49AgEGBSuB BAAiA2IABKoSR5CYG/vvw0AHgyBO8TCCogbR8pKGYfL2IWjKAMTH6kMAVIbc/R/fALhBYlzccBYy 3h+Z1MzFB8gIH2EWB1E9fVwHU+M1OIzfzZ/ZLg1KthkuWnBaBu2+8KGwytAJKaNjMGEwHQYDVR0O BBYEFFvKXuXe0oGqzagtZFG22XKbl+ZPMA8GA1UdEwEB/wQFMAMBAf8wHwYDVR0jBBgwFoAUW8pe 5d7SgarNqC1kUbbZcpuX5k8wDgYDVR0PAQH/BAQDAgGGMAoGCCqGSM49BAMCA2gAMGUCMQCK5kCJ N+vp1RPZytRrJPOwPYdGWBrssd9v+1a6cGvHOMzosYxPD/fxZ3YOg9AeUY8CMD32IygmTMZgh5Mm m7I1HrrW9zzRHM76JTymGoEVW/MSD2zuZYrJh6j5B+BimoxcSg== -----END CERTIFICATE----- GlobalSign Root CA - R6 ======================= -----BEGIN CERTIFICATE----- MIIFgzCCA2ugAwIBAgIORea7A4Mzw4VlSOb/RVEwDQYJKoZIhvcNAQEMBQAwTDEgMB4GA1UECxMX R2xvYmFsU2lnbiBSb290IENBIC0gUjYxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkds b2JhbFNpZ24wHhcNMTQxMjEwMDAwMDAwWhcNMzQxMjEwMDAwMDAwWjBMMSAwHgYDVQQLExdHbG9i YWxTaWduIFJvb3QgQ0EgLSBSNjETMBEGA1UEChMKR2xvYmFsU2lnbjETMBEGA1UEAxMKR2xvYmFs U2lnbjCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAJUH6HPKZvnsFMp7PPcNCPG0RQss grRIxutbPK6DuEGSMxSkb3/pKszGsIhrxbaJ0cay/xTOURQh7ErdG1rG1ofuTToVBu1kZguSgMpE 3nOUTvOniX9PeGMIyBJQbUJmL025eShNUhqKGoC3GYEOfsSKvGRMIRxDaNc9PIrFsmbVkJq3MQbF vuJtMgamHvm566qjuL++gmNQ0PAYid/kD3n16qIfKtJwLnvnvJO7bVPiSHyMEAc4/2ayd2F+4OqM PKq0pPbzlUoSB239jLKJz9CgYXfIWHSw1CM69106yqLbnQneXUQtkPGBzVeS+n68UARjNN9rkxi+ azayOeSsJDa38O+2HBNXk7besvjihbdzorg1qkXy4J02oW9UivFyVm4uiMVRQkQVlO6jxTiWm05O WgtH8wY2SXcwvHE35absIQh1/OZhFj931dmRl4QKbNQCTXTAFO39OfuD8l4UoQSwC+n+7o/hbguy CLNhZglqsQY6ZZZZwPA1/cnaKI0aEYdwgQqomnUdnjqGBQCe24DWJfncBZ4nWUx2OVvq+aWh2IMP 0f/fMBH5hc8zSPXKbWQULHpYT9NLCEnFlWQaYw55PfWzjMpYrZxCRXluDocZXFSxZba/jJvcE+kN b7gu3GduyYsRtYQUigAZcIN5kZeR1BonvzceMgfYFGM8KEyvAgMBAAGjYzBhMA4GA1UdDwEB/wQE AwIBBjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBSubAWjkxPioufi1xzWx/B/yGdToDAfBgNV HSMEGDAWgBSubAWjkxPioufi1xzWx/B/yGdToDANBgkqhkiG9w0BAQwFAAOCAgEAgyXt6NH9lVLN nsAEoJFp5lzQhN7craJP6Ed41mWYqVuoPId8AorRbrcWc+ZfwFSY1XS+wc3iEZGtIxg93eFyRJa0 lV7Ae46ZeBZDE1ZXs6KzO7V33EByrKPrmzU+sQghoefEQzd5Mr6155wsTLxDKZmOMNOsIeDjHfrY BzN2VAAiKrlNIC5waNrlU/yDXNOd8v9EDERm8tLjvUYAGm0CuiVdjaExUd1URhxN25mW7xocBFym Fe944Hn+Xds+qkxV/ZoVqW/hpvvfcDDpw+5CRu3CkwWJ+n1jez/QcYF8AOiYrg54NMMl+68KnyBr 3TsTjxKM4kEaSHpzoHdpx7Zcf4LIHv5YGygrqGytXm3ABdJ7t+uA/iU3/gKbaKxCXcPu9czc8FB1 0jZpnOZ7BN9uBmm23goJSFmH63sUYHpkqmlD75HHTOwY3WzvUy2MmeFe8nI+z1TIvWfspA9MRf/T uTAjB0yPEL+GltmZWrSZVxykzLsViVO6LAUP5MSeGbEYNNVMnbrt9x+vJJUEeKgDu+6B5dpffItK oZB0JaezPkvILFa9x8jvOOJckvB595yEunQtYQEgfn7R8k8HWV+LLUNS60YMlOH1Zkd5d9VUWx+t JDfLRVpOoERIyNiwmcUVhAn21klJwGW45hpxbqCo8YLoRT5s1gLXCmeDBVrJpBA= -----END CERTIFICATE----- OISTE WISeKey Global Root GC CA =============================== -----BEGIN CERTIFICATE----- MIICaTCCAe+gAwIBAgIQISpWDK7aDKtARb8roi066jAKBggqhkjOPQQDAzBtMQswCQYDVQQGEwJD SDEQMA4GA1UEChMHV0lTZUtleTEiMCAGA1UECxMZT0lTVEUgRm91bmRhdGlvbiBFbmRvcnNlZDEo MCYGA1UEAxMfT0lTVEUgV0lTZUtleSBHbG9iYWwgUm9vdCBHQyBDQTAeFw0xNzA1MDkwOTQ4MzRa Fw00MjA1MDkwOTU4MzNaMG0xCzAJBgNVBAYTAkNIMRAwDgYDVQQKEwdXSVNlS2V5MSIwIAYDVQQL ExlPSVNURSBGb3VuZGF0aW9uIEVuZG9yc2VkMSgwJgYDVQQDEx9PSVNURSBXSVNlS2V5IEdsb2Jh bCBSb290IEdDIENBMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAETOlQwMYPchi82PG6s4nieUqjFqdr VCTbUf/q9Akkwwsin8tqJ4KBDdLArzHkdIJuyiXZjHWd8dvQmqJLIX4Wp2OQ0jnUsYd4XxiWD1Ab NTcPasbc2RNNpI6QN+a9WzGRo1QwUjAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAd BgNVHQ4EFgQUSIcUrOPDnpBgOtfKie7TrYy0UGYwEAYJKwYBBAGCNxUBBAMCAQAwCgYIKoZIzj0E AwMDaAAwZQIwJsdpW9zV57LnyAyMjMPdeYwbY9XJUpROTYJKcx6ygISpJcBMWm1JKWB4E+J+SOtk AjEA2zQgMgj/mkkCtojeFK9dbJlxjRo/i9fgojaGHAeCOnZT/cKi7e97sIBPWA9LUzm9 -----END CERTIFICATE----- UCA Global G2 Root ================== -----BEGIN CERTIFICATE----- MIIFRjCCAy6gAwIBAgIQXd+x2lqj7V2+WmUgZQOQ7zANBgkqhkiG9w0BAQsFADA9MQswCQYDVQQG EwJDTjERMA8GA1UECgwIVW5pVHJ1c3QxGzAZBgNVBAMMElVDQSBHbG9iYWwgRzIgUm9vdDAeFw0x NjAzMTEwMDAwMDBaFw00MDEyMzEwMDAwMDBaMD0xCzAJBgNVBAYTAkNOMREwDwYDVQQKDAhVbmlU cnVzdDEbMBkGA1UEAwwSVUNBIEdsb2JhbCBHMiBSb290MIICIjANBgkqhkiG9w0BAQEFAAOCAg8A MIICCgKCAgEAxeYrb3zvJgUno4Ek2m/LAfmZmqkywiKHYUGRO8vDaBsGxUypK8FnFyIdK+35KYmT oni9kmugow2ifsqTs6bRjDXVdfkX9s9FxeV67HeToI8jrg4aA3++1NDtLnurRiNb/yzmVHqUwCoV 8MmNsHo7JOHXaOIxPAYzRrZUEaalLyJUKlgNAQLx+hVRZ2zA+te2G3/RVogvGjqNO7uCEeBHANBS h6v7hn4PJGtAnTRnvI3HLYZveT6OqTwXS3+wmeOwcWDcC/Vkw85DvG1xudLeJ1uK6NjGruFZfc8o LTW4lVYa8bJYS7cSN8h8s+1LgOGN+jIjtm+3SJUIsUROhYw6AlQgL9+/V087OpAh18EmNVQg7Mc/ R+zvWr9LesGtOxdQXGLYD0tK3Cv6brxzks3sx1DoQZbXqX5t2Okdj4q1uViSukqSKwxW/YDrCPBe KW4bHAyvj5OJrdu9o54hyokZ7N+1wxrrFv54NkzWbtA+FxyQF2smuvt6L78RHBgOLXMDj6DlNaBa 4kx1HXHhOThTeEDMg5PXCp6dW4+K5OXgSORIskfNTip1KnvyIvbJvgmRlld6iIis7nCs+dwp4wwc OxJORNanTrAmyPPZGpeRaOrvjUYG0lZFWJo8DA+DuAUlwznPO6Q0ibd5Ei9Hxeepl2n8pndntd97 8XplFeRhVmUCAwEAAaNCMEAwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0O BBYEFIHEjMz15DD/pQwIX4wVZyF0Ad/fMA0GCSqGSIb3DQEBCwUAA4ICAQATZSL1jiutROTL/7lo 5sOASD0Ee/ojL3rtNtqyzm325p7lX1iPyzcyochltq44PTUbPrw7tgTQvPlJ9Zv3hcU2tsu8+Mg5 1eRfB70VVJd0ysrtT7q6ZHafgbiERUlMjW+i67HM0cOU2kTC5uLqGOiiHycFutfl1qnN3e92mI0A Ds0b+gO3joBYDic/UvuUospeZcnWhNq5NXHzJsBPd+aBJ9J3O5oUb3n09tDh05S60FdRvScFDcH9 yBIw7m+NESsIndTUv4BFFJqIRNow6rSn4+7vW4LVPtateJLbXDzz2K36uGt/xDYotgIVilQsnLAX c47QN6MUPJiVAAwpBVueSUmxX8fjy88nZY41F7dXyDDZQVu5FLbowg+UMaeUmMxq67XhJ/UQqAHo jhJi6IjMtX9Gl8CbEGY4GjZGXyJoPd/JxhMnq1MGrKI8hgZlb7F+sSlEmqO6SWkoaY/X5V+tBIZk bxqgDMUIYs6Ao9Dz7GjevjPHF1t/gMRMTLGmhIrDO7gJzRSBuhjjVFc2/tsvfEehOjPI+Vg7RE+x ygKJBJYoaMVLuCaJu9YzL1DV/pqJuhgyklTGW+Cd+V7lDSKb9triyCGyYiGqhkCyLmTTX8jjfhFn RR8F/uOi77Oos/N9j/gMHyIfLXC0uAE0djAA5SN4p1bXUB+K+wb1whnw0A== -----END CERTIFICATE----- UCA Extended Validation Root ============================ -----BEGIN CERTIFICATE----- MIIFWjCCA0KgAwIBAgIQT9Irj/VkyDOeTzRYZiNwYDANBgkqhkiG9w0BAQsFADBHMQswCQYDVQQG EwJDTjERMA8GA1UECgwIVW5pVHJ1c3QxJTAjBgNVBAMMHFVDQSBFeHRlbmRlZCBWYWxpZGF0aW9u IFJvb3QwHhcNMTUwMzEzMDAwMDAwWhcNMzgxMjMxMDAwMDAwWjBHMQswCQYDVQQGEwJDTjERMA8G A1UECgwIVW5pVHJ1c3QxJTAjBgNVBAMMHFVDQSBFeHRlbmRlZCBWYWxpZGF0aW9uIFJvb3QwggIi MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCpCQcoEwKwmeBkqh5DFnpzsZGgdT6o+uM4AHrs iWogD4vFsJszA1qGxliG1cGFu0/GnEBNyr7uaZa4rYEwmnySBesFK5pI0Lh2PpbIILvSsPGP2KxF Rv+qZ2C0d35qHzwaUnoEPQc8hQ2E0B92CvdqFN9y4zR8V05WAT558aopO2z6+I9tTcg1367r3CTu eUWnhbYFiN6IXSV8l2RnCdm/WhUFhvMJHuxYMjMR83dksHYf5BA1FxvyDrFspCqjc/wJHx4yGVMR 59mzLC52LqGj3n5qiAno8geK+LLNEOfic0CTuwjRP+H8C5SzJe98ptfRr5//lpr1kXuYC3fUfugH 0mK1lTnj8/FtDw5lhIpjVMWAtuCeS31HJqcBCF3RiJ7XwzJE+oJKCmhUfzhTA8ykADNkUVkLo4KR el7sFsLzKuZi2irbWWIQJUoqgQtHB0MGcIfS+pMRKXpITeuUx3BNr2fVUbGAIAEBtHoIppB/TuDv B0GHr2qlXov7z1CymlSvw4m6WC31MJixNnI5fkkE/SmnTHnkBVfblLkWU41Gsx2VYVdWf6/wFlth WG82UBEL2KwrlRYaDh8IzTY0ZRBiZtWAXxQgXy0MoHgKaNYs1+lvK9JKBZP8nm9rZ/+I8U6laUpS NwXqxhaN0sSZ0YIrO7o1dfdRUVjzyAfd5LQDfwIDAQABo0IwQDAdBgNVHQ4EFgQU2XQ65DA9DfcS 3H5aBZ8eNJr34RQwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAYYwDQYJKoZIhvcNAQEL BQADggIBADaNl8xCFWQpN5smLNb7rhVpLGsaGvdftvkHTFnq88nIua7Mui563MD1sC3AO6+fcAUR ap8lTwEpcOPlDOHqWnzcSbvBHiqB9RZLcpHIojG5qtr8nR/zXUACE/xOHAbKsxSQVBcZEhrxH9cM aVr2cXj0lH2RC47skFSOvG+hTKv8dGT9cZr4QQehzZHkPJrgmzI5c6sq1WnIeJEmMX3ixzDx/BR4 dxIOE/TdFpS/S2d7cFOFyrC78zhNLJA5wA3CXWvp4uXViI3WLL+rG761KIcSF3Ru/H38j9CHJrAb +7lsq+KePRXBOy5nAliRn+/4Qh8st2j1da3Ptfb/EX3C8CSlrdP6oDyp+l3cpaDvRKS+1ujl5BOW F3sGPjLtx7dCvHaj2GU4Kzg1USEODm8uNBNA4StnDG1KQTAYI1oyVZnJF+A83vbsea0rWBmirSwi GpWOvpaQXUJXxPkUAzUrHC1RVwinOt4/5Mi0A3PCwSaAuwtCH60NryZy2sy+s6ODWA2CxR9GUeOc GMyNm43sSet1UNWMKFnKdDTajAshqx7qG+XH/RU+wBeq+yNuJkbL+vmxcmtpzyKEC2IPrNkZAJSi djzULZrtBJ4tBmIQN1IchXIbJ+XMxjHsN+xjWZsLHXbMfjKaiJUINlK73nZfdklJrX+9ZSCyycEr dhh2n1ax -----END CERTIFICATE----- Certigna Root CA ================ -----BEGIN CERTIFICATE----- MIIGWzCCBEOgAwIBAgIRAMrpG4nxVQMNo+ZBbcTjpuEwDQYJKoZIhvcNAQELBQAwWjELMAkGA1UE BhMCRlIxEjAQBgNVBAoMCURoaW15b3RpczEcMBoGA1UECwwTMDAwMiA0ODE0NjMwODEwMDAzNjEZ MBcGA1UEAwwQQ2VydGlnbmEgUm9vdCBDQTAeFw0xMzEwMDEwODMyMjdaFw0zMzEwMDEwODMyMjda MFoxCzAJBgNVBAYTAkZSMRIwEAYDVQQKDAlEaGlteW90aXMxHDAaBgNVBAsMEzAwMDIgNDgxNDYz MDgxMDAwMzYxGTAXBgNVBAMMEENlcnRpZ25hIFJvb3QgQ0EwggIiMA0GCSqGSIb3DQEBAQUAA4IC DwAwggIKAoICAQDNGDllGlmx6mQWDoyUJJV8g9PFOSbcDO8WV43X2KyjQn+Cyu3NW9sOty3tRQgX stmzy9YXUnIo245Onoq2C/mehJpNdt4iKVzSs9IGPjA5qXSjklYcoW9MCiBtnyN6tMbaLOQdLNyz KNAT8kxOAkmhVECe5uUFoC2EyP+YbNDrihqECB63aCPuI9Vwzm1RaRDuoXrC0SIxwoKF0vJVdlB8 JXrJhFwLrN1CTivngqIkicuQstDuI7pmTLtipPlTWmR7fJj6o0ieD5Wupxj0auwuA0Wv8HT4Ks16 XdG+RCYyKfHx9WzMfgIhC59vpD++nVPiz32pLHxYGpfhPTc3GGYo0kDFUYqMwy3OU4gkWGQwFsWq 4NYKpkDfePb1BHxpE4S80dGnBs8B92jAqFe7OmGtBIyT46388NtEbVncSVmurJqZNjBBe3YzIoej wpKGbvlw7q6Hh5UbxHq9MfPU0uWZ/75I7HX1eBYdpnDBfzwboZL7z8g81sWTCo/1VTp2lc5ZmIoJ lXcymoO6LAQ6l73UL77XbJuiyn1tJslV1c/DeVIICZkHJC1kJWumIWmbat10TWuXekG9qxf5kBdI jzb5LdXF2+6qhUVB+s06RbFo5jZMm5BX7CO5hwjCxAnxl4YqKE3idMDaxIzb3+KhF1nOJFl0Mdp/ /TBt2dzhauH8XwIDAQABo4IBGjCCARYwDwYDVR0TAQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYw HQYDVR0OBBYEFBiHVuBud+4kNTxOc5of1uHieX4rMB8GA1UdIwQYMBaAFBiHVuBud+4kNTxOc5of 1uHieX4rMEQGA1UdIAQ9MDswOQYEVR0gADAxMC8GCCsGAQUFBwIBFiNodHRwczovL3d3d3cuY2Vy dGlnbmEuZnIvYXV0b3JpdGVzLzBtBgNVHR8EZjBkMC+gLaArhilodHRwOi8vY3JsLmNlcnRpZ25h LmZyL2NlcnRpZ25hcm9vdGNhLmNybDAxoC+gLYYraHR0cDovL2NybC5kaGlteW90aXMuY29tL2Nl cnRpZ25hcm9vdGNhLmNybDANBgkqhkiG9w0BAQsFAAOCAgEAlLieT/DjlQgi581oQfccVdV8AOIt OoldaDgvUSILSo3L6btdPrtcPbEo/uRTVRPPoZAbAh1fZkYJMyjhDSSXcNMQH+pkV5a7XdrnxIxP TGRGHVyH41neQtGbqH6mid2PHMkwgu07nM3A6RngatgCdTer9zQoKJHyBApPNeNgJgH60BGM+RFq 7q89w1DTj18zeTyGqHNFkIwgtnJzFyO+B2XleJINugHA64wcZr+shncBlA2c5uk5jR+mUYyZDDl3 4bSb+hxnV29qao6pK0xXeXpXIs/NX2NGjVxZOob4Mkdio2cNGJHc+6Zr9UhhcyNZjgKnvETq9Emd 8VRY+WCv2hikLyhF3HqgiIZd8zvn/yk1gPxkQ5Tm4xxvvq0OKmOZK8l+hfZx6AYDlf7ej0gcWtSS 6Cvu5zHbugRqh5jnxV/vfaci9wHYTfmJ0A6aBVmknpjZbyvKcL5kwlWj9Omvw5Ip3IgWJJk8jSaY tlu3zM63Nwf9JtmYhST/WSMDmu2dnajkXjjO11INb9I/bbEFa0nOipFGc/T2L/Coc3cOZayhjWZS aX5LaAzHHjcng6WMxwLkFM1JAbBzs/3GkDpv0mztO+7skb6iQ12LAEpmJURw3kAP+HwV96LOPNde E4yBFxgX0b3xdxA61GU5wSesVywlVP+i2k+KYTlerj1KjL0= -----END CERTIFICATE----- emSign Root CA - G1 =================== -----BEGIN CERTIFICATE----- MIIDlDCCAnygAwIBAgIKMfXkYgxsWO3W2DANBgkqhkiG9w0BAQsFADBnMQswCQYDVQQGEwJJTjET MBEGA1UECxMKZW1TaWduIFBLSTElMCMGA1UEChMcZU11ZGhyYSBUZWNobm9sb2dpZXMgTGltaXRl ZDEcMBoGA1UEAxMTZW1TaWduIFJvb3QgQ0EgLSBHMTAeFw0xODAyMTgxODMwMDBaFw00MzAyMTgx ODMwMDBaMGcxCzAJBgNVBAYTAklOMRMwEQYDVQQLEwplbVNpZ24gUEtJMSUwIwYDVQQKExxlTXVk aHJhIFRlY2hub2xvZ2llcyBMaW1pdGVkMRwwGgYDVQQDExNlbVNpZ24gUm9vdCBDQSAtIEcxMIIB IjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAk0u76WaK7p1b1TST0Bsew+eeuGQzf2N4aLTN LnF115sgxk0pvLZoYIr3IZpWNVrzdr3YzZr/k1ZLpVkGoZM0Kd0WNHVO8oG0x5ZOrRkVUkr+PHB1 cM2vK6sVmjM8qrOLqs1D/fXqcP/tzxE7lM5OMhbTI0Aqd7OvPAEsbO2ZLIvZTmmYsvePQbAyeGHW DV/D+qJAkh1cF+ZwPjXnorfCYuKrpDhMtTk1b+oDafo6VGiFbdbyL0NVHpENDtjVaqSW0RM8LHhQ 6DqS0hdW5TUaQBw+jSztOd9C4INBdN+jzcKGYEho42kLVACL5HZpIQ15TjQIXhTCzLG3rdd8cIrH hQIDAQABo0IwQDAdBgNVHQ4EFgQU++8Nhp6w492pufEhF38+/PB3KxowDgYDVR0PAQH/BAQDAgEG MA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQADggEBAFn/8oz1h31xPaOfG1vR2vjTnGs2 vZupYeveFix0PZ7mddrXuqe8QhfnPZHr5X3dPpzxz5KsbEjMwiI/aTvFthUvozXGaCocV685743Q NcMYDHsAVhzNixl03r4PEuDQqqE/AjSxcM6dGNYIAwlG7mDgfrbESQRRfXBgvKqy/3lyeqYdPV8q +Mri/Tm3R7nrft8EI6/6nAYH6ftjk4BAtcZsCjEozgyfz7MjNYBBjWzEN3uBL4ChQEKF6dk4jeih U80Bv2noWgbyRQuQ+q7hv53yrlc8pa6yVvSLZUDp/TGBLPQ5Cdjua6e0ph0VpZj3AYHYhX3zUVxx iN66zB+Afko= -----END CERTIFICATE----- emSign ECC Root CA - G3 ======================= -----BEGIN CERTIFICATE----- MIICTjCCAdOgAwIBAgIKPPYHqWhwDtqLhDAKBggqhkjOPQQDAzBrMQswCQYDVQQGEwJJTjETMBEG A1UECxMKZW1TaWduIFBLSTElMCMGA1UEChMcZU11ZGhyYSBUZWNobm9sb2dpZXMgTGltaXRlZDEg MB4GA1UEAxMXZW1TaWduIEVDQyBSb290IENBIC0gRzMwHhcNMTgwMjE4MTgzMDAwWhcNNDMwMjE4 MTgzMDAwWjBrMQswCQYDVQQGEwJJTjETMBEGA1UECxMKZW1TaWduIFBLSTElMCMGA1UEChMcZU11 ZGhyYSBUZWNobm9sb2dpZXMgTGltaXRlZDEgMB4GA1UEAxMXZW1TaWduIEVDQyBSb290IENBIC0g RzMwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAAQjpQy4LRL1KPOxst3iAhKAnjlfSU2fySU0WXTsuwYc 58Byr+iuL+FBVIcUqEqy6HyC5ltqtdyzdc6LBtCGI79G1Y4PPwT01xySfvalY8L1X44uT6EYGQIr MgqCZH0Wk9GjQjBAMB0GA1UdDgQWBBR8XQKEE9TMipuBzhccLikenEhjQjAOBgNVHQ8BAf8EBAMC AQYwDwYDVR0TAQH/BAUwAwEB/zAKBggqhkjOPQQDAwNpADBmAjEAvvNhzwIQHWSVB7gYboiFBS+D CBeQyh+KTOgNG3qxrdWBCUfvO6wIBHxcmbHtRwfSAjEAnbpV/KlK6O3t5nYBQnvI+GDZjVGLVTv7 jHvrZQnD+JbNR6iC8hZVdyR+EhCVBCyj -----END CERTIFICATE----- emSign Root CA - C1 =================== -----BEGIN CERTIFICATE----- MIIDczCCAlugAwIBAgILAK7PALrEzzL4Q7IwDQYJKoZIhvcNAQELBQAwVjELMAkGA1UEBhMCVVMx EzARBgNVBAsTCmVtU2lnbiBQS0kxFDASBgNVBAoTC2VNdWRocmEgSW5jMRwwGgYDVQQDExNlbVNp Z24gUm9vdCBDQSAtIEMxMB4XDTE4MDIxODE4MzAwMFoXDTQzMDIxODE4MzAwMFowVjELMAkGA1UE BhMCVVMxEzARBgNVBAsTCmVtU2lnbiBQS0kxFDASBgNVBAoTC2VNdWRocmEgSW5jMRwwGgYDVQQD ExNlbVNpZ24gUm9vdCBDQSAtIEMxMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAz+up ufGZBczYKCFK83M0UYRWEPWgTywS4/oTmifQz/l5GnRfHXk5/Fv4cI7gklL35CX5VIPZHdPIWoU/ Xse2B+4+wM6ar6xWQio5JXDWv7V7Nq2s9nPczdcdioOl+yuQFTdrHCZH3DspVpNqs8FqOp099cGX OFgFixwR4+S0uF2FHYP+eF8LRWgYSKVGczQ7/g/IdrvHGPMF0Ybzhe3nudkyrVWIzqa2kbBPrH4V I5b2P/AgNBbeCsbEBEV5f6f9vtKppa+cxSMq9zwhbL2vj07FOrLzNBL834AaSaTUqZX3noleooms lMuoaJuvimUnzYnu3Yy1aylwQ6BpC+S5DwIDAQABo0IwQDAdBgNVHQ4EFgQU/qHgcB4qAzlSWkK+ XJGFehiqTbUwDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMBAf8wDQYJKoZIhvcNAQELBQAD ggEBAMJKVvoVIXsoounlHfv4LcQ5lkFMOycsxGwYFYDGrK9HWS8mC+M2sO87/kOXSTKZEhVb3xEp /6tT+LvBeA+snFOvV71ojD1pM/CjoCNjO2RnIkSt1XHLVip4kqNPEjE2NuLe/gDEo2APJ62gsIq1 NnpSob0n9CAnYuhNlCQT5AoE6TyrLshDCUrGYQTlSTR+08TI9Q/Aqum6VF7zYytPT1DU/rl7mYw9 wC68AivTxEDkigcxHpvOJpkT+xHqmiIMERnHXhuBUDDIlhJu58tBf5E7oke3VIAb3ADMmpDqw8NQ BmIMMMAVSKeoWXzhriKi4gp6D/piq1JM4fHfyr6DDUI= -----END CERTIFICATE----- emSign ECC Root CA - C3 ======================= -----BEGIN CERTIFICATE----- MIICKzCCAbGgAwIBAgIKe3G2gla4EnycqDAKBggqhkjOPQQDAzBaMQswCQYDVQQGEwJVUzETMBEG A1UECxMKZW1TaWduIFBLSTEUMBIGA1UEChMLZU11ZGhyYSBJbmMxIDAeBgNVBAMTF2VtU2lnbiBF Q0MgUm9vdCBDQSAtIEMzMB4XDTE4MDIxODE4MzAwMFoXDTQzMDIxODE4MzAwMFowWjELMAkGA1UE BhMCVVMxEzARBgNVBAsTCmVtU2lnbiBQS0kxFDASBgNVBAoTC2VNdWRocmEgSW5jMSAwHgYDVQQD ExdlbVNpZ24gRUNDIFJvb3QgQ0EgLSBDMzB2MBAGByqGSM49AgEGBSuBBAAiA2IABP2lYa57JhAd 6bciMK4G9IGzsUJxlTm801Ljr6/58pc1kjZGDoeVjbk5Wum739D+yAdBPLtVb4OjavtisIGJAnB9 SMVK4+kiVCJNk7tCDK93nCOmfddhEc5lx/h//vXyqaNCMEAwHQYDVR0OBBYEFPtaSNCAIEDyqOkA B2kZd6fmw/TPMA4GA1UdDwEB/wQEAwIBBjAPBgNVHRMBAf8EBTADAQH/MAoGCCqGSM49BAMDA2gA MGUCMQC02C8Cif22TGK6Q04ThHK1rt0c3ta13FaPWEBaLd4gTCKDypOofu4SQMfWh0/434UCMBwU ZOR8loMRnLDRWmFLpg9J0wD8ofzkpf9/rdcw0Md3f76BB1UwUCAU9Vc4CqgxUQ== -----END CERTIFICATE----- Hongkong Post Root CA 3 ======================= -----BEGIN CERTIFICATE----- MIIFzzCCA7egAwIBAgIUCBZfikyl7ADJk0DfxMauI7gcWqQwDQYJKoZIhvcNAQELBQAwbzELMAkG A1UEBhMCSEsxEjAQBgNVBAgTCUhvbmcgS29uZzESMBAGA1UEBxMJSG9uZyBLb25nMRYwFAYDVQQK Ew1Ib25na29uZyBQb3N0MSAwHgYDVQQDExdIb25na29uZyBQb3N0IFJvb3QgQ0EgMzAeFw0xNzA2 MDMwMjI5NDZaFw00MjA2MDMwMjI5NDZaMG8xCzAJBgNVBAYTAkhLMRIwEAYDVQQIEwlIb25nIEtv bmcxEjAQBgNVBAcTCUhvbmcgS29uZzEWMBQGA1UEChMNSG9uZ2tvbmcgUG9zdDEgMB4GA1UEAxMX SG9uZ2tvbmcgUG9zdCBSb290IENBIDMwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCz iNfqzg8gTr7m1gNt7ln8wlffKWihgw4+aMdoWJwcYEuJQwy51BWy7sFOdem1p+/l6TWZ5Mwc50tf jTMwIDNT2aa71T4Tjukfh0mtUC1Qyhi+AViiE3CWu4mIVoBc+L0sPOFMV4i707mV78vH9toxdCim 5lSJ9UExyuUmGs2C4HDaOym71QP1mbpV9WTRYA6ziUm4ii8F0oRFKHyPaFASePwLtVPLwpgchKOe sL4jpNrcyCse2m5FHomY2vkALgbpDDtw1VAliJnLzXNg99X/NWfFobxeq81KuEXryGgeDQ0URhLj 0mRiikKYvLTGCAj4/ahMZJx2Ab0vqWwzD9g/KLg8aQFChn5pwckGyuV6RmXpwtZQQS4/t+TtbNe/ JgERohYpSms0BpDsE9K2+2p20jzt8NYt3eEV7KObLyzJPivkaTv/ciWxNoZbx39ri1UbSsUgYT2u y1DhCDq+sI9jQVMwCFk8mB13umOResoQUGC/8Ne8lYePl8X+l2oBlKN8W4UdKjk60FSh0Tlxnf0h +bV78OLgAo9uliQlLKAeLKjEiafv7ZkGL7YKTE/bosw3Gq9HhS2KX8Q0NEwA/RiTZxPRN+ZItIsG xVd7GYYKecsAyVKvQv83j+GjHno9UKtjBucVtT+2RTeUN7F+8kjDf8V1/peNRY8apxpyKBpADwID AQABo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAfBgNVHSMEGDAWgBQXnc0e i9Y5K3DTXNSguB+wAPzFYTAdBgNVHQ4EFgQUF53NHovWOStw01zUoLgfsAD8xWEwDQYJKoZIhvcN AQELBQADggIBAFbVe27mIgHSQpsY1Q7XZiNc4/6gx5LS6ZStS6LG7BJ8dNVI0lkUmcDrudHr9Egw W62nV3OZqdPlt9EuWSRY3GguLmLYauRwCy0gUCCkMpXRAJi70/33MvJJrsZ64Ee+bs7Lo3I6LWld y8joRTnU+kLBEUx3XZL7av9YROXrgZ6voJmtvqkBZss4HTzfQx/0TW60uhdG/H39h4F5ag0zD/ov +BS5gLNdTaqX4fnkGMX41TiMJjz98iji7lpJiCzfeT2OnpA8vUFKOt1b9pq0zj8lMH8yfaIDlNDc eqFS3m6TjRgm/VWsvY+b0s+v54Ysyx8Jb6NvqYTUc79NoXQbTiNg8swOqn+knEwlqLJmOzj/2ZQw 9nKEvmhVEA/GcywWaZMH/rFF7buiVWqw2rVKAiUnhde3t4ZEFolsgCs+l6mc1X5VTMbeRRAc6uk7 nwNT7u56AQIWeNTowr5GdogTPyK7SBIdUgC0An4hGh6cJfTzPV4e0hz5sy229zdcxsshTrD3mUcY hcErulWuBurQB7Lcq9CClnXO0lD+mefPL5/ndtFhKvshuzHQqp9HpLIiyhY6UFfEW0NnxWViA0kB 60PZ2Pierc+xYw5F9KBaLJstxabArahH9CdMOA0uG0k7UvToiIMrVCjU8jVStDKDYmlkDJGcn5fq dBb9HxEGmpv0 -----END CERTIFICATE----- Entrust Root Certification Authority - G4 ========================================= -----BEGIN CERTIFICATE----- MIIGSzCCBDOgAwIBAgIRANm1Q3+vqTkPAAAAAFVlrVgwDQYJKoZIhvcNAQELBQAwgb4xCzAJBgNV BAYTAlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQLEx9TZWUgd3d3LmVudHJ1c3Qu bmV0L2xlZ2FsLXRlcm1zMTkwNwYDVQQLEzAoYykgMjAxNSBFbnRydXN0LCBJbmMuIC0gZm9yIGF1 dGhvcml6ZWQgdXNlIG9ubHkxMjAwBgNVBAMTKUVudHJ1c3QgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1 dGhvcml0eSAtIEc0MB4XDTE1MDUyNzExMTExNloXDTM3MTIyNzExNDExNlowgb4xCzAJBgNVBAYT AlVTMRYwFAYDVQQKEw1FbnRydXN0LCBJbmMuMSgwJgYDVQQLEx9TZWUgd3d3LmVudHJ1c3QubmV0 L2xlZ2FsLXRlcm1zMTkwNwYDVQQLEzAoYykgMjAxNSBFbnRydXN0LCBJbmMuIC0gZm9yIGF1dGhv cml6ZWQgdXNlIG9ubHkxMjAwBgNVBAMTKUVudHJ1c3QgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhv cml0eSAtIEc0MIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAsewsQu7i0TD/pZJH4i3D umSXbcr3DbVZwbPLqGgZ2K+EbTBwXX7zLtJTmeH+H17ZSK9dE43b/2MzTdMAArzE+NEGCJR5WIoV 3imz/f3ET+iq4qA7ec2/a0My3dl0ELn39GjUu9CH1apLiipvKgS1sqbHoHrmSKvS0VnM1n4j5pds 8ELl3FFLFUHtSUrJ3hCX1nbB76W1NhSXNdh4IjVS70O92yfbYVaCNNzLiGAMC1rlLAHGVK/XqsEQ e9IFWrhAnoanw5CGAlZSCXqc0ieCU0plUmr1POeo8pyvi73TDtTUXm6Hnmo9RR3RXRv06QqsYJn7 ibT/mCzPfB3pAqoEmh643IhuJbNsZvc8kPNXwbMv9W3y+8qh+CmdRouzavbmZwe+LGcKKh9asj5X xNMhIWNlUpEbsZmOeX7m640A2Vqq6nPopIICR5b+W45UYaPrL0swsIsjdXJ8ITzI9vF01Bx7owVV 7rtNOzK+mndmnqxpkCIHH2E6lr7lmk/MBTwoWdPBDFSoWWG9yHJM6Nyfh3+9nEg2XpWjDrk4JFX8 dWbrAuMINClKxuMrLzOg2qOGpRKX/YAr2hRC45K9PvJdXmd0LhyIRyk0X+IyqJwlN4y6mACXi0mW Hv0liqzc2thddG5msP9E36EYxr5ILzeUePiVSj9/E15dWf10hkNjc0kCAwEAAaNCMEAwDwYDVR0T AQH/BAUwAwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFJ84xFYjwznooHFs6FRM5Og6sb9n MA0GCSqGSIb3DQEBCwUAA4ICAQAS5UKme4sPDORGpbZgQIeMJX6tuGguW8ZAdjwD+MlZ9POrYs4Q jbRaZIxowLByQzTSGwv2LFPSypBLhmb8qoMi9IsabyZIrHZ3CL/FmFz0Jomee8O5ZDIBf9PD3Vht 7LGrhFV0d4QEJ1JrhkzO3bll/9bGXp+aEJlLdWr+aumXIOTkdnrG0CSqkM0gkLpHZPt/B7NTeLUK YvJzQ85BK4FqLoUWlFPUa19yIqtRLULVAJyZv967lDtX/Zr1hstWO1uIAeV8KEsD+UmDfLJ/fOPt jqF/YFOOVZ1QNBIPt5d7bIdKROf1beyAN/BYGW5KaHbwH5Lk6rWS02FREAutp9lfx1/cH6NcjKF+ m7ee01ZvZl4HliDtC3T7Zk6LERXpgUl+b7DUUH8i119lAg2m9IUe2K4GS0qn0jFmwvjO5QimpAKW RGhXxNUzzxkvFMSUHHuk2fCfDrGA4tGeEWSpiBE6doLlYsKA2KSD7ZPvfC+QsDJMlhVoSFLUmQjA JOgc47OlIQ6SwJAfzyBfyjs4x7dtOvPmRLgOMWuIjnDrnBdSqEGULoe256YSxXXfW8AKbnuk5F6G +TaU33fD6Q3AOfF5u0aOq0NZJ7cguyPpVkAh7DE9ZapD8j3fcEThuk0mEDuYn/PIjhs4ViFqUZPT kcpG2om3PVODLAgfi49T3f+sHw== -----END CERTIFICATE----- Microsoft ECC Root Certificate Authority 2017 ============================================= -----BEGIN CERTIFICATE----- MIICWTCCAd+gAwIBAgIQZvI9r4fei7FK6gxXMQHC7DAKBggqhkjOPQQDAzBlMQswCQYDVQQGEwJV UzEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMTYwNAYDVQQDEy1NaWNyb3NvZnQgRUND IFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5IDIwMTcwHhcNMTkxMjE4MjMwNjQ1WhcNNDIwNzE4 MjMxNjA0WjBlMQswCQYDVQQGEwJVUzEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMTYw NAYDVQQDEy1NaWNyb3NvZnQgRUNDIFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5IDIwMTcwdjAQ BgcqhkjOPQIBBgUrgQQAIgNiAATUvD0CQnVBEyPNgASGAlEvaqiBYgtlzPbKnR5vSmZRogPZnZH6 thaxjG7efM3beaYvzrvOcS/lpaso7GMEZpn4+vKTEAXhgShC48Zo9OYbhGBKia/teQ87zvH2RPUB eMCjVDBSMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTIy5lycFIM +Oa+sgRXKSrPQhDtNTAQBgkrBgEEAYI3FQEEAwIBADAKBggqhkjOPQQDAwNoADBlAjBY8k3qDPlf Xu5gKcs68tvWMoQZP3zVL8KxzJOuULsJMsbG7X7JNpQS5GiFBqIb0C8CMQCZ6Ra0DvpWSNSkMBaR eNtUjGUBiudQZsIxtzm6uBoiB078a1QWIP8rtedMDE2mT3M= -----END CERTIFICATE----- Microsoft RSA Root Certificate Authority 2017 ============================================= -----BEGIN CERTIFICATE----- MIIFqDCCA5CgAwIBAgIQHtOXCV/YtLNHcB6qvn9FszANBgkqhkiG9w0BAQwFADBlMQswCQYDVQQG EwJVUzEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9uMTYwNAYDVQQDEy1NaWNyb3NvZnQg UlNBIFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5IDIwMTcwHhcNMTkxMjE4MjI1MTIyWhcNNDIw NzE4MjMwMDIzWjBlMQswCQYDVQQGEwJVUzEeMBwGA1UEChMVTWljcm9zb2Z0IENvcnBvcmF0aW9u MTYwNAYDVQQDEy1NaWNyb3NvZnQgUlNBIFJvb3QgQ2VydGlmaWNhdGUgQXV0aG9yaXR5IDIwMTcw ggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDKW76UM4wplZEWCpW9R2LBifOZNt9GkMml 7Xhqb0eRaPgnZ1AzHaGm++DlQ6OEAlcBXZxIQIJTELy/xztokLaCLeX0ZdDMbRnMlfl7rEqUrQ7e S0MdhweSE5CAg2Q1OQT85elss7YfUJQ4ZVBcF0a5toW1HLUX6NZFndiyJrDKxHBKrmCk3bPZ7Pw7 1VdyvD/IybLeS2v4I2wDwAW9lcfNcztmgGTjGqwu+UcF8ga2m3P1eDNbx6H7JyqhtJqRjJHTOoI+ dkC0zVJhUXAoP8XFWvLJjEm7FFtNyP9nTUwSlq31/niol4fX/V4ggNyhSyL71Imtus5Hl0dVe49F yGcohJUcaDDv70ngNXtk55iwlNpNhTs+VcQor1fznhPbRiefHqJeRIOkpcrVE7NLP8TjwuaGYaRS MLl6IE9vDzhTyzMMEyuP1pq9KsgtsRx9S1HKR9FIJ3Jdh+vVReZIZZ2vUpC6W6IYZVcSn2i51BVr lMRpIpj0M+Dt+VGOQVDJNE92kKz8OMHY4Xu54+OU4UZpyw4KUGsTuqwPN1q3ErWQgR5WrlcihtnJ 0tHXUeOrO8ZV/R4O03QK0dqq6mm4lyiPSMQH+FJDOvTKVTUssKZqwJz58oHhEmrARdlns87/I6KJ ClTUFLkqqNfs+avNJVgyeY+QW5g5xAgGwax/Dj0ApQIDAQABo1QwUjAOBgNVHQ8BAf8EBAMCAYYw DwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUCctZf4aycI8awznjwNnpv7tNsiMwEAYJKwYBBAGC NxUBBAMCAQAwDQYJKoZIhvcNAQEMBQADggIBAKyvPl3CEZaJjqPnktaXFbgToqZCLgLNFgVZJ8og 6Lq46BrsTaiXVq5lQ7GPAJtSzVXNUzltYkyLDVt8LkS/gxCP81OCgMNPOsduET/m4xaRhPtthH80 dK2Jp86519efhGSSvpWhrQlTM93uCupKUY5vVau6tZRGrox/2KJQJWVggEbbMwSubLWYdFQl3JPk +ONVFT24bcMKpBLBaYVu32TxU5nhSnUgnZUP5NbcA/FZGOhHibJXWpS2qdgXKxdJ5XbLwVaZOjex /2kskZGT4d9Mozd2TaGf+G0eHdP67Pv0RR0Tbc/3WeUiJ3IrhvNXuzDtJE3cfVa7o7P4NHmJweDy AmH3pvwPuxwXC65B2Xy9J6P9LjrRk5Sxcx0ki69bIImtt2dmefU6xqaWM/5TkshGsRGRxpl/j8nW ZjEgQRCHLQzWwa80mMpkg/sTV9HB8Dx6jKXB/ZUhoHHBk2dxEuqPiAppGWSZI1b7rCoucL5mxAyE 7+WL85MB+GqQk2dLsmijtWKP6T+MejteD+eMuMZ87zf9dOLITzNy4ZQ5bb0Sr74MTnB8G2+NszKT c0QWbej09+CVgI+WXTik9KveCjCHk9hNAHFiRSdLOkKEW39lt2c0Ui2cFmuqqNh7o0JMcccMyj6D 5KbvtwEwXlGjefVwaaZBRA+GsCyRxj3qrg+E -----END CERTIFICATE----- e-Szigno Root CA 2017 ===================== -----BEGIN CERTIFICATE----- MIICQDCCAeWgAwIBAgIMAVRI7yH9l1kN9QQKMAoGCCqGSM49BAMCMHExCzAJBgNVBAYTAkhVMREw DwYDVQQHDAhCdWRhcGVzdDEWMBQGA1UECgwNTWljcm9zZWMgTHRkLjEXMBUGA1UEYQwOVkFUSFUt MjM1ODQ0OTcxHjAcBgNVBAMMFWUtU3ppZ25vIFJvb3QgQ0EgMjAxNzAeFw0xNzA4MjIxMjA3MDZa Fw00MjA4MjIxMjA3MDZaMHExCzAJBgNVBAYTAkhVMREwDwYDVQQHDAhCdWRhcGVzdDEWMBQGA1UE CgwNTWljcm9zZWMgTHRkLjEXMBUGA1UEYQwOVkFUSFUtMjM1ODQ0OTcxHjAcBgNVBAMMFWUtU3pp Z25vIFJvb3QgQ0EgMjAxNzBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABJbcPYrYsHtvxie+RJCx s1YVe45DJH0ahFnuY2iyxl6H0BVIHqiQrb1TotreOpCmYF9oMrWGQd+HWyx7xf58etqjYzBhMA8G A1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBSHERUI0arBeAyxr87GyZDv vzAEwDAfBgNVHSMEGDAWgBSHERUI0arBeAyxr87GyZDvvzAEwDAKBggqhkjOPQQDAgNJADBGAiEA tVfd14pVCzbhhkT61NlojbjcI4qKDdQvfepz7L9NbKgCIQDLpbQS+ue16M9+k/zzNY9vTlp8tLxO svxyqltZ+efcMQ== -----END CERTIFICATE----- certSIGN Root CA G2 =================== -----BEGIN CERTIFICATE----- MIIFRzCCAy+gAwIBAgIJEQA0tk7GNi02MA0GCSqGSIb3DQEBCwUAMEExCzAJBgNVBAYTAlJPMRQw EgYDVQQKEwtDRVJUU0lHTiBTQTEcMBoGA1UECxMTY2VydFNJR04gUk9PVCBDQSBHMjAeFw0xNzAy MDYwOTI3MzVaFw00MjAyMDYwOTI3MzVaMEExCzAJBgNVBAYTAlJPMRQwEgYDVQQKEwtDRVJUU0lH TiBTQTEcMBoGA1UECxMTY2VydFNJR04gUk9PVCBDQSBHMjCCAiIwDQYJKoZIhvcNAQEBBQADggIP ADCCAgoCggIBAMDFdRmRfUR0dIf+DjuW3NgBFszuY5HnC2/OOwppGnzC46+CjobXXo9X69MhWf05 N0IwvlDqtg+piNguLWkh59E3GE59kdUWX2tbAMI5Qw02hVK5U2UPHULlj88F0+7cDBrZuIt4Imfk abBoxTzkbFpG583H+u/E7Eu9aqSs/cwoUe+StCmrqzWaTOTECMYmzPhpn+Sc8CnTXPnGFiWeI8Mg wT0PPzhAsP6CRDiqWhqKa2NYOLQV07YRaXseVO6MGiKscpc/I1mbySKEwQdPzH/iV8oScLumZfNp dWO9lfsbl83kqK/20U6o2YpxJM02PbyWxPFsqa7lzw1uKA2wDrXKUXt4FMMgL3/7FFXhEZn91Qqh ngLjYl/rNUssuHLoPj1PrCy7Lobio3aP5ZMqz6WryFyNSwb/EkaseMsUBzXgqd+L6a8VTxaJW732 jcZZroiFDsGJ6x9nxUWO/203Nit4ZoORUSs9/1F3dmKh7Gc+PoGD4FapUB8fepmrY7+EF3fxDTvf 95xhszWYijqy7DwaNz9+j5LP2RIUZNoQAhVB/0/E6xyjyfqZ90bp4RjZsbgyLcsUDFDYg2WD7rlc z8sFWkz6GZdr1l0T08JcVLwyc6B49fFtHsufpaafItzRUZ6CeWRgKRM+o/1Pcmqr4tTluCRVLERL iohEnMqE0yo7AgMBAAGjQjBAMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1Ud DgQWBBSCIS1mxteg4BXrzkwJd8RgnlRuAzANBgkqhkiG9w0BAQsFAAOCAgEAYN4auOfyYILVAzOB ywaK8SJJ6ejqkX/GM15oGQOGO0MBzwdw5AgeZYWR5hEit/UCI46uuR59H35s5r0l1ZUa8gWmr4UC b6741jH/JclKyMeKqdmfS0mbEVeZkkMR3rYzpMzXjWR91M08KCy0mpbqTfXERMQlqiCA2ClV9+BB /AYm/7k29UMUA2Z44RGx2iBfRgB4ACGlHgAoYXhvqAEBj500mv/0OJD7uNGzcgbJceaBxXntC6Z5 8hMLnPddDnskk7RI24Zf3lCGeOdA5jGokHZwYa+cNywRtYK3qq4kNFtyDGkNzVmf9nGvnAvRCjj5 BiKDUyUM/FHE5r7iOZULJK2v0ZXkltd0ZGtxTgI8qoXzIKNDOXZbbFD+mpwUHmUUihW9o4JFWklW atKcsWMy5WHgUyIOpwpJ6st+H6jiYoD2EEVSmAYY3qXNL3+q1Ok+CHLsIwMCPKaq2LxndD0UF/tU Sxfj03k9bWtJySgOLnRQvwzZRjoQhsmnP+mg7H/rpXdYaXHmgwo38oZJar55CJD2AhZkPuXaTH4M NMn5X7azKFGnpyuqSfqNZSlO42sTp5SjLVFteAxEy9/eCG/Oo2Sr05WE1LlSVHJ7liXMvGnjSG4N 0MedJ5qq+BOS3R7fY581qRY27Iy4g/Q9iY/NtBde17MXQRBdJ3NghVdJIgc= -----END CERTIFICATE----- Trustwave Global Certification Authority ======================================== -----BEGIN CERTIFICATE----- MIIF2jCCA8KgAwIBAgIMBfcOhtpJ80Y1LrqyMA0GCSqGSIb3DQEBCwUAMIGIMQswCQYDVQQGEwJV UzERMA8GA1UECAwISWxsaW5vaXMxEDAOBgNVBAcMB0NoaWNhZ28xITAfBgNVBAoMGFRydXN0d2F2 ZSBIb2xkaW5ncywgSW5jLjExMC8GA1UEAwwoVHJ1c3R3YXZlIEdsb2JhbCBDZXJ0aWZpY2F0aW9u IEF1dGhvcml0eTAeFw0xNzA4MjMxOTM0MTJaFw00MjA4MjMxOTM0MTJaMIGIMQswCQYDVQQGEwJV UzERMA8GA1UECAwISWxsaW5vaXMxEDAOBgNVBAcMB0NoaWNhZ28xITAfBgNVBAoMGFRydXN0d2F2 ZSBIb2xkaW5ncywgSW5jLjExMC8GA1UEAwwoVHJ1c3R3YXZlIEdsb2JhbCBDZXJ0aWZpY2F0aW9u IEF1dGhvcml0eTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBALldUShLPDeS0YLOvR29 zd24q88KPuFd5dyqCblXAj7mY2Hf8g+CY66j96xz0XznswuvCAAJWX/NKSqIk4cXGIDtiLK0thAf LdZfVaITXdHG6wZWiYj+rDKd/VzDBcdu7oaJuogDnXIhhpCujwOl3J+IKMujkkkP7NAP4m1ET4Bq stTnoApTAbqOl5F2brz81Ws25kCI1nsvXwXoLG0R8+eyvpJETNKXpP7ScoFDB5zpET71ixpZfR9o WN0EACyW80OzfpgZdNmcc9kYvkHHNHnZ9GLCQ7mzJ7Aiy/k9UscwR7PJPrhq4ufogXBeQotPJqX+ OsIgbrv4Fo7NDKm0G2x2EOFYeUY+VM6AqFcJNykbmROPDMjWLBz7BegIlT1lRtzuzWniTY+HKE40 Cz7PFNm73bZQmq131BnW2hqIyE4bJ3XYsgjxroMwuREOzYfwhI0Vcnyh78zyiGG69Gm7DIwLdVcE uE4qFC49DxweMqZiNu5m4iK4BUBjECLzMx10coos9TkpoNPnG4CELcU9402x/RpvumUHO1jsQkUm +9jaJXLE9gCxInm943xZYkqcBW89zubWR2OZxiRvchLIrH+QtAuRcOi35hYQcRfO3gZPSEF9NUqj ifLJS3tBEW1ntwiYTOURGa5CgNz7kAXU+FDKvuStx8KU1xad5hePrzb7AgMBAAGjQjBAMA8GA1Ud EwEB/wQFMAMBAf8wHQYDVR0OBBYEFJngGWcNYtt2s9o9uFvo/ULSMQ6HMA4GA1UdDwEB/wQEAwIB BjANBgkqhkiG9w0BAQsFAAOCAgEAmHNw4rDT7TnsTGDZqRKGFx6W0OhUKDtkLSGm+J1WE2pIPU/H PinbbViDVD2HfSMF1OQc3Og4ZYbFdada2zUFvXfeuyk3QAUHw5RSn8pk3fEbK9xGChACMf1KaA0H ZJDmHvUqoai7PF35owgLEQzxPy0QlG/+4jSHg9bP5Rs1bdID4bANqKCqRieCNqcVtgimQlRXtpla 4gt5kNdXElE1GYhBaCXUNxeEFfsBctyV3lImIJgm4nb1J2/6ADtKYdkNy1GTKv0WBpanI5ojSP5R vbbEsLFUzt5sQa0WZ37b/TjNuThOssFgy50X31ieemKyJo90lZvkWx3SD92YHJtZuSPTMaCm/zjd zyBP6VhWOmfD0faZmZ26NraAL4hHT4a/RDqA5Dccprrql5gR0IRiR2Qequ5AvzSxnI9O4fKSTx+O 856X3vOmeWqJcU9LJxdI/uz0UA9PSX3MReO9ekDFQdxhVicGaeVyQYHTtgGJoC86cnn+OjC/QezH Yj6RS8fZMXZC+fc8Y+wmjHMMfRod6qh8h6jCJ3zhM0EPz8/8AKAigJ5Kp28AsEFFtyLKaEjFQqKu 3R3y4G5OBVixwJAWKqQ9EEC+j2Jjg6mcgn0tAumDMHzLJ8n9HmYAsC7TIS+OMxZsmO0QqAfWzJPP 29FpHOTKyeC2nOnOcXHebD8WpHk= -----END CERTIFICATE----- Trustwave Global ECC P256 Certification Authority ================================================= -----BEGIN CERTIFICATE----- MIICYDCCAgegAwIBAgIMDWpfCD8oXD5Rld9dMAoGCCqGSM49BAMCMIGRMQswCQYDVQQGEwJVUzER MA8GA1UECBMISWxsaW5vaXMxEDAOBgNVBAcTB0NoaWNhZ28xITAfBgNVBAoTGFRydXN0d2F2ZSBI b2xkaW5ncywgSW5jLjE6MDgGA1UEAxMxVHJ1c3R3YXZlIEdsb2JhbCBFQ0MgUDI1NiBDZXJ0aWZp Y2F0aW9uIEF1dGhvcml0eTAeFw0xNzA4MjMxOTM1MTBaFw00MjA4MjMxOTM1MTBaMIGRMQswCQYD VQQGEwJVUzERMA8GA1UECBMISWxsaW5vaXMxEDAOBgNVBAcTB0NoaWNhZ28xITAfBgNVBAoTGFRy dXN0d2F2ZSBIb2xkaW5ncywgSW5jLjE6MDgGA1UEAxMxVHJ1c3R3YXZlIEdsb2JhbCBFQ0MgUDI1 NiBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTBZMBMGByqGSM49AgEGCCqGSM49AwEHA0IABH77bOYj 43MyCMpg5lOcunSNGLB4kFKA3TjASh3RqMyTpJcGOMoNFWLGjgEqZZ2q3zSRLoHB5DOSMcT9CTqm P62jQzBBMA8GA1UdEwEB/wQFMAMBAf8wDwYDVR0PAQH/BAUDAwcGADAdBgNVHQ4EFgQUo0EGrJBt 0UrrdaVKEJmzsaGLSvcwCgYIKoZIzj0EAwIDRwAwRAIgB+ZU2g6gWrKuEZ+Hxbb/ad4lvvigtwjz RM4q3wghDDcCIC0mA6AFvWvR9lz4ZcyGbbOcNEhjhAnFjXca4syc4XR7 -----END CERTIFICATE----- Trustwave Global ECC P384 Certification Authority ================================================= -----BEGIN CERTIFICATE----- MIICnTCCAiSgAwIBAgIMCL2Fl2yZJ6SAaEc7MAoGCCqGSM49BAMDMIGRMQswCQYDVQQGEwJVUzER MA8GA1UECBMISWxsaW5vaXMxEDAOBgNVBAcTB0NoaWNhZ28xITAfBgNVBAoTGFRydXN0d2F2ZSBI b2xkaW5ncywgSW5jLjE6MDgGA1UEAxMxVHJ1c3R3YXZlIEdsb2JhbCBFQ0MgUDM4NCBDZXJ0aWZp Y2F0aW9uIEF1dGhvcml0eTAeFw0xNzA4MjMxOTM2NDNaFw00MjA4MjMxOTM2NDNaMIGRMQswCQYD VQQGEwJVUzERMA8GA1UECBMISWxsaW5vaXMxEDAOBgNVBAcTB0NoaWNhZ28xITAfBgNVBAoTGFRy dXN0d2F2ZSBIb2xkaW5ncywgSW5jLjE6MDgGA1UEAxMxVHJ1c3R3YXZlIEdsb2JhbCBFQ0MgUDM4 NCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTB2MBAGByqGSM49AgEGBSuBBAAiA2IABGvaDXU1CDFH Ba5FmVXxERMuSvgQMSOjfoPTfygIOiYaOs+Xgh+AtycJj9GOMMQKmw6sWASr9zZ9lCOkmwqKi6vr /TklZvFe/oyujUF5nQlgziip04pt89ZF1PKYhDhloKNDMEEwDwYDVR0TAQH/BAUwAwEB/zAPBgNV HQ8BAf8EBQMDBwYAMB0GA1UdDgQWBBRVqYSJ0sEyvRjLbKYHTsjnnb6CkDAKBggqhkjOPQQDAwNn ADBkAjA3AZKXRRJ+oPM+rRk6ct30UJMDEr5E0k9BpIycnR+j9sKS50gU/k6bpZFXrsY3crsCMGcl CrEMXu6pY5Jv5ZAL/mYiykf9ijH3g/56vxC+GCsej/YpHpRZ744hN8tRmKVuSw== -----END CERTIFICATE----- NAVER Global Root Certification Authority ========================================= -----BEGIN CERTIFICATE----- MIIFojCCA4qgAwIBAgIUAZQwHqIL3fXFMyqxQ0Rx+NZQTQ0wDQYJKoZIhvcNAQEMBQAwaTELMAkG A1UEBhMCS1IxJjAkBgNVBAoMHU5BVkVSIEJVU0lORVNTIFBMQVRGT1JNIENvcnAuMTIwMAYDVQQD DClOQVZFUiBHbG9iYWwgUm9vdCBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTAeFw0xNzA4MTgwODU4 NDJaFw0zNzA4MTgyMzU5NTlaMGkxCzAJBgNVBAYTAktSMSYwJAYDVQQKDB1OQVZFUiBCVVNJTkVT UyBQTEFURk9STSBDb3JwLjEyMDAGA1UEAwwpTkFWRVIgR2xvYmFsIFJvb3QgQ2VydGlmaWNhdGlv biBBdXRob3JpdHkwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC21PGTXLVAiQqrDZBb UGOukJR0F0Vy1ntlWilLp1agS7gvQnXp2XskWjFlqxcX0TM62RHcQDaH38dq6SZeWYp34+hInDEW +j6RscrJo+KfziFTowI2MMtSAuXaMl3Dxeb57hHHi8lEHoSTGEq0n+USZGnQJoViAbbJAh2+g1G7 XNr4rRVqmfeSVPc0W+m/6imBEtRTkZazkVrd/pBzKPswRrXKCAfHcXLJZtM0l/aM9BhK4dA9WkW2 aacp+yPOiNgSnABIqKYPszuSjXEOdMWLyEz59JuOuDxp7W87UC9Y7cSw0BwbagzivESq2M0UXZR4 Yb8ObtoqvC8MC3GmsxY/nOb5zJ9TNeIDoKAYv7vxvvTWjIcNQvcGufFt7QSUqP620wbGQGHfnZ3z VHbOUzoBppJB7ASjjw2i1QnK1sua8e9DXcCrpUHPXFNwcMmIpi3Ua2FzUCaGYQ5fG8Ir4ozVu53B A0K6lNpfqbDKzE0K70dpAy8i+/Eozr9dUGWokG2zdLAIx6yo0es+nPxdGoMuK8u180SdOqcXYZai cdNwlhVNt0xz7hlcxVs+Qf6sdWA7G2POAN3aCJBitOUt7kinaxeZVL6HSuOpXgRM6xBtVNbv8ejy YhbLgGvtPe31HzClrkvJE+2KAQHJuFFYwGY6sWZLxNUxAmLpdIQM201GLQIDAQABo0IwQDAdBgNV HQ4EFgQU0p+I36HNLL3s9TsBAZMzJ7LrYEswDgYDVR0PAQH/BAQDAgEGMA8GA1UdEwEB/wQFMAMB Af8wDQYJKoZIhvcNAQEMBQADggIBADLKgLOdPVQG3dLSLvCkASELZ0jKbY7gyKoNqo0hV4/GPnrK 21HUUrPUloSlWGB/5QuOH/XcChWB5Tu2tyIvCZwTFrFsDDUIbatjcu3cvuzHV+YwIHHW1xDBE1UB jCpD5EHxzzp6U5LOogMFDTjfArsQLtk70pt6wKGm+LUx5vR1yblTmXVHIloUFcd4G7ad6Qz4G3bx hYTeodoS76TiEJd6eN4MUZeoIUCLhr0N8F5OSza7OyAfikJW4Qsav3vQIkMsRIz75Sq0bBwcupTg E34h5prCy8VCZLQelHsIJchxzIdFV4XTnyliIoNRlwAYl3dqmJLJfGBs32x9SuRwTMKeuB330DTH D8z7p/8Dvq1wkNoL3chtl1+afwkyQf3NosxabUzyqkn+Zvjp2DXrDige7kgvOtB5CTh8piKCk5XQ A76+AqAF3SAi428diDRgxuYKuQl1C/AH6GmWNcf7I4GOODm4RStDeKLRLBT/DShycpWbXgnbiUSY qqFJu3FS8r/2/yehNq+4tneI3TqkbZs0kNwUXTC/t+sX5Ie3cdCh13cV1ELX8vMxmV2b3RZtP+oG I/hGoiLtk/bdmuYqh7GYVPEi92tF4+KOdh2ajcQGjTa3FPOdVGm3jjzVpG2Tgbet9r1ke8LJaDmg kpzNNIaRkPpkUZ3+/uul9XXeifdy -----END CERTIFICATE----- AC RAIZ FNMT-RCM SERVIDORES SEGUROS =================================== -----BEGIN CERTIFICATE----- MIICbjCCAfOgAwIBAgIQYvYybOXE42hcG2LdnC6dlTAKBggqhkjOPQQDAzB4MQswCQYDVQQGEwJF UzERMA8GA1UECgwIRk5NVC1SQ00xDjAMBgNVBAsMBUNlcmVzMRgwFgYDVQRhDA9WQVRFUy1RMjgy NjAwNEoxLDAqBgNVBAMMI0FDIFJBSVogRk5NVC1SQ00gU0VSVklET1JFUyBTRUdVUk9TMB4XDTE4 MTIyMDA5MzczM1oXDTQzMTIyMDA5MzczM1oweDELMAkGA1UEBhMCRVMxETAPBgNVBAoMCEZOTVQt UkNNMQ4wDAYDVQQLDAVDZXJlczEYMBYGA1UEYQwPVkFURVMtUTI4MjYwMDRKMSwwKgYDVQQDDCNB QyBSQUlaIEZOTVQtUkNNIFNFUlZJRE9SRVMgU0VHVVJPUzB2MBAGByqGSM49AgEGBSuBBAAiA2IA BPa6V1PIyqvfNkpSIeSX0oNnnvBlUdBeh8dHsVnyV0ebAAKTRBdp20LHsbI6GA60XYyzZl2hNPk2 LEnb80b8s0RpRBNm/dfF/a82Tc4DTQdxz69qBdKiQ1oKUm8BA06Oi6NCMEAwDwYDVR0TAQH/BAUw AwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFAG5L++/EYZg8k/QQW6rcx/n0m5JMAoGCCqG SM49BAMDA2kAMGYCMQCuSuMrQMN0EfKVrRYj3k4MGuZdpSRea0R7/DjiT8ucRRcRTBQnJlU5dUoD zBOQn5ICMQD6SmxgiHPz7riYYqnOK8LZiqZwMR2vsJRM60/G49HzYqc8/5MuB1xJAWdpEgJyv+c= -----END CERTIFICATE----- GlobalSign Root R46 =================== -----BEGIN CERTIFICATE----- MIIFWjCCA0KgAwIBAgISEdK7udcjGJ5AXwqdLdDfJWfRMA0GCSqGSIb3DQEBDAUAMEYxCzAJBgNV BAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMRwwGgYDVQQDExNHbG9iYWxTaWduIFJv b3QgUjQ2MB4XDTE5MDMyMDAwMDAwMFoXDTQ2MDMyMDAwMDAwMFowRjELMAkGA1UEBhMCQkUxGTAX BgNVBAoTEEdsb2JhbFNpZ24gbnYtc2ExHDAaBgNVBAMTE0dsb2JhbFNpZ24gUm9vdCBSNDYwggIi MA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQCsrHQy6LNl5brtQyYdpokNRbopiLKkHWPd08Es CVeJOaFV6Wc0dwxu5FUdUiXSE2te4R2pt32JMl8Nnp8semNgQB+msLZ4j5lUlghYruQGvGIFAha/ r6gjA7aUD7xubMLL1aa7DOn2wQL7Id5m3RerdELv8HQvJfTqa1VbkNud316HCkD7rRlr+/fKYIje 2sGP1q7Vf9Q8g+7XFkyDRTNrJ9CG0Bwta/OrffGFqfUo0q3v84RLHIf8E6M6cqJaESvWJ3En7YEt bWaBkoe0G1h6zD8K+kZPTXhc+CtI4wSEy132tGqzZfxCnlEmIyDLPRT5ge1lFgBPGmSXZgjPjHvj K8Cd+RTyG/FWaha/LIWFzXg4mutCagI0GIMXTpRW+LaCtfOW3T3zvn8gdz57GSNrLNRyc0NXfeD4 12lPFzYE+cCQYDdF3uYM2HSNrpyibXRdQr4G9dlkbgIQrImwTDsHTUB+JMWKmIJ5jqSngiCNI/on ccnfxkF0oE32kRbcRoxfKWMxWXEM2G/CtjJ9++ZdU6Z+Ffy7dXxd7Pj2Fxzsx2sZy/N78CsHpdls eVR2bJ0cpm4O6XkMqCNqo98bMDGfsVR7/mrLZqrcZdCinkqaByFrgY/bxFn63iLABJzjqls2k+g9 vXqhnQt2sQvHnf3PmKgGwvgqo6GDoLclcqUC4wIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAYYwDwYD VR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUA1yrc4GHqMywptWU4jaWSf8FmSwwDQYJKoZIhvcNAQEM BQADggIBAHx47PYCLLtbfpIrXTncvtgdokIzTfnvpCo7RGkerNlFo048p9gkUbJUHJNOxO97k4Vg JuoJSOD1u8fpaNK7ajFxzHmuEajwmf3lH7wvqMxX63bEIaZHU1VNaL8FpO7XJqti2kM3S+LGteWy gxk6x9PbTZ4IevPuzz5i+6zoYMzRx6Fcg0XERczzF2sUyQQCPtIkpnnpHs6i58FZFZ8d4kuaPp92 CC1r2LpXFNqD6v6MVenQTqnMdzGxRBF6XLE+0xRFFRhiJBPSy03OXIPBNvIQtQ6IbbjhVp+J3pZm OUdkLG5NrmJ7v2B0GbhWrJKsFjLtrWhV/pi60zTe9Mlhww6G9kuEYO4Ne7UyWHmRVSyBQ7N0H3qq JZ4d16GLuc1CLgSkZoNNiTW2bKg2SnkheCLQQrzRQDGQob4Ez8pn7fXwgNNgyYMqIgXQBztSvwye qiv5u+YfjyW6hY0XHgL+XVAEV8/+LbzvXMAaq7afJMbfc2hIkCwU9D9SGuTSyxTDYWnP4vkYxboz nxSjBF25cfe1lNj2M8FawTSLfJvdkzrnE6JwYZ+vj+vYxXX4M2bUdGc6N3ec592kD3ZDZopD8p/7 DEJ4Y9HiD2971KE9dJeFt0g5QdYg/NA6s/rob8SKunE3vouXsXgxT7PntgMTzlSdriVZzH81Xwj3 QEUxeCp6 -----END CERTIFICATE----- GlobalSign Root E46 =================== -----BEGIN CERTIFICATE----- MIICCzCCAZGgAwIBAgISEdK7ujNu1LzmJGjFDYQdmOhDMAoGCCqGSM49BAMDMEYxCzAJBgNVBAYT AkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMRwwGgYDVQQDExNHbG9iYWxTaWduIFJvb3Qg RTQ2MB4XDTE5MDMyMDAwMDAwMFoXDTQ2MDMyMDAwMDAwMFowRjELMAkGA1UEBhMCQkUxGTAXBgNV BAoTEEdsb2JhbFNpZ24gbnYtc2ExHDAaBgNVBAMTE0dsb2JhbFNpZ24gUm9vdCBFNDYwdjAQBgcq hkjOPQIBBgUrgQQAIgNiAAScDrHPt+ieUnd1NPqlRqetMhkytAepJ8qUuwzSChDH2omwlwxwEwkB jtjqR+q+soArzfwoDdusvKSGN+1wCAB16pMLey5SnCNoIwZD7JIvU4Tb+0cUB+hflGddyXqBPCCj QjBAMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBQxCpCPtsad0kRL gLWi5h+xEk8blTAKBggqhkjOPQQDAwNoADBlAjEA31SQ7Zvvi5QCkxeCmb6zniz2C5GMn0oUsfZk vLtoURMMA/cVi4RguYv/Uo7njLwcAjA8+RHUjE7AwWHCFUyqqx0LMV87HOIAl0Qx5v5zli/altP+ CAezNIm8BZ/3Hobui3A= -----END CERTIFICATE----- GLOBALTRUST 2020 ================ -----BEGIN CERTIFICATE----- MIIFgjCCA2qgAwIBAgILWku9WvtPilv6ZeUwDQYJKoZIhvcNAQELBQAwTTELMAkGA1UEBhMCQVQx IzAhBgNVBAoTGmUtY29tbWVyY2UgbW9uaXRvcmluZyBHbWJIMRkwFwYDVQQDExBHTE9CQUxUUlVT VCAyMDIwMB4XDTIwMDIxMDAwMDAwMFoXDTQwMDYxMDAwMDAwMFowTTELMAkGA1UEBhMCQVQxIzAh BgNVBAoTGmUtY29tbWVyY2UgbW9uaXRvcmluZyBHbWJIMRkwFwYDVQQDExBHTE9CQUxUUlVTVCAy MDIwMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAri5WrRsc7/aVj6B3GyvTY4+ETUWi D59bRatZe1E0+eyLinjF3WuvvcTfk0Uev5E4C64OFudBc/jbu9G4UeDLgztzOG53ig9ZYybNpyrO VPu44sB8R85gfD+yc/LAGbaKkoc1DZAoouQVBGM+uq/ufF7MpotQsjj3QWPKzv9pj2gOlTblzLmM CcpL3TGQlsjMH/1WljTbjhzqLL6FLmPdqqmV0/0plRPwyJiT2S0WR5ARg6I6IqIoV6Lr/sCMKKCm fecqQjuCgGOlYx8ZzHyyZqjC0203b+J+BlHZRYQfEs4kUmSFC0iAToexIiIwquuuvuAC4EDosEKA A1GqtH6qRNdDYfOiaxaJSaSjpCuKAsR49GiKweR6NrFvG5Ybd0mN1MkGco/PU+PcF4UgStyYJ9OR JitHHmkHr96i5OTUawuzXnzUJIBHKWk7buis/UDr2O1xcSvy6Fgd60GXIsUf1DnQJ4+H4xj04KlG DfV0OoIu0G4skaMxXDtG6nsEEFZegB31pWXogvziB4xiRfUg3kZwhqG8k9MedKZssCz3AwyIDMvU clOGvGBG85hqwvG/Q/lwIHfKN0F5VVJjjVsSn8VoxIidrPIwq7ejMZdnrY8XD2zHc+0klGvIg5rQ mjdJBKuxFshsSUktq6HQjJLyQUp5ISXbY9e2nKd+Qmn7OmMCAwEAAaNjMGEwDwYDVR0TAQH/BAUw AwEB/zAOBgNVHQ8BAf8EBAMCAQYwHQYDVR0OBBYEFNwuH9FhN3nkq9XVsxJxaD1qaJwiMB8GA1Ud IwQYMBaAFNwuH9FhN3nkq9XVsxJxaD1qaJwiMA0GCSqGSIb3DQEBCwUAA4ICAQCR8EICaEDuw2jA VC/f7GLDw56KoDEoqoOOpFaWEhCGVrqXctJUMHytGdUdaG/7FELYjQ7ztdGl4wJCXtzoRlgHNQIw 4Lx0SsFDKv/bGtCwr2zD/cuz9X9tAy5ZVp0tLTWMstZDFyySCstd6IwPS3BD0IL/qMy/pJTAvoe9 iuOTe8aPmxadJ2W8esVCgmxcB9CpwYhgROmYhRZf+I/KARDOJcP5YBugxZfD0yyIMaK9MOzQ0MAS 8cE54+X1+NZK3TTN+2/BT+MAi1bikvcoskJ3ciNnxz8RFbLEAwW+uxF7Cr+obuf/WEPPm2eggAe2 HcqtbepBEX4tdJP7wry+UUTF72glJ4DjyKDUEuzZpTcdN3y0kcra1LGWge9oXHYQSa9+pTeAsRxS vTOBTI/53WXZFM2KJVj04sWDpQmQ1GwUY7VA3+vA/MRYfg0UFodUJ25W5HCEuGwyEn6CMUO+1918 oa2u1qsgEu8KwxCMSZY13At1XrFP1U80DhEgB3VDRemjEdqso5nCtnkn4rnvyOL2NSl6dPrFf4IF YqYK6miyeUcGbvJXqBUzxvd4Sj1Ce2t+/vdG6tHrju+IaFvowdlxfv1k7/9nR4hYJS8+hge9+6jl gqispdNpQ80xiEmEU5LAsTkbOYMBMMTyqfrQA71yN2BWHzZ8vTmR9W0Nv3vXkg== -----END CERTIFICATE----- ANF Secure Server Root CA ========================= -----BEGIN CERTIFICATE----- MIIF7zCCA9egAwIBAgIIDdPjvGz5a7EwDQYJKoZIhvcNAQELBQAwgYQxEjAQBgNVBAUTCUc2MzI4 NzUxMDELMAkGA1UEBhMCRVMxJzAlBgNVBAoTHkFORiBBdXRvcmlkYWQgZGUgQ2VydGlmaWNhY2lv bjEUMBIGA1UECxMLQU5GIENBIFJhaXoxIjAgBgNVBAMTGUFORiBTZWN1cmUgU2VydmVyIFJvb3Qg Q0EwHhcNMTkwOTA0MTAwMDM4WhcNMzkwODMwMTAwMDM4WjCBhDESMBAGA1UEBRMJRzYzMjg3NTEw MQswCQYDVQQGEwJFUzEnMCUGA1UEChMeQU5GIEF1dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uMRQw EgYDVQQLEwtBTkYgQ0EgUmFpejEiMCAGA1UEAxMZQU5GIFNlY3VyZSBTZXJ2ZXIgUm9vdCBDQTCC AiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBANvrayvmZFSVgpCjcqQZAZ2cC4Ffc0m6p6zz BE57lgvsEeBbphzOG9INgxwruJ4dfkUyYA8H6XdYfp9qyGFOtibBTI3/TO80sh9l2Ll49a2pcbnv T1gdpd50IJeh7WhM3pIXS7yr/2WanvtH2Vdy8wmhrnZEE26cLUQ5vPnHO6RYPUG9tMJJo8gN0pcv B2VSAKduyK9o7PQUlrZXH1bDOZ8rbeTzPvY1ZNoMHKGESy9LS+IsJJ1tk0DrtSOOMspvRdOoiXse zx76W0OLzc2oD2rKDF65nkeP8Nm2CgtYZRczuSPkdxl9y0oukntPLxB3sY0vaJxizOBQ+OyRp1RM VwnVdmPF6GUe7m1qzwmd+nxPrWAI/VaZDxUse6mAq4xhj0oHdkLePfTdsiQzW7i1o0TJrH93PB0j 7IKppuLIBkwC/qxcmZkLLxCKpvR/1Yd0DVlJRfbwcVw5Kda/SiOL9V8BY9KHcyi1Swr1+KuCLH5z JTIdC2MKF4EA/7Z2Xue0sUDKIbvVgFHlSFJnLNJhiQcND85Cd8BEc5xEUKDbEAotlRyBr+Qc5RQe 8TZBAQIvfXOn3kLMTOmJDVb3n5HUA8ZsyY/b2BzgQJhdZpmYgG4t/wHFzstGH6wCxkPmrqKEPMVO Hj1tyRRM4y5Bu8o5vzY8KhmqQYdOpc5LMnndkEl/AgMBAAGjYzBhMB8GA1UdIwQYMBaAFJxf0Gxj o1+TypOYCK2Mh6UsXME3MB0GA1UdDgQWBBScX9BsY6Nfk8qTmAitjIelLFzBNzAOBgNVHQ8BAf8E BAMCAYYwDwYDVR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAgEATh65isagmD9uw2nAalxJ UqzLK114OMHVVISfk/CHGT0sZonrDUL8zPB1hT+L9IBdeeUXZ701guLyPI59WzbLWoAAKfLOKyzx j6ptBZNscsdW699QIyjlRRA96Gejrw5VD5AJYu9LWaL2U/HANeQvwSS9eS9OICI7/RogsKQOLHDt dD+4E5UGUcjohybKpFtqFiGS3XNgnhAY3jyB6ugYw3yJ8otQPr0R4hUDqDZ9MwFsSBXXiJCZBMXM 5gf0vPSQ7RPi6ovDj6MzD8EpTBNO2hVWcXNyglD2mjN8orGoGjR0ZVzO0eurU+AagNjqOknkJjCb 5RyKqKkVMoaZkgoQI1YS4PbOTOK7vtuNknMBZi9iPrJyJ0U27U1W45eZ/zo1PqVUSlJZS2Db7v54 EX9K3BR5YLZrZAPbFYPhor72I5dQ8AkzNqdxliXzuUJ92zg/LFis6ELhDtjTO0wugumDLmsx2d1H hk9tl5EuT+IocTUW0fJz/iUrB0ckYyfI+PbZa/wSMVYIwFNCr5zQM378BvAxRAMU8Vjq8moNqRGy g77FGr8H6lnco4g175x2MjxNBiLOFeXdntiP2t7SxDnlF4HPOEfrf4htWRvfn0IUrn7PqLBmZdo3 r5+qPeoott7VMVgWglvquxl1AnMaykgaIZOQCo6ThKd9OyMYkomgjaw= -----END CERTIFICATE----- Certum EC-384 CA ================ -----BEGIN CERTIFICATE----- MIICZTCCAeugAwIBAgIQeI8nXIESUiClBNAt3bpz9DAKBggqhkjOPQQDAzB0MQswCQYDVQQGEwJQ TDEhMB8GA1UEChMYQXNzZWNvIERhdGEgU3lzdGVtcyBTLkEuMScwJQYDVQQLEx5DZXJ0dW0gQ2Vy dGlmaWNhdGlvbiBBdXRob3JpdHkxGTAXBgNVBAMTEENlcnR1bSBFQy0zODQgQ0EwHhcNMTgwMzI2 MDcyNDU0WhcNNDMwMzI2MDcyNDU0WjB0MQswCQYDVQQGEwJQTDEhMB8GA1UEChMYQXNzZWNvIERh dGEgU3lzdGVtcyBTLkEuMScwJQYDVQQLEx5DZXJ0dW0gQ2VydGlmaWNhdGlvbiBBdXRob3JpdHkx GTAXBgNVBAMTEENlcnR1bSBFQy0zODQgQ0EwdjAQBgcqhkjOPQIBBgUrgQQAIgNiAATEKI6rGFtq vm5kN2PkzeyrOvfMobgOgknXhimfoZTy42B4mIF4Bk3y7JoOV2CDn7TmFy8as10CW4kjPMIRBSqn iBMY81CE1700LCeJVf/OTOffph8oxPBUw7l8t1Ot68KjQjBAMA8GA1UdEwEB/wQFMAMBAf8wHQYD VR0OBBYEFI0GZnQkdjrzife81r1HfS+8EF9LMA4GA1UdDwEB/wQEAwIBBjAKBggqhkjOPQQDAwNo ADBlAjADVS2m5hjEfO/JUG7BJw+ch69u1RsIGL2SKcHvlJF40jocVYli5RsJHrpka/F2tNQCMQC0 QoSZ/6vnnvuRlydd3LBbMHHOXjgaatkl5+r3YZJW+OraNsKHZZYuciUvf9/DE8k= -----END CERTIFICATE----- Certum Trusted Root CA ====================== -----BEGIN CERTIFICATE----- MIIFwDCCA6igAwIBAgIQHr9ZULjJgDdMBvfrVU+17TANBgkqhkiG9w0BAQ0FADB6MQswCQYDVQQG EwJQTDEhMB8GA1UEChMYQXNzZWNvIERhdGEgU3lzdGVtcyBTLkEuMScwJQYDVQQLEx5DZXJ0dW0g Q2VydGlmaWNhdGlvbiBBdXRob3JpdHkxHzAdBgNVBAMTFkNlcnR1bSBUcnVzdGVkIFJvb3QgQ0Ew HhcNMTgwMzE2MTIxMDEzWhcNNDMwMzE2MTIxMDEzWjB6MQswCQYDVQQGEwJQTDEhMB8GA1UEChMY QXNzZWNvIERhdGEgU3lzdGVtcyBTLkEuMScwJQYDVQQLEx5DZXJ0dW0gQ2VydGlmaWNhdGlvbiBB dXRob3JpdHkxHzAdBgNVBAMTFkNlcnR1bSBUcnVzdGVkIFJvb3QgQ0EwggIiMA0GCSqGSIb3DQEB AQUAA4ICDwAwggIKAoICAQDRLY67tzbqbTeRn06TpwXkKQMlzhyC93yZn0EGze2jusDbCSzBfN8p fktlL5On1AFrAygYo9idBcEq2EXxkd7fO9CAAozPOA/qp1x4EaTByIVcJdPTsuclzxFUl6s1wB52 HO8AU5853BSlLCIls3Jy/I2z5T4IHhQqNwuIPMqw9MjCoa68wb4pZ1Xi/K1ZXP69VyywkI3C7Te2 fJmItdUDmj0VDT06qKhF8JVOJVkdzZhpu9PMMsmN74H+rX2Ju7pgE8pllWeg8xn2A1bUatMn4qGt g/BKEiJ3HAVz4hlxQsDsdUaakFjgao4rpUYwBI4Zshfjvqm6f1bxJAPXsiEodg42MEx51UGamqi4 NboMOvJEGyCI98Ul1z3G4z5D3Yf+xOr1Uz5MZf87Sst4WmsXXw3Hw09Omiqi7VdNIuJGmj8PkTQk fVXjjJU30xrwCSss0smNtA0Aq2cpKNgB9RkEth2+dv5yXMSFytKAQd8FqKPVhJBPC/PgP5sZ0jeJ P/J7UhyM9uH3PAeXjA6iWYEMspA90+NZRu0PqafegGtaqge2Gcu8V/OXIXoMsSt0Puvap2ctTMSY njYJdmZm/Bo/6khUHL4wvYBQv3y1zgD2DGHZ5yQD4OMBgQ692IU0iL2yNqh7XAjlRICMb/gv1SHK HRzQ+8S1h9E6Tsd2tTVItQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBSM+xx1 vALTn04uSNn5YFSqxLNP+jAOBgNVHQ8BAf8EBAMCAQYwDQYJKoZIhvcNAQENBQADggIBAEii1QAL LtA/vBzVtVRJHlpr9OTy4EA34MwUe7nJ+jW1dReTagVphZzNTxl4WxmB82M+w85bj/UvXgF2Ez8s ALnNllI5SW0ETsXpD4YN4fqzX4IS8TrOZgYkNCvozMrnadyHncI013nR03e4qllY/p0m+jiGPp2K h2RX5Rc64vmNueMzeMGQ2Ljdt4NR5MTMI9UGfOZR0800McD2RrsLrfw9EAUqO0qRJe6M1ISHgCq8 CYyqOhNf6DR5UMEQGfnTKB7U0VEwKbOukGfWHwpjscWpxkIxYxeU72nLL/qMFH3EQxiJ2fAyQOaA 4kZf5ePBAFmo+eggvIksDkc0C+pXwlM2/KfUrzHN/gLldfq5Jwn58/U7yn2fqSLLiMmq0Uc9Nneo WWRrJ8/vJ8HjJLWG965+Mk2weWjROeiQWMODvA8s1pfrzgzhIMfatz7DP78v3DSk+yshzWePS/Tj 6tQ/50+6uaWTRRxmHyH6ZF5v4HaUMst19W7l9o/HuKTMqJZ9ZPskWkoDbGs4xugDQ5r3V7mzKWmT OPQD8rv7gmsHINFSH5pkAnuYZttcTVoP0ISVoDwUQwbKytu4QTbaakRnh6+v40URFWkIsr4WOZck bxJF0WddCajJFdr60qZfE2Efv4WstK2tBZQIgx51F9NxO5NQI1mg7TyRVJ12AMXDuDjb -----END CERTIFICATE----- TunTrust Root CA ================ -----BEGIN CERTIFICATE----- MIIFszCCA5ugAwIBAgIUEwLV4kBMkkaGFmddtLu7sms+/BMwDQYJKoZIhvcNAQELBQAwYTELMAkG A1UEBhMCVE4xNzA1BgNVBAoMLkFnZW5jZSBOYXRpb25hbGUgZGUgQ2VydGlmaWNhdGlvbiBFbGVj dHJvbmlxdWUxGTAXBgNVBAMMEFR1blRydXN0IFJvb3QgQ0EwHhcNMTkwNDI2MDg1NzU2WhcNNDQw NDI2MDg1NzU2WjBhMQswCQYDVQQGEwJUTjE3MDUGA1UECgwuQWdlbmNlIE5hdGlvbmFsZSBkZSBD ZXJ0aWZpY2F0aW9uIEVsZWN0cm9uaXF1ZTEZMBcGA1UEAwwQVHVuVHJ1c3QgUm9vdCBDQTCCAiIw DQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAMPN0/y9BFPdDCA61YguBUtB9YOCfvdZn56eY+hz 2vYGqU8ftPkLHzmMmiDQfgbU7DTZhrx1W4eI8NLZ1KMKsmwb60ksPqxd2JQDoOw05TDENX37Jk0b bjBU2PWARZw5rZzJJQRNmpA+TkBuimvNKWfGzC3gdOgFVwpIUPp6Q9p+7FuaDmJ2/uqdHYVy7BG7 NegfJ7/Boce7SBbdVtfMTqDhuazb1YMZGoXRlJfXyqNlC/M4+QKu3fZnz8k/9YosRxqZbwUN/dAd gjH8KcwAWJeRTIAAHDOFli/LQcKLEITDCSSJH7UP2dl3RxiSlGBcx5kDPP73lad9UKGAwqmDrViW VSHbhlnUr8a83YFuB9tgYv7sEG7aaAH0gxupPqJbI9dkxt/con3YS7qC0lH4Zr8GRuR5KiY2eY8f Tpkdso8MDhz/yV3A/ZAQprE38806JG60hZC/gLkMjNWb1sjxVj8agIl6qeIbMlEsPvLfe/ZdeikZ juXIvTZxi11Mwh0/rViizz1wTaZQmCXcI/m4WEEIcb9PuISgjwBUFfyRbVinljvrS5YnzWuioYas DXxU5mZMZl+QviGaAkYt5IPCgLnPSz7ofzwB7I9ezX/SKEIBlYrilz0QIX32nRzFNKHsLA4KUiwS VXAkPcvCFDVDXSdOvsC9qnyW5/yeYa1E0wCXAgMBAAGjYzBhMB0GA1UdDgQWBBQGmpsfU33x9aTI 04Y+oXNZtPdEITAPBgNVHRMBAf8EBTADAQH/MB8GA1UdIwQYMBaAFAaamx9TffH1pMjThj6hc1m0 90QhMA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsFAAOCAgEAqgVutt0Vyb+zxiD2BkewhpMl 0425yAA/l/VSJ4hxyXT968pk21vvHl26v9Hr7lxpuhbI87mP0zYuQEkHDVneixCwSQXi/5E/S7fd Ao74gShczNxtr18UnH1YeA32gAm56Q6XKRm4t+v4FstVEuTGfbvE7Pi1HE4+Z7/FXxttbUcoqgRY YdZ2vyJ/0Adqp2RT8JeNnYA/u8EH22Wv5psymsNUk8QcCMNE+3tjEUPRahphanltkE8pjkcFwRJp adbGNjHh/PqAulxPxOu3Mqz4dWEX1xAZufHSCe96Qp1bWgvUxpVOKs7/B9dPfhgGiPEZtdmYu65x xBzndFlY7wyJz4sfdZMaBBSSSFCp61cpABbjNhzI+L/wM9VBD8TMPN3pM0MBkRArHtG5Xc0yGYuP jCB31yLEQtyEFpslbei0VXF/sHyz03FJuc9SpAQ/3D2gu68zngowYI7bnV2UqL1g52KAdoGDDIzM MEZJ4gzSqK/rYXHv5yJiqfdcZGyfFoxnNidF9Ql7v/YQCvGwjVRDjAS6oz/v4jXH+XTgbzRB0L9z ZVcg+ZtnemZoJE6AZb0QmQZZ8mWvuMZHu/2QeItBcy6vVR/cO5JyboTT0GFMDcx2V+IthSIVNg3r AZ3r2OvEhJn7wAzMMujjd9qDRIueVSjAi1jTkD5OGwDxFa2DK5o= -----END CERTIFICATE----- HARICA TLS RSA Root CA 2021 =========================== -----BEGIN CERTIFICATE----- MIIFpDCCA4ygAwIBAgIQOcqTHO9D88aOk8f0ZIk4fjANBgkqhkiG9w0BAQsFADBsMQswCQYDVQQG EwJHUjE3MDUGA1UECgwuSGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJlc2VhcmNoIEluc3RpdHV0aW9u cyBDQTEkMCIGA1UEAwwbSEFSSUNBIFRMUyBSU0EgUm9vdCBDQSAyMDIxMB4XDTIxMDIxOTEwNTUz OFoXDTQ1MDIxMzEwNTUzN1owbDELMAkGA1UEBhMCR1IxNzA1BgNVBAoMLkhlbGxlbmljIEFjYWRl bWljIGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgQ0ExJDAiBgNVBAMMG0hBUklDQSBUTFMgUlNB IFJvb3QgQ0EgMjAyMTCCAiIwDQYJKoZIhvcNAQEBBQADggIPADCCAgoCggIBAIvC569lmwVnlskN JLnQDmT8zuIkGCyEf3dRywQRNrhe7Wlxp57kJQmXZ8FHws+RFjZiPTgE4VGC/6zStGndLuwRo0Xu a2s7TL+MjaQenRG56Tj5eg4MmOIjHdFOY9TnuEFE+2uva9of08WRiFukiZLRgeaMOVig1mlDqa2Y Ulhu2wr7a89o+uOkXjpFc5gH6l8Cct4MpbOfrqkdtx2z/IpZ525yZa31MJQjB/OCFks1mJxTuy/K 5FrZx40d/JiZ+yykgmvwKh+OC19xXFyuQnspiYHLA6OZyoieC0AJQTPb5lh6/a6ZcMBaD9YThnEv dmn8kN3bLW7R8pv1GmuebxWMevBLKKAiOIAkbDakO/IwkfN4E8/BPzWr8R0RI7VDIp4BkrcYAuUR 0YLbFQDMYTfBKnya4dC6s1BG7oKsnTH4+yPiAwBIcKMJJnkVU2DzOFytOOqBAGMUuTNe3QvboEUH GjMJ+E20pwKmafTCWQWIZYVWrkvL4N48fS0ayOn7H6NhStYqE613TBoYm5EPWNgGVMWX+Ko/IIqm haZ39qb8HOLubpQzKoNQhArlT4b4UEV4AIHrW2jjJo3Me1xR9BQsQL4aYB16cmEdH2MtiKrOokWQ CPxrvrNQKlr9qEgYRtaQQJKQCoReaDH46+0N0x3GfZkYVVYnZS6NRcUk7M7jAgMBAAGjQjBAMA8G A1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFApII6ZgpJIKM+qTW8VX6iVNvRLuMA4GA1UdDwEB/wQE AwIBhjANBgkqhkiG9w0BAQsFAAOCAgEAPpBIqm5iFSVmewzVjIuJndftTgfvnNAUX15QvWiWkKQU EapobQk1OUAJ2vQJLDSle1mESSmXdMgHHkdt8s4cUCbjnj1AUz/3f5Z2EMVGpdAgS1D0NTsY9FVq QRtHBmg8uwkIYtlfVUKqrFOFrJVWNlar5AWMxajaH6NpvVMPxP/cyuN+8kyIhkdGGvMA9YCRotxD QpSbIPDRzbLrLFPCU3hKTwSUQZqPJzLB5UkZv/HywouoCjkxKLR9YjYsTewfM7Z+d21+UPCfDtcR j88YxeMn/ibvBZ3PzzfF0HvaO7AWhAw6k9a+F9sPPg4ZeAnHqQJyIkv3N3a6dcSFA1pj1bF1BcK5 vZStjBWZp5N99sXzqnTPBIWUmAD04vnKJGW/4GKvyMX6ssmeVkjaef2WdhW+o45WxLM0/L5H9MG0 qPzVMIho7suuyWPEdr6sOBjhXlzPrjoiUevRi7PzKzMHVIf6tLITe7pTBGIBnfHAT+7hOtSLIBD6 Alfm78ELt5BGnBkpjNxvoEppaZS3JGWg/6w/zgH7IS79aPib8qXPMThcFarmlwDB31qlpzmq6YR/ PFGoOtmUW4y/Twhx5duoXNTSpv4Ao8YWxw/ogM4cKGR0GQjTQuPOAF1/sdwTsOEFy9EgqoZ0njnn kf3/W9b3raYvAwtt41dU63ZTGI0RmLo= -----END CERTIFICATE----- HARICA TLS ECC Root CA 2021 =========================== -----BEGIN CERTIFICATE----- MIICVDCCAdugAwIBAgIQZ3SdjXfYO2rbIvT/WeK/zjAKBggqhkjOPQQDAzBsMQswCQYDVQQGEwJH UjE3MDUGA1UECgwuSGVsbGVuaWMgQWNhZGVtaWMgYW5kIFJlc2VhcmNoIEluc3RpdHV0aW9ucyBD QTEkMCIGA1UEAwwbSEFSSUNBIFRMUyBFQ0MgUm9vdCBDQSAyMDIxMB4XDTIxMDIxOTExMDExMFoX DTQ1MDIxMzExMDEwOVowbDELMAkGA1UEBhMCR1IxNzA1BgNVBAoMLkhlbGxlbmljIEFjYWRlbWlj IGFuZCBSZXNlYXJjaCBJbnN0aXR1dGlvbnMgQ0ExJDAiBgNVBAMMG0hBUklDQSBUTFMgRUNDIFJv b3QgQ0EgMjAyMTB2MBAGByqGSM49AgEGBSuBBAAiA2IABDgI/rGgltJ6rK9JOtDA4MM7KKrxcm1l AEeIhPyaJmuqS7psBAqIXhfyVYf8MLA04jRYVxqEU+kw2anylnTDUR9YSTHMmE5gEYd103KUkE+b ECUqqHgtvpBBWJAVcqeht6NCMEAwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUyRtTgRL+BNUW 0aq8mm+3oJUZbsowDgYDVR0PAQH/BAQDAgGGMAoGCCqGSM49BAMDA2cAMGQCMBHervjcToiwqfAi rcJRQO9gcS3ujwLEXQNwSaSS6sUUiHCm0w2wqsosQJz76YJumgIwK0eaB8bRwoF8yguWGEEbo/Qw CZ61IygNnxS2PFOiTAZpffpskcYqSUXm7LcT4Tps -----END CERTIFICATE----- Autoridad de Certificacion Firmaprofesional CIF A62634068 ========================================================= -----BEGIN CERTIFICATE----- MIIGFDCCA/ygAwIBAgIIG3Dp0v+ubHEwDQYJKoZIhvcNAQELBQAwUTELMAkGA1UEBhMCRVMxQjBA BgNVBAMMOUF1dG9yaWRhZCBkZSBDZXJ0aWZpY2FjaW9uIEZpcm1hcHJvZmVzaW9uYWwgQ0lGIEE2 MjYzNDA2ODAeFw0xNDA5MjMxNTIyMDdaFw0zNjA1MDUxNTIyMDdaMFExCzAJBgNVBAYTAkVTMUIw QAYDVQQDDDlBdXRvcmlkYWQgZGUgQ2VydGlmaWNhY2lvbiBGaXJtYXByb2Zlc2lvbmFsIENJRiBB NjI2MzQwNjgwggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDKlmuO6vj78aI14H9M2uDD Utd9thDIAl6zQyrET2qyyhxdKJp4ERppWVevtSBC5IsP5t9bpgOSL/UR5GLXMnE42QQMcas9UX4P B99jBVzpv5RvwSmCwLTaUbDBPLutN0pcyvFLNg4kq7/DhHf9qFD0sefGL9ItWY16Ck6WaVICqjaY 7Pz6FIMMNx/Jkjd/14Et5cS54D40/mf0PmbR0/RAz15iNA9wBj4gGFrO93IbJWyTdBSTo3OxDqqH ECNZXyAFGUftaI6SEspd/NYrspI8IM/hX68gvqB2f3bl7BqGYTM+53u0P6APjqK5am+5hyZvQWyI plD9amML9ZMWGxmPsu2bm8mQ9QEM3xk9Dz44I8kvjwzRAv4bVdZO0I08r0+k8/6vKtMFnXkIoctX MbScyJCyZ/QYFpM6/EfY0XiWMR+6KwxfXZmtY4laJCB22N/9q06mIqqdXuYnin1oKaPnirjaEbsX LZmdEyRG98Xi2J+Of8ePdG1asuhy9azuJBCtLxTa/y2aRnFHvkLfuwHb9H/TKI8xWVvTyQKmtFLK bpf7Q8UIJm+K9Lv9nyiqDdVF8xM6HdjAeI9BZzwelGSuewvF6NkBiDkal4ZkQdU7hwxu+g/GvUgU vzlN1J5Bto+WHWOWk9mVBngxaJ43BjuAiUVhOSPHG0SjFeUc+JIwuwIDAQABo4HvMIHsMB0GA1Ud DgQWBBRlzeurNR4APn7VdMActHNHDhpkLzASBgNVHRMBAf8ECDAGAQH/AgEBMIGmBgNVHSAEgZ4w gZswgZgGBFUdIAAwgY8wLwYIKwYBBQUHAgEWI2h0dHA6Ly93d3cuZmlybWFwcm9mZXNpb25hbC5j b20vY3BzMFwGCCsGAQUFBwICMFAeTgBQAGEAcwBlAG8AIABkAGUAIABsAGEAIABCAG8AbgBhAG4A bwB2AGEAIAA0ADcAIABCAGEAcgBjAGUAbABvAG4AYQAgADAAOAAwADEANzAOBgNVHQ8BAf8EBAMC AQYwDQYJKoZIhvcNAQELBQADggIBAHSHKAIrdx9miWTtj3QuRhy7qPj4Cx2Dtjqn6EWKB7fgPiDL 4QjbEwj4KKE1soCzC1HA01aajTNFSa9J8OA9B3pFE1r/yJfY0xgsfZb43aJlQ3CTkBW6kN/oGbDb LIpgD7dvlAceHabJhfa9NPhAeGIQcDq+fUs5gakQ1JZBu/hfHAsdCPKxsIl68veg4MSPi3i1O1il I45PVf42O+AMt8oqMEEgtIDNrvx2ZnOorm7hfNoD6JQg5iKj0B+QXSBTFCZX2lSX3xZEEAEeiGaP cjiT3SC3NL7X8e5jjkd5KAb881lFJWAiMxujX6i6KtoaPc1A6ozuBRWV1aUsIC+nmCjuRfzxuIgA LI9C2lHVnOUTaHFFQ4ueCyE8S1wF3BqfmI7avSKecs2tCsvMo2ebKHTEm9caPARYpoKdrcd7b/+A lun4jWq9GJAd/0kakFI3ky88Al2CdgtR5xbHV/g4+afNmyJU72OwFW1TZQNKXkqgsqeOSQBZONXH 9IBk9W6VULgRfhVwOEqwf9DEMnDAGf/JOC0ULGb0QkTmVXYbgBVX/8Cnp6o5qtjTcNAuuuuUavpf NIbnYrX9ivAwhZTJryQCL2/W3Wf+47BVTwSYT6RBVuKT0Gro1vP7ZeDOdcQxWQzugsgMYDNKGbqE ZycPvEJdvSRUDewdcAZfpLz6IHxV -----END CERTIFICATE----- vTrus ECC Root CA ================= -----BEGIN CERTIFICATE----- MIICDzCCAZWgAwIBAgIUbmq8WapTvpg5Z6LSa6Q75m0c1towCgYIKoZIzj0EAwMwRzELMAkGA1UE BhMCQ04xHDAaBgNVBAoTE2lUcnVzQ2hpbmEgQ28uLEx0ZC4xGjAYBgNVBAMTEXZUcnVzIEVDQyBS b290IENBMB4XDTE4MDczMTA3MjY0NFoXDTQzMDczMTA3MjY0NFowRzELMAkGA1UEBhMCQ04xHDAa BgNVBAoTE2lUcnVzQ2hpbmEgQ28uLEx0ZC4xGjAYBgNVBAMTEXZUcnVzIEVDQyBSb290IENBMHYw EAYHKoZIzj0CAQYFK4EEACIDYgAEZVBKrox5lkqqHAjDo6LN/llWQXf9JpRCux3NCNtzslt188+c ToL0v/hhJoVs1oVbcnDS/dtitN9Ti72xRFhiQgnH+n9bEOf+QP3A2MMrMudwpremIFUde4BdS49n TPEQo0IwQDAdBgNVHQ4EFgQUmDnNvtiyjPeyq+GtJK97fKHbH88wDwYDVR0TAQH/BAUwAwEB/zAO BgNVHQ8BAf8EBAMCAQYwCgYIKoZIzj0EAwMDaAAwZQIwV53dVvHH4+m4SVBrm2nDb+zDfSXkV5UT QJtS0zvzQBm8JsctBp61ezaf9SXUY2sAAjEA6dPGnlaaKsyh2j/IZivTWJwghfqrkYpwcBE4YGQL YgmRWAD5Tfs0aNoJrSEGGJTO -----END CERTIFICATE----- vTrus Root CA ============= -----BEGIN CERTIFICATE----- MIIFVjCCAz6gAwIBAgIUQ+NxE9izWRRdt86M/TX9b7wFjUUwDQYJKoZIhvcNAQELBQAwQzELMAkG A1UEBhMCQ04xHDAaBgNVBAoTE2lUcnVzQ2hpbmEgQ28uLEx0ZC4xFjAUBgNVBAMTDXZUcnVzIFJv b3QgQ0EwHhcNMTgwNzMxMDcyNDA1WhcNNDMwNzMxMDcyNDA1WjBDMQswCQYDVQQGEwJDTjEcMBoG A1UEChMTaVRydXNDaGluYSBDby4sTHRkLjEWMBQGA1UEAxMNdlRydXMgUm9vdCBDQTCCAiIwDQYJ KoZIhvcNAQEBBQADggIPADCCAgoCggIBAL1VfGHTuB0EYgWgrmy3cLRB6ksDXhA/kFocizuwZots SKYcIrrVQJLuM7IjWcmOvFjai57QGfIvWcaMY1q6n6MLsLOaXLoRuBLpDLvPbmyAhykUAyyNJJrI ZIO1aqwTLDPxn9wsYTwaP3BVm60AUn/PBLn+NvqcwBauYv6WTEN+VRS+GrPSbcKvdmaVayqwlHeF XgQPYh1jdfdr58tbmnDsPmcF8P4HCIDPKNsFxhQnL4Z98Cfe/+Z+M0jnCx5Y0ScrUw5XSmXX+6KA YPxMvDVTAWqXcoKv8R1w6Jz1717CbMdHflqUhSZNO7rrTOiwCcJlwp2dCZtOtZcFrPUGoPc2BX70 kLJrxLT5ZOrpGgrIDajtJ8nU57O5q4IikCc9Kuh8kO+8T/3iCiSn3mUkpF3qwHYw03dQ+A0Em5Q2 AXPKBlim0zvc+gRGE1WKyURHuFE5Gi7oNOJ5y1lKCn+8pu8fA2dqWSslYpPZUxlmPCdiKYZNpGvu /9ROutW04o5IWgAZCfEF2c6Rsffr6TlP9m8EQ5pV9T4FFL2/s1m02I4zhKOQUqqzApVg+QxMaPnu 1RcN+HFXtSXkKe5lXa/R7jwXC1pDxaWG6iSe4gUH3DRCEpHWOXSuTEGC2/KmSNGzm/MzqvOmwMVO 9fSddmPmAsYiS8GVP1BkLFTltvA8Kc9XAgMBAAGjQjBAMB0GA1UdDgQWBBRUYnBj8XWEQ1iO0RYg scasGrz2iTAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjANBgkqhkiG9w0BAQsFAAOC AgEAKbqSSaet8PFww+SX8J+pJdVrnjT+5hpk9jprUrIQeBqfTNqK2uwcN1LgQkv7bHbKJAs5EhWd nxEt/Hlk3ODg9d3gV8mlsnZwUKT+twpw1aA08XXXTUm6EdGz2OyC/+sOxL9kLX1jbhd47F18iMjr jld22VkE+rxSH0Ws8HqA7Oxvdq6R2xCOBNyS36D25q5J08FsEhvMKar5CKXiNxTKsbhm7xqC5PD4 8acWabfbqWE8n/Uxy+QARsIvdLGx14HuqCaVvIivTDUHKgLKeBRtRytAVunLKmChZwOgzoy8sHJn xDHO2zTlJQNgJXtxmOTAGytfdELSS8VZCAeHvsXDf+eW2eHcKJfWjwXj9ZtOyh1QRwVTsMo554Wg icEFOwE30z9J4nfrI8iIZjs9OXYhRvHsXyO466JmdXTBQPfYaJqT4i2pLr0cox7IdMakLXogqzu4 sEb9b91fUlV1YvCXoHzXOP0l382gmxDPi7g4Xl7FtKYCNqEeXxzP4padKar9mK5S4fNBUvupLnKW nyfjqnN9+BojZns7q2WwMgFLFT49ok8MKzWixtlnEjUwzXYuFrOZnk1PTi07NEPhmg4NpGaXutIc SkwsKouLgU9xGqndXHt7CMUADTdA43x7VF8vhV929vensBxXVsFy6K2ir40zSbofitzmdHxghm+H l3s= -----END CERTIFICATE----- ISRG Root X2 ============ -----BEGIN CERTIFICATE----- MIICGzCCAaGgAwIBAgIQQdKd0XLq7qeAwSxs6S+HUjAKBggqhkjOPQQDAzBPMQswCQYDVQQGEwJV UzEpMCcGA1UEChMgSW50ZXJuZXQgU2VjdXJpdHkgUmVzZWFyY2ggR3JvdXAxFTATBgNVBAMTDElT UkcgUm9vdCBYMjAeFw0yMDA5MDQwMDAwMDBaFw00MDA5MTcxNjAwMDBaME8xCzAJBgNVBAYTAlVT MSkwJwYDVQQKEyBJbnRlcm5ldCBTZWN1cml0eSBSZXNlYXJjaCBHcm91cDEVMBMGA1UEAxMMSVNS RyBSb290IFgyMHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEzZvVn4CDCuwJSvMWSj5cz3es3mcFDR0H ttwW+1qLFNvicWDEukWVEYmO6gbf9yoWHKS5xcUy4APgHoIYOIvXRdgKam7mAHf7AlF9ItgKbppb d9/w+kHsOdx1ymgHDB/qo0IwQDAOBgNVHQ8BAf8EBAMCAQYwDwYDVR0TAQH/BAUwAwEB/zAdBgNV HQ4EFgQUfEKWrt5LSDv6kviejM9ti6lyN5UwCgYIKoZIzj0EAwMDaAAwZQIwe3lORlCEwkSHRhtF cP9Ymd70/aTSVaYgLXTWNLxBo1BfASdWtL4ndQavEi51mI38AjEAi/V3bNTIZargCyzuFJ0nN6T5 U6VR5CmD1/iQMVtCnwr1/q4AaOeMSQ+2b1tbFfLn -----END CERTIFICATE----- HiPKI Root CA - G1 ================== -----BEGIN CERTIFICATE----- MIIFajCCA1KgAwIBAgIQLd2szmKXlKFD6LDNdmpeYDANBgkqhkiG9w0BAQsFADBPMQswCQYDVQQG EwJUVzEjMCEGA1UECgwaQ2h1bmdod2EgVGVsZWNvbSBDby4sIEx0ZC4xGzAZBgNVBAMMEkhpUEtJ IFJvb3QgQ0EgLSBHMTAeFw0xOTAyMjIwOTQ2MDRaFw0zNzEyMzExNTU5NTlaME8xCzAJBgNVBAYT AlRXMSMwIQYDVQQKDBpDaHVuZ2h3YSBUZWxlY29tIENvLiwgTHRkLjEbMBkGA1UEAwwSSGlQS0kg Um9vdCBDQSAtIEcxMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEA9B5/UnMyDHPkvRN0 o9QwqNCuS9i233VHZvR85zkEHmpwINJaR3JnVfSl6J3VHiGh8Ge6zCFovkRTv4354twvVcg3Px+k wJyz5HdcoEb+d/oaoDjq7Zpy3iu9lFc6uux55199QmQ5eiY29yTw1S+6lZgRZq2XNdZ1AYDgr/SE YYwNHl98h5ZeQa/rh+r4XfEuiAU+TCK72h8q3VJGZDnzQs7ZngyzsHeXZJzA9KMuH5UHsBffMNsA GJZMoYFL3QRtU6M9/Aes1MU3guvklQgZKILSQjqj2FPseYlgSGDIcpJQ3AOPgz+yQlda22rpEZfd hSi8MEyr48KxRURHH+CKFgeW0iEPU8DtqX7UTuybCeyvQqww1r/REEXgphaypcXTT3OUM3ECoWqj 1jOXTyFjHluP2cFeRXF3D4FdXyGarYPM+l7WjSNfGz1BryB1ZlpK9p/7qxj3ccC2HTHsOyDry+K4 9a6SsvfhhEvyovKTmiKe0xRvNlS9H15ZFblzqMF8b3ti6RZsR1pl8w4Rm0bZ/W3c1pzAtH2lsN0/ Vm+h+fbkEkj9Bn8SV7apI09bA8PgcSojt/ewsTu8mL3WmKgMa/aOEmem8rJY5AIJEzypuxC00jBF 8ez3ABHfZfjcK0NVvxaXxA/VLGGEqnKG/uY6fsI/fe78LxQ+5oXdUG+3Se0CAwEAAaNCMEAwDwYD VR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQU8ncX+l6o/vY9cdVouslGDDjYr7AwDgYDVR0PAQH/BAQD AgGGMA0GCSqGSIb3DQEBCwUAA4ICAQBQUfB13HAE4/+qddRxosuej6ip0691x1TPOhwEmSKsxBHi 7zNKpiMdDg1H2DfHb680f0+BazVP6XKlMeJ45/dOlBhbQH3PayFUhuaVevvGyuqcSE5XCV0vrPSl tJczWNWseanMX/mF+lLFjfiRFOs6DRfQUsJ748JzjkZ4Bjgs6FzaZsT0pPBWGTMpWmWSBUdGSquE wx4noR8RkpkndZMPvDY7l1ePJlsMu5wP1G4wB9TcXzZoZjmDlicmisjEOf6aIW/Vcobpf2Lll07Q JNBAsNB1CI69aO4I1258EHBGG3zgiLKecoaZAeO/n0kZtCW+VmWuF2PlHt/o/0elv+EmBYTksMCv 5wiZqAxeJoBF1PhoL5aPruJKHJwWDBNvOIf2u8g0X5IDUXlwpt/L9ZlNec1OvFefQ05rLisY+Gpz jLrFNe85akEez3GoorKGB1s6yeHvP2UEgEcyRHCVTjFnanRbEEV16rCf0OY1/k6fi8wrkkVbbiVg hUbN0aqwdmaTd5a+g744tiROJgvM7XpWGuDpWsZkrUx6AEhEL7lAuxM+vhV4nYWBSipX3tUZQ9rb yltHhoMLP7YNdnhzeSJesYAfz77RP1YQmCuVh6EfnWQUYDksswBVLuT1sw5XxJFBAJw/6KXf6vb/ yPCtbVKoF6ubYfwSUTXkJf2vqmqGOQ== -----END CERTIFICATE----- GlobalSign ECC Root CA - R4 =========================== -----BEGIN CERTIFICATE----- MIIB3DCCAYOgAwIBAgINAgPlfvU/k/2lCSGypjAKBggqhkjOPQQDAjBQMSQwIgYDVQQLExtHbG9i YWxTaWduIEVDQyBSb290IENBIC0gUjQxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkds b2JhbFNpZ24wHhcNMTIxMTEzMDAwMDAwWhcNMzgwMTE5MDMxNDA3WjBQMSQwIgYDVQQLExtHbG9i YWxTaWduIEVDQyBSb290IENBIC0gUjQxEzARBgNVBAoTCkdsb2JhbFNpZ24xEzARBgNVBAMTCkds b2JhbFNpZ24wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAS4xnnTj2wlDp8uORkcA6SumuU5BwkW ymOxuYb4ilfBV85C+nOh92VC/x7BALJucw7/xyHlGKSq2XE/qNS5zowdo0IwQDAOBgNVHQ8BAf8E BAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNVHQ4EFgQUVLB7rUW44kB/+wpu+74zyTyjhNUwCgYI KoZIzj0EAwIDRwAwRAIgIk90crlgr/HmnKAWBVBfw147bmF0774BxL4YSFlhgjICICadVGNA3jdg UM/I2O2dgq43mLyjj0xMqTQrbO/7lZsm -----END CERTIFICATE----- GTS Root R1 =========== -----BEGIN CERTIFICATE----- MIIFVzCCAz+gAwIBAgINAgPlk28xsBNJiGuiFzANBgkqhkiG9w0BAQwFADBHMQswCQYDVQQGEwJV UzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3Qg UjEwHhcNMTYwNjIyMDAwMDAwWhcNMzYwNjIyMDAwMDAwWjBHMQswCQYDVQQGEwJVUzEiMCAGA1UE ChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjEwggIiMA0G CSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQC2EQKLHuOhd5s73L+UPreVp0A8of2C+X0yBoJx9vaM f/vo27xqLpeXo4xL+Sv2sfnOhB2x+cWX3u+58qPpvBKJXqeqUqv4IyfLpLGcY9vXmX7wCl7raKb0 xlpHDU0QM+NOsROjyBhsS+z8CZDfnWQpJSMHobTSPS5g4M/SCYe7zUjwTcLCeoiKu7rPWRnWr4+w B7CeMfGCwcDfLqZtbBkOtdh+JhpFAz2weaSUKK0PfyblqAj+lug8aJRT7oM6iCsVlgmy4HqMLnXW nOunVmSPlk9orj2XwoSPwLxAwAtcvfaHszVsrBhQf4TgTM2S0yDpM7xSma8ytSmzJSq0SPly4cpk 9+aCEI3oncKKiPo4Zor8Y/kB+Xj9e1x3+naH+uzfsQ55lVe0vSbv1gHR6xYKu44LtcXFilWr06zq kUspzBmkMiVOKvFlRNACzqrOSbTqn3yDsEB750Orp2yjj32JgfpMpf/VjsPOS+C12LOORc92wO1A K/1TD7Cn1TsNsYqiA94xrcx36m97PtbfkSIS5r762DL8EGMUUXLeXdYWk70paDPvOmbsB4om3xPX V2V4J95eSRQAogB/mqghtqmxlbCluQ0WEdrHbEg8QOB+DVrNVjzRlwW5y0vtOUucxD/SVRNuJLDW cfr0wbrM7Rv1/oFB2ACYPTrIrnqYNxgFlQIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAYYwDwYDVR0T AQH/BAUwAwEB/zAdBgNVHQ4EFgQU5K8rJnEaK0gnhS9SZizv8IkTcT4wDQYJKoZIhvcNAQEMBQAD ggIBAJ+qQibbC5u+/x6Wki4+omVKapi6Ist9wTrYggoGxval3sBOh2Z5ofmmWJyq+bXmYOfg6LEe QkEzCzc9zolwFcq1JKjPa7XSQCGYzyI0zzvFIoTgxQ6KfF2I5DUkzps+GlQebtuyh6f88/qBVRRi ClmpIgUxPoLW7ttXNLwzldMXG+gnoot7TiYaelpkttGsN/H9oPM47HLwEXWdyzRSjeZ2axfG34ar J45JK3VmgRAhpuo+9K4l/3wV3s6MJT/KYnAK9y8JZgfIPxz88NtFMN9iiMG1D53Dn0reWVlHxYci NuaCp+0KueIHoI17eko8cdLiA6EfMgfdG+RCzgwARWGAtQsgWSl4vflVy2PFPEz0tv/bal8xa5me LMFrUKTX5hgUvYU/Z6tGn6D/Qqc6f1zLXbBwHSs09dR2CQzreExZBfMzQsNhFRAbd03OIozUhfJF fbdT6u9AWpQKXCBfTkBdYiJ23//OYb2MI3jSNwLgjt7RETeJ9r/tSQdirpLsQBqvFAnZ0E6yove+ 7u7Y/9waLd64NnHi/Hm3lCXRSHNboTXns5lndcEZOitHTtNCjv0xyBZm2tIMPNuzjsmhDYAPexZ3 FL//2wmUspO8IFgV6dtxQ/PeEMMA3KgqlbbC1j+Qa3bbbP6MvPJwNQzcmRk13NfIRmPVNnGuV/u3 gm3c -----END CERTIFICATE----- GTS Root R2 =========== -----BEGIN CERTIFICATE----- MIIFVzCCAz+gAwIBAgINAgPlrsWNBCUaqxElqjANBgkqhkiG9w0BAQwFADBHMQswCQYDVQQGEwJV UzEiMCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3Qg UjIwHhcNMTYwNjIyMDAwMDAwWhcNMzYwNjIyMDAwMDAwWjBHMQswCQYDVQQGEwJVUzEiMCAGA1UE ChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjIwggIiMA0G CSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDO3v2m++zsFDQ8BwZabFn3GTXd98GdVarTzTukk3Lv CvptnfbwhYBboUhSnznFt+4orO/LdmgUud+tAWyZH8QiHZ/+cnfgLFuv5AS/T3KgGjSY6Dlo7JUl e3ah5mm5hRm9iYz+re026nO8/4Piy33B0s5Ks40FnotJk9/BW9BuXvAuMC6C/Pq8tBcKSOWIm8Wb a96wyrQD8Nr0kLhlZPdcTK3ofmZemde4wj7I0BOdre7kRXuJVfeKH2JShBKzwkCX44ofR5GmdFrS +LFjKBC4swm4VndAoiaYecb+3yXuPuWgf9RhD1FLPD+M2uFwdNjCaKH5wQzpoeJ/u1U8dgbuak7M kogwTZq9TwtImoS1mKPV+3PBV2HdKFZ1E66HjucMUQkQdYhMvI35ezzUIkgfKtzra7tEscszcTJG r61K8YzodDqs5xoic4DSMPclQsciOzsSrZYuxsN2B6ogtzVJV+mSSeh2FnIxZyuWfoqjx5RWIr9q S34BIbIjMt/kmkRtWVtd9QCgHJvGeJeNkP+byKq0rxFROV7Z+2et1VsRnTKaG73VululycslaVNV J1zgyjbLiGH7HrfQy+4W+9OmTN6SpdTi3/UGVN4unUu0kzCqgc7dGtxRcw1PcOnlthYhGXmy5okL dWTK1au8CcEYof/UVKGFPP0UJAOyh9OktwIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAYYwDwYDVR0T AQH/BAUwAwEB/zAdBgNVHQ4EFgQUu//KjiOfT5nK2+JopqUVJxce2Q4wDQYJKoZIhvcNAQEMBQAD ggIBAB/Kzt3HvqGf2SdMC9wXmBFqiN495nFWcrKeGk6c1SuYJF2ba3uwM4IJvd8lRuqYnrYb/oM8 0mJhwQTtzuDFycgTE1XnqGOtjHsB/ncw4c5omwX4Eu55MaBBRTUoCnGkJE+M3DyCB19m3H0Q/gxh swWV7uGugQ+o+MePTagjAiZrHYNSVc61LwDKgEDg4XSsYPWHgJ2uNmSRXbBoGOqKYcl3qJfEycel /FVL8/B/uWU9J2jQzGv6U53hkRrJXRqWbTKH7QMgyALOWr7Z6v2yTcQvG99fevX4i8buMTolUVVn jWQye+mew4K6Ki3pHrTgSAai/GevHyICc/sgCq+dVEuhzf9gR7A/Xe8bVr2XIZYtCtFenTgCR2y5 9PYjJbigapordwj6xLEokCZYCDzifqrXPW+6MYgKBesntaFJ7qBFVHvmJ2WZICGoo7z7GJa7Um8M 7YNRTOlZ4iBgxcJlkoKM8xAfDoqXvneCbT+PHV28SSe9zE8P4c52hgQjxcCMElv924SgJPFI/2R8 0L5cFtHvma3AH/vLrrw4IgYmZNralw4/KBVEqE8AyvCazM90arQ+POuV7LXTWtiBmelDGDfrs7vR WGJB82bSj6p4lVQgw1oudCvV0b4YacCs1aTPObpRhANl6WLAYv7YTVWW4tAR+kg0Eeye7QUd5MjW HYbL -----END CERTIFICATE----- GTS Root R3 =========== -----BEGIN CERTIFICATE----- MIICCTCCAY6gAwIBAgINAgPluILrIPglJ209ZjAKBggqhkjOPQQDAzBHMQswCQYDVQQGEwJVUzEi MCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjMw HhcNMTYwNjIyMDAwMDAwWhcNMzYwNjIyMDAwMDAwWjBHMQswCQYDVQQGEwJVUzEiMCAGA1UEChMZ R29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjMwdjAQBgcqhkjO PQIBBgUrgQQAIgNiAAQfTzOHMymKoYTey8chWEGJ6ladK0uFxh1MJ7x/JlFyb+Kf1qPKzEUURout 736GjOyxfi//qXGdGIRFBEFVbivqJn+7kAHjSxm65FSWRQmx1WyRRK2EE46ajA2ADDL24CejQjBA MA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBTB8Sa6oC2uhYHP0/Eq Er24Cmf9vDAKBggqhkjOPQQDAwNpADBmAjEA9uEglRR7VKOQFhG/hMjqb2sXnh5GmCCbn9MN2azT L818+FsuVbu/3ZL3pAzcMeGiAjEA/JdmZuVDFhOD3cffL74UOO0BzrEXGhF16b0DjyZ+hOXJYKaV 11RZt+cRLInUue4X -----END CERTIFICATE----- GTS Root R4 =========== -----BEGIN CERTIFICATE----- MIICCTCCAY6gAwIBAgINAgPlwGjvYxqccpBQUjAKBggqhkjOPQQDAzBHMQswCQYDVQQGEwJVUzEi MCAGA1UEChMZR29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjQw HhcNMTYwNjIyMDAwMDAwWhcNMzYwNjIyMDAwMDAwWjBHMQswCQYDVQQGEwJVUzEiMCAGA1UEChMZ R29vZ2xlIFRydXN0IFNlcnZpY2VzIExMQzEUMBIGA1UEAxMLR1RTIFJvb3QgUjQwdjAQBgcqhkjO PQIBBgUrgQQAIgNiAATzdHOnaItgrkO4NcWBMHtLSZ37wWHO5t5GvWvVYRg1rkDdc/eJkTBa6zzu hXyiQHY7qca4R9gq55KRanPpsXI5nymfopjTX15YhmUPoYRlBtHci8nHc8iMai/lxKvRHYqjQjBA MA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1UdDgQWBBSATNbrdP9JNqPV2Py1 PsVq8JQdjDAKBggqhkjOPQQDAwNpADBmAjEA6ED/g94D9J+uHXqnLrmvT/aDHQ4thQEd0dlq7A/C r8deVl5c1RxYIigL9zC2L7F8AjEA8GE8p/SgguMh1YQdc4acLa/KNJvxn7kjNuK8YAOdgLOaVsjh 4rsUecrNIdSUtUlD -----END CERTIFICATE----- Telia Root CA v2 ================ -----BEGIN CERTIFICATE----- MIIFdDCCA1ygAwIBAgIPAWdfJ9b+euPkrL4JWwWeMA0GCSqGSIb3DQEBCwUAMEQxCzAJBgNVBAYT AkZJMRowGAYDVQQKDBFUZWxpYSBGaW5sYW5kIE95ajEZMBcGA1UEAwwQVGVsaWEgUm9vdCBDQSB2 MjAeFw0xODExMjkxMTU1NTRaFw00MzExMjkxMTU1NTRaMEQxCzAJBgNVBAYTAkZJMRowGAYDVQQK DBFUZWxpYSBGaW5sYW5kIE95ajEZMBcGA1UEAwwQVGVsaWEgUm9vdCBDQSB2MjCCAiIwDQYJKoZI hvcNAQEBBQADggIPADCCAgoCggIBALLQPwe84nvQa5n44ndp586dpAO8gm2h/oFlH0wnrI4AuhZ7 6zBqAMCzdGh+sq/H1WKzej9Qyow2RCRj0jbpDIX2Q3bVTKFgcmfiKDOlyzG4OiIjNLh9vVYiQJ3q 9HsDrWj8soFPmNB06o3lfc1jw6P23pLCWBnglrvFxKk9pXSW/q/5iaq9lRdU2HhE8Qx3FZLgmEKn pNaqIJLNwaCzlrI6hEKNfdWV5Nbb6WLEWLN5xYzTNTODn3WhUidhOPFZPY5Q4L15POdslv5e2QJl tI5c0BE0312/UqeBAMN/mUWZFdUXyApT7GPzmX3MaRKGwhfwAZ6/hLzRUssbkmbOpFPlob/E2wnW 5olWK8jjfN7j/4nlNW4o6GwLI1GpJQXrSPjdscr6bAhR77cYbETKJuFzxokGgeWKrLDiKca5JLNr RBH0pUPCTEPlcDaMtjNXepUugqD0XBCzYYP2AgWGLnwtbNwDRm41k9V6lS/eINhbfpSQBGq6WT0E BXWdN6IOLj3rwaRSg/7Qa9RmjtzG6RJOHSpXqhC8fF6CfaamyfItufUXJ63RDolUK5X6wK0dmBR4 M0KGCqlztft0DbcbMBnEWg4cJ7faGND/isgFuvGqHKI3t+ZIpEYslOqodmJHixBTB0hXbOKSTbau BcvcwUpej6w9GU7C7WB1K9vBykLVAgMBAAGjYzBhMB8GA1UdIwQYMBaAFHKs5DN5qkWH9v2sHZ7W xy+G2CQ5MB0GA1UdDgQWBBRyrOQzeapFh/b9rB2e1scvhtgkOTAOBgNVHQ8BAf8EBAMCAQYwDwYD VR0TAQH/BAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAgEAoDtZpwmUPjaE0n4vOaWWl/oRrfxn83EJ 8rKJhGdEr7nv7ZbsnGTbMjBvZ5qsfl+yqwE2foH65IRe0qw24GtixX1LDoJt0nZi0f6X+J8wfBj5 tFJ3gh1229MdqfDBmgC9bXXYfef6xzijnHDoRnkDry5023X4blMMA8iZGok1GTzTyVR8qPAs5m4H eW9q4ebqkYJpCh3DflminmtGFZhb069GHWLIzoBSSRE/yQQSwxN8PzuKlts8oB4KtItUsiRnDe+C y748fdHif64W1lZYudogsYMVoe+KTTJvQS8TUoKU1xrBeKJR3Stwbbca+few4GeXVtt8YVMJAygC QMez2P2ccGrGKMOF6eLtGpOg3kuYooQ+BXcBlj37tCAPnHICehIv1aO6UXivKitEZU61/Qrowc15 h2Er3oBXRb9n8ZuRXqWk7FlIEA04x7D6w0RtBPV4UBySllva9bguulvP5fBqnUsvWHMtTy3EHD70 sz+rFQ47GUGKpMFXEmZxTPpT41frYpUJnlTd0cI8Vzy9OK2YZLe4A5pTVmBds9hCG1xLEooc6+t9 xnppxyd/pPiL8uSUZodL6ZQHCRJ5irLrdATczvREWeAWysUsWNc8e89ihmpQfTU2Zqf7N+cox9jQ raVplI/owd8k+BsHMYeB2F326CjYSlKArBPuUBQemMc= -----END CERTIFICATE----- D-TRUST BR Root CA 1 2020 ========================= -----BEGIN CERTIFICATE----- MIIC2zCCAmCgAwIBAgIQfMmPK4TX3+oPyWWa00tNljAKBggqhkjOPQQDAzBIMQswCQYDVQQGEwJE RTEVMBMGA1UEChMMRC1UcnVzdCBHbWJIMSIwIAYDVQQDExlELVRSVVNUIEJSIFJvb3QgQ0EgMSAy MDIwMB4XDTIwMDIxMTA5NDUwMFoXDTM1MDIxMTA5NDQ1OVowSDELMAkGA1UEBhMCREUxFTATBgNV BAoTDEQtVHJ1c3QgR21iSDEiMCAGA1UEAxMZRC1UUlVTVCBCUiBSb290IENBIDEgMjAyMDB2MBAG ByqGSM49AgEGBSuBBAAiA2IABMbLxyjR+4T1mu9CFCDhQ2tuda38KwOE1HaTJddZO0Flax7mNCq7 dPYSzuht56vkPE4/RAiLzRZxy7+SmfSk1zxQVFKQhYN4lGdnoxwJGT11NIXe7WB9xwy0QVK5buXu QqOCAQ0wggEJMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFHOREKv/VbNafAkl1bK6CKBrqx9t MA4GA1UdDwEB/wQEAwIBBjCBxgYDVR0fBIG+MIG7MD6gPKA6hjhodHRwOi8vY3JsLmQtdHJ1c3Qu bmV0L2NybC9kLXRydXN0X2JyX3Jvb3RfY2FfMV8yMDIwLmNybDB5oHegdYZzbGRhcDovL2RpcmVj dG9yeS5kLXRydXN0Lm5ldC9DTj1ELVRSVVNUJTIwQlIlMjBSb290JTIwQ0ElMjAxJTIwMjAyMCxP PUQtVHJ1c3QlMjBHbWJILEM9REU/Y2VydGlmaWNhdGVyZXZvY2F0aW9ubGlzdDAKBggqhkjOPQQD AwNpADBmAjEAlJAtE/rhY/hhY+ithXhUkZy4kzg+GkHaQBZTQgjKL47xPoFWwKrY7RjEsK70Pvom AjEA8yjixtsrmfu3Ubgko6SUeho/5jbiA1czijDLgsfWFBHVdWNbFJWcHwHP2NVypw87 -----END CERTIFICATE----- D-TRUST EV Root CA 1 2020 ========================= -----BEGIN CERTIFICATE----- MIIC2zCCAmCgAwIBAgIQXwJB13qHfEwDo6yWjfv/0DAKBggqhkjOPQQDAzBIMQswCQYDVQQGEwJE RTEVMBMGA1UEChMMRC1UcnVzdCBHbWJIMSIwIAYDVQQDExlELVRSVVNUIEVWIFJvb3QgQ0EgMSAy MDIwMB4XDTIwMDIxMTEwMDAwMFoXDTM1MDIxMTA5NTk1OVowSDELMAkGA1UEBhMCREUxFTATBgNV BAoTDEQtVHJ1c3QgR21iSDEiMCAGA1UEAxMZRC1UUlVTVCBFViBSb290IENBIDEgMjAyMDB2MBAG ByqGSM49AgEGBSuBBAAiA2IABPEL3YZDIBnfl4XoIkqbz52Yv7QFJsnL46bSj8WeeHsxiamJrSc8 ZRCC/N/DnU7wMyPE0jL1HLDfMxddxfCxivnvubcUyilKwg+pf3VlSSowZ/Rk99Yad9rDwpdhQntJ raOCAQ0wggEJMA8GA1UdEwEB/wQFMAMBAf8wHQYDVR0OBBYEFH8QARY3OqQo5FD4pPfsazK2/umL MA4GA1UdDwEB/wQEAwIBBjCBxgYDVR0fBIG+MIG7MD6gPKA6hjhodHRwOi8vY3JsLmQtdHJ1c3Qu bmV0L2NybC9kLXRydXN0X2V2X3Jvb3RfY2FfMV8yMDIwLmNybDB5oHegdYZzbGRhcDovL2RpcmVj dG9yeS5kLXRydXN0Lm5ldC9DTj1ELVRSVVNUJTIwRVYlMjBSb290JTIwQ0ElMjAxJTIwMjAyMCxP PUQtVHJ1c3QlMjBHbWJILEM9REU/Y2VydGlmaWNhdGVyZXZvY2F0aW9ubGlzdDAKBggqhkjOPQQD AwNpADBmAjEAyjzGKnXCXnViOTYAYFqLwZOZzNnbQTs7h5kXO9XMT8oi96CAy/m0sRtW9XLS/BnR AjEAkfcwkz8QRitxpNA7RJvAKQIFskF3UfN5Wp6OFKBOQtJbgfM0agPnIjhQW+0ZT0MW -----END CERTIFICATE----- ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5369406 stripe-10.1.0/stripe/entitlements/0000755000175100001770000000000014637354616016544 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/entitlements/__init__.py0000644000175100001770000000105614637354563020660 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe.entitlements._active_entitlement import ( ActiveEntitlement as ActiveEntitlement, ) from stripe.entitlements._active_entitlement_service import ( ActiveEntitlementService as ActiveEntitlementService, ) from stripe.entitlements._active_entitlement_summary import ( ActiveEntitlementSummary as ActiveEntitlementSummary, ) from stripe.entitlements._feature import Feature as Feature from stripe.entitlements._feature_service import ( FeatureService as FeatureService, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/entitlements/_active_entitlement.py0000644000175100001770000001056514637354563023150 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from typing import ClassVar, List from typing_extensions import Literal, NotRequired, Unpack, TYPE_CHECKING if TYPE_CHECKING: from stripe.entitlements._feature import Feature class ActiveEntitlement(ListableAPIResource["ActiveEntitlement"]): """ An active entitlement describes access to a feature for a customer. """ OBJECT_NAME: ClassVar[Literal["entitlements.active_entitlement"]] = ( "entitlements.active_entitlement" ) class ListParams(RequestOptions): customer: str """ The ID of the customer. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ feature: ExpandableField["Feature"] """ The [Feature](https://stripe.com/docs/api/entitlements/feature) that the customer is entitled to. """ id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ lookup_key: str """ A unique key you provide as your own system identifier. This may be up to 80 characters. """ object: Literal["entitlements.active_entitlement"] """ String representing the object's type. Objects of the same type share the same value. """ @classmethod def list( cls, **params: Unpack["ActiveEntitlement.ListParams"] ) -> ListObject["ActiveEntitlement"]: """ Retrieve a list of active entitlements for a customer """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["ActiveEntitlement.ListParams"] ) -> ListObject["ActiveEntitlement"]: """ Retrieve a list of active entitlements for a customer """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def retrieve( cls, id: str, **params: Unpack["ActiveEntitlement.RetrieveParams"] ) -> "ActiveEntitlement": """ Retrieve an active entitlement """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["ActiveEntitlement.RetrieveParams"] ) -> "ActiveEntitlement": """ Retrieve an active entitlement """ instance = cls(id, **params) await instance.refresh_async() return instance ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/entitlements/_active_entitlement_service.py0000644000175100001770000001016614637354563024665 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.entitlements._active_entitlement import ActiveEntitlement from typing import List, cast from typing_extensions import NotRequired, TypedDict class ActiveEntitlementService(StripeService): class ListParams(TypedDict): customer: str """ The ID of the customer. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def list( self, params: "ActiveEntitlementService.ListParams", options: RequestOptions = {}, ) -> ListObject[ActiveEntitlement]: """ Retrieve a list of active entitlements for a customer """ return cast( ListObject[ActiveEntitlement], self._request( "get", "/v1/entitlements/active_entitlements", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "ActiveEntitlementService.ListParams", options: RequestOptions = {}, ) -> ListObject[ActiveEntitlement]: """ Retrieve a list of active entitlements for a customer """ return cast( ListObject[ActiveEntitlement], await self._request_async( "get", "/v1/entitlements/active_entitlements", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, id: str, params: "ActiveEntitlementService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> ActiveEntitlement: """ Retrieve an active entitlement """ return cast( ActiveEntitlement, self._request( "get", "/v1/entitlements/active_entitlements/{id}".format( id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, id: str, params: "ActiveEntitlementService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> ActiveEntitlement: """ Retrieve an active entitlement """ return cast( ActiveEntitlement, await self._request_async( "get", "/v1/entitlements/active_entitlements/{id}".format( id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/entitlements/_active_entitlement_summary.py0000644000175100001770000000211114637354563024711 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._stripe_object import StripeObject from typing import ClassVar from typing_extensions import Literal, TYPE_CHECKING if TYPE_CHECKING: from stripe.entitlements._active_entitlement import ActiveEntitlement class ActiveEntitlementSummary(StripeObject): """ A summary of a customer's active entitlements. """ OBJECT_NAME: ClassVar[ Literal["entitlements.active_entitlement_summary"] ] = "entitlements.active_entitlement_summary" customer: str """ The customer that is entitled to this feature. """ entitlements: ListObject["ActiveEntitlement"] """ The list of entitlements this customer has. """ 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["entitlements.active_entitlement_summary"] """ String representing the object's type. Objects of the same type share the same value. """ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/entitlements/_feature.py0000644000175100001770000001767114637354563020725 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import sanitize_id from typing import ClassVar, Dict, List, cast from typing_extensions import Literal, NotRequired, Unpack class Feature( CreateableAPIResource["Feature"], ListableAPIResource["Feature"], UpdateableAPIResource["Feature"], ): """ A feature represents a monetizable ability or functionality in your system. Features can be assigned to products, and when those products are purchased, Stripe will create an entitlement to the feature for the purchasing customer. """ OBJECT_NAME: ClassVar[Literal["entitlements.feature"]] = ( "entitlements.feature" ) class CreateParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ lookup_key: str """ A unique key you provide as your own system identifier. This may be up to 80 characters. """ metadata: NotRequired[Dict[str, str]] """ Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ name: str """ The feature's name, for your own purpose, not meant to be displayable to the customer. """ class ListParams(RequestOptions): archived: NotRequired[bool] """ If set, filter results to only include features with the given archive status. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ lookup_key: NotRequired[str] """ If set, filter results to only include features with the given lookup_key. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ModifyParams(RequestOptions): active: NotRequired[bool] """ Inactive features cannot be attached to new products and will not be returned from the features list endpoint. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ name: NotRequired[str] """ The feature's name, for your own purpose, not meant to be displayable to the customer. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ active: bool """ Inactive features cannot be attached to new products and will not be returned from the features list endpoint. """ id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ lookup_key: str """ A unique key you provide as your own system identifier. This may be up to 80 characters. """ metadata: Dict[str, str] """ Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ name: str """ The feature's name, for your own purpose, not meant to be displayable to the customer. """ object: Literal["entitlements.feature"] """ String representing the object's type. Objects of the same type share the same value. """ @classmethod def create(cls, **params: Unpack["Feature.CreateParams"]) -> "Feature": """ Creates a feature """ return cast( "Feature", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["Feature.CreateParams"] ) -> "Feature": """ Creates a feature """ return cast( "Feature", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def list( cls, **params: Unpack["Feature.ListParams"] ) -> ListObject["Feature"]: """ Retrieve a list of features """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["Feature.ListParams"] ) -> ListObject["Feature"]: """ Retrieve a list of features """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def modify( cls, id: str, **params: Unpack["Feature.ModifyParams"] ) -> "Feature": """ Update a feature's metadata or permanently deactivate it. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Feature", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["Feature.ModifyParams"] ) -> "Feature": """ Update a feature's metadata or permanently deactivate it. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Feature", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["Feature.RetrieveParams"] ) -> "Feature": """ Retrieves a feature """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["Feature.RetrieveParams"] ) -> "Feature": """ Retrieves a feature """ instance = cls(id, **params) await instance.refresh_async() return instance ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/entitlements/_feature_service.py0000644000175100001770000001676414637354563022447 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.entitlements._feature import Feature from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class FeatureService(StripeService): class CreateParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ lookup_key: str """ A unique key you provide as your own system identifier. This may be up to 80 characters. """ metadata: NotRequired[Dict[str, str]] """ Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ name: str """ The feature's name, for your own purpose, not meant to be displayable to the customer. """ class ListParams(TypedDict): archived: NotRequired[bool] """ If set, filter results to only include features with the given archive status. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ lookup_key: NotRequired[str] """ If set, filter results to only include features with the given lookup_key. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): active: NotRequired[bool] """ Inactive features cannot be attached to new products and will not be returned from the features list endpoint. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of key-value pairs that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ name: NotRequired[str] """ The feature's name, for your own purpose, not meant to be displayable to the customer. """ def list( self, params: "FeatureService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Feature]: """ Retrieve a list of features """ return cast( ListObject[Feature], self._request( "get", "/v1/entitlements/features", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "FeatureService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Feature]: """ Retrieve a list of features """ return cast( ListObject[Feature], await self._request_async( "get", "/v1/entitlements/features", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "FeatureService.CreateParams", options: RequestOptions = {}, ) -> Feature: """ Creates a feature """ return cast( Feature, self._request( "post", "/v1/entitlements/features", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "FeatureService.CreateParams", options: RequestOptions = {}, ) -> Feature: """ Creates a feature """ return cast( Feature, await self._request_async( "post", "/v1/entitlements/features", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, id: str, params: "FeatureService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Feature: """ Retrieves a feature """ return cast( Feature, self._request( "get", "/v1/entitlements/features/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, id: str, params: "FeatureService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Feature: """ Retrieves a feature """ return cast( Feature, await self._request_async( "get", "/v1/entitlements/features/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, id: str, params: "FeatureService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Feature: """ Update a feature's metadata or permanently deactivate it. """ return cast( Feature, self._request( "post", "/v1/entitlements/features/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, id: str, params: "FeatureService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Feature: """ Update a feature's metadata or permanently deactivate it. """ return cast( Feature, await self._request_async( "post", "/v1/entitlements/features/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/error.py0000644000175100001770000000177614637354563015550 0ustar00runnerdocker# -*- coding: utf-8 -*- from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.api_resources.error_object package is deprecated, please change your imports to import from stripe directly. From: from stripe.api_resources.error_object import ErrorObject To: from stripe import ErrorObject """, DeprecationWarning, ) if not TYPE_CHECKING: from stripe._error import StripeError # noqa from stripe._error import APIError # noqa from stripe._error import APIConnectionError # noqa from stripe._error import StripeErrorWithParamCode # noqa from stripe._error import CardError # noqa from stripe._error import IdempotencyError # noqa from stripe._error import InvalidRequestError # noqa from stripe._error import AuthenticationError # noqa from stripe._error import PermissionError # noqa from stripe._error import RateLimitError # noqa from stripe._error import SignatureVerificationError # noqa ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5369406 stripe-10.1.0/stripe/financial_connections/0000755000175100001770000000000014637354616020357 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/financial_connections/__init__.py0000644000175100001770000000162714637354563022477 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe.financial_connections._account import Account as Account from stripe.financial_connections._account_owner import ( AccountOwner as AccountOwner, ) from stripe.financial_connections._account_owner_service import ( AccountOwnerService as AccountOwnerService, ) from stripe.financial_connections._account_ownership import ( AccountOwnership as AccountOwnership, ) from stripe.financial_connections._account_service import ( AccountService as AccountService, ) from stripe.financial_connections._session import Session as Session from stripe.financial_connections._session_service import ( SessionService as SessionService, ) from stripe.financial_connections._transaction import ( Transaction as Transaction, ) from stripe.financial_connections._transaction_service import ( TransactionService as TransactionService, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/financial_connections/_account.py0000644000175100001770000007721514637354563022541 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._account import Account as AccountResource from stripe._customer import Customer from stripe.financial_connections._account_owner import AccountOwner from stripe.financial_connections._account_ownership import ( AccountOwnership, ) class Account(ListableAPIResource["Account"]): """ A Financial Connections Account represents an account that exists outside of Stripe, to which you have been granted some degree of access. """ OBJECT_NAME: ClassVar[Literal["financial_connections.account"]] = ( "financial_connections.account" ) class AccountHolder(StripeObject): account: Optional[ExpandableField["AccountResource"]] """ The ID of the Stripe account this account belongs to. Should only be present if `account_holder.type` is `account`. """ customer: Optional[ExpandableField["Customer"]] """ ID of the Stripe customer this account belongs to. Present if and only if `account_holder.type` is `customer`. """ type: Literal["account", "customer"] """ Type of account holder that this account belongs to. """ class Balance(StripeObject): class Cash(StripeObject): available: Optional[Dict[str, int]] """ The funds available to the account holder. Typically this is the current balance less any holds. Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. """ class Credit(StripeObject): used: Optional[Dict[str, int]] """ The credit that has been used by the account holder. Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. """ as_of: int """ The time that the external institution calculated this balance. Measured in seconds since the Unix epoch. """ cash: Optional[Cash] credit: Optional[Credit] current: Dict[str, int] """ The balances owed to (or by) the account holder. Each key is a three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Each value is a integer amount. A positive amount indicates money owed to the account holder. A negative amount indicates money owed by the account holder. """ type: Literal["cash", "credit"] """ The `type` of the balance. An additional hash is included on the balance with a name matching this value. """ _inner_class_types = {"cash": Cash, "credit": Credit} class BalanceRefresh(StripeObject): last_attempted_at: int """ The time at which the last refresh attempt was initiated. Measured in seconds since the Unix epoch. """ next_refresh_available_at: Optional[int] """ Time at which the next balance refresh can be initiated. This value will be `null` when `status` is `pending`. Measured in seconds since the Unix epoch. """ status: Literal["failed", "pending", "succeeded"] """ The status of the last refresh attempt. """ class OwnershipRefresh(StripeObject): last_attempted_at: int """ The time at which the last refresh attempt was initiated. Measured in seconds since the Unix epoch. """ next_refresh_available_at: Optional[int] """ Time at which the next ownership refresh can be initiated. This value will be `null` when `status` is `pending`. Measured in seconds since the Unix epoch. """ status: Literal["failed", "pending", "succeeded"] """ The status of the last refresh attempt. """ class TransactionRefresh(StripeObject): id: str """ Unique identifier for the object. """ last_attempted_at: int """ The time at which the last refresh attempt was initiated. Measured in seconds since the Unix epoch. """ next_refresh_available_at: Optional[int] """ Time at which the next transaction refresh can be initiated. This value will be `null` when `status` is `pending`. Measured in seconds since the Unix epoch. """ status: Literal["failed", "pending", "succeeded"] """ The status of the last refresh attempt. """ class DisconnectParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ListOwnersParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ ownership: str """ The ID of the ownership object to fetch owners from. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParams(RequestOptions): account_holder: NotRequired["Account.ListParamsAccountHolder"] """ If present, only return accounts that belong to the specified account holder. `account_holder[customer]` and `account_holder[account]` are mutually exclusive. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ session: NotRequired[str] """ If present, only return accounts that were collected as part of the given session. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsAccountHolder(TypedDict): account: NotRequired[str] """ The ID of the Stripe account whose accounts will be retrieved. """ customer: NotRequired[str] """ The ID of the Stripe customer whose accounts will be retrieved. """ class RefreshAccountParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ features: List[Literal["balance", "ownership", "transactions"]] """ The list of account features that you would like to refresh. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class SubscribeParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ features: List[Literal["transactions"]] """ The list of account features to which you would like to subscribe. """ class UnsubscribeParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ features: List[Literal["transactions"]] """ The list of account features from which you would like to unsubscribe. """ account_holder: Optional[AccountHolder] """ The account holder that this account belongs to. """ balance: Optional[Balance] """ The most recent information about the account's balance. """ balance_refresh: Optional[BalanceRefresh] """ The state of the most recent attempt to refresh the account balance. """ category: Literal["cash", "credit", "investment", "other"] """ The type of the account. Account category is further divided in `subcategory`. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ display_name: Optional[str] """ A human-readable name that has been assigned to this account, either by the account holder or by the institution. """ id: str """ Unique identifier for the object. """ institution_name: str """ The name of the institution that holds this account. """ last4: Optional[str] """ The last 4 digits of the account number. If present, this will be 4 numeric characters. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ object: Literal["financial_connections.account"] """ String representing the object's type. Objects of the same type share the same value. """ ownership: Optional[ExpandableField["AccountOwnership"]] """ The most recent information about the account's owners. """ ownership_refresh: Optional[OwnershipRefresh] """ The state of the most recent attempt to refresh the account owners. """ permissions: Optional[ List[ Literal["balances", "ownership", "payment_method", "transactions"] ] ] """ The list of permissions granted by this account. """ status: Literal["active", "disconnected", "inactive"] """ The status of the link to the account. """ subcategory: Literal[ "checking", "credit_card", "line_of_credit", "mortgage", "other", "savings", ] """ If `category` is `cash`, one of: - `checking` - `savings` - `other` If `category` is `credit`, one of: - `mortgage` - `line_of_credit` - `credit_card` - `other` If `category` is `investment` or `other`, this will be `other`. """ subscriptions: Optional[List[Literal["transactions"]]] """ The list of data refresh subscriptions requested on this account. """ supported_payment_method_types: List[Literal["link", "us_bank_account"]] """ The [PaymentMethod type](https://stripe.com/docs/api/payment_methods/object#payment_method_object-type)(s) that can be created from this account. """ transaction_refresh: Optional[TransactionRefresh] """ The state of the most recent attempt to refresh the account transactions. """ @classmethod def _cls_disconnect( cls, account: str, **params: Unpack["Account.DisconnectParams"] ) -> "Account": """ Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions). """ return cast( "Account", cls._static_request( "post", "/v1/financial_connections/accounts/{account}/disconnect".format( account=sanitize_id(account) ), params=params, ), ) @overload @staticmethod def disconnect( account: str, **params: Unpack["Account.DisconnectParams"] ) -> "Account": """ Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions). """ ... @overload def disconnect( self, **params: Unpack["Account.DisconnectParams"] ) -> "Account": """ Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions). """ ... @class_method_variant("_cls_disconnect") def disconnect( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Account.DisconnectParams"] ) -> "Account": """ Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions). """ return cast( "Account", self._request( "post", "/v1/financial_connections/accounts/{account}/disconnect".format( account=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_disconnect_async( cls, account: str, **params: Unpack["Account.DisconnectParams"] ) -> "Account": """ Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions). """ return cast( "Account", await cls._static_request_async( "post", "/v1/financial_connections/accounts/{account}/disconnect".format( account=sanitize_id(account) ), params=params, ), ) @overload @staticmethod async def disconnect_async( account: str, **params: Unpack["Account.DisconnectParams"] ) -> "Account": """ Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions). """ ... @overload async def disconnect_async( self, **params: Unpack["Account.DisconnectParams"] ) -> "Account": """ Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions). """ ... @class_method_variant("_cls_disconnect_async") async def disconnect_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Account.DisconnectParams"] ) -> "Account": """ Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions). """ return cast( "Account", await self._request_async( "post", "/v1/financial_connections/accounts/{account}/disconnect".format( account=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def list( cls, **params: Unpack["Account.ListParams"] ) -> ListObject["Account"]: """ Returns a list of Financial Connections Account objects. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["Account.ListParams"] ) -> ListObject["Account"]: """ Returns a list of Financial Connections Account objects. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def _cls_list_owners( cls, account: str, **params: Unpack["Account.ListOwnersParams"] ) -> ListObject["AccountOwner"]: """ Lists all owners for a given Account """ return cast( ListObject["AccountOwner"], cls._static_request( "get", "/v1/financial_connections/accounts/{account}/owners".format( account=sanitize_id(account) ), params=params, ), ) @overload @staticmethod def list_owners( account: str, **params: Unpack["Account.ListOwnersParams"] ) -> ListObject["AccountOwner"]: """ Lists all owners for a given Account """ ... @overload def list_owners( self, **params: Unpack["Account.ListOwnersParams"] ) -> ListObject["AccountOwner"]: """ Lists all owners for a given Account """ ... @class_method_variant("_cls_list_owners") def list_owners( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Account.ListOwnersParams"] ) -> ListObject["AccountOwner"]: """ Lists all owners for a given Account """ return cast( ListObject["AccountOwner"], self._request( "get", "/v1/financial_connections/accounts/{account}/owners".format( account=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_list_owners_async( cls, account: str, **params: Unpack["Account.ListOwnersParams"] ) -> ListObject["AccountOwner"]: """ Lists all owners for a given Account """ return cast( ListObject["AccountOwner"], await cls._static_request_async( "get", "/v1/financial_connections/accounts/{account}/owners".format( account=sanitize_id(account) ), params=params, ), ) @overload @staticmethod async def list_owners_async( account: str, **params: Unpack["Account.ListOwnersParams"] ) -> ListObject["AccountOwner"]: """ Lists all owners for a given Account """ ... @overload async def list_owners_async( self, **params: Unpack["Account.ListOwnersParams"] ) -> ListObject["AccountOwner"]: """ Lists all owners for a given Account """ ... @class_method_variant("_cls_list_owners_async") async def list_owners_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Account.ListOwnersParams"] ) -> ListObject["AccountOwner"]: """ Lists all owners for a given Account """ return cast( ListObject["AccountOwner"], await self._request_async( "get", "/v1/financial_connections/accounts/{account}/owners".format( account=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def _cls_refresh_account( cls, account: str, **params: Unpack["Account.RefreshAccountParams"] ) -> "Account": """ Refreshes the data associated with a Financial Connections Account. """ return cast( "Account", cls._static_request( "post", "/v1/financial_connections/accounts/{account}/refresh".format( account=sanitize_id(account) ), params=params, ), ) @overload @staticmethod def refresh_account( account: str, **params: Unpack["Account.RefreshAccountParams"] ) -> "Account": """ Refreshes the data associated with a Financial Connections Account. """ ... @overload def refresh_account( self, **params: Unpack["Account.RefreshAccountParams"] ) -> "Account": """ Refreshes the data associated with a Financial Connections Account. """ ... @class_method_variant("_cls_refresh_account") def refresh_account( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Account.RefreshAccountParams"] ) -> "Account": """ Refreshes the data associated with a Financial Connections Account. """ return cast( "Account", self._request( "post", "/v1/financial_connections/accounts/{account}/refresh".format( account=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_refresh_account_async( cls, account: str, **params: Unpack["Account.RefreshAccountParams"] ) -> "Account": """ Refreshes the data associated with a Financial Connections Account. """ return cast( "Account", await cls._static_request_async( "post", "/v1/financial_connections/accounts/{account}/refresh".format( account=sanitize_id(account) ), params=params, ), ) @overload @staticmethod async def refresh_account_async( account: str, **params: Unpack["Account.RefreshAccountParams"] ) -> "Account": """ Refreshes the data associated with a Financial Connections Account. """ ... @overload async def refresh_account_async( self, **params: Unpack["Account.RefreshAccountParams"] ) -> "Account": """ Refreshes the data associated with a Financial Connections Account. """ ... @class_method_variant("_cls_refresh_account_async") async def refresh_account_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Account.RefreshAccountParams"] ) -> "Account": """ Refreshes the data associated with a Financial Connections Account. """ return cast( "Account", await self._request_async( "post", "/v1/financial_connections/accounts/{account}/refresh".format( account=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["Account.RetrieveParams"] ) -> "Account": """ Retrieves the details of an Financial Connections Account. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["Account.RetrieveParams"] ) -> "Account": """ Retrieves the details of an Financial Connections Account. """ instance = cls(id, **params) await instance.refresh_async() return instance @classmethod def _cls_subscribe( cls, account: str, **params: Unpack["Account.SubscribeParams"] ) -> "Account": """ Subscribes to periodic refreshes of data associated with a Financial Connections Account. """ return cast( "Account", cls._static_request( "post", "/v1/financial_connections/accounts/{account}/subscribe".format( account=sanitize_id(account) ), params=params, ), ) @overload @staticmethod def subscribe( account: str, **params: Unpack["Account.SubscribeParams"] ) -> "Account": """ Subscribes to periodic refreshes of data associated with a Financial Connections Account. """ ... @overload def subscribe( self, **params: Unpack["Account.SubscribeParams"] ) -> "Account": """ Subscribes to periodic refreshes of data associated with a Financial Connections Account. """ ... @class_method_variant("_cls_subscribe") def subscribe( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Account.SubscribeParams"] ) -> "Account": """ Subscribes to periodic refreshes of data associated with a Financial Connections Account. """ return cast( "Account", self._request( "post", "/v1/financial_connections/accounts/{account}/subscribe".format( account=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_subscribe_async( cls, account: str, **params: Unpack["Account.SubscribeParams"] ) -> "Account": """ Subscribes to periodic refreshes of data associated with a Financial Connections Account. """ return cast( "Account", await cls._static_request_async( "post", "/v1/financial_connections/accounts/{account}/subscribe".format( account=sanitize_id(account) ), params=params, ), ) @overload @staticmethod async def subscribe_async( account: str, **params: Unpack["Account.SubscribeParams"] ) -> "Account": """ Subscribes to periodic refreshes of data associated with a Financial Connections Account. """ ... @overload async def subscribe_async( self, **params: Unpack["Account.SubscribeParams"] ) -> "Account": """ Subscribes to periodic refreshes of data associated with a Financial Connections Account. """ ... @class_method_variant("_cls_subscribe_async") async def subscribe_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Account.SubscribeParams"] ) -> "Account": """ Subscribes to periodic refreshes of data associated with a Financial Connections Account. """ return cast( "Account", await self._request_async( "post", "/v1/financial_connections/accounts/{account}/subscribe".format( account=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def _cls_unsubscribe( cls, account: str, **params: Unpack["Account.UnsubscribeParams"] ) -> "Account": """ Unsubscribes from periodic refreshes of data associated with a Financial Connections Account. """ return cast( "Account", cls._static_request( "post", "/v1/financial_connections/accounts/{account}/unsubscribe".format( account=sanitize_id(account) ), params=params, ), ) @overload @staticmethod def unsubscribe( account: str, **params: Unpack["Account.UnsubscribeParams"] ) -> "Account": """ Unsubscribes from periodic refreshes of data associated with a Financial Connections Account. """ ... @overload def unsubscribe( self, **params: Unpack["Account.UnsubscribeParams"] ) -> "Account": """ Unsubscribes from periodic refreshes of data associated with a Financial Connections Account. """ ... @class_method_variant("_cls_unsubscribe") def unsubscribe( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Account.UnsubscribeParams"] ) -> "Account": """ Unsubscribes from periodic refreshes of data associated with a Financial Connections Account. """ return cast( "Account", self._request( "post", "/v1/financial_connections/accounts/{account}/unsubscribe".format( account=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_unsubscribe_async( cls, account: str, **params: Unpack["Account.UnsubscribeParams"] ) -> "Account": """ Unsubscribes from periodic refreshes of data associated with a Financial Connections Account. """ return cast( "Account", await cls._static_request_async( "post", "/v1/financial_connections/accounts/{account}/unsubscribe".format( account=sanitize_id(account) ), params=params, ), ) @overload @staticmethod async def unsubscribe_async( account: str, **params: Unpack["Account.UnsubscribeParams"] ) -> "Account": """ Unsubscribes from periodic refreshes of data associated with a Financial Connections Account. """ ... @overload async def unsubscribe_async( self, **params: Unpack["Account.UnsubscribeParams"] ) -> "Account": """ Unsubscribes from periodic refreshes of data associated with a Financial Connections Account. """ ... @class_method_variant("_cls_unsubscribe_async") async def unsubscribe_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Account.UnsubscribeParams"] ) -> "Account": """ Unsubscribes from periodic refreshes of data associated with a Financial Connections Account. """ return cast( "Account", await self._request_async( "post", "/v1/financial_connections/accounts/{account}/unsubscribe".format( account=sanitize_id(self.get("id")) ), params=params, ), ) _inner_class_types = { "account_holder": AccountHolder, "balance": Balance, "balance_refresh": BalanceRefresh, "ownership_refresh": OwnershipRefresh, "transaction_refresh": TransactionRefresh, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/financial_connections/_account_owner.py0000644000175100001770000000216514637354563023743 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject from typing import ClassVar, Optional from typing_extensions import Literal class AccountOwner(StripeObject): """ Describes an owner of an account. """ OBJECT_NAME: ClassVar[Literal["financial_connections.account_owner"]] = ( "financial_connections.account_owner" ) email: Optional[str] """ The email address of the owner. """ id: str """ Unique identifier for the object. """ name: str """ The full name of the owner. """ object: Literal["financial_connections.account_owner"] """ String representing the object's type. Objects of the same type share the same value. """ ownership: str """ The ownership object that this owner belongs to. """ phone: Optional[str] """ The raw phone number of the owner. """ raw_address: Optional[str] """ The raw physical address of the owner. """ refreshed_at: Optional[int] """ The timestamp of the refresh that updated this owner. """ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/financial_connections/_account_owner_service.py0000644000175100001770000000561014637354563025461 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.financial_connections._account_owner import AccountOwner from typing import List, cast from typing_extensions import NotRequired, TypedDict class AccountOwnerService(StripeService): class ListParams(TypedDict): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ ownership: str """ The ID of the ownership object to fetch owners from. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ def list( self, account: str, params: "AccountOwnerService.ListParams", options: RequestOptions = {}, ) -> ListObject[AccountOwner]: """ Lists all owners for a given Account """ return cast( ListObject[AccountOwner], self._request( "get", "/v1/financial_connections/accounts/{account}/owners".format( account=sanitize_id(account), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, account: str, params: "AccountOwnerService.ListParams", options: RequestOptions = {}, ) -> ListObject[AccountOwner]: """ Lists all owners for a given Account """ return cast( ListObject[AccountOwner], await self._request_async( "get", "/v1/financial_connections/accounts/{account}/owners".format( account=sanitize_id(account), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/financial_connections/_account_ownership.py0000644000175100001770000000204314637354563024622 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._stripe_object import StripeObject from typing import ClassVar from typing_extensions import Literal, TYPE_CHECKING if TYPE_CHECKING: from stripe.financial_connections._account_owner import AccountOwner class AccountOwnership(StripeObject): """ Describes a snapshot of the owners of an account at a particular point in time. """ OBJECT_NAME: ClassVar[ Literal["financial_connections.account_ownership"] ] = "financial_connections.account_ownership" created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ id: str """ Unique identifier for the object. """ object: Literal["financial_connections.account_ownership"] """ String representing the object's type. Objects of the same type share the same value. """ owners: ListObject["AccountOwner"] """ A paginated list of owners for this account. """ ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/financial_connections/_account_service.py0000644000175100001770000002714014637354563024251 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.financial_connections._account import Account from stripe.financial_connections._account_owner_service import ( AccountOwnerService, ) from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict class AccountService(StripeService): def __init__(self, requestor): super().__init__(requestor) self.owners = AccountOwnerService(self._requestor) class DisconnectParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ListParams(TypedDict): account_holder: NotRequired["AccountService.ListParamsAccountHolder"] """ If present, only return accounts that belong to the specified account holder. `account_holder[customer]` and `account_holder[account]` are mutually exclusive. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ session: NotRequired[str] """ If present, only return accounts that were collected as part of the given session. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsAccountHolder(TypedDict): account: NotRequired[str] """ The ID of the Stripe account whose accounts will be retrieved. """ customer: NotRequired[str] """ The ID of the Stripe customer whose accounts will be retrieved. """ class RefreshParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ features: List[Literal["balance", "ownership", "transactions"]] """ The list of account features that you would like to refresh. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class SubscribeParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ features: List[Literal["transactions"]] """ The list of account features to which you would like to subscribe. """ class UnsubscribeParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ features: List[Literal["transactions"]] """ The list of account features from which you would like to unsubscribe. """ def list( self, params: "AccountService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Account]: """ Returns a list of Financial Connections Account objects. """ return cast( ListObject[Account], self._request( "get", "/v1/financial_connections/accounts", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "AccountService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Account]: """ Returns a list of Financial Connections Account objects. """ return cast( ListObject[Account], await self._request_async( "get", "/v1/financial_connections/accounts", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, account: str, params: "AccountService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Account: """ Retrieves the details of an Financial Connections Account. """ return cast( Account, self._request( "get", "/v1/financial_connections/accounts/{account}".format( account=sanitize_id(account), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, account: str, params: "AccountService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Account: """ Retrieves the details of an Financial Connections Account. """ return cast( Account, await self._request_async( "get", "/v1/financial_connections/accounts/{account}".format( account=sanitize_id(account), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def disconnect( self, account: str, params: "AccountService.DisconnectParams" = {}, options: RequestOptions = {}, ) -> Account: """ Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions). """ return cast( Account, self._request( "post", "/v1/financial_connections/accounts/{account}/disconnect".format( account=sanitize_id(account), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def disconnect_async( self, account: str, params: "AccountService.DisconnectParams" = {}, options: RequestOptions = {}, ) -> Account: """ Disables your access to a Financial Connections Account. You will no longer be able to access data associated with the account (e.g. balances, transactions). """ return cast( Account, await self._request_async( "post", "/v1/financial_connections/accounts/{account}/disconnect".format( account=sanitize_id(account), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def refresh( self, account: str, params: "AccountService.RefreshParams", options: RequestOptions = {}, ) -> Account: """ Refreshes the data associated with a Financial Connections Account. """ return cast( Account, self._request( "post", "/v1/financial_connections/accounts/{account}/refresh".format( account=sanitize_id(account), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def refresh_async( self, account: str, params: "AccountService.RefreshParams", options: RequestOptions = {}, ) -> Account: """ Refreshes the data associated with a Financial Connections Account. """ return cast( Account, await self._request_async( "post", "/v1/financial_connections/accounts/{account}/refresh".format( account=sanitize_id(account), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def subscribe( self, account: str, params: "AccountService.SubscribeParams", options: RequestOptions = {}, ) -> Account: """ Subscribes to periodic refreshes of data associated with a Financial Connections Account. """ return cast( Account, self._request( "post", "/v1/financial_connections/accounts/{account}/subscribe".format( account=sanitize_id(account), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def subscribe_async( self, account: str, params: "AccountService.SubscribeParams", options: RequestOptions = {}, ) -> Account: """ Subscribes to periodic refreshes of data associated with a Financial Connections Account. """ return cast( Account, await self._request_async( "post", "/v1/financial_connections/accounts/{account}/subscribe".format( account=sanitize_id(account), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def unsubscribe( self, account: str, params: "AccountService.UnsubscribeParams", options: RequestOptions = {}, ) -> Account: """ Unsubscribes from periodic refreshes of data associated with a Financial Connections Account. """ return cast( Account, self._request( "post", "/v1/financial_connections/accounts/{account}/unsubscribe".format( account=sanitize_id(account), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def unsubscribe_async( self, account: str, params: "AccountService.UnsubscribeParams", options: RequestOptions = {}, ) -> Account: """ Unsubscribes from periodic refreshes of data associated with a Financial Connections Account. """ return cast( Account, await self._request_async( "post", "/v1/financial_connections/accounts/{account}/unsubscribe".format( account=sanitize_id(account), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/financial_connections/_session.py0000644000175100001770000001725214637354563022563 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from typing import ClassVar, List, Optional, cast from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._account import Account as AccountResource from stripe._customer import Customer from stripe.financial_connections._account import ( Account as FinancialConnectionsAccountResource, ) class Session(CreateableAPIResource["Session"]): """ A Financial Connections Session is the secure way to programmatically launch the client-side Stripe.js modal that lets your users link their accounts. """ OBJECT_NAME: ClassVar[Literal["financial_connections.session"]] = ( "financial_connections.session" ) class AccountHolder(StripeObject): account: Optional[ExpandableField["AccountResource"]] """ The ID of the Stripe account this account belongs to. Should only be present if `account_holder.type` is `account`. """ customer: Optional[ExpandableField["Customer"]] """ ID of the Stripe customer this account belongs to. Present if and only if `account_holder.type` is `customer`. """ type: Literal["account", "customer"] """ Type of account holder that this account belongs to. """ class Filters(StripeObject): account_subcategories: Optional[ List[ Literal[ "checking", "credit_card", "line_of_credit", "mortgage", "savings", ] ] ] """ Restricts the Session to subcategories of accounts that can be linked. Valid subcategories are: `checking`, `savings`, `mortgage`, `line_of_credit`, `credit_card`. """ countries: Optional[List[str]] """ List of countries from which to filter accounts. """ class CreateParams(RequestOptions): account_holder: "Session.CreateParamsAccountHolder" """ The account holder to link accounts for. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ filters: NotRequired["Session.CreateParamsFilters"] """ Filters to restrict the kinds of accounts to collect. """ permissions: List[ Literal["balances", "ownership", "payment_method", "transactions"] ] """ List of data features that you would like to request access to. Possible values are `balances`, `transactions`, `ownership`, and `payment_method`. """ prefetch: NotRequired[ List[Literal["balances", "ownership", "transactions"]] ] """ List of data features that you would like to retrieve upon account creation. """ return_url: NotRequired[str] """ For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. """ class CreateParamsAccountHolder(TypedDict): account: NotRequired[str] """ The ID of the Stripe account whose accounts will be retrieved. Should only be present if `type` is `account`. """ customer: NotRequired[str] """ The ID of the Stripe customer whose accounts will be retrieved. Should only be present if `type` is `customer`. """ type: Literal["account", "customer"] """ Type of account holder to collect accounts for. """ class CreateParamsFilters(TypedDict): account_subcategories: NotRequired[ List[ Literal[ "checking", "credit_card", "line_of_credit", "mortgage", "savings", ] ] ] """ Restricts the Session to subcategories of accounts that can be linked. Valid subcategories are: `checking`, `savings`, `mortgage`, `line_of_credit`, `credit_card`. """ countries: NotRequired[List[str]] """ List of countries from which to collect accounts. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ account_holder: Optional[AccountHolder] """ The account holder for whom accounts are collected in this session. """ accounts: ListObject["FinancialConnectionsAccountResource"] """ The accounts that were collected as part of this Session. """ client_secret: str """ A value that will be passed to the client to launch the authentication flow. """ filters: Optional[Filters] id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ object: Literal["financial_connections.session"] """ String representing the object's type. Objects of the same type share the same value. """ permissions: List[ Literal["balances", "ownership", "payment_method", "transactions"] ] """ Permissions requested for accounts collected during this session. """ prefetch: Optional[List[Literal["balances", "ownership", "transactions"]]] """ Data features requested to be retrieved upon account creation. """ return_url: Optional[str] """ For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. """ @classmethod def create(cls, **params: Unpack["Session.CreateParams"]) -> "Session": """ To launch the Financial Connections authorization flow, create a Session. The session's client_secret can be used to launch the flow using Stripe.js. """ return cast( "Session", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["Session.CreateParams"] ) -> "Session": """ To launch the Financial Connections authorization flow, create a Session. The session's client_secret can be used to launch the flow using Stripe.js. """ return cast( "Session", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["Session.RetrieveParams"] ) -> "Session": """ Retrieves the details of a Financial Connections Session """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["Session.RetrieveParams"] ) -> "Session": """ Retrieves the details of a Financial Connections Session """ instance = cls(id, **params) await instance.refresh_async() return instance _inner_class_types = {"account_holder": AccountHolder, "filters": Filters} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/financial_connections/_session_service.py0000644000175100001770000001260514637354563024300 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.financial_connections._session import Session from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict class SessionService(StripeService): class CreateParams(TypedDict): account_holder: "SessionService.CreateParamsAccountHolder" """ The account holder to link accounts for. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ filters: NotRequired["SessionService.CreateParamsFilters"] """ Filters to restrict the kinds of accounts to collect. """ permissions: List[ Literal["balances", "ownership", "payment_method", "transactions"] ] """ List of data features that you would like to request access to. Possible values are `balances`, `transactions`, `ownership`, and `payment_method`. """ prefetch: NotRequired[ List[Literal["balances", "ownership", "transactions"]] ] """ List of data features that you would like to retrieve upon account creation. """ return_url: NotRequired[str] """ For webview integrations only. Upon completing OAuth login in the native browser, the user will be redirected to this URL to return to your app. """ class CreateParamsAccountHolder(TypedDict): account: NotRequired[str] """ The ID of the Stripe account whose accounts will be retrieved. Should only be present if `type` is `account`. """ customer: NotRequired[str] """ The ID of the Stripe customer whose accounts will be retrieved. Should only be present if `type` is `customer`. """ type: Literal["account", "customer"] """ Type of account holder to collect accounts for. """ class CreateParamsFilters(TypedDict): account_subcategories: NotRequired[ List[ Literal[ "checking", "credit_card", "line_of_credit", "mortgage", "savings", ] ] ] """ Restricts the Session to subcategories of accounts that can be linked. Valid subcategories are: `checking`, `savings`, `mortgage`, `line_of_credit`, `credit_card`. """ countries: NotRequired[List[str]] """ List of countries from which to collect accounts. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def retrieve( self, session: str, params: "SessionService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Session: """ Retrieves the details of a Financial Connections Session """ return cast( Session, self._request( "get", "/v1/financial_connections/sessions/{session}".format( session=sanitize_id(session), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, session: str, params: "SessionService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Session: """ Retrieves the details of a Financial Connections Session """ return cast( Session, await self._request_async( "get", "/v1/financial_connections/sessions/{session}".format( session=sanitize_id(session), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "SessionService.CreateParams", options: RequestOptions = {}, ) -> Session: """ To launch the Financial Connections authorization flow, create a Session. The session's client_secret can be used to launch the flow using Stripe.js. """ return cast( Session, self._request( "post", "/v1/financial_connections/sessions", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "SessionService.CreateParams", options: RequestOptions = {}, ) -> Session: """ To launch the Financial Connections authorization flow, create a Session. The session's client_secret can be used to launch the flow using Stripe.js. """ return cast( Session, await self._request_async( "post", "/v1/financial_connections/sessions", api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/financial_connections/_transaction.py0000644000175100001770000001531214637354563023420 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from typing import ClassVar, List, Optional from typing_extensions import Literal, NotRequired, TypedDict, Unpack class Transaction(ListableAPIResource["Transaction"]): """ A Transaction represents a real transaction that affects a Financial Connections Account balance. """ OBJECT_NAME: ClassVar[Literal["financial_connections.transaction"]] = ( "financial_connections.transaction" ) class StatusTransitions(StripeObject): posted_at: Optional[int] """ Time at which this transaction posted. Measured in seconds since the Unix epoch. """ void_at: Optional[int] """ Time at which this transaction was voided. Measured in seconds since the Unix epoch. """ class ListParams(RequestOptions): account: str """ The ID of the Stripe account whose transactions will be retrieved. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ transacted_at: NotRequired["Transaction.ListParamsTransactedAt|int"] """ A filter on the list based on the object `transacted_at` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with the following options: """ transaction_refresh: NotRequired[ "Transaction.ListParamsTransactionRefresh" ] """ A filter on the list based on the object `transaction_refresh` field. The value can be a dictionary with the following options: """ class ListParamsTransactedAt(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsTransactionRefresh(TypedDict): after: str """ Return results where the transactions were created or updated by a refresh that took place after this refresh (non-inclusive). """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ account: str """ The ID of the Financial Connections Account this transaction belongs to. """ amount: int """ The amount of this transaction, in cents (or local equivalent). """ 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: str """ The description of this transaction. """ id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ object: Literal["financial_connections.transaction"] """ String representing the object's type. Objects of the same type share the same value. """ status: Literal["pending", "posted", "void"] """ The status of the transaction. """ status_transitions: StatusTransitions transacted_at: int """ Time at which the transaction was transacted. Measured in seconds since the Unix epoch. """ transaction_refresh: str """ The token of the transaction refresh that last updated or created this transaction. """ updated: int """ Time at which the object was last updated. Measured in seconds since the Unix epoch. """ @classmethod def list( cls, **params: Unpack["Transaction.ListParams"] ) -> ListObject["Transaction"]: """ Returns a list of Financial Connections Transaction objects. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["Transaction.ListParams"] ) -> ListObject["Transaction"]: """ Returns a list of Financial Connections Transaction objects. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def retrieve( cls, id: str, **params: Unpack["Transaction.RetrieveParams"] ) -> "Transaction": """ Retrieves the details of a Financial Connections Transaction """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["Transaction.RetrieveParams"] ) -> "Transaction": """ Retrieves the details of a Financial Connections Transaction """ instance = cls(id, **params) await instance.refresh_async() return instance _inner_class_types = {"status_transitions": StatusTransitions} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/financial_connections/_transaction_service.py0000644000175100001770000001273214637354563025143 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.financial_connections._transaction import Transaction from typing import List, cast from typing_extensions import NotRequired, TypedDict class TransactionService(StripeService): class ListParams(TypedDict): account: str """ The ID of the Stripe account whose transactions will be retrieved. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ transacted_at: NotRequired[ "TransactionService.ListParamsTransactedAt|int" ] """ A filter on the list based on the object `transacted_at` field. The value can be a string with an integer Unix timestamp, or it can be a dictionary with the following options: """ transaction_refresh: NotRequired[ "TransactionService.ListParamsTransactionRefresh" ] """ A filter on the list based on the object `transaction_refresh` field. The value can be a dictionary with the following options: """ class ListParamsTransactedAt(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsTransactionRefresh(TypedDict): after: str """ Return results where the transactions were created or updated by a refresh that took place after this refresh (non-inclusive). """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def list( self, params: "TransactionService.ListParams", options: RequestOptions = {}, ) -> ListObject[Transaction]: """ Returns a list of Financial Connections Transaction objects. """ return cast( ListObject[Transaction], self._request( "get", "/v1/financial_connections/transactions", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "TransactionService.ListParams", options: RequestOptions = {}, ) -> ListObject[Transaction]: """ Returns a list of Financial Connections Transaction objects. """ return cast( ListObject[Transaction], await self._request_async( "get", "/v1/financial_connections/transactions", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, transaction: str, params: "TransactionService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Transaction: """ Retrieves the details of a Financial Connections Transaction """ return cast( Transaction, self._request( "get", "/v1/financial_connections/transactions/{transaction}".format( transaction=sanitize_id(transaction), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, transaction: str, params: "TransactionService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Transaction: """ Retrieves the details of a Financial Connections Transaction """ return cast( Transaction, await self._request_async( "get", "/v1/financial_connections/transactions/{transaction}".format( transaction=sanitize_id(transaction), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5369406 stripe-10.1.0/stripe/forwarding/0000755000175100001770000000000014637354616016173 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/forwarding/__init__.py0000644000175100001770000000031114637354563020300 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe.forwarding._request import Request as Request from stripe.forwarding._request_service import RequestService as RequestService ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/forwarding/_request.py0000644000175100001770000002434514637354563020405 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from typing import ClassVar, List, Optional, cast from typing_extensions import Literal, NotRequired, TypedDict, Unpack class Request( CreateableAPIResource["Request"], ListableAPIResource["Request"] ): """ Instructs Stripe to make a request on your behalf using the destination URL. The destination URL is activated by Stripe at the time of onboarding. Stripe verifies requests with your credentials provided during onboarding, and injects card details from the payment_method into the request. Stripe redacts all sensitive fields and headers, including authentication credentials and card numbers, before storing the request and response data in the forwarding Request object, which are subject to a 30-day retention period. You can provide a Stripe idempotency key to make sure that requests with the same key result in only one outbound request. The Stripe idempotency key provided should be unique and different from any idempotency keys provided on the underlying third-party request. Forwarding Requests are synchronous requests that return a response or time out according to Stripe's limits. Related guide: [Forward card details to third-party API endpoints](https://docs.stripe.com/payments/forwarding). """ OBJECT_NAME: ClassVar[Literal["forwarding.request"]] = "forwarding.request" class RequestContext(StripeObject): destination_duration: int """ The time it took in milliseconds for the destination endpoint to respond. """ destination_ip_address: str """ The IP address of the destination. """ class RequestDetails(StripeObject): class Header(StripeObject): name: str """ The header name. """ value: str """ The header value. """ body: str """ The body payload to send to the destination endpoint. """ headers: List[Header] """ The headers to include in the forwarded request. Can be omitted if no additional headers (excluding Stripe-generated ones such as the Content-Type header) should be included. """ http_method: Literal["POST"] """ The HTTP method used to call the destination endpoint. """ _inner_class_types = {"headers": Header} class ResponseDetails(StripeObject): class Header(StripeObject): name: str """ The header name. """ value: str """ The header value. """ body: str """ The response body from the destination endpoint to Stripe. """ headers: List[Header] """ HTTP headers that the destination endpoint returned. """ status: int """ The HTTP status code that the destination endpoint returned. """ _inner_class_types = {"headers": Header} class CreateParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ payment_method: str """ The PaymentMethod to insert into the forwarded request. Forwarding previously consumed PaymentMethods is allowed. """ replacements: List[ Literal[ "card_cvc", "card_expiry", "card_number", "cardholder_name" ] ] """ The field kinds to be replaced in the forwarded request. """ request: "Request.CreateParamsRequest" """ The request body and headers to be sent to the destination endpoint. """ url: str """ The destination URL for the forwarded request. Must be supported by the config. """ class CreateParamsRequest(TypedDict): body: NotRequired[str] """ The body payload to send to the destination endpoint. """ headers: NotRequired[List["Request.CreateParamsRequestHeader"]] """ The headers to include in the forwarded request. Can be omitted if no additional headers (excluding Stripe-generated ones such as the Content-Type header) should be included. """ class CreateParamsRequestHeader(TypedDict): name: str """ The header name. """ value: str """ The header value. """ class ListParams(RequestOptions): created: NotRequired["Request.ListParamsCreated"] """ Similar to other List endpoints, filters results based on created timestamp. You can pass gt, gte, lt, and lte timestamp values. """ ending_before: NotRequired[str] """ A pagination cursor to fetch the previous page of the list. The value must be a ForwardingRequest ID. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A pagination cursor to fetch the next page of the list. The value must be a ForwardingRequest ID. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Return results where the `created` field is greater than this value. """ gte: NotRequired[int] """ Return results where the `created` field is greater than or equal to this value. """ lt: NotRequired[int] """ Return results where the `created` field is less than this value. """ lte: NotRequired[int] """ Return results where the `created` field is less than or equal to this value. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ object: Literal["forwarding.request"] """ String representing the object's type. Objects of the same type share the same value. """ payment_method: str """ The PaymentMethod to insert into the forwarded request. Forwarding previously consumed PaymentMethods is allowed. """ replacements: List[ Literal["card_cvc", "card_expiry", "card_number", "cardholder_name"] ] """ The field kinds to be replaced in the forwarded request. """ request_context: Optional[RequestContext] """ Context about the request from Stripe's servers to the destination endpoint. """ request_details: Optional[RequestDetails] """ The request that was sent to the destination endpoint. We redact any sensitive fields. """ response_details: Optional[ResponseDetails] """ The response that the destination endpoint returned to us. We redact any sensitive fields. """ url: Optional[str] """ The destination URL for the forwarded request. Must be supported by the config. """ @classmethod def create(cls, **params: Unpack["Request.CreateParams"]) -> "Request": """ Creates a ForwardingRequest object. """ return cast( "Request", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["Request.CreateParams"] ) -> "Request": """ Creates a ForwardingRequest object. """ return cast( "Request", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def list( cls, **params: Unpack["Request.ListParams"] ) -> ListObject["Request"]: """ Lists all ForwardingRequest objects. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["Request.ListParams"] ) -> ListObject["Request"]: """ Lists all ForwardingRequest objects. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def retrieve( cls, id: str, **params: Unpack["Request.RetrieveParams"] ) -> "Request": """ Retrieves a ForwardingRequest object. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["Request.RetrieveParams"] ) -> "Request": """ Retrieves a ForwardingRequest object. """ instance = cls(id, **params) await instance.refresh_async() return instance _inner_class_types = { "request_context": RequestContext, "request_details": RequestDetails, "response_details": ResponseDetails, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/forwarding/_request_service.py0000644000175100001770000001516414637354563022124 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.forwarding._request import Request from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict class RequestService(StripeService): class CreateParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ payment_method: str """ The PaymentMethod to insert into the forwarded request. Forwarding previously consumed PaymentMethods is allowed. """ replacements: List[ Literal[ "card_cvc", "card_expiry", "card_number", "cardholder_name" ] ] """ The field kinds to be replaced in the forwarded request. """ request: "RequestService.CreateParamsRequest" """ The request body and headers to be sent to the destination endpoint. """ url: str """ The destination URL for the forwarded request. Must be supported by the config. """ class CreateParamsRequest(TypedDict): body: NotRequired[str] """ The body payload to send to the destination endpoint. """ headers: NotRequired[List["RequestService.CreateParamsRequestHeader"]] """ The headers to include in the forwarded request. Can be omitted if no additional headers (excluding Stripe-generated ones such as the Content-Type header) should be included. """ class CreateParamsRequestHeader(TypedDict): name: str """ The header name. """ value: str """ The header value. """ class ListParams(TypedDict): created: NotRequired["RequestService.ListParamsCreated"] """ Similar to other List endpoints, filters results based on created timestamp. You can pass gt, gte, lt, and lte timestamp values. """ ending_before: NotRequired[str] """ A pagination cursor to fetch the previous page of the list. The value must be a ForwardingRequest ID. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A pagination cursor to fetch the next page of the list. The value must be a ForwardingRequest ID. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Return results where the `created` field is greater than this value. """ gte: NotRequired[int] """ Return results where the `created` field is greater than or equal to this value. """ lt: NotRequired[int] """ Return results where the `created` field is less than this value. """ lte: NotRequired[int] """ Return results where the `created` field is less than or equal to this value. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def list( self, params: "RequestService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Request]: """ Lists all ForwardingRequest objects. """ return cast( ListObject[Request], self._request( "get", "/v1/forwarding/requests", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "RequestService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Request]: """ Lists all ForwardingRequest objects. """ return cast( ListObject[Request], await self._request_async( "get", "/v1/forwarding/requests", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "RequestService.CreateParams", options: RequestOptions = {}, ) -> Request: """ Creates a ForwardingRequest object. """ return cast( Request, self._request( "post", "/v1/forwarding/requests", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "RequestService.CreateParams", options: RequestOptions = {}, ) -> Request: """ Creates a ForwardingRequest object. """ return cast( Request, await self._request_async( "post", "/v1/forwarding/requests", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, id: str, params: "RequestService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Request: """ Retrieves a ForwardingRequest object. """ return cast( Request, self._request( "get", "/v1/forwarding/requests/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, id: str, params: "RequestService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Request: """ Retrieves a ForwardingRequest object. """ return cast( Request, await self._request_async( "get", "/v1/forwarding/requests/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/http_client.py0000644000175100001770000000067614637354563016732 0ustar00runnerdocker# -*- coding: utf-8 -*- from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.http_client package is deprecated, please change your imports to import from stripe directly. From: from stripe.http_client import HTTPClient To: from stripe import HTTPClient """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._http_client import * # noqa ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5369406 stripe-10.1.0/stripe/identity/0000755000175100001770000000000014637354616015662 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/identity/__init__.py0000644000175100001770000000077514637354563020005 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe.identity._verification_report import ( VerificationReport as VerificationReport, ) from stripe.identity._verification_report_service import ( VerificationReportService as VerificationReportService, ) from stripe.identity._verification_session import ( VerificationSession as VerificationSession, ) from stripe.identity._verification_session_service import ( VerificationSessionService as VerificationSessionService, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/identity/_verification_report.py0000644000175100001770000004232414637354563022456 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from typing import ClassVar, List, Optional from typing_extensions import Literal, NotRequired, TypedDict, Unpack class VerificationReport(ListableAPIResource["VerificationReport"]): """ A VerificationReport is the result of an attempt to collect and verify data from a user. The collection of verification checks performed is determined from the `type` and `options` parameters used. You can find the result of each verification check performed in the appropriate sub-resource: `document`, `id_number`, `selfie`. Each VerificationReport contains a copy of any data collected by the user as well as reference IDs which can be used to access collected images through the [FileUpload](https://stripe.com/docs/api/files) API. To configure and create VerificationReports, use the [VerificationSession](https://stripe.com/docs/api/identity/verification_sessions) API. Related guides: [Accessing verification results](https://stripe.com/docs/identity/verification-sessions#results). """ OBJECT_NAME: ClassVar[Literal["identity.verification_report"]] = ( "identity.verification_report" ) class Document(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 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State, county, province, or region. """ class Dob(StripeObject): day: Optional[int] """ Numerical day between 1 and 31. """ month: Optional[int] """ Numerical month between 1 and 12. """ year: Optional[int] """ The four-digit year. """ class Error(StripeObject): code: Optional[ Literal[ "document_expired", "document_type_not_supported", "document_unverified_other", ] ] """ A short machine-readable string giving the reason for the verification failure. """ reason: Optional[str] """ A human-readable message giving the reason for the failure. These messages can be shown to your users. """ class ExpirationDate(StripeObject): day: Optional[int] """ Numerical day between 1 and 31. """ month: Optional[int] """ Numerical month between 1 and 12. """ year: Optional[int] """ The four-digit year. """ class IssuedDate(StripeObject): day: Optional[int] """ Numerical day between 1 and 31. """ month: Optional[int] """ Numerical month between 1 and 12. """ year: Optional[int] """ The four-digit year. """ address: Optional[Address] """ Address as it appears in the document. """ dob: Optional[Dob] """ Date of birth as it appears in the document. """ error: Optional[Error] """ Details on the verification error. Present when status is `unverified`. """ expiration_date: Optional[ExpirationDate] """ Expiration date of the document. """ files: Optional[List[str]] """ Array of [File](https://stripe.com/docs/api/files) ids containing images for this document. """ first_name: Optional[str] """ First name as it appears in the document. """ issued_date: Optional[IssuedDate] """ Issued date of the document. """ issuing_country: Optional[str] """ Issuing country of the document. """ last_name: Optional[str] """ Last name as it appears in the document. """ number: Optional[str] """ Document ID number. """ status: Literal["unverified", "verified"] """ Status of this `document` check. """ type: Optional[Literal["driving_license", "id_card", "passport"]] """ Type of the document. """ _inner_class_types = { "address": Address, "dob": Dob, "error": Error, "expiration_date": ExpirationDate, "issued_date": IssuedDate, } class Email(StripeObject): class Error(StripeObject): code: Optional[ Literal[ "email_unverified_other", "email_verification_declined" ] ] """ A short machine-readable string giving the reason for the verification failure. """ reason: Optional[str] """ A human-readable message giving the reason for the failure. These messages can be shown to your users. """ email: Optional[str] """ Email to be verified. """ error: Optional[Error] """ Details on the verification error. Present when status is `unverified`. """ status: Literal["unverified", "verified"] """ Status of this `email` check. """ _inner_class_types = {"error": Error} class IdNumber(StripeObject): class Dob(StripeObject): day: Optional[int] """ Numerical day between 1 and 31. """ month: Optional[int] """ Numerical month between 1 and 12. """ year: Optional[int] """ The four-digit year. """ class Error(StripeObject): code: Optional[ Literal[ "id_number_insufficient_document_data", "id_number_mismatch", "id_number_unverified_other", ] ] """ A short machine-readable string giving the reason for the verification failure. """ reason: Optional[str] """ A human-readable message giving the reason for the failure. These messages can be shown to your users. """ dob: Optional[Dob] """ Date of birth. """ error: Optional[Error] """ Details on the verification error. Present when status is `unverified`. """ first_name: Optional[str] """ First name. """ id_number: Optional[str] """ ID number. When `id_number_type` is `us_ssn`, only the last 4 digits are present. """ id_number_type: Optional[Literal["br_cpf", "sg_nric", "us_ssn"]] """ Type of ID number. """ last_name: Optional[str] """ Last name. """ status: Literal["unverified", "verified"] """ Status of this `id_number` check. """ _inner_class_types = {"dob": Dob, "error": Error} class Options(StripeObject): class Document(StripeObject): allowed_types: Optional[ List[Literal["driving_license", "id_card", "passport"]] ] """ Array of strings of allowed identity document types. If the provided identity document isn't one of the allowed types, the verification check will fail with a document_type_not_allowed error code. """ require_id_number: Optional[bool] """ Collect an ID number and perform an [ID number check](https://stripe.com/docs/identity/verification-checks?type=id-number) with the document's extracted name and date of birth. """ require_live_capture: Optional[bool] """ Disable image uploads, identity document images have to be captured using the device's camera. """ require_matching_selfie: Optional[bool] """ Capture a face image and perform a [selfie check](https://stripe.com/docs/identity/verification-checks?type=selfie) comparing a photo ID and a picture of your user's face. [Learn more](https://stripe.com/docs/identity/selfie). """ class IdNumber(StripeObject): pass document: Optional[Document] id_number: Optional[IdNumber] _inner_class_types = {"document": Document, "id_number": IdNumber} class Phone(StripeObject): class Error(StripeObject): code: Optional[ Literal[ "phone_unverified_other", "phone_verification_declined" ] ] """ A short machine-readable string giving the reason for the verification failure. """ reason: Optional[str] """ A human-readable message giving the reason for the failure. These messages can be shown to your users. """ error: Optional[Error] """ Details on the verification error. Present when status is `unverified`. """ phone: Optional[str] """ Phone to be verified. """ status: Literal["unverified", "verified"] """ Status of this `phone` check. """ _inner_class_types = {"error": Error} class Selfie(StripeObject): class Error(StripeObject): code: Optional[ Literal[ "selfie_document_missing_photo", "selfie_face_mismatch", "selfie_manipulated", "selfie_unverified_other", ] ] """ A short machine-readable string giving the reason for the verification failure. """ reason: Optional[str] """ A human-readable message giving the reason for the failure. These messages can be shown to your users. """ document: Optional[str] """ ID of the [File](https://stripe.com/docs/api/files) holding the image of the identity document used in this check. """ error: Optional[Error] """ Details on the verification error. Present when status is `unverified`. """ selfie: Optional[str] """ ID of the [File](https://stripe.com/docs/api/files) holding the image of the selfie used in this check. """ status: Literal["unverified", "verified"] """ Status of this `selfie` check. """ _inner_class_types = {"error": Error} class ListParams(RequestOptions): client_reference_id: NotRequired[str] """ A string to reference this user. This can be a customer ID, a session ID, or similar, and can be used to reconcile this verification with your internal systems. """ created: NotRequired["VerificationReport.ListParamsCreated|int"] """ Only return VerificationReports that were created during the given date interval. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ type: NotRequired[Literal["document", "id_number"]] """ Only return VerificationReports of this type """ verification_session: NotRequired[str] """ Only return VerificationReports created by this VerificationSession ID. It is allowed to provide a VerificationIntent ID. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ client_reference_id: Optional[str] """ A string to reference this user. This can be a customer ID, a session ID, or similar, and can be used to reconcile this verification with your internal systems. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ document: Optional[Document] """ Result from a document check """ email: Optional[Email] """ Result from a email check """ id: str """ Unique identifier for the object. """ id_number: Optional[IdNumber] """ Result from an id_number check """ 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["identity.verification_report"] """ String representing the object's type. Objects of the same type share the same value. """ options: Optional[Options] phone: Optional[Phone] """ Result from a phone check """ selfie: Optional[Selfie] """ Result from a selfie check """ type: Literal["document", "id_number", "verification_flow"] """ Type of report. """ verification_flow: Optional[str] """ The configuration token of a Verification Flow from the dashboard. """ verification_session: Optional[str] """ ID of the VerificationSession that created this report. """ @classmethod def list( cls, **params: Unpack["VerificationReport.ListParams"] ) -> ListObject["VerificationReport"]: """ List all verification reports. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["VerificationReport.ListParams"] ) -> ListObject["VerificationReport"]: """ List all verification reports. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def retrieve( cls, id: str, **params: Unpack["VerificationReport.RetrieveParams"] ) -> "VerificationReport": """ Retrieves an existing VerificationReport """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["VerificationReport.RetrieveParams"] ) -> "VerificationReport": """ Retrieves an existing VerificationReport """ instance = cls(id, **params) await instance.refresh_async() return instance _inner_class_types = { "document": Document, "email": Email, "id_number": IdNumber, "options": Options, "phone": Phone, "selfie": Selfie, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/identity/_verification_report_service.py0000644000175100001770000001237614637354563024202 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.identity._verification_report import VerificationReport from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict class VerificationReportService(StripeService): class ListParams(TypedDict): client_reference_id: NotRequired[str] """ A string to reference this user. This can be a customer ID, a session ID, or similar, and can be used to reconcile this verification with your internal systems. """ created: NotRequired["VerificationReportService.ListParamsCreated|int"] """ Only return VerificationReports that were created during the given date interval. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ type: NotRequired[Literal["document", "id_number"]] """ Only return VerificationReports of this type """ verification_session: NotRequired[str] """ Only return VerificationReports created by this VerificationSession ID. It is allowed to provide a VerificationIntent ID. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def list( self, params: "VerificationReportService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[VerificationReport]: """ List all verification reports. """ return cast( ListObject[VerificationReport], self._request( "get", "/v1/identity/verification_reports", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "VerificationReportService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[VerificationReport]: """ List all verification reports. """ return cast( ListObject[VerificationReport], await self._request_async( "get", "/v1/identity/verification_reports", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, report: str, params: "VerificationReportService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> VerificationReport: """ Retrieves an existing VerificationReport """ return cast( VerificationReport, self._request( "get", "/v1/identity/verification_reports/{report}".format( report=sanitize_id(report), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, report: str, params: "VerificationReportService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> VerificationReport: """ Retrieves an existing VerificationReport """ return cast( VerificationReport, await self._request_async( "get", "/v1/identity/verification_reports/{report}".format( report=sanitize_id(report), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/identity/_verification_session.py0000644000175100001770000012447514637354563022636 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe.identity._verification_report import VerificationReport class VerificationSession( CreateableAPIResource["VerificationSession"], ListableAPIResource["VerificationSession"], UpdateableAPIResource["VerificationSession"], ): """ A VerificationSession guides you through the process of collecting and verifying the identities of your users. It contains details about the type of verification, such as what [verification check](https://stripe.com/docs/identity/verification-checks) to perform. Only create one VerificationSession for each verification in your system. A VerificationSession transitions through [multiple statuses](https://stripe.com/docs/identity/how-sessions-work) throughout its lifetime as it progresses through the verification flow. The VerificationSession contains the user's verified data after verification checks are complete. Related guide: [The Verification Sessions API](https://stripe.com/docs/identity/verification-sessions) """ OBJECT_NAME: ClassVar[Literal["identity.verification_session"]] = ( "identity.verification_session" ) class LastError(StripeObject): code: Optional[ Literal[ "abandoned", "consent_declined", "country_not_supported", "device_not_supported", "document_expired", "document_type_not_supported", "document_unverified_other", "email_unverified_other", "email_verification_declined", "id_number_insufficient_document_data", "id_number_mismatch", "id_number_unverified_other", "phone_unverified_other", "phone_verification_declined", "selfie_document_missing_photo", "selfie_face_mismatch", "selfie_manipulated", "selfie_unverified_other", "under_supported_age", ] ] """ A short machine-readable string giving the reason for the verification or user-session failure. """ reason: Optional[str] """ A message that explains the reason for verification or user-session failure. """ class Options(StripeObject): class Document(StripeObject): allowed_types: Optional[ List[Literal["driving_license", "id_card", "passport"]] ] """ Array of strings of allowed identity document types. If the provided identity document isn't one of the allowed types, the verification check will fail with a document_type_not_allowed error code. """ require_id_number: Optional[bool] """ Collect an ID number and perform an [ID number check](https://stripe.com/docs/identity/verification-checks?type=id-number) with the document's extracted name and date of birth. """ require_live_capture: Optional[bool] """ Disable image uploads, identity document images have to be captured using the device's camera. """ require_matching_selfie: Optional[bool] """ Capture a face image and perform a [selfie check](https://stripe.com/docs/identity/verification-checks?type=selfie) comparing a photo ID and a picture of your user's face. [Learn more](https://stripe.com/docs/identity/selfie). """ class Email(StripeObject): require_verification: Optional[bool] """ Request one time password verification of `provided_details.email`. """ class IdNumber(StripeObject): pass class Phone(StripeObject): require_verification: Optional[bool] """ Request one time password verification of `provided_details.phone`. """ document: Optional[Document] email: Optional[Email] id_number: Optional[IdNumber] phone: Optional[Phone] _inner_class_types = { "document": Document, "email": Email, "id_number": IdNumber, "phone": Phone, } class ProvidedDetails(StripeObject): email: Optional[str] """ Email of user being verified """ phone: Optional[str] """ Phone number of user being verified """ class Redaction(StripeObject): status: Literal["processing", "redacted"] """ Indicates whether this object and its related objects have been redacted or not. """ class VerifiedOutputs(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 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State, county, province, or region. """ class Dob(StripeObject): day: Optional[int] """ Numerical day between 1 and 31. """ month: Optional[int] """ Numerical month between 1 and 12. """ year: Optional[int] """ The four-digit year. """ address: Optional[Address] """ The user's verified address. """ dob: Optional[Dob] """ The user's verified date of birth. """ email: Optional[str] """ The user's verified email address """ first_name: Optional[str] """ The user's verified first name. """ id_number: Optional[str] """ The user's verified id number. """ id_number_type: Optional[Literal["br_cpf", "sg_nric", "us_ssn"]] """ The user's verified id number type. """ last_name: Optional[str] """ The user's verified last name. """ phone: Optional[str] """ The user's verified phone number """ _inner_class_types = {"address": Address, "dob": Dob} class CancelParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CreateParams(RequestOptions): client_reference_id: NotRequired[str] """ A string to reference this user. This can be a customer ID, a session ID, or similar, and can be used to reconcile this verification with your internal systems. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ options: NotRequired["VerificationSession.CreateParamsOptions"] """ A set of options for the session's verification checks. """ provided_details: NotRequired[ "VerificationSession.CreateParamsProvidedDetails" ] """ Details provided about the user being verified. These details may be shown to the user. """ return_url: NotRequired[str] """ The URL that the user will be redirected to upon completing the verification flow. """ type: NotRequired[Literal["document", "id_number"]] """ The type of [verification check](https://stripe.com/docs/identity/verification-checks) to be performed. You must provide a `type` if not passing `verification_flow`. """ verification_flow: NotRequired[str] """ The ID of a Verification Flow from the Dashboard. See https://docs.stripe.com/identity/verification-flows. """ class CreateParamsOptions(TypedDict): document: NotRequired[ "Literal['']|VerificationSession.CreateParamsOptionsDocument" ] """ Options that apply to the [document check](https://stripe.com/docs/identity/verification-checks?type=document). """ class CreateParamsOptionsDocument(TypedDict): allowed_types: NotRequired[ List[Literal["driving_license", "id_card", "passport"]] ] """ Array of strings of allowed identity document types. If the provided identity document isn't one of the allowed types, the verification check will fail with a document_type_not_allowed error code. """ require_id_number: NotRequired[bool] """ Collect an ID number and perform an [ID number check](https://stripe.com/docs/identity/verification-checks?type=id-number) with the document's extracted name and date of birth. """ require_live_capture: NotRequired[bool] """ Disable image uploads, identity document images have to be captured using the device's camera. """ require_matching_selfie: NotRequired[bool] """ Capture a face image and perform a [selfie check](https://stripe.com/docs/identity/verification-checks?type=selfie) comparing a photo ID and a picture of your user's face. [Learn more](https://stripe.com/docs/identity/selfie). """ class CreateParamsProvidedDetails(TypedDict): email: NotRequired[str] """ Email of user being verified """ phone: NotRequired[str] """ Phone number of user being verified """ class ListParams(RequestOptions): client_reference_id: NotRequired[str] """ A string to reference this user. This can be a customer ID, a session ID, or similar, and can be used to reconcile this verification with your internal systems. """ created: NotRequired["VerificationSession.ListParamsCreated|int"] """ Only return VerificationSessions that were created during the given date interval. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ Literal["canceled", "processing", "requires_input", "verified"] ] """ Only return VerificationSessions with this status. [Learn more about the lifecycle of sessions](https://stripe.com/docs/identity/how-sessions-work). """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ options: NotRequired["VerificationSession.ModifyParamsOptions"] """ A set of options for the session's verification checks. """ provided_details: NotRequired[ "VerificationSession.ModifyParamsProvidedDetails" ] """ Details provided about the user being verified. These details may be shown to the user. """ type: NotRequired[Literal["document", "id_number"]] """ The type of [verification check](https://stripe.com/docs/identity/verification-checks) to be performed. """ class ModifyParamsOptions(TypedDict): document: NotRequired[ "Literal['']|VerificationSession.ModifyParamsOptionsDocument" ] """ Options that apply to the [document check](https://stripe.com/docs/identity/verification-checks?type=document). """ class ModifyParamsOptionsDocument(TypedDict): allowed_types: NotRequired[ List[Literal["driving_license", "id_card", "passport"]] ] """ Array of strings of allowed identity document types. If the provided identity document isn't one of the allowed types, the verification check will fail with a document_type_not_allowed error code. """ require_id_number: NotRequired[bool] """ Collect an ID number and perform an [ID number check](https://stripe.com/docs/identity/verification-checks?type=id-number) with the document's extracted name and date of birth. """ require_live_capture: NotRequired[bool] """ Disable image uploads, identity document images have to be captured using the device's camera. """ require_matching_selfie: NotRequired[bool] """ Capture a face image and perform a [selfie check](https://stripe.com/docs/identity/verification-checks?type=selfie) comparing a photo ID and a picture of your user's face. [Learn more](https://stripe.com/docs/identity/selfie). """ class ModifyParamsProvidedDetails(TypedDict): email: NotRequired[str] """ Email of user being verified """ phone: NotRequired[str] """ Phone number of user being verified """ class RedactParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ client_reference_id: Optional[str] """ A string to reference this user. This can be a customer ID, a session ID, or similar, and can be used to reconcile this verification with your internal systems. """ client_secret: Optional[str] """ The short-lived client secret used by Stripe.js to [show a verification modal](https://stripe.com/docs/js/identity/modal) inside your app. This client secret expires after 24 hours and can only be used once. Don't store it, log it, embed it in a URL, or expose it to anyone other than the user. Make sure that you have TLS enabled on any page that includes the client secret. Refer to our docs on [passing the client secret to the frontend](https://stripe.com/docs/identity/verification-sessions#client-secret) to learn more. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ id: str """ Unique identifier for the object. """ last_error: Optional[LastError] """ If present, this property tells you the last error encountered when processing the verification. """ last_verification_report: Optional[ExpandableField["VerificationReport"]] """ ID of the most recent VerificationReport. [Learn more about accessing detailed verification results.](https://stripe.com/docs/identity/verification-sessions#results) """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ metadata: Dict[str, str] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ object: Literal["identity.verification_session"] """ String representing the object's type. Objects of the same type share the same value. """ options: Optional[Options] """ A set of options for the session's verification checks. """ provided_details: Optional[ProvidedDetails] """ Details provided about the user being verified. These details may be shown to the user. """ redaction: Optional[Redaction] """ Redaction status of this VerificationSession. If the VerificationSession is not redacted, this field will be null. """ status: Literal["canceled", "processing", "requires_input", "verified"] """ Status of this VerificationSession. [Learn more about the lifecycle of sessions](https://stripe.com/docs/identity/how-sessions-work). """ type: Literal["document", "id_number", "verification_flow"] """ The type of [verification check](https://stripe.com/docs/identity/verification-checks) to be performed. """ url: Optional[str] """ The short-lived URL that you use to redirect a user to Stripe to submit their identity information. This URL expires after 48 hours and can only be used once. Don't store it, log it, send it in emails or expose it to anyone other than the user. Refer to our docs on [verifying identity documents](https://stripe.com/docs/identity/verify-identity-documents?platform=web&type=redirect) to learn how to redirect users to Stripe. """ verification_flow: Optional[str] """ The configuration token of a Verification Flow from the dashboard. """ verified_outputs: Optional[VerifiedOutputs] """ The user's verified data. """ @classmethod def _cls_cancel( cls, session: str, **params: Unpack["VerificationSession.CancelParams"] ) -> "VerificationSession": """ A VerificationSession object can be canceled when it is in requires_input [status](https://stripe.com/docs/identity/how-sessions-work). Once canceled, future submission attempts are disabled. This cannot be undone. [Learn more](https://stripe.com/docs/identity/verification-sessions#cancel). """ return cast( "VerificationSession", cls._static_request( "post", "/v1/identity/verification_sessions/{session}/cancel".format( session=sanitize_id(session) ), params=params, ), ) @overload @staticmethod def cancel( session: str, **params: Unpack["VerificationSession.CancelParams"] ) -> "VerificationSession": """ A VerificationSession object can be canceled when it is in requires_input [status](https://stripe.com/docs/identity/how-sessions-work). Once canceled, future submission attempts are disabled. This cannot be undone. [Learn more](https://stripe.com/docs/identity/verification-sessions#cancel). """ ... @overload def cancel( self, **params: Unpack["VerificationSession.CancelParams"] ) -> "VerificationSession": """ A VerificationSession object can be canceled when it is in requires_input [status](https://stripe.com/docs/identity/how-sessions-work). Once canceled, future submission attempts are disabled. This cannot be undone. [Learn more](https://stripe.com/docs/identity/verification-sessions#cancel). """ ... @class_method_variant("_cls_cancel") def cancel( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["VerificationSession.CancelParams"] ) -> "VerificationSession": """ A VerificationSession object can be canceled when it is in requires_input [status](https://stripe.com/docs/identity/how-sessions-work). Once canceled, future submission attempts are disabled. This cannot be undone. [Learn more](https://stripe.com/docs/identity/verification-sessions#cancel). """ return cast( "VerificationSession", self._request( "post", "/v1/identity/verification_sessions/{session}/cancel".format( session=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_cancel_async( cls, session: str, **params: Unpack["VerificationSession.CancelParams"] ) -> "VerificationSession": """ A VerificationSession object can be canceled when it is in requires_input [status](https://stripe.com/docs/identity/how-sessions-work). Once canceled, future submission attempts are disabled. This cannot be undone. [Learn more](https://stripe.com/docs/identity/verification-sessions#cancel). """ return cast( "VerificationSession", await cls._static_request_async( "post", "/v1/identity/verification_sessions/{session}/cancel".format( session=sanitize_id(session) ), params=params, ), ) @overload @staticmethod async def cancel_async( session: str, **params: Unpack["VerificationSession.CancelParams"] ) -> "VerificationSession": """ A VerificationSession object can be canceled when it is in requires_input [status](https://stripe.com/docs/identity/how-sessions-work). Once canceled, future submission attempts are disabled. This cannot be undone. [Learn more](https://stripe.com/docs/identity/verification-sessions#cancel). """ ... @overload async def cancel_async( self, **params: Unpack["VerificationSession.CancelParams"] ) -> "VerificationSession": """ A VerificationSession object can be canceled when it is in requires_input [status](https://stripe.com/docs/identity/how-sessions-work). Once canceled, future submission attempts are disabled. This cannot be undone. [Learn more](https://stripe.com/docs/identity/verification-sessions#cancel). """ ... @class_method_variant("_cls_cancel_async") async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["VerificationSession.CancelParams"] ) -> "VerificationSession": """ A VerificationSession object can be canceled when it is in requires_input [status](https://stripe.com/docs/identity/how-sessions-work). Once canceled, future submission attempts are disabled. This cannot be undone. [Learn more](https://stripe.com/docs/identity/verification-sessions#cancel). """ return cast( "VerificationSession", await self._request_async( "post", "/v1/identity/verification_sessions/{session}/cancel".format( session=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def create( cls, **params: Unpack["VerificationSession.CreateParams"] ) -> "VerificationSession": """ Creates a VerificationSession object. After the VerificationSession is created, display a verification modal using the session client_secret or send your users to the session's url. If your API key is in test mode, verification checks won't actually process, though everything else will occur as if in live mode. Related guide: [Verify your users' identity documents](https://stripe.com/docs/identity/verify-identity-documents) """ return cast( "VerificationSession", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["VerificationSession.CreateParams"] ) -> "VerificationSession": """ Creates a VerificationSession object. After the VerificationSession is created, display a verification modal using the session client_secret or send your users to the session's url. If your API key is in test mode, verification checks won't actually process, though everything else will occur as if in live mode. Related guide: [Verify your users' identity documents](https://stripe.com/docs/identity/verify-identity-documents) """ return cast( "VerificationSession", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def list( cls, **params: Unpack["VerificationSession.ListParams"] ) -> ListObject["VerificationSession"]: """ Returns a list of VerificationSessions """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["VerificationSession.ListParams"] ) -> ListObject["VerificationSession"]: """ Returns a list of VerificationSessions """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def modify( cls, id: str, **params: Unpack["VerificationSession.ModifyParams"] ) -> "VerificationSession": """ Updates a VerificationSession object. When the session status is requires_input, you can use this method to update the verification check and options. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "VerificationSession", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["VerificationSession.ModifyParams"] ) -> "VerificationSession": """ Updates a VerificationSession object. When the session status is requires_input, you can use this method to update the verification check and options. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "VerificationSession", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def _cls_redact( cls, session: str, **params: Unpack["VerificationSession.RedactParams"] ) -> "VerificationSession": """ Redact a VerificationSession to remove all collected information from Stripe. This will redact the VerificationSession and all objects related to it, including VerificationReports, Events, request logs, etc. A VerificationSession object can be redacted when it is in requires_input or verified [status](https://stripe.com/docs/identity/how-sessions-work). Redacting a VerificationSession in requires_action state will automatically cancel it. The redaction process may take up to four days. When the redaction process is in progress, the VerificationSession's redaction.status field will be set to processing; when the process is finished, it will change to redacted and an identity.verification_session.redacted event will be emitted. Redaction is irreversible. Redacted objects are still accessible in the Stripe API, but all the fields that contain personal data will be replaced by the string [redacted] or a similar placeholder. The metadata field will also be erased. Redacted objects cannot be updated or used for any purpose. [Learn more](https://stripe.com/docs/identity/verification-sessions#redact). """ return cast( "VerificationSession", cls._static_request( "post", "/v1/identity/verification_sessions/{session}/redact".format( session=sanitize_id(session) ), params=params, ), ) @overload @staticmethod def redact( session: str, **params: Unpack["VerificationSession.RedactParams"] ) -> "VerificationSession": """ Redact a VerificationSession to remove all collected information from Stripe. This will redact the VerificationSession and all objects related to it, including VerificationReports, Events, request logs, etc. A VerificationSession object can be redacted when it is in requires_input or verified [status](https://stripe.com/docs/identity/how-sessions-work). Redacting a VerificationSession in requires_action state will automatically cancel it. The redaction process may take up to four days. When the redaction process is in progress, the VerificationSession's redaction.status field will be set to processing; when the process is finished, it will change to redacted and an identity.verification_session.redacted event will be emitted. Redaction is irreversible. Redacted objects are still accessible in the Stripe API, but all the fields that contain personal data will be replaced by the string [redacted] or a similar placeholder. The metadata field will also be erased. Redacted objects cannot be updated or used for any purpose. [Learn more](https://stripe.com/docs/identity/verification-sessions#redact). """ ... @overload def redact( self, **params: Unpack["VerificationSession.RedactParams"] ) -> "VerificationSession": """ Redact a VerificationSession to remove all collected information from Stripe. This will redact the VerificationSession and all objects related to it, including VerificationReports, Events, request logs, etc. A VerificationSession object can be redacted when it is in requires_input or verified [status](https://stripe.com/docs/identity/how-sessions-work). Redacting a VerificationSession in requires_action state will automatically cancel it. The redaction process may take up to four days. When the redaction process is in progress, the VerificationSession's redaction.status field will be set to processing; when the process is finished, it will change to redacted and an identity.verification_session.redacted event will be emitted. Redaction is irreversible. Redacted objects are still accessible in the Stripe API, but all the fields that contain personal data will be replaced by the string [redacted] or a similar placeholder. The metadata field will also be erased. Redacted objects cannot be updated or used for any purpose. [Learn more](https://stripe.com/docs/identity/verification-sessions#redact). """ ... @class_method_variant("_cls_redact") def redact( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["VerificationSession.RedactParams"] ) -> "VerificationSession": """ Redact a VerificationSession to remove all collected information from Stripe. This will redact the VerificationSession and all objects related to it, including VerificationReports, Events, request logs, etc. A VerificationSession object can be redacted when it is in requires_input or verified [status](https://stripe.com/docs/identity/how-sessions-work). Redacting a VerificationSession in requires_action state will automatically cancel it. The redaction process may take up to four days. When the redaction process is in progress, the VerificationSession's redaction.status field will be set to processing; when the process is finished, it will change to redacted and an identity.verification_session.redacted event will be emitted. Redaction is irreversible. Redacted objects are still accessible in the Stripe API, but all the fields that contain personal data will be replaced by the string [redacted] or a similar placeholder. The metadata field will also be erased. Redacted objects cannot be updated or used for any purpose. [Learn more](https://stripe.com/docs/identity/verification-sessions#redact). """ return cast( "VerificationSession", self._request( "post", "/v1/identity/verification_sessions/{session}/redact".format( session=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_redact_async( cls, session: str, **params: Unpack["VerificationSession.RedactParams"] ) -> "VerificationSession": """ Redact a VerificationSession to remove all collected information from Stripe. This will redact the VerificationSession and all objects related to it, including VerificationReports, Events, request logs, etc. A VerificationSession object can be redacted when it is in requires_input or verified [status](https://stripe.com/docs/identity/how-sessions-work). Redacting a VerificationSession in requires_action state will automatically cancel it. The redaction process may take up to four days. When the redaction process is in progress, the VerificationSession's redaction.status field will be set to processing; when the process is finished, it will change to redacted and an identity.verification_session.redacted event will be emitted. Redaction is irreversible. Redacted objects are still accessible in the Stripe API, but all the fields that contain personal data will be replaced by the string [redacted] or a similar placeholder. The metadata field will also be erased. Redacted objects cannot be updated or used for any purpose. [Learn more](https://stripe.com/docs/identity/verification-sessions#redact). """ return cast( "VerificationSession", await cls._static_request_async( "post", "/v1/identity/verification_sessions/{session}/redact".format( session=sanitize_id(session) ), params=params, ), ) @overload @staticmethod async def redact_async( session: str, **params: Unpack["VerificationSession.RedactParams"] ) -> "VerificationSession": """ Redact a VerificationSession to remove all collected information from Stripe. This will redact the VerificationSession and all objects related to it, including VerificationReports, Events, request logs, etc. A VerificationSession object can be redacted when it is in requires_input or verified [status](https://stripe.com/docs/identity/how-sessions-work). Redacting a VerificationSession in requires_action state will automatically cancel it. The redaction process may take up to four days. When the redaction process is in progress, the VerificationSession's redaction.status field will be set to processing; when the process is finished, it will change to redacted and an identity.verification_session.redacted event will be emitted. Redaction is irreversible. Redacted objects are still accessible in the Stripe API, but all the fields that contain personal data will be replaced by the string [redacted] or a similar placeholder. The metadata field will also be erased. Redacted objects cannot be updated or used for any purpose. [Learn more](https://stripe.com/docs/identity/verification-sessions#redact). """ ... @overload async def redact_async( self, **params: Unpack["VerificationSession.RedactParams"] ) -> "VerificationSession": """ Redact a VerificationSession to remove all collected information from Stripe. This will redact the VerificationSession and all objects related to it, including VerificationReports, Events, request logs, etc. A VerificationSession object can be redacted when it is in requires_input or verified [status](https://stripe.com/docs/identity/how-sessions-work). Redacting a VerificationSession in requires_action state will automatically cancel it. The redaction process may take up to four days. When the redaction process is in progress, the VerificationSession's redaction.status field will be set to processing; when the process is finished, it will change to redacted and an identity.verification_session.redacted event will be emitted. Redaction is irreversible. Redacted objects are still accessible in the Stripe API, but all the fields that contain personal data will be replaced by the string [redacted] or a similar placeholder. The metadata field will also be erased. Redacted objects cannot be updated or used for any purpose. [Learn more](https://stripe.com/docs/identity/verification-sessions#redact). """ ... @class_method_variant("_cls_redact_async") async def redact_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["VerificationSession.RedactParams"] ) -> "VerificationSession": """ Redact a VerificationSession to remove all collected information from Stripe. This will redact the VerificationSession and all objects related to it, including VerificationReports, Events, request logs, etc. A VerificationSession object can be redacted when it is in requires_input or verified [status](https://stripe.com/docs/identity/how-sessions-work). Redacting a VerificationSession in requires_action state will automatically cancel it. The redaction process may take up to four days. When the redaction process is in progress, the VerificationSession's redaction.status field will be set to processing; when the process is finished, it will change to redacted and an identity.verification_session.redacted event will be emitted. Redaction is irreversible. Redacted objects are still accessible in the Stripe API, but all the fields that contain personal data will be replaced by the string [redacted] or a similar placeholder. The metadata field will also be erased. Redacted objects cannot be updated or used for any purpose. [Learn more](https://stripe.com/docs/identity/verification-sessions#redact). """ return cast( "VerificationSession", await self._request_async( "post", "/v1/identity/verification_sessions/{session}/redact".format( session=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["VerificationSession.RetrieveParams"] ) -> "VerificationSession": """ Retrieves the details of a VerificationSession that was previously created. When the session status is requires_input, you can use this method to retrieve a valid client_secret or url to allow re-submission. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["VerificationSession.RetrieveParams"] ) -> "VerificationSession": """ Retrieves the details of a VerificationSession that was previously created. When the session status is requires_input, you can use this method to retrieve a valid client_secret or url to allow re-submission. """ instance = cls(id, **params) await instance.refresh_async() return instance _inner_class_types = { "last_error": LastError, "options": Options, "provided_details": ProvidedDetails, "redaction": Redaction, "verified_outputs": VerifiedOutputs, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/identity/_verification_session_service.py0000644000175100001770000005213314637354563024345 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.identity._verification_session import VerificationSession from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class VerificationSessionService(StripeService): class CancelParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CreateParams(TypedDict): client_reference_id: NotRequired[str] """ A string to reference this user. This can be a customer ID, a session ID, or similar, and can be used to reconcile this verification with your internal systems. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ options: NotRequired["VerificationSessionService.CreateParamsOptions"] """ A set of options for the session's verification checks. """ provided_details: NotRequired[ "VerificationSessionService.CreateParamsProvidedDetails" ] """ Details provided about the user being verified. These details may be shown to the user. """ return_url: NotRequired[str] """ The URL that the user will be redirected to upon completing the verification flow. """ type: NotRequired[Literal["document", "id_number"]] """ The type of [verification check](https://stripe.com/docs/identity/verification-checks) to be performed. You must provide a `type` if not passing `verification_flow`. """ verification_flow: NotRequired[str] """ The ID of a Verification Flow from the Dashboard. See https://docs.stripe.com/identity/verification-flows. """ class CreateParamsOptions(TypedDict): document: NotRequired[ "Literal['']|VerificationSessionService.CreateParamsOptionsDocument" ] """ Options that apply to the [document check](https://stripe.com/docs/identity/verification-checks?type=document). """ class CreateParamsOptionsDocument(TypedDict): allowed_types: NotRequired[ List[Literal["driving_license", "id_card", "passport"]] ] """ Array of strings of allowed identity document types. If the provided identity document isn't one of the allowed types, the verification check will fail with a document_type_not_allowed error code. """ require_id_number: NotRequired[bool] """ Collect an ID number and perform an [ID number check](https://stripe.com/docs/identity/verification-checks?type=id-number) with the document's extracted name and date of birth. """ require_live_capture: NotRequired[bool] """ Disable image uploads, identity document images have to be captured using the device's camera. """ require_matching_selfie: NotRequired[bool] """ Capture a face image and perform a [selfie check](https://stripe.com/docs/identity/verification-checks?type=selfie) comparing a photo ID and a picture of your user's face. [Learn more](https://stripe.com/docs/identity/selfie). """ class CreateParamsProvidedDetails(TypedDict): email: NotRequired[str] """ Email of user being verified """ phone: NotRequired[str] """ Phone number of user being verified """ class ListParams(TypedDict): client_reference_id: NotRequired[str] """ A string to reference this user. This can be a customer ID, a session ID, or similar, and can be used to reconcile this verification with your internal systems. """ created: NotRequired[ "VerificationSessionService.ListParamsCreated|int" ] """ Only return VerificationSessions that were created during the given date interval. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ Literal["canceled", "processing", "requires_input", "verified"] ] """ Only return VerificationSessions with this status. [Learn more about the lifecycle of sessions](https://stripe.com/docs/identity/how-sessions-work). """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RedactParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ options: NotRequired["VerificationSessionService.UpdateParamsOptions"] """ A set of options for the session's verification checks. """ provided_details: NotRequired[ "VerificationSessionService.UpdateParamsProvidedDetails" ] """ Details provided about the user being verified. These details may be shown to the user. """ type: NotRequired[Literal["document", "id_number"]] """ The type of [verification check](https://stripe.com/docs/identity/verification-checks) to be performed. """ class UpdateParamsOptions(TypedDict): document: NotRequired[ "Literal['']|VerificationSessionService.UpdateParamsOptionsDocument" ] """ Options that apply to the [document check](https://stripe.com/docs/identity/verification-checks?type=document). """ class UpdateParamsOptionsDocument(TypedDict): allowed_types: NotRequired[ List[Literal["driving_license", "id_card", "passport"]] ] """ Array of strings of allowed identity document types. If the provided identity document isn't one of the allowed types, the verification check will fail with a document_type_not_allowed error code. """ require_id_number: NotRequired[bool] """ Collect an ID number and perform an [ID number check](https://stripe.com/docs/identity/verification-checks?type=id-number) with the document's extracted name and date of birth. """ require_live_capture: NotRequired[bool] """ Disable image uploads, identity document images have to be captured using the device's camera. """ require_matching_selfie: NotRequired[bool] """ Capture a face image and perform a [selfie check](https://stripe.com/docs/identity/verification-checks?type=selfie) comparing a photo ID and a picture of your user's face. [Learn more](https://stripe.com/docs/identity/selfie). """ class UpdateParamsProvidedDetails(TypedDict): email: NotRequired[str] """ Email of user being verified """ phone: NotRequired[str] """ Phone number of user being verified """ def list( self, params: "VerificationSessionService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[VerificationSession]: """ Returns a list of VerificationSessions """ return cast( ListObject[VerificationSession], self._request( "get", "/v1/identity/verification_sessions", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "VerificationSessionService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[VerificationSession]: """ Returns a list of VerificationSessions """ return cast( ListObject[VerificationSession], await self._request_async( "get", "/v1/identity/verification_sessions", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "VerificationSessionService.CreateParams" = {}, options: RequestOptions = {}, ) -> VerificationSession: """ Creates a VerificationSession object. After the VerificationSession is created, display a verification modal using the session client_secret or send your users to the session's url. If your API key is in test mode, verification checks won't actually process, though everything else will occur as if in live mode. Related guide: [Verify your users' identity documents](https://stripe.com/docs/identity/verify-identity-documents) """ return cast( VerificationSession, self._request( "post", "/v1/identity/verification_sessions", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "VerificationSessionService.CreateParams" = {}, options: RequestOptions = {}, ) -> VerificationSession: """ Creates a VerificationSession object. After the VerificationSession is created, display a verification modal using the session client_secret or send your users to the session's url. If your API key is in test mode, verification checks won't actually process, though everything else will occur as if in live mode. Related guide: [Verify your users' identity documents](https://stripe.com/docs/identity/verify-identity-documents) """ return cast( VerificationSession, await self._request_async( "post", "/v1/identity/verification_sessions", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, session: str, params: "VerificationSessionService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> VerificationSession: """ Retrieves the details of a VerificationSession that was previously created. When the session status is requires_input, you can use this method to retrieve a valid client_secret or url to allow re-submission. """ return cast( VerificationSession, self._request( "get", "/v1/identity/verification_sessions/{session}".format( session=sanitize_id(session), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, session: str, params: "VerificationSessionService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> VerificationSession: """ Retrieves the details of a VerificationSession that was previously created. When the session status is requires_input, you can use this method to retrieve a valid client_secret or url to allow re-submission. """ return cast( VerificationSession, await self._request_async( "get", "/v1/identity/verification_sessions/{session}".format( session=sanitize_id(session), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, session: str, params: "VerificationSessionService.UpdateParams" = {}, options: RequestOptions = {}, ) -> VerificationSession: """ Updates a VerificationSession object. When the session status is requires_input, you can use this method to update the verification check and options. """ return cast( VerificationSession, self._request( "post", "/v1/identity/verification_sessions/{session}".format( session=sanitize_id(session), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, session: str, params: "VerificationSessionService.UpdateParams" = {}, options: RequestOptions = {}, ) -> VerificationSession: """ Updates a VerificationSession object. When the session status is requires_input, you can use this method to update the verification check and options. """ return cast( VerificationSession, await self._request_async( "post", "/v1/identity/verification_sessions/{session}".format( session=sanitize_id(session), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def cancel( self, session: str, params: "VerificationSessionService.CancelParams" = {}, options: RequestOptions = {}, ) -> VerificationSession: """ A VerificationSession object can be canceled when it is in requires_input [status](https://stripe.com/docs/identity/how-sessions-work). Once canceled, future submission attempts are disabled. This cannot be undone. [Learn more](https://stripe.com/docs/identity/verification-sessions#cancel). """ return cast( VerificationSession, self._request( "post", "/v1/identity/verification_sessions/{session}/cancel".format( session=sanitize_id(session), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def cancel_async( self, session: str, params: "VerificationSessionService.CancelParams" = {}, options: RequestOptions = {}, ) -> VerificationSession: """ A VerificationSession object can be canceled when it is in requires_input [status](https://stripe.com/docs/identity/how-sessions-work). Once canceled, future submission attempts are disabled. This cannot be undone. [Learn more](https://stripe.com/docs/identity/verification-sessions#cancel). """ return cast( VerificationSession, await self._request_async( "post", "/v1/identity/verification_sessions/{session}/cancel".format( session=sanitize_id(session), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def redact( self, session: str, params: "VerificationSessionService.RedactParams" = {}, options: RequestOptions = {}, ) -> VerificationSession: """ Redact a VerificationSession to remove all collected information from Stripe. This will redact the VerificationSession and all objects related to it, including VerificationReports, Events, request logs, etc. A VerificationSession object can be redacted when it is in requires_input or verified [status](https://stripe.com/docs/identity/how-sessions-work). Redacting a VerificationSession in requires_action state will automatically cancel it. The redaction process may take up to four days. When the redaction process is in progress, the VerificationSession's redaction.status field will be set to processing; when the process is finished, it will change to redacted and an identity.verification_session.redacted event will be emitted. Redaction is irreversible. Redacted objects are still accessible in the Stripe API, but all the fields that contain personal data will be replaced by the string [redacted] or a similar placeholder. The metadata field will also be erased. Redacted objects cannot be updated or used for any purpose. [Learn more](https://stripe.com/docs/identity/verification-sessions#redact). """ return cast( VerificationSession, self._request( "post", "/v1/identity/verification_sessions/{session}/redact".format( session=sanitize_id(session), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def redact_async( self, session: str, params: "VerificationSessionService.RedactParams" = {}, options: RequestOptions = {}, ) -> VerificationSession: """ Redact a VerificationSession to remove all collected information from Stripe. This will redact the VerificationSession and all objects related to it, including VerificationReports, Events, request logs, etc. A VerificationSession object can be redacted when it is in requires_input or verified [status](https://stripe.com/docs/identity/how-sessions-work). Redacting a VerificationSession in requires_action state will automatically cancel it. The redaction process may take up to four days. When the redaction process is in progress, the VerificationSession's redaction.status field will be set to processing; when the process is finished, it will change to redacted and an identity.verification_session.redacted event will be emitted. Redaction is irreversible. Redacted objects are still accessible in the Stripe API, but all the fields that contain personal data will be replaced by the string [redacted] or a similar placeholder. The metadata field will also be erased. Redacted objects cannot be updated or used for any purpose. [Learn more](https://stripe.com/docs/identity/verification-sessions#redact). """ return cast( VerificationSession, await self._request_async( "post", "/v1/identity/verification_sessions/{session}/redact".format( session=sanitize_id(session), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5409405 stripe-10.1.0/stripe/issuing/0000755000175100001770000000000014637354616015512 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/issuing/__init__.py0000644000175100001770000000250714637354563017630 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe.issuing._authorization import Authorization as Authorization from stripe.issuing._authorization_service import ( AuthorizationService as AuthorizationService, ) from stripe.issuing._card import Card as Card from stripe.issuing._card_service import CardService as CardService from stripe.issuing._cardholder import Cardholder as Cardholder from stripe.issuing._cardholder_service import ( CardholderService as CardholderService, ) from stripe.issuing._dispute import Dispute as Dispute from stripe.issuing._dispute_service import DisputeService as DisputeService from stripe.issuing._personalization_design import ( PersonalizationDesign as PersonalizationDesign, ) from stripe.issuing._personalization_design_service import ( PersonalizationDesignService as PersonalizationDesignService, ) from stripe.issuing._physical_bundle import PhysicalBundle as PhysicalBundle from stripe.issuing._physical_bundle_service import ( PhysicalBundleService as PhysicalBundleService, ) from stripe.issuing._token import Token as Token from stripe.issuing._token_service import TokenService as TokenService from stripe.issuing._transaction import Transaction as Transaction from stripe.issuing._transaction_service import ( TransactionService as TransactionService, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/issuing/_authorization.py0000644000175100001770000031516114637354563021133 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._test_helpers import APIResourceTestHelpers from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, NotRequired, Type, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._balance_transaction import BalanceTransaction from stripe.issuing._card import Card from stripe.issuing._cardholder import Cardholder from stripe.issuing._token import Token from stripe.issuing._transaction import Transaction class Authorization( ListableAPIResource["Authorization"], UpdateableAPIResource["Authorization"], ): """ When an [issued card](https://stripe.com/docs/issuing) is used to make a purchase, an Issuing `Authorization` object is created. [Authorizations](https://stripe.com/docs/issuing/purchases/authorizations) must be approved for the purchase to be completed successfully. Related guide: [Issued card authorizations](https://stripe.com/docs/issuing/purchases/authorizations) """ OBJECT_NAME: ClassVar[Literal["issuing.authorization"]] = ( "issuing.authorization" ) class AmountDetails(StripeObject): atm_fee: Optional[int] """ The fee charged by the ATM for the cash withdrawal. """ cashback_amount: Optional[int] """ The amount of cash requested by the cardholder. """ class Fleet(StripeObject): class CardholderPromptData(StripeObject): alphanumeric_id: Optional[str] """ [Deprecated] An alphanumeric ID, though typical point of sales only support numeric entry. The card program can be configured to prompt for a vehicle ID, driver ID, or generic ID. """ driver_id: Optional[str] """ Driver ID. """ odometer: Optional[int] """ Odometer reading. """ unspecified_id: Optional[str] """ An alphanumeric ID. This field is used when a vehicle ID, driver ID, or generic ID is entered by the cardholder, but the merchant or card network did not specify the prompt type. """ user_id: Optional[str] """ User ID. """ vehicle_number: Optional[str] """ Vehicle number. """ class ReportedBreakdown(StripeObject): class Fuel(StripeObject): gross_amount_decimal: Optional[str] """ Gross fuel amount that should equal Fuel Quantity multiplied by Fuel Unit Cost, inclusive of taxes. """ class NonFuel(StripeObject): gross_amount_decimal: Optional[str] """ Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes. """ class Tax(StripeObject): local_amount_decimal: Optional[str] """ Amount of state or provincial Sales Tax included in the transaction amount. `null` if not reported by merchant or not subject to tax. """ national_amount_decimal: Optional[str] """ Amount of national Sales Tax or VAT included in the transaction amount. `null` if not reported by merchant or not subject to tax. """ fuel: Optional[Fuel] """ Breakdown of fuel portion of the purchase. """ non_fuel: Optional[NonFuel] """ Breakdown of non-fuel portion of the purchase. """ tax: Optional[Tax] """ Information about tax included in this transaction. """ _inner_class_types = { "fuel": Fuel, "non_fuel": NonFuel, "tax": Tax, } cardholder_prompt_data: Optional[CardholderPromptData] """ Answers to prompts presented to the cardholder at the point of sale. Prompted fields vary depending on the configuration of your physical fleet cards. Typical points of sale support only numeric entry. """ purchase_type: Optional[ Literal[ "fuel_and_non_fuel_purchase", "fuel_purchase", "non_fuel_purchase", ] ] """ The type of purchase. """ reported_breakdown: Optional[ReportedBreakdown] """ More information about the total amount. Typically this information is received from the merchant after the authorization has been approved and the fuel dispensed. This information is not guaranteed to be accurate as some merchants may provide unreliable data. """ service_type: Optional[ Literal["full_service", "non_fuel_transaction", "self_service"] ] """ The type of fuel service. """ _inner_class_types = { "cardholder_prompt_data": CardholderPromptData, "reported_breakdown": ReportedBreakdown, } class Fuel(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[str] """ The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places. """ type: Optional[ Literal[ "diesel", "other", "unleaded_plus", "unleaded_regular", "unleaded_super", ] ] """ The type of fuel that was purchased. """ unit: Optional[ Literal[ "charging_minute", "imperial_gallon", "kilogram", "kilowatt_hour", "liter", "other", "pound", "us_gallon", ] ] """ The units for `quantity_decimal`. """ unit_cost_decimal: Optional[str] """ The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. """ class MerchantData(StripeObject): category: str """ A categorization of the seller's type of business. See our [merchant categories guide](https://stripe.com/docs/issuing/merchant-categories) for a list of possible values. """ category_code: str """ The merchant category code for the seller's business """ city: Optional[str] """ City where the seller is located """ country: Optional[str] """ Country where the seller is located """ name: Optional[str] """ Name of the seller """ network_id: str """ Identifier assigned to the seller by the card network. Different card networks may assign different network_id fields to the same merchant. """ postal_code: Optional[str] """ Postal code where the seller is located """ state: Optional[str] """ State where the seller is located """ terminal_id: Optional[str] """ An ID assigned by the seller to the location of the sale. """ url: Optional[str] """ URL provided by the merchant on a 3DS request """ class NetworkData(StripeObject): acquiring_institution_id: Optional[str] """ Identifier assigned to the acquirer by the card network. Sometimes this value is not provided by the network; in this case, the value will be `null`. """ system_trace_audit_number: Optional[str] """ The System Trace Audit Number (STAN) is a 6-digit identifier assigned by the acquirer. Prefer `network_data.transaction_id` if present, unless you have special requirements. """ transaction_id: Optional[str] """ Unique identifier for the authorization assigned by the card network used to match subsequent messages, disputes, and transactions. """ class PendingRequest(StripeObject): class AmountDetails(StripeObject): atm_fee: Optional[int] """ The fee charged by the ATM for the cash withdrawal. """ cashback_amount: Optional[int] """ The amount of cash requested by the cardholder. """ amount: int """ The additional amount Stripe will hold if the authorization is approved, in the card's [currency](https://stripe.com/docs/api#issuing_authorization_object-pending-request-currency) and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ amount_details: Optional[AmountDetails] """ Detailed breakdown of amount components. These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ 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). """ is_amount_controllable: bool """ If set `true`, you may provide [amount](https://stripe.com/docs/api/issuing/authorizations/approve#approve_issuing_authorization-amount) to control how much to hold for the authorization. """ merchant_amount: int """ The amount the merchant is requesting to be authorized in the `merchant_currency`. The amount is in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ merchant_currency: str """ The local currency the merchant is requesting to authorize. """ network_risk_score: Optional[int] """ The card network's estimate of the likelihood that an authorization is fraudulent. Takes on values between 1 and 99. """ _inner_class_types = {"amount_details": AmountDetails} class RequestHistory(StripeObject): class AmountDetails(StripeObject): atm_fee: Optional[int] """ The fee charged by the ATM for the cash withdrawal. """ cashback_amount: Optional[int] """ The amount of cash requested by the cardholder. """ amount: int """ The `pending_request.amount` at the time of the request, presented in your card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). Stripe held this amount from your account to fund the authorization if the request was approved. """ amount_details: Optional[AmountDetails] """ Detailed breakdown of amount components. These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ approved: bool """ Whether this request was approved. """ authorization_code: Optional[str] """ A code created by Stripe which is shared with the merchant to validate the authorization. This field will be populated if the authorization message was approved. The code typically starts with the letter "S", followed by a six-digit number. For example, "S498162". Please note that the code is not guaranteed to be unique across authorizations. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ 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). """ merchant_amount: int """ The `pending_request.merchant_amount` at the time of the request, presented in the `merchant_currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ merchant_currency: str """ The currency that was collected by the merchant and presented to the cardholder for the authorization. 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). """ network_risk_score: Optional[int] """ The card network's estimate of the likelihood that an authorization is fraudulent. Takes on values between 1 and 99. """ reason: Literal[ "account_disabled", "card_active", "card_canceled", "card_expired", "card_inactive", "cardholder_blocked", "cardholder_inactive", "cardholder_verification_required", "insecure_authorization_method", "insufficient_funds", "not_allowed", "pin_blocked", "spending_controls", "suspected_fraud", "verification_failed", "webhook_approved", "webhook_declined", "webhook_error", "webhook_timeout", ] """ When an authorization is approved or declined by you or by Stripe, this field provides additional detail on the reason for the outcome. """ reason_message: Optional[str] """ If the `request_history.reason` is `webhook_error` because the direct webhook response is invalid (for example, parsing errors or missing parameters), we surface a more detailed error message via this field. """ requested_at: Optional[int] """ Time when the card network received an authorization request from the acquirer in UTC. Referred to by networks as transmission time. """ _inner_class_types = {"amount_details": AmountDetails} class Treasury(StripeObject): received_credits: List[str] """ The array of [ReceivedCredits](https://stripe.com/docs/api/treasury/received_credits) associated with this authorization """ received_debits: List[str] """ The array of [ReceivedDebits](https://stripe.com/docs/api/treasury/received_debits) associated with this authorization """ transaction: Optional[str] """ The Treasury [Transaction](https://stripe.com/docs/api/treasury/transactions) associated with this authorization """ class VerificationData(StripeObject): class AuthenticationExemption(StripeObject): claimed_by: Literal["acquirer", "issuer"] """ The entity that requested the exemption, either the acquiring merchant or the Issuing user. """ type: Literal[ "low_value_transaction", "transaction_risk_analysis", "unknown" ] """ The specific exemption claimed for this authorization. """ class ThreeDSecure(StripeObject): result: Literal[ "attempt_acknowledged", "authenticated", "failed", "required" ] """ The outcome of the 3D Secure authentication request. """ address_line1_check: Literal["match", "mismatch", "not_provided"] """ Whether the cardholder provided an address first line and if it matched the cardholder's `billing.address.line1`. """ address_postal_code_check: Literal["match", "mismatch", "not_provided"] """ Whether the cardholder provided a postal code and if it matched the cardholder's `billing.address.postal_code`. """ authentication_exemption: Optional[AuthenticationExemption] """ The exemption applied to this authorization. """ cvc_check: Literal["match", "mismatch", "not_provided"] """ Whether the cardholder provided a CVC and if it matched Stripe's record. """ expiry_check: Literal["match", "mismatch", "not_provided"] """ Whether the cardholder provided an expiry date and if it matched Stripe's record. """ postal_code: Optional[str] """ The postal code submitted as part of the authorization used for postal code verification. """ three_d_secure: Optional[ThreeDSecure] """ 3D Secure details. """ _inner_class_types = { "authentication_exemption": AuthenticationExemption, "three_d_secure": ThreeDSecure, } class ApproveParams(RequestOptions): amount: NotRequired[int] """ If the authorization's `pending_request.is_amount_controllable` property is `true`, you may provide this value to control how much to hold for the authorization. Must be positive (use [`decline`](https://stripe.com/docs/api/issuing/authorizations/decline) to decline an authorization request). """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ class CaptureParams(RequestOptions): capture_amount: NotRequired[int] """ The amount to capture from the authorization. If not provided, the full amount of the authorization will be captured. This amount is in the authorization currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ close_authorization: NotRequired[bool] """ Whether to close the authorization after capture. Defaults to true. Set to false to enable multi-capture flows. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ purchase_details: NotRequired[ "Authorization.CaptureParamsPurchaseDetails" ] """ Additional purchase information that is optionally provided by the merchant. """ class CaptureParamsPurchaseDetails(TypedDict): fleet: NotRequired["Authorization.CaptureParamsPurchaseDetailsFleet"] """ Fleet-specific information for transactions using Fleet cards. """ flight: NotRequired["Authorization.CaptureParamsPurchaseDetailsFlight"] """ Information about the flight that was purchased with this transaction. """ fuel: NotRequired["Authorization.CaptureParamsPurchaseDetailsFuel"] """ Information about fuel that was purchased with this transaction. """ lodging: NotRequired[ "Authorization.CaptureParamsPurchaseDetailsLodging" ] """ Information about lodging that was purchased with this transaction. """ receipt: NotRequired[ List["Authorization.CaptureParamsPurchaseDetailsReceipt"] ] """ The line items in the purchase. """ reference: NotRequired[str] """ A merchant-specific order number. """ class CaptureParamsPurchaseDetailsFleet(TypedDict): cardholder_prompt_data: NotRequired[ "Authorization.CaptureParamsPurchaseDetailsFleetCardholderPromptData" ] """ Answers to prompts presented to the cardholder at the point of sale. Prompted fields vary depending on the configuration of your physical fleet cards. Typical points of sale support only numeric entry. """ purchase_type: NotRequired[ Literal[ "fuel_and_non_fuel_purchase", "fuel_purchase", "non_fuel_purchase", ] ] """ The type of purchase. One of `fuel_purchase`, `non_fuel_purchase`, or `fuel_and_non_fuel_purchase`. """ reported_breakdown: NotRequired[ "Authorization.CaptureParamsPurchaseDetailsFleetReportedBreakdown" ] """ More information about the total amount. This information is not guaranteed to be accurate as some merchants may provide unreliable data. """ service_type: NotRequired[ Literal["full_service", "non_fuel_transaction", "self_service"] ] """ The type of fuel service. One of `non_fuel_transaction`, `full_service`, or `self_service`. """ class CaptureParamsPurchaseDetailsFleetCardholderPromptData(TypedDict): driver_id: NotRequired[str] """ Driver ID. """ odometer: NotRequired[int] """ Odometer reading. """ unspecified_id: NotRequired[str] """ An alphanumeric ID. This field is used when a vehicle ID, driver ID, or generic ID is entered by the cardholder, but the merchant or card network did not specify the prompt type. """ user_id: NotRequired[str] """ User ID. """ vehicle_number: NotRequired[str] """ Vehicle number. """ class CaptureParamsPurchaseDetailsFleetReportedBreakdown(TypedDict): fuel: NotRequired[ "Authorization.CaptureParamsPurchaseDetailsFleetReportedBreakdownFuel" ] """ Breakdown of fuel portion of the purchase. """ non_fuel: NotRequired[ "Authorization.CaptureParamsPurchaseDetailsFleetReportedBreakdownNonFuel" ] """ Breakdown of non-fuel portion of the purchase. """ tax: NotRequired[ "Authorization.CaptureParamsPurchaseDetailsFleetReportedBreakdownTax" ] """ Information about tax included in this transaction. """ class CaptureParamsPurchaseDetailsFleetReportedBreakdownFuel(TypedDict): gross_amount_decimal: NotRequired[str] """ Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. """ class CaptureParamsPurchaseDetailsFleetReportedBreakdownNonFuel(TypedDict): gross_amount_decimal: NotRequired[str] """ Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes. """ class CaptureParamsPurchaseDetailsFleetReportedBreakdownTax(TypedDict): local_amount_decimal: NotRequired[str] """ Amount of state or provincial Sales Tax included in the transaction amount. Null if not reported by merchant or not subject to tax. """ national_amount_decimal: NotRequired[str] """ Amount of national Sales Tax or VAT included in the transaction amount. Null if not reported by merchant or not subject to tax. """ class CaptureParamsPurchaseDetailsFlight(TypedDict): departure_at: NotRequired[int] """ The time that the flight departed. """ passenger_name: NotRequired[str] """ The name of the passenger. """ refundable: NotRequired[bool] """ Whether the ticket is refundable. """ segments: NotRequired[ List["Authorization.CaptureParamsPurchaseDetailsFlightSegment"] ] """ The legs of the trip. """ travel_agency: NotRequired[str] """ The travel agency that issued the ticket. """ class CaptureParamsPurchaseDetailsFlightSegment(TypedDict): arrival_airport_code: NotRequired[str] """ The three-letter IATA airport code of the flight's destination. """ carrier: NotRequired[str] """ The airline carrier code. """ departure_airport_code: NotRequired[str] """ The three-letter IATA airport code that the flight departed from. """ flight_number: NotRequired[str] """ The flight number. """ service_class: NotRequired[str] """ The flight's service class. """ stopover_allowed: NotRequired[bool] """ Whether a stopover is allowed on this flight. """ class CaptureParamsPurchaseDetailsFuel(TypedDict): industry_product_code: NotRequired[str] """ [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased. """ quantity_decimal: NotRequired[str] """ The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places. """ type: NotRequired[ Literal[ "diesel", "other", "unleaded_plus", "unleaded_regular", "unleaded_super", ] ] """ The type of fuel that was purchased. One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. """ unit: NotRequired[ Literal[ "charging_minute", "imperial_gallon", "kilogram", "kilowatt_hour", "liter", "other", "pound", "us_gallon", ] ] """ The units for `quantity_decimal`. One of `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `liter`, `pound`, `us_gallon`, or `other`. """ unit_cost_decimal: NotRequired[str] """ The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. """ class CaptureParamsPurchaseDetailsLodging(TypedDict): check_in_at: NotRequired[int] """ The time of checking into the lodging. """ nights: NotRequired[int] """ The number of nights stayed at the lodging. """ class CaptureParamsPurchaseDetailsReceipt(TypedDict): description: NotRequired[str] quantity: NotRequired[str] total: NotRequired[int] unit_cost: NotRequired[int] class CreateParams(RequestOptions): amount: int """ The total amount to attempt to authorize. This amount is in the provided currency, or defaults to the card's currency, and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ amount_details: NotRequired["Authorization.CreateParamsAmountDetails"] """ Detailed breakdown of amount components. These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ authorization_method: NotRequired[ Literal["chip", "contactless", "keyed_in", "online", "swipe"] ] """ How the card details were provided. Defaults to online. """ card: str """ Card associated with this authorization. """ currency: NotRequired[str] """ The currency of the authorization. If not provided, defaults to the currency of the card. 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). """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ fleet: NotRequired["Authorization.CreateParamsFleet"] """ Fleet-specific information for authorizations using Fleet cards. """ fuel: NotRequired["Authorization.CreateParamsFuel"] """ Information about fuel that was purchased with this transaction. """ is_amount_controllable: NotRequired[bool] """ If set `true`, you may provide [amount](https://stripe.com/docs/api/issuing/authorizations/approve#approve_issuing_authorization-amount) to control how much to hold for the authorization. """ merchant_data: NotRequired["Authorization.CreateParamsMerchantData"] """ Details about the seller (grocery store, e-commerce website, etc.) where the card authorization happened. """ network_data: NotRequired["Authorization.CreateParamsNetworkData"] """ Details about the authorization, such as identifiers, set by the card network. """ verification_data: NotRequired[ "Authorization.CreateParamsVerificationData" ] """ Verifications that Stripe performed on information that the cardholder provided to the merchant. """ wallet: NotRequired[Literal["apple_pay", "google_pay", "samsung_pay"]] """ The digital wallet used for this transaction. One of `apple_pay`, `google_pay`, or `samsung_pay`. Will populate as `null` when no digital wallet was utilized. """ class CreateParamsAmountDetails(TypedDict): atm_fee: NotRequired[int] """ The ATM withdrawal fee. """ cashback_amount: NotRequired[int] """ The amount of cash requested by the cardholder. """ class CreateParamsFleet(TypedDict): cardholder_prompt_data: NotRequired[ "Authorization.CreateParamsFleetCardholderPromptData" ] """ Answers to prompts presented to the cardholder at the point of sale. Prompted fields vary depending on the configuration of your physical fleet cards. Typical points of sale support only numeric entry. """ purchase_type: NotRequired[ Literal[ "fuel_and_non_fuel_purchase", "fuel_purchase", "non_fuel_purchase", ] ] """ The type of purchase. One of `fuel_purchase`, `non_fuel_purchase`, or `fuel_and_non_fuel_purchase`. """ reported_breakdown: NotRequired[ "Authorization.CreateParamsFleetReportedBreakdown" ] """ More information about the total amount. This information is not guaranteed to be accurate as some merchants may provide unreliable data. """ service_type: NotRequired[ Literal["full_service", "non_fuel_transaction", "self_service"] ] """ The type of fuel service. One of `non_fuel_transaction`, `full_service`, or `self_service`. """ class CreateParamsFleetCardholderPromptData(TypedDict): driver_id: NotRequired[str] """ Driver ID. """ odometer: NotRequired[int] """ Odometer reading. """ unspecified_id: NotRequired[str] """ An alphanumeric ID. This field is used when a vehicle ID, driver ID, or generic ID is entered by the cardholder, but the merchant or card network did not specify the prompt type. """ user_id: NotRequired[str] """ User ID. """ vehicle_number: NotRequired[str] """ Vehicle number. """ class CreateParamsFleetReportedBreakdown(TypedDict): fuel: NotRequired[ "Authorization.CreateParamsFleetReportedBreakdownFuel" ] """ Breakdown of fuel portion of the purchase. """ non_fuel: NotRequired[ "Authorization.CreateParamsFleetReportedBreakdownNonFuel" ] """ Breakdown of non-fuel portion of the purchase. """ tax: NotRequired["Authorization.CreateParamsFleetReportedBreakdownTax"] """ Information about tax included in this transaction. """ class CreateParamsFleetReportedBreakdownFuel(TypedDict): gross_amount_decimal: NotRequired[str] """ Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. """ class CreateParamsFleetReportedBreakdownNonFuel(TypedDict): gross_amount_decimal: NotRequired[str] """ Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes. """ class CreateParamsFleetReportedBreakdownTax(TypedDict): local_amount_decimal: NotRequired[str] """ Amount of state or provincial Sales Tax included in the transaction amount. Null if not reported by merchant or not subject to tax. """ national_amount_decimal: NotRequired[str] """ Amount of national Sales Tax or VAT included in the transaction amount. Null if not reported by merchant or not subject to tax. """ class CreateParamsFuel(TypedDict): industry_product_code: NotRequired[str] """ [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased. """ quantity_decimal: NotRequired[str] """ The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places. """ type: NotRequired[ Literal[ "diesel", "other", "unleaded_plus", "unleaded_regular", "unleaded_super", ] ] """ The type of fuel that was purchased. One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. """ unit: NotRequired[ Literal[ "charging_minute", "imperial_gallon", "kilogram", "kilowatt_hour", "liter", "other", "pound", "us_gallon", ] ] """ The units for `quantity_decimal`. One of `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `liter`, `pound`, `us_gallon`, or `other`. """ unit_cost_decimal: NotRequired[str] """ The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. """ class CreateParamsMerchantData(TypedDict): category: NotRequired[ Literal[ "ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards", ] ] """ A categorization of the seller's type of business. See our [merchant categories guide](https://stripe.com/docs/issuing/merchant-categories) for a list of possible values. """ city: NotRequired[str] """ City where the seller is located """ country: NotRequired[str] """ Country where the seller is located """ name: NotRequired[str] """ Name of the seller """ network_id: NotRequired[str] """ Identifier assigned to the seller by the card network. Different card networks may assign different network_id fields to the same merchant. """ postal_code: NotRequired[str] """ Postal code where the seller is located """ state: NotRequired[str] """ State where the seller is located """ terminal_id: NotRequired[str] """ An ID assigned by the seller to the location of the sale. """ url: NotRequired[str] """ URL provided by the merchant on a 3DS request """ class CreateParamsNetworkData(TypedDict): acquiring_institution_id: NotRequired[str] """ Identifier assigned to the acquirer by the card network. """ class CreateParamsVerificationData(TypedDict): address_line1_check: NotRequired[ Literal["match", "mismatch", "not_provided"] ] """ Whether the cardholder provided an address first line and if it matched the cardholder's `billing.address.line1`. """ address_postal_code_check: NotRequired[ Literal["match", "mismatch", "not_provided"] ] """ Whether the cardholder provided a postal code and if it matched the cardholder's `billing.address.postal_code`. """ authentication_exemption: NotRequired[ "Authorization.CreateParamsVerificationDataAuthenticationExemption" ] """ The exemption applied to this authorization. """ cvc_check: NotRequired[Literal["match", "mismatch", "not_provided"]] """ Whether the cardholder provided a CVC and if it matched Stripe's record. """ expiry_check: NotRequired[Literal["match", "mismatch", "not_provided"]] """ Whether the cardholder provided an expiry date and if it matched Stripe's record. """ three_d_secure: NotRequired[ "Authorization.CreateParamsVerificationDataThreeDSecure" ] """ 3D Secure details. """ class CreateParamsVerificationDataAuthenticationExemption(TypedDict): claimed_by: Literal["acquirer", "issuer"] """ The entity that requested the exemption, either the acquiring merchant or the Issuing user. """ type: Literal[ "low_value_transaction", "transaction_risk_analysis", "unknown" ] """ The specific exemption claimed for this authorization. """ class CreateParamsVerificationDataThreeDSecure(TypedDict): result: Literal[ "attempt_acknowledged", "authenticated", "failed", "required" ] """ The outcome of the 3D Secure authentication request. """ class DeclineParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ class ExpireParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class FinalizeAmountParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ final_amount: int """ The final authorization amount that will be captured by the merchant. This amount is in the authorization currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ fleet: NotRequired["Authorization.FinalizeAmountParamsFleet"] """ Fleet-specific information for authorizations using Fleet cards. """ fuel: NotRequired["Authorization.FinalizeAmountParamsFuel"] """ Information about fuel that was purchased with this transaction. """ class FinalizeAmountParamsFleet(TypedDict): cardholder_prompt_data: NotRequired[ "Authorization.FinalizeAmountParamsFleetCardholderPromptData" ] """ Answers to prompts presented to the cardholder at the point of sale. Prompted fields vary depending on the configuration of your physical fleet cards. Typical points of sale support only numeric entry. """ purchase_type: NotRequired[ Literal[ "fuel_and_non_fuel_purchase", "fuel_purchase", "non_fuel_purchase", ] ] """ The type of purchase. One of `fuel_purchase`, `non_fuel_purchase`, or `fuel_and_non_fuel_purchase`. """ reported_breakdown: NotRequired[ "Authorization.FinalizeAmountParamsFleetReportedBreakdown" ] """ More information about the total amount. This information is not guaranteed to be accurate as some merchants may provide unreliable data. """ service_type: NotRequired[ Literal["full_service", "non_fuel_transaction", "self_service"] ] """ The type of fuel service. One of `non_fuel_transaction`, `full_service`, or `self_service`. """ class FinalizeAmountParamsFleetCardholderPromptData(TypedDict): driver_id: NotRequired[str] """ Driver ID. """ odometer: NotRequired[int] """ Odometer reading. """ unspecified_id: NotRequired[str] """ An alphanumeric ID. This field is used when a vehicle ID, driver ID, or generic ID is entered by the cardholder, but the merchant or card network did not specify the prompt type. """ user_id: NotRequired[str] """ User ID. """ vehicle_number: NotRequired[str] """ Vehicle number. """ class FinalizeAmountParamsFleetReportedBreakdown(TypedDict): fuel: NotRequired[ "Authorization.FinalizeAmountParamsFleetReportedBreakdownFuel" ] """ Breakdown of fuel portion of the purchase. """ non_fuel: NotRequired[ "Authorization.FinalizeAmountParamsFleetReportedBreakdownNonFuel" ] """ Breakdown of non-fuel portion of the purchase. """ tax: NotRequired[ "Authorization.FinalizeAmountParamsFleetReportedBreakdownTax" ] """ Information about tax included in this transaction. """ class FinalizeAmountParamsFleetReportedBreakdownFuel(TypedDict): gross_amount_decimal: NotRequired[str] """ Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. """ class FinalizeAmountParamsFleetReportedBreakdownNonFuel(TypedDict): gross_amount_decimal: NotRequired[str] """ Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes. """ class FinalizeAmountParamsFleetReportedBreakdownTax(TypedDict): local_amount_decimal: NotRequired[str] """ Amount of state or provincial Sales Tax included in the transaction amount. Null if not reported by merchant or not subject to tax. """ national_amount_decimal: NotRequired[str] """ Amount of national Sales Tax or VAT included in the transaction amount. Null if not reported by merchant or not subject to tax. """ class FinalizeAmountParamsFuel(TypedDict): industry_product_code: NotRequired[str] """ [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased. """ quantity_decimal: NotRequired[str] """ The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places. """ type: NotRequired[ Literal[ "diesel", "other", "unleaded_plus", "unleaded_regular", "unleaded_super", ] ] """ The type of fuel that was purchased. One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. """ unit: NotRequired[ Literal[ "charging_minute", "imperial_gallon", "kilogram", "kilowatt_hour", "liter", "other", "pound", "us_gallon", ] ] """ The units for `quantity_decimal`. One of `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `liter`, `pound`, `us_gallon`, or `other`. """ unit_cost_decimal: NotRequired[str] """ The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. """ class IncrementParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ increment_amount: int """ The amount to increment the authorization by. This amount is in the authorization currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ is_amount_controllable: NotRequired[bool] """ If set `true`, you may provide [amount](https://stripe.com/docs/api/issuing/authorizations/approve#approve_issuing_authorization-amount) to control how much to hold for the authorization. """ class ListParams(RequestOptions): card: NotRequired[str] """ Only return authorizations that belong to the given card. """ cardholder: NotRequired[str] """ Only return authorizations that belong to the given cardholder. """ created: NotRequired["Authorization.ListParamsCreated|int"] """ Only return authorizations that were created during the given date interval. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[Literal["closed", "pending", "reversed"]] """ Only return authorizations with the given status. One of `pending`, `closed`, or `reversed`. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ReverseParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ reverse_amount: NotRequired[int] """ The amount to reverse from the authorization. If not provided, the full amount of the authorization will be reversed. This amount is in the authorization currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ amount: int """ The total amount that was authorized or rejected. This amount is in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). `amount` should be the same as `merchant_amount`, unless `currency` and `merchant_currency` are different. """ amount_details: Optional[AmountDetails] """ Detailed breakdown of amount components. These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ approved: bool """ Whether the authorization has been approved. """ authorization_method: Literal[ "chip", "contactless", "keyed_in", "online", "swipe" ] """ How the card details were provided. """ balance_transactions: List["BalanceTransaction"] """ List of balance transactions associated with this authorization. """ card: "Card" """ You can [create physical or virtual cards](https://stripe.com/docs/issuing/cards) that are issued to cardholders. """ cardholder: Optional[ExpandableField["Cardholder"]] """ The cardholder to whom this authorization belongs. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ currency: str """ The currency of the cardholder. This currency can be different from the currency presented at authorization and the `merchant_currency` field on this authorization. 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). """ fleet: Optional[Fleet] """ Fleet-specific information for authorizations using Fleet cards. """ fuel: Optional[Fuel] """ 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. """ id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ merchant_amount: int """ The total amount that was authorized or rejected. This amount is in the `merchant_currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). `merchant_amount` should be the same as `amount`, unless `merchant_currency` and `currency` are different. """ merchant_currency: str """ The local currency that was presented to the cardholder for the authorization. This currency can be different from the cardholder currency and the `currency` field on this authorization. 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). """ merchant_data: MerchantData metadata: Dict[str, str] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ network_data: Optional[NetworkData] """ Details about the authorization, such as identifiers, set by the card network. """ object: Literal["issuing.authorization"] """ String representing the object's type. Objects of the same type share the same value. """ pending_request: Optional[PendingRequest] """ The pending authorization request. This field will only be non-null during an `issuing_authorization.request` webhook. """ request_history: List[RequestHistory] """ History of every time a `pending_request` authorization was approved/declined, either by you directly or by Stripe (e.g. based on your spending_controls). If the merchant changes the authorization by performing an incremental authorization, you can look at this field to see the previous requests for the authorization. This field can be helpful in determining why a given authorization was approved/declined. """ status: Literal["closed", "pending", "reversed"] """ The current status of the authorization in its lifecycle. """ token: Optional[ExpandableField["Token"]] """ [Token](https://stripe.com/docs/api/issuing/tokens/object) object used for this authorization. If a network token was not used for this authorization, this field will be null. """ transactions: List["Transaction"] """ List of [transactions](https://stripe.com/docs/api/issuing/transactions) associated with this authorization. """ treasury: Optional[Treasury] """ [Treasury](https://stripe.com/docs/api/treasury) details related to this authorization if it was created on a [FinancialAccount](https://stripe.com/docs/api/treasury/financial_accounts). """ verification_data: VerificationData wallet: Optional[str] """ The digital wallet used for this transaction. One of `apple_pay`, `google_pay`, or `samsung_pay`. Will populate as `null` when no digital wallet was utilized. """ @classmethod def _cls_approve( cls, authorization: str, **params: Unpack["Authorization.ApproveParams"], ) -> "Authorization": """ [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. This method is deprecated. Instead, [respond directly to the webhook request to approve an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). """ return cast( "Authorization", cls._static_request( "post", "/v1/issuing/authorizations/{authorization}/approve".format( authorization=sanitize_id(authorization) ), params=params, ), ) @overload @staticmethod def approve( authorization: str, **params: Unpack["Authorization.ApproveParams"] ) -> "Authorization": """ [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. This method is deprecated. Instead, [respond directly to the webhook request to approve an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). """ ... @overload def approve( self, **params: Unpack["Authorization.ApproveParams"] ) -> "Authorization": """ [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. This method is deprecated. Instead, [respond directly to the webhook request to approve an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). """ ... @class_method_variant("_cls_approve") def approve( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Authorization.ApproveParams"] ) -> "Authorization": """ [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. This method is deprecated. Instead, [respond directly to the webhook request to approve an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). """ return cast( "Authorization", self._request( "post", "/v1/issuing/authorizations/{authorization}/approve".format( authorization=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_approve_async( cls, authorization: str, **params: Unpack["Authorization.ApproveParams"], ) -> "Authorization": """ [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. This method is deprecated. Instead, [respond directly to the webhook request to approve an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). """ return cast( "Authorization", await cls._static_request_async( "post", "/v1/issuing/authorizations/{authorization}/approve".format( authorization=sanitize_id(authorization) ), params=params, ), ) @overload @staticmethod async def approve_async( authorization: str, **params: Unpack["Authorization.ApproveParams"] ) -> "Authorization": """ [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. This method is deprecated. Instead, [respond directly to the webhook request to approve an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). """ ... @overload async def approve_async( self, **params: Unpack["Authorization.ApproveParams"] ) -> "Authorization": """ [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. This method is deprecated. Instead, [respond directly to the webhook request to approve an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). """ ... @class_method_variant("_cls_approve_async") async def approve_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Authorization.ApproveParams"] ) -> "Authorization": """ [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. This method is deprecated. Instead, [respond directly to the webhook request to approve an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). """ return cast( "Authorization", await self._request_async( "post", "/v1/issuing/authorizations/{authorization}/approve".format( authorization=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def _cls_decline( cls, authorization: str, **params: Unpack["Authorization.DeclineParams"], ) -> "Authorization": """ [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. This method is deprecated. Instead, [respond directly to the webhook request to decline an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). """ return cast( "Authorization", cls._static_request( "post", "/v1/issuing/authorizations/{authorization}/decline".format( authorization=sanitize_id(authorization) ), params=params, ), ) @overload @staticmethod def decline( authorization: str, **params: Unpack["Authorization.DeclineParams"] ) -> "Authorization": """ [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. This method is deprecated. Instead, [respond directly to the webhook request to decline an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). """ ... @overload def decline( self, **params: Unpack["Authorization.DeclineParams"] ) -> "Authorization": """ [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. This method is deprecated. Instead, [respond directly to the webhook request to decline an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). """ ... @class_method_variant("_cls_decline") def decline( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Authorization.DeclineParams"] ) -> "Authorization": """ [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. This method is deprecated. Instead, [respond directly to the webhook request to decline an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). """ return cast( "Authorization", self._request( "post", "/v1/issuing/authorizations/{authorization}/decline".format( authorization=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_decline_async( cls, authorization: str, **params: Unpack["Authorization.DeclineParams"], ) -> "Authorization": """ [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. This method is deprecated. Instead, [respond directly to the webhook request to decline an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). """ return cast( "Authorization", await cls._static_request_async( "post", "/v1/issuing/authorizations/{authorization}/decline".format( authorization=sanitize_id(authorization) ), params=params, ), ) @overload @staticmethod async def decline_async( authorization: str, **params: Unpack["Authorization.DeclineParams"] ) -> "Authorization": """ [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. This method is deprecated. Instead, [respond directly to the webhook request to decline an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). """ ... @overload async def decline_async( self, **params: Unpack["Authorization.DeclineParams"] ) -> "Authorization": """ [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. This method is deprecated. Instead, [respond directly to the webhook request to decline an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). """ ... @class_method_variant("_cls_decline_async") async def decline_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Authorization.DeclineParams"] ) -> "Authorization": """ [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. This method is deprecated. Instead, [respond directly to the webhook request to decline an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). """ return cast( "Authorization", await self._request_async( "post", "/v1/issuing/authorizations/{authorization}/decline".format( authorization=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def list( cls, **params: Unpack["Authorization.ListParams"] ) -> ListObject["Authorization"]: """ Returns a list of Issuing Authorization objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["Authorization.ListParams"] ) -> ListObject["Authorization"]: """ Returns a list of Issuing Authorization objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def modify( cls, id: str, **params: Unpack["Authorization.ModifyParams"] ) -> "Authorization": """ Updates the specified Issuing Authorization object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Authorization", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["Authorization.ModifyParams"] ) -> "Authorization": """ Updates the specified Issuing Authorization object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Authorization", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["Authorization.RetrieveParams"] ) -> "Authorization": """ Retrieves an Issuing Authorization object. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["Authorization.RetrieveParams"] ) -> "Authorization": """ Retrieves an Issuing Authorization object. """ instance = cls(id, **params) await instance.refresh_async() return instance class TestHelpers(APIResourceTestHelpers["Authorization"]): _resource_cls: Type["Authorization"] @classmethod def _cls_capture( cls, authorization: str, **params: Unpack["Authorization.CaptureParams"], ) -> "Authorization": """ Capture a test-mode authorization. """ return cast( "Authorization", cls._static_request( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/capture".format( authorization=sanitize_id(authorization) ), params=params, ), ) @overload @staticmethod def capture( authorization: str, **params: Unpack["Authorization.CaptureParams"] ) -> "Authorization": """ Capture a test-mode authorization. """ ... @overload def capture( self, **params: Unpack["Authorization.CaptureParams"] ) -> "Authorization": """ Capture a test-mode authorization. """ ... @class_method_variant("_cls_capture") def capture( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Authorization.CaptureParams"] ) -> "Authorization": """ Capture a test-mode authorization. """ return cast( "Authorization", self.resource._request( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/capture".format( authorization=sanitize_id(self.resource.get("id")) ), params=params, ), ) @classmethod async def _cls_capture_async( cls, authorization: str, **params: Unpack["Authorization.CaptureParams"], ) -> "Authorization": """ Capture a test-mode authorization. """ return cast( "Authorization", await cls._static_request_async( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/capture".format( authorization=sanitize_id(authorization) ), params=params, ), ) @overload @staticmethod async def capture_async( authorization: str, **params: Unpack["Authorization.CaptureParams"] ) -> "Authorization": """ Capture a test-mode authorization. """ ... @overload async def capture_async( self, **params: Unpack["Authorization.CaptureParams"] ) -> "Authorization": """ Capture a test-mode authorization. """ ... @class_method_variant("_cls_capture_async") async def capture_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Authorization.CaptureParams"] ) -> "Authorization": """ Capture a test-mode authorization. """ return cast( "Authorization", await self.resource._request_async( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/capture".format( authorization=sanitize_id(self.resource.get("id")) ), params=params, ), ) @classmethod def create( cls, **params: Unpack["Authorization.CreateParams"] ) -> "Authorization": """ Create a test-mode authorization. """ return cast( "Authorization", cls._static_request( "post", "/v1/test_helpers/issuing/authorizations", params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["Authorization.CreateParams"] ) -> "Authorization": """ Create a test-mode authorization. """ return cast( "Authorization", await cls._static_request_async( "post", "/v1/test_helpers/issuing/authorizations", params=params, ), ) @classmethod def _cls_expire( cls, authorization: str, **params: Unpack["Authorization.ExpireParams"], ) -> "Authorization": """ Expire a test-mode Authorization. """ return cast( "Authorization", cls._static_request( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/expire".format( authorization=sanitize_id(authorization) ), params=params, ), ) @overload @staticmethod def expire( authorization: str, **params: Unpack["Authorization.ExpireParams"] ) -> "Authorization": """ Expire a test-mode Authorization. """ ... @overload def expire( self, **params: Unpack["Authorization.ExpireParams"] ) -> "Authorization": """ Expire a test-mode Authorization. """ ... @class_method_variant("_cls_expire") def expire( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Authorization.ExpireParams"] ) -> "Authorization": """ Expire a test-mode Authorization. """ return cast( "Authorization", self.resource._request( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/expire".format( authorization=sanitize_id(self.resource.get("id")) ), params=params, ), ) @classmethod async def _cls_expire_async( cls, authorization: str, **params: Unpack["Authorization.ExpireParams"], ) -> "Authorization": """ Expire a test-mode Authorization. """ return cast( "Authorization", await cls._static_request_async( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/expire".format( authorization=sanitize_id(authorization) ), params=params, ), ) @overload @staticmethod async def expire_async( authorization: str, **params: Unpack["Authorization.ExpireParams"] ) -> "Authorization": """ Expire a test-mode Authorization. """ ... @overload async def expire_async( self, **params: Unpack["Authorization.ExpireParams"] ) -> "Authorization": """ Expire a test-mode Authorization. """ ... @class_method_variant("_cls_expire_async") async def expire_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Authorization.ExpireParams"] ) -> "Authorization": """ Expire a test-mode Authorization. """ return cast( "Authorization", await self.resource._request_async( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/expire".format( authorization=sanitize_id(self.resource.get("id")) ), params=params, ), ) @classmethod def _cls_finalize_amount( cls, authorization: str, **params: Unpack["Authorization.FinalizeAmountParams"], ) -> "Authorization": """ Finalize the amount on an Authorization prior to capture, when the initial authorization was for an estimated amount. """ return cast( "Authorization", cls._static_request( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/finalize_amount".format( authorization=sanitize_id(authorization) ), params=params, ), ) @overload @staticmethod def finalize_amount( authorization: str, **params: Unpack["Authorization.FinalizeAmountParams"], ) -> "Authorization": """ Finalize the amount on an Authorization prior to capture, when the initial authorization was for an estimated amount. """ ... @overload def finalize_amount( self, **params: Unpack["Authorization.FinalizeAmountParams"] ) -> "Authorization": """ Finalize the amount on an Authorization prior to capture, when the initial authorization was for an estimated amount. """ ... @class_method_variant("_cls_finalize_amount") def finalize_amount( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Authorization.FinalizeAmountParams"] ) -> "Authorization": """ Finalize the amount on an Authorization prior to capture, when the initial authorization was for an estimated amount. """ return cast( "Authorization", self.resource._request( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/finalize_amount".format( authorization=sanitize_id(self.resource.get("id")) ), params=params, ), ) @classmethod async def _cls_finalize_amount_async( cls, authorization: str, **params: Unpack["Authorization.FinalizeAmountParams"], ) -> "Authorization": """ Finalize the amount on an Authorization prior to capture, when the initial authorization was for an estimated amount. """ return cast( "Authorization", await cls._static_request_async( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/finalize_amount".format( authorization=sanitize_id(authorization) ), params=params, ), ) @overload @staticmethod async def finalize_amount_async( authorization: str, **params: Unpack["Authorization.FinalizeAmountParams"], ) -> "Authorization": """ Finalize the amount on an Authorization prior to capture, when the initial authorization was for an estimated amount. """ ... @overload async def finalize_amount_async( self, **params: Unpack["Authorization.FinalizeAmountParams"] ) -> "Authorization": """ Finalize the amount on an Authorization prior to capture, when the initial authorization was for an estimated amount. """ ... @class_method_variant("_cls_finalize_amount_async") async def finalize_amount_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Authorization.FinalizeAmountParams"] ) -> "Authorization": """ Finalize the amount on an Authorization prior to capture, when the initial authorization was for an estimated amount. """ return cast( "Authorization", await self.resource._request_async( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/finalize_amount".format( authorization=sanitize_id(self.resource.get("id")) ), params=params, ), ) @classmethod def _cls_increment( cls, authorization: str, **params: Unpack["Authorization.IncrementParams"], ) -> "Authorization": """ Increment a test-mode Authorization. """ return cast( "Authorization", cls._static_request( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/increment".format( authorization=sanitize_id(authorization) ), params=params, ), ) @overload @staticmethod def increment( authorization: str, **params: Unpack["Authorization.IncrementParams"], ) -> "Authorization": """ Increment a test-mode Authorization. """ ... @overload def increment( self, **params: Unpack["Authorization.IncrementParams"] ) -> "Authorization": """ Increment a test-mode Authorization. """ ... @class_method_variant("_cls_increment") def increment( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Authorization.IncrementParams"] ) -> "Authorization": """ Increment a test-mode Authorization. """ return cast( "Authorization", self.resource._request( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/increment".format( authorization=sanitize_id(self.resource.get("id")) ), params=params, ), ) @classmethod async def _cls_increment_async( cls, authorization: str, **params: Unpack["Authorization.IncrementParams"], ) -> "Authorization": """ Increment a test-mode Authorization. """ return cast( "Authorization", await cls._static_request_async( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/increment".format( authorization=sanitize_id(authorization) ), params=params, ), ) @overload @staticmethod async def increment_async( authorization: str, **params: Unpack["Authorization.IncrementParams"], ) -> "Authorization": """ Increment a test-mode Authorization. """ ... @overload async def increment_async( self, **params: Unpack["Authorization.IncrementParams"] ) -> "Authorization": """ Increment a test-mode Authorization. """ ... @class_method_variant("_cls_increment_async") async def increment_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Authorization.IncrementParams"] ) -> "Authorization": """ Increment a test-mode Authorization. """ return cast( "Authorization", await self.resource._request_async( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/increment".format( authorization=sanitize_id(self.resource.get("id")) ), params=params, ), ) @classmethod def _cls_reverse( cls, authorization: str, **params: Unpack["Authorization.ReverseParams"], ) -> "Authorization": """ Reverse a test-mode Authorization. """ return cast( "Authorization", cls._static_request( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/reverse".format( authorization=sanitize_id(authorization) ), params=params, ), ) @overload @staticmethod def reverse( authorization: str, **params: Unpack["Authorization.ReverseParams"] ) -> "Authorization": """ Reverse a test-mode Authorization. """ ... @overload def reverse( self, **params: Unpack["Authorization.ReverseParams"] ) -> "Authorization": """ Reverse a test-mode Authorization. """ ... @class_method_variant("_cls_reverse") def reverse( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Authorization.ReverseParams"] ) -> "Authorization": """ Reverse a test-mode Authorization. """ return cast( "Authorization", self.resource._request( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/reverse".format( authorization=sanitize_id(self.resource.get("id")) ), params=params, ), ) @classmethod async def _cls_reverse_async( cls, authorization: str, **params: Unpack["Authorization.ReverseParams"], ) -> "Authorization": """ Reverse a test-mode Authorization. """ return cast( "Authorization", await cls._static_request_async( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/reverse".format( authorization=sanitize_id(authorization) ), params=params, ), ) @overload @staticmethod async def reverse_async( authorization: str, **params: Unpack["Authorization.ReverseParams"] ) -> "Authorization": """ Reverse a test-mode Authorization. """ ... @overload async def reverse_async( self, **params: Unpack["Authorization.ReverseParams"] ) -> "Authorization": """ Reverse a test-mode Authorization. """ ... @class_method_variant("_cls_reverse_async") async def reverse_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Authorization.ReverseParams"] ) -> "Authorization": """ Reverse a test-mode Authorization. """ return cast( "Authorization", await self.resource._request_async( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/reverse".format( authorization=sanitize_id(self.resource.get("id")) ), params=params, ), ) @property def test_helpers(self): return self.TestHelpers(self) _inner_class_types = { "amount_details": AmountDetails, "fleet": Fleet, "fuel": Fuel, "merchant_data": MerchantData, "network_data": NetworkData, "pending_request": PendingRequest, "request_history": RequestHistory, "treasury": Treasury, "verification_data": VerificationData, } Authorization.TestHelpers._resource_cls = Authorization ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/issuing/_authorization_service.py0000644000175100001770000003207714637354563022655 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.issuing._authorization import Authorization from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class AuthorizationService(StripeService): class ApproveParams(TypedDict): amount: NotRequired[int] """ If the authorization's `pending_request.is_amount_controllable` property is `true`, you may provide this value to control how much to hold for the authorization. Must be positive (use [`decline`](https://stripe.com/docs/api/issuing/authorizations/decline) to decline an authorization request). """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ class DeclineParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ class ListParams(TypedDict): card: NotRequired[str] """ Only return authorizations that belong to the given card. """ cardholder: NotRequired[str] """ Only return authorizations that belong to the given cardholder. """ created: NotRequired["AuthorizationService.ListParamsCreated|int"] """ Only return authorizations that were created during the given date interval. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[Literal["closed", "pending", "reversed"]] """ Only return authorizations with the given status. One of `pending`, `closed`, or `reversed`. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ def list( self, params: "AuthorizationService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Authorization]: """ Returns a list of Issuing Authorization objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. """ return cast( ListObject[Authorization], self._request( "get", "/v1/issuing/authorizations", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "AuthorizationService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Authorization]: """ Returns a list of Issuing Authorization objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. """ return cast( ListObject[Authorization], await self._request_async( "get", "/v1/issuing/authorizations", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, authorization: str, params: "AuthorizationService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Authorization: """ Retrieves an Issuing Authorization object. """ return cast( Authorization, self._request( "get", "/v1/issuing/authorizations/{authorization}".format( authorization=sanitize_id(authorization), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, authorization: str, params: "AuthorizationService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Authorization: """ Retrieves an Issuing Authorization object. """ return cast( Authorization, await self._request_async( "get", "/v1/issuing/authorizations/{authorization}".format( authorization=sanitize_id(authorization), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, authorization: str, params: "AuthorizationService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Authorization: """ Updates the specified Issuing Authorization object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. """ return cast( Authorization, self._request( "post", "/v1/issuing/authorizations/{authorization}".format( authorization=sanitize_id(authorization), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, authorization: str, params: "AuthorizationService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Authorization: """ Updates the specified Issuing Authorization object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. """ return cast( Authorization, await self._request_async( "post", "/v1/issuing/authorizations/{authorization}".format( authorization=sanitize_id(authorization), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def approve( self, authorization: str, params: "AuthorizationService.ApproveParams" = {}, options: RequestOptions = {}, ) -> Authorization: """ [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. This method is deprecated. Instead, [respond directly to the webhook request to approve an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). """ return cast( Authorization, self._request( "post", "/v1/issuing/authorizations/{authorization}/approve".format( authorization=sanitize_id(authorization), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def approve_async( self, authorization: str, params: "AuthorizationService.ApproveParams" = {}, options: RequestOptions = {}, ) -> Authorization: """ [Deprecated] Approves a pending Issuing Authorization object. This request should be made within the timeout window of the [real-time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. This method is deprecated. Instead, [respond directly to the webhook request to approve an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). """ return cast( Authorization, await self._request_async( "post", "/v1/issuing/authorizations/{authorization}/approve".format( authorization=sanitize_id(authorization), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def decline( self, authorization: str, params: "AuthorizationService.DeclineParams" = {}, options: RequestOptions = {}, ) -> Authorization: """ [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. This method is deprecated. Instead, [respond directly to the webhook request to decline an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). """ return cast( Authorization, self._request( "post", "/v1/issuing/authorizations/{authorization}/decline".format( authorization=sanitize_id(authorization), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def decline_async( self, authorization: str, params: "AuthorizationService.DeclineParams" = {}, options: RequestOptions = {}, ) -> Authorization: """ [Deprecated] Declines a pending Issuing Authorization object. This request should be made within the timeout window of the [real time authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations) flow. This method is deprecated. Instead, [respond directly to the webhook request to decline an authorization](https://stripe.com/docs/issuing/controls/real-time-authorizations#authorization-handling). """ return cast( Authorization, await self._request_async( "post", "/v1/issuing/authorizations/{authorization}/decline".format( authorization=sanitize_id(authorization), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/issuing/_card.py0000644000175100001770000053631314637354563017150 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._test_helpers import APIResourceTestHelpers from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, NotRequired, Type, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe.issuing._cardholder import Cardholder from stripe.issuing._personalization_design import PersonalizationDesign class Card( CreateableAPIResource["Card"], ListableAPIResource["Card"], UpdateableAPIResource["Card"], ): """ You can [create physical or virtual cards](https://stripe.com/docs/issuing/cards) that are issued to cardholders. """ OBJECT_NAME: ClassVar[Literal["issuing.card"]] = "issuing.card" class Shipping(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 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State, county, province, or region. """ class Customs(StripeObject): eori_number: Optional[str] """ A registration number used for customs in Europe. See [https://www.gov.uk/eori](https://www.gov.uk/eori) for the UK and [https://ec.europa.eu/taxation_customs/business/customs-procedures-import-and-export/customs-procedures/economic-operators-registration-and-identification-number-eori_en](https://ec.europa.eu/taxation_customs/business/customs-procedures-import-and-export/customs-procedures/economic-operators-registration-and-identification-number-eori_en) for the EU. """ address: Address carrier: Optional[Literal["dhl", "fedex", "royal_mail", "usps"]] """ The delivery company that shipped a card. """ customs: Optional[Customs] """ Additional information that may be required for clearing customs. """ eta: Optional[int] """ A unix timestamp representing a best estimate of when the card will be delivered. """ name: str """ Recipient name. """ phone_number: Optional[str] """ The phone number of the receiver of the shipment. Our courier partners will use this number to contact you in the event of card delivery issues. For individual shipments to the EU/UK, if this field is empty, we will provide them with the phone number provided when the cardholder was initially created. """ require_signature: Optional[bool] """ Whether a signature is required for card delivery. This feature is only supported for US users. Standard shipping service does not support signature on delivery. The default value for standard shipping service is false and for express and priority services is true. """ service: Literal["express", "priority", "standard"] """ Shipment service, such as `standard` or `express`. """ status: Optional[ Literal[ "canceled", "delivered", "failure", "pending", "returned", "shipped", ] ] """ The delivery status of the card. """ tracking_number: Optional[str] """ A tracking number for a card shipment. """ tracking_url: Optional[str] """ A link to the shipping carrier's site where you can view detailed information about a card shipment. """ type: Literal["bulk", "individual"] """ Packaging options. """ _inner_class_types = {"address": Address, "customs": Customs} class SpendingControls(StripeObject): class SpendingLimit(StripeObject): amount: int """ Maximum amount allowed to spend per interval. This amount is in the card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ categories: Optional[ List[ Literal[ "ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards", ] ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. Omitting this field will apply the limit to all categories. """ interval: Literal[ "all_time", "daily", "monthly", "per_authorization", "weekly", "yearly", ] """ Interval (or event) to which the amount applies. """ allowed_categories: Optional[ List[ Literal[ "ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards", ] ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. All other categories will be blocked. Cannot be set with `blocked_categories`. """ allowed_merchant_countries: Optional[List[str]] """ Array of strings containing representing countries from which authorizations will be allowed. Authorizations from merchants in all other countries will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `blocked_merchant_countries`. Provide an empty value to unset this control. """ blocked_categories: Optional[ List[ Literal[ "ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards", ] ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. All other categories will be allowed. Cannot be set with `allowed_categories`. """ blocked_merchant_countries: Optional[List[str]] """ Array of strings containing representing countries from which authorizations will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `allowed_merchant_countries`. Provide an empty value to unset this control. """ spending_limits: Optional[List[SpendingLimit]] """ Limit spending with amount-based rules that apply across any cards this card replaced (i.e., its `replacement_for` card and _that_ card's `replacement_for` card, up the chain). """ spending_limits_currency: Optional[str] """ Currency of the amounts within `spending_limits`. Always the same as the currency of the card. """ _inner_class_types = {"spending_limits": SpendingLimit} class Wallets(StripeObject): class ApplePay(StripeObject): eligible: bool """ Apple Pay Eligibility """ ineligible_reason: Optional[ Literal[ "missing_agreement", "missing_cardholder_contact", "unsupported_region", ] ] """ Reason the card is ineligible for Apple Pay """ class GooglePay(StripeObject): eligible: bool """ Google Pay Eligibility """ ineligible_reason: Optional[ Literal[ "missing_agreement", "missing_cardholder_contact", "unsupported_region", ] ] """ Reason the card is ineligible for Google Pay """ apple_pay: ApplePay google_pay: GooglePay primary_account_identifier: Optional[str] """ Unique identifier for a card used with digital wallets """ _inner_class_types = {"apple_pay": ApplePay, "google_pay": GooglePay} class CreateParams(RequestOptions): cardholder: NotRequired[str] """ The [Cardholder](https://stripe.com/docs/api#issuing_cardholder_object) object with which the card will be associated. """ currency: str """ The currency for the card. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ financial_account: NotRequired[str] metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ personalization_design: NotRequired[str] """ The personalization design object belonging to this card. """ pin: NotRequired["Card.CreateParamsPin"] """ The desired PIN for this card. """ replacement_for: NotRequired[str] """ The card this is meant to be a replacement for (if any). """ replacement_reason: NotRequired[ Literal["damaged", "expired", "lost", "stolen"] ] """ If `replacement_for` is specified, this should indicate why that card is being replaced. """ second_line: NotRequired["Literal['']|str"] """ The second line to print on the card. """ shipping: NotRequired["Card.CreateParamsShipping"] """ The address where the card will be shipped. """ spending_controls: NotRequired["Card.CreateParamsSpendingControls"] """ Rules that control spending for this card. Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. """ status: NotRequired[Literal["active", "inactive"]] """ Whether authorizations can be approved on this card. May be blocked from activating cards depending on past-due Cardholder requirements. Defaults to `inactive`. """ type: Literal["physical", "virtual"] """ The type of card to issue. Possible values are `physical` or `virtual`. """ class CreateParamsPin(TypedDict): encrypted_number: NotRequired[str] """ The card's desired new PIN, encrypted under Stripe's public key. """ class CreateParamsShipping(TypedDict): address: "Card.CreateParamsShippingAddress" """ The address that the card is shipped to. """ customs: NotRequired["Card.CreateParamsShippingCustoms"] """ Customs information for the shipment. """ name: str """ The name printed on the shipping label when shipping the card. """ phone_number: NotRequired[str] """ Phone number of the recipient of the shipment. """ require_signature: NotRequired[bool] """ Whether a signature is required for card delivery. """ service: NotRequired[Literal["express", "priority", "standard"]] """ Shipment service. """ type: NotRequired[Literal["bulk", "individual"]] """ Packaging options. """ class CreateParamsShippingAddress(TypedDict): city: str """ City, district, suburb, town, or village. """ country: str """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: str """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: str """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsShippingCustoms(TypedDict): eori_number: NotRequired[str] """ The Economic Operators Registration and Identification (EORI) number to use for Customs. Required for bulk shipments to Europe. """ class CreateParamsSpendingControls(TypedDict): allowed_categories: NotRequired[ List[ Literal[ "ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards", ] ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. All other categories will be blocked. Cannot be set with `blocked_categories`. """ allowed_merchant_countries: NotRequired[List[str]] """ Array of strings containing representing countries from which authorizations will be allowed. Authorizations from merchants in all other countries will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `blocked_merchant_countries`. Provide an empty value to unset this control. """ blocked_categories: NotRequired[ List[ Literal[ "ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards", ] ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. All other categories will be allowed. Cannot be set with `allowed_categories`. """ blocked_merchant_countries: NotRequired[List[str]] """ Array of strings containing representing countries from which authorizations will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `allowed_merchant_countries`. Provide an empty value to unset this control. """ spending_limits: NotRequired[ List["Card.CreateParamsSpendingControlsSpendingLimit"] ] """ Limit spending with amount-based rules that apply across any cards this card replaced (i.e., its `replacement_for` card and _that_ card's `replacement_for` card, up the chain). """ class CreateParamsSpendingControlsSpendingLimit(TypedDict): amount: int """ Maximum amount allowed to spend per interval. """ categories: NotRequired[ List[ Literal[ "ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards", ] ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. Omitting this field will apply the limit to all categories. """ interval: Literal[ "all_time", "daily", "monthly", "per_authorization", "weekly", "yearly", ] """ Interval (or event) to which the amount applies. """ class DeliverCardParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class FailCardParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ListParams(RequestOptions): cardholder: NotRequired[str] """ Only return cards belonging to the Cardholder with the provided ID. """ created: NotRequired["Card.ListParamsCreated|int"] """ Only return cards that were issued during the given date interval. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ exp_month: NotRequired[int] """ Only return cards that have the given expiration month. """ exp_year: NotRequired[int] """ Only return cards that have the given expiration year. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ last4: NotRequired[str] """ Only return cards that have the given last four digits. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ personalization_design: NotRequired[str] starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[Literal["active", "canceled", "inactive"]] """ Only return cards that have the given status. One of `active`, `inactive`, or `canceled`. """ type: NotRequired[Literal["physical", "virtual"]] """ Only return cards that have the given type. One of `virtual` or `physical`. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): cancellation_reason: NotRequired[Literal["lost", "stolen"]] """ Reason why the `status` of this card is `canceled`. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ personalization_design: NotRequired[str] pin: NotRequired["Card.ModifyParamsPin"] """ The desired new PIN for this card. """ spending_controls: NotRequired["Card.ModifyParamsSpendingControls"] """ Rules that control spending for this card. Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. """ status: NotRequired[Literal["active", "canceled", "inactive"]] """ Dictates whether authorizations can be approved on this card. May be blocked from activating cards depending on past-due Cardholder requirements. Defaults to `inactive`. If this card is being canceled because it was lost or stolen, this information should be provided as `cancellation_reason`. """ class ModifyParamsPin(TypedDict): encrypted_number: NotRequired[str] """ The card's desired new PIN, encrypted under Stripe's public key. """ class ModifyParamsSpendingControls(TypedDict): allowed_categories: NotRequired[ List[ Literal[ "ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards", ] ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. All other categories will be blocked. Cannot be set with `blocked_categories`. """ allowed_merchant_countries: NotRequired[List[str]] """ Array of strings containing representing countries from which authorizations will be allowed. Authorizations from merchants in all other countries will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `blocked_merchant_countries`. Provide an empty value to unset this control. """ blocked_categories: NotRequired[ List[ Literal[ "ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards", ] ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. All other categories will be allowed. Cannot be set with `allowed_categories`. """ blocked_merchant_countries: NotRequired[List[str]] """ Array of strings containing representing countries from which authorizations will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `allowed_merchant_countries`. Provide an empty value to unset this control. """ spending_limits: NotRequired[ List["Card.ModifyParamsSpendingControlsSpendingLimit"] ] """ Limit spending with amount-based rules that apply across any cards this card replaced (i.e., its `replacement_for` card and _that_ card's `replacement_for` card, up the chain). """ class ModifyParamsSpendingControlsSpendingLimit(TypedDict): amount: int """ Maximum amount allowed to spend per interval. """ categories: NotRequired[ List[ Literal[ "ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards", ] ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. Omitting this field will apply the limit to all categories. """ interval: Literal[ "all_time", "daily", "monthly", "per_authorization", "weekly", "yearly", ] """ Interval (or event) to which the amount applies. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ReturnCardParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ShipCardParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ brand: str """ The brand of the card. """ cancellation_reason: Optional[Literal["design_rejected", "lost", "stolen"]] """ The reason why the card was canceled. """ cardholder: "Cardholder" """ An Issuing `Cardholder` object represents an individual or business entity who is [issued](https://stripe.com/docs/issuing) cards. Related guide: [How to create a cardholder](https://stripe.com/docs/issuing/cards#create-cardholder) """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ currency: str """ Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. Supported currencies are `usd` in the US, `eur` in the EU, and `gbp` in the UK. """ cvc: Optional[str] """ The card's CVC. For security reasons, this is only available for virtual cards, and will be omitted unless you explicitly request it with [the `expand` parameter](https://stripe.com/docs/api/expanding_objects). Additionally, it's only available via the ["Retrieve a card" endpoint](https://stripe.com/docs/api/issuing/cards/retrieve), not via "List all cards" or any other endpoint. """ exp_month: int """ The expiration month of the card. """ exp_year: int """ The expiration year of the card. """ financial_account: Optional[str] """ The financial account this card is attached to. """ id: str """ Unique identifier for the object. """ last4: str """ The last 4 digits of the card number. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ metadata: Dict[str, str] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ number: Optional[str] """ The full unredacted card number. For security reasons, this is only available for virtual cards, and will be omitted unless you explicitly request it with [the `expand` parameter](https://stripe.com/docs/api/expanding_objects). Additionally, it's only available via the ["Retrieve a card" endpoint](https://stripe.com/docs/api/issuing/cards/retrieve), not via "List all cards" or any other endpoint. """ object: Literal["issuing.card"] """ String representing the object's type. Objects of the same type share the same value. """ personalization_design: Optional[ExpandableField["PersonalizationDesign"]] """ The personalization design object belonging to this card. """ replaced_by: Optional[ExpandableField["Card"]] """ The latest card that replaces this card, if any. """ replacement_for: Optional[ExpandableField["Card"]] """ The card this card replaces, if any. """ replacement_reason: Optional[ Literal["damaged", "expired", "lost", "stolen"] ] """ The reason why the previous card needed to be replaced. """ shipping: Optional[Shipping] """ Where and how the card will be shipped. """ spending_controls: SpendingControls status: Literal["active", "canceled", "inactive"] """ Whether authorizations can be approved on this card. May be blocked from activating cards depending on past-due Cardholder requirements. Defaults to `inactive`. """ type: Literal["physical", "virtual"] """ The type of the card. """ wallets: Optional[Wallets] """ Information relating to digital wallets (like Apple Pay and Google Pay). """ @classmethod def create(cls, **params: Unpack["Card.CreateParams"]) -> "Card": """ Creates an Issuing Card object. """ return cast( "Card", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["Card.CreateParams"] ) -> "Card": """ Creates an Issuing Card object. """ return cast( "Card", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def list(cls, **params: Unpack["Card.ListParams"]) -> ListObject["Card"]: """ Returns a list of Issuing Card objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["Card.ListParams"] ) -> ListObject["Card"]: """ Returns a list of Issuing Card objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def modify(cls, id: str, **params: Unpack["Card.ModifyParams"]) -> "Card": """ Updates the specified Issuing Card object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Card", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["Card.ModifyParams"] ) -> "Card": """ Updates the specified Issuing Card object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Card", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["Card.RetrieveParams"] ) -> "Card": """ Retrieves an Issuing Card object. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["Card.RetrieveParams"] ) -> "Card": """ Retrieves an Issuing Card object. """ instance = cls(id, **params) await instance.refresh_async() return instance class TestHelpers(APIResourceTestHelpers["Card"]): _resource_cls: Type["Card"] @classmethod def _cls_deliver_card( cls, card: str, **params: Unpack["Card.DeliverCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to delivered. """ return cast( "Card", cls._static_request( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/deliver".format( card=sanitize_id(card) ), params=params, ), ) @overload @staticmethod def deliver_card( card: str, **params: Unpack["Card.DeliverCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to delivered. """ ... @overload def deliver_card( self, **params: Unpack["Card.DeliverCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to delivered. """ ... @class_method_variant("_cls_deliver_card") def deliver_card( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Card.DeliverCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to delivered. """ return cast( "Card", self.resource._request( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/deliver".format( card=sanitize_id(self.resource.get("id")) ), params=params, ), ) @classmethod async def _cls_deliver_card_async( cls, card: str, **params: Unpack["Card.DeliverCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to delivered. """ return cast( "Card", await cls._static_request_async( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/deliver".format( card=sanitize_id(card) ), params=params, ), ) @overload @staticmethod async def deliver_card_async( card: str, **params: Unpack["Card.DeliverCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to delivered. """ ... @overload async def deliver_card_async( self, **params: Unpack["Card.DeliverCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to delivered. """ ... @class_method_variant("_cls_deliver_card_async") async def deliver_card_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Card.DeliverCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to delivered. """ return cast( "Card", await self.resource._request_async( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/deliver".format( card=sanitize_id(self.resource.get("id")) ), params=params, ), ) @classmethod def _cls_fail_card( cls, card: str, **params: Unpack["Card.FailCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to failure. """ return cast( "Card", cls._static_request( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/fail".format( card=sanitize_id(card) ), params=params, ), ) @overload @staticmethod def fail_card( card: str, **params: Unpack["Card.FailCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to failure. """ ... @overload def fail_card(self, **params: Unpack["Card.FailCardParams"]) -> "Card": """ Updates the shipping status of the specified Issuing Card object to failure. """ ... @class_method_variant("_cls_fail_card") def fail_card( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Card.FailCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to failure. """ return cast( "Card", self.resource._request( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/fail".format( card=sanitize_id(self.resource.get("id")) ), params=params, ), ) @classmethod async def _cls_fail_card_async( cls, card: str, **params: Unpack["Card.FailCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to failure. """ return cast( "Card", await cls._static_request_async( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/fail".format( card=sanitize_id(card) ), params=params, ), ) @overload @staticmethod async def fail_card_async( card: str, **params: Unpack["Card.FailCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to failure. """ ... @overload async def fail_card_async( self, **params: Unpack["Card.FailCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to failure. """ ... @class_method_variant("_cls_fail_card_async") async def fail_card_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Card.FailCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to failure. """ return cast( "Card", await self.resource._request_async( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/fail".format( card=sanitize_id(self.resource.get("id")) ), params=params, ), ) @classmethod def _cls_return_card( cls, card: str, **params: Unpack["Card.ReturnCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to returned. """ return cast( "Card", cls._static_request( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/return".format( card=sanitize_id(card) ), params=params, ), ) @overload @staticmethod def return_card( card: str, **params: Unpack["Card.ReturnCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to returned. """ ... @overload def return_card( self, **params: Unpack["Card.ReturnCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to returned. """ ... @class_method_variant("_cls_return_card") def return_card( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Card.ReturnCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to returned. """ return cast( "Card", self.resource._request( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/return".format( card=sanitize_id(self.resource.get("id")) ), params=params, ), ) @classmethod async def _cls_return_card_async( cls, card: str, **params: Unpack["Card.ReturnCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to returned. """ return cast( "Card", await cls._static_request_async( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/return".format( card=sanitize_id(card) ), params=params, ), ) @overload @staticmethod async def return_card_async( card: str, **params: Unpack["Card.ReturnCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to returned. """ ... @overload async def return_card_async( self, **params: Unpack["Card.ReturnCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to returned. """ ... @class_method_variant("_cls_return_card_async") async def return_card_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Card.ReturnCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to returned. """ return cast( "Card", await self.resource._request_async( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/return".format( card=sanitize_id(self.resource.get("id")) ), params=params, ), ) @classmethod def _cls_ship_card( cls, card: str, **params: Unpack["Card.ShipCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to shipped. """ return cast( "Card", cls._static_request( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/ship".format( card=sanitize_id(card) ), params=params, ), ) @overload @staticmethod def ship_card( card: str, **params: Unpack["Card.ShipCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to shipped. """ ... @overload def ship_card(self, **params: Unpack["Card.ShipCardParams"]) -> "Card": """ Updates the shipping status of the specified Issuing Card object to shipped. """ ... @class_method_variant("_cls_ship_card") def ship_card( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Card.ShipCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to shipped. """ return cast( "Card", self.resource._request( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/ship".format( card=sanitize_id(self.resource.get("id")) ), params=params, ), ) @classmethod async def _cls_ship_card_async( cls, card: str, **params: Unpack["Card.ShipCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to shipped. """ return cast( "Card", await cls._static_request_async( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/ship".format( card=sanitize_id(card) ), params=params, ), ) @overload @staticmethod async def ship_card_async( card: str, **params: Unpack["Card.ShipCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to shipped. """ ... @overload async def ship_card_async( self, **params: Unpack["Card.ShipCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to shipped. """ ... @class_method_variant("_cls_ship_card_async") async def ship_card_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Card.ShipCardParams"] ) -> "Card": """ Updates the shipping status of the specified Issuing Card object to shipped. """ return cast( "Card", await self.resource._request_async( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/ship".format( card=sanitize_id(self.resource.get("id")) ), params=params, ), ) @property def test_helpers(self): return self.TestHelpers(self) _inner_class_types = { "shipping": Shipping, "spending_controls": SpendingControls, "wallets": Wallets, } Card.TestHelpers._resource_cls = Card ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/issuing/_card_service.py0000644000175100001770000032126614637354563020667 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.issuing._card import Card from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class CardService(StripeService): class CreateParams(TypedDict): cardholder: NotRequired[str] """ The [Cardholder](https://stripe.com/docs/api#issuing_cardholder_object) object with which the card will be associated. """ currency: str """ The currency for the card. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ financial_account: NotRequired[str] metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ personalization_design: NotRequired[str] """ The personalization design object belonging to this card. """ pin: NotRequired["CardService.CreateParamsPin"] """ The desired PIN for this card. """ replacement_for: NotRequired[str] """ The card this is meant to be a replacement for (if any). """ replacement_reason: NotRequired[ Literal["damaged", "expired", "lost", "stolen"] ] """ If `replacement_for` is specified, this should indicate why that card is being replaced. """ second_line: NotRequired["Literal['']|str"] """ The second line to print on the card. """ shipping: NotRequired["CardService.CreateParamsShipping"] """ The address where the card will be shipped. """ spending_controls: NotRequired[ "CardService.CreateParamsSpendingControls" ] """ Rules that control spending for this card. Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. """ status: NotRequired[Literal["active", "inactive"]] """ Whether authorizations can be approved on this card. May be blocked from activating cards depending on past-due Cardholder requirements. Defaults to `inactive`. """ type: Literal["physical", "virtual"] """ The type of card to issue. Possible values are `physical` or `virtual`. """ class CreateParamsPin(TypedDict): encrypted_number: NotRequired[str] """ The card's desired new PIN, encrypted under Stripe's public key. """ class CreateParamsShipping(TypedDict): address: "CardService.CreateParamsShippingAddress" """ The address that the card is shipped to. """ customs: NotRequired["CardService.CreateParamsShippingCustoms"] """ Customs information for the shipment. """ name: str """ The name printed on the shipping label when shipping the card. """ phone_number: NotRequired[str] """ Phone number of the recipient of the shipment. """ require_signature: NotRequired[bool] """ Whether a signature is required for card delivery. """ service: NotRequired[Literal["express", "priority", "standard"]] """ Shipment service. """ type: NotRequired[Literal["bulk", "individual"]] """ Packaging options. """ class CreateParamsShippingAddress(TypedDict): city: str """ City, district, suburb, town, or village. """ country: str """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: str """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: str """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsShippingCustoms(TypedDict): eori_number: NotRequired[str] """ The Economic Operators Registration and Identification (EORI) number to use for Customs. Required for bulk shipments to Europe. """ class CreateParamsSpendingControls(TypedDict): allowed_categories: NotRequired[ List[ Literal[ "ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards", ] ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. All other categories will be blocked. Cannot be set with `blocked_categories`. """ allowed_merchant_countries: NotRequired[List[str]] """ Array of strings containing representing countries from which authorizations will be allowed. Authorizations from merchants in all other countries will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `blocked_merchant_countries`. Provide an empty value to unset this control. """ blocked_categories: NotRequired[ List[ Literal[ "ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards", ] ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. All other categories will be allowed. Cannot be set with `allowed_categories`. """ blocked_merchant_countries: NotRequired[List[str]] """ Array of strings containing representing countries from which authorizations will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `allowed_merchant_countries`. Provide an empty value to unset this control. """ spending_limits: NotRequired[ List["CardService.CreateParamsSpendingControlsSpendingLimit"] ] """ Limit spending with amount-based rules that apply across any cards this card replaced (i.e., its `replacement_for` card and _that_ card's `replacement_for` card, up the chain). """ class CreateParamsSpendingControlsSpendingLimit(TypedDict): amount: int """ Maximum amount allowed to spend per interval. """ categories: NotRequired[ List[ Literal[ "ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards", ] ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. Omitting this field will apply the limit to all categories. """ interval: Literal[ "all_time", "daily", "monthly", "per_authorization", "weekly", "yearly", ] """ Interval (or event) to which the amount applies. """ class ListParams(TypedDict): cardholder: NotRequired[str] """ Only return cards belonging to the Cardholder with the provided ID. """ created: NotRequired["CardService.ListParamsCreated|int"] """ Only return cards that were issued during the given date interval. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ exp_month: NotRequired[int] """ Only return cards that have the given expiration month. """ exp_year: NotRequired[int] """ Only return cards that have the given expiration year. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ last4: NotRequired[str] """ Only return cards that have the given last four digits. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ personalization_design: NotRequired[str] starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[Literal["active", "canceled", "inactive"]] """ Only return cards that have the given status. One of `active`, `inactive`, or `canceled`. """ type: NotRequired[Literal["physical", "virtual"]] """ Only return cards that have the given type. One of `virtual` or `physical`. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): cancellation_reason: NotRequired[Literal["lost", "stolen"]] """ Reason why the `status` of this card is `canceled`. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ personalization_design: NotRequired[str] pin: NotRequired["CardService.UpdateParamsPin"] """ The desired new PIN for this card. """ spending_controls: NotRequired[ "CardService.UpdateParamsSpendingControls" ] """ Rules that control spending for this card. Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. """ status: NotRequired[Literal["active", "canceled", "inactive"]] """ Dictates whether authorizations can be approved on this card. May be blocked from activating cards depending on past-due Cardholder requirements. Defaults to `inactive`. If this card is being canceled because it was lost or stolen, this information should be provided as `cancellation_reason`. """ class UpdateParamsPin(TypedDict): encrypted_number: NotRequired[str] """ The card's desired new PIN, encrypted under Stripe's public key. """ class UpdateParamsSpendingControls(TypedDict): allowed_categories: NotRequired[ List[ Literal[ "ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards", ] ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. All other categories will be blocked. Cannot be set with `blocked_categories`. """ allowed_merchant_countries: NotRequired[List[str]] """ Array of strings containing representing countries from which authorizations will be allowed. Authorizations from merchants in all other countries will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `blocked_merchant_countries`. Provide an empty value to unset this control. """ blocked_categories: NotRequired[ List[ Literal[ "ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards", ] ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. All other categories will be allowed. Cannot be set with `allowed_categories`. """ blocked_merchant_countries: NotRequired[List[str]] """ Array of strings containing representing countries from which authorizations will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `allowed_merchant_countries`. Provide an empty value to unset this control. """ spending_limits: NotRequired[ List["CardService.UpdateParamsSpendingControlsSpendingLimit"] ] """ Limit spending with amount-based rules that apply across any cards this card replaced (i.e., its `replacement_for` card and _that_ card's `replacement_for` card, up the chain). """ class UpdateParamsSpendingControlsSpendingLimit(TypedDict): amount: int """ Maximum amount allowed to spend per interval. """ categories: NotRequired[ List[ Literal[ "ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards", ] ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. Omitting this field will apply the limit to all categories. """ interval: Literal[ "all_time", "daily", "monthly", "per_authorization", "weekly", "yearly", ] """ Interval (or event) to which the amount applies. """ def list( self, params: "CardService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Card]: """ Returns a list of Issuing Card objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. """ return cast( ListObject[Card], self._request( "get", "/v1/issuing/cards", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "CardService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Card]: """ Returns a list of Issuing Card objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. """ return cast( ListObject[Card], await self._request_async( "get", "/v1/issuing/cards", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "CardService.CreateParams", options: RequestOptions = {} ) -> Card: """ Creates an Issuing Card object. """ return cast( Card, self._request( "post", "/v1/issuing/cards", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "CardService.CreateParams", options: RequestOptions = {} ) -> Card: """ Creates an Issuing Card object. """ return cast( Card, await self._request_async( "post", "/v1/issuing/cards", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, card: str, params: "CardService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Card: """ Retrieves an Issuing Card object. """ return cast( Card, self._request( "get", "/v1/issuing/cards/{card}".format(card=sanitize_id(card)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, card: str, params: "CardService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Card: """ Retrieves an Issuing Card object. """ return cast( Card, await self._request_async( "get", "/v1/issuing/cards/{card}".format(card=sanitize_id(card)), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, card: str, params: "CardService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Card: """ Updates the specified Issuing Card object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. """ return cast( Card, self._request( "post", "/v1/issuing/cards/{card}".format(card=sanitize_id(card)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, card: str, params: "CardService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Card: """ Updates the specified Issuing Card object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. """ return cast( Card, await self._request_async( "post", "/v1/issuing/cards/{card}".format(card=sanitize_id(card)), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/issuing/_cardholder.py0000644000175100001770000051461714637354563020351 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import sanitize_id from typing import ClassVar, Dict, List, Optional, cast from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._file import File class Cardholder( CreateableAPIResource["Cardholder"], ListableAPIResource["Cardholder"], UpdateableAPIResource["Cardholder"], ): """ An Issuing `Cardholder` object represents an individual or business entity who is [issued](https://stripe.com/docs/issuing) cards. Related guide: [How to create a cardholder](https://stripe.com/docs/issuing/cards#create-cardholder) """ OBJECT_NAME: ClassVar[Literal["issuing.cardholder"]] = "issuing.cardholder" class Billing(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 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State, county, province, or region. """ address: Address _inner_class_types = {"address": Address} class Company(StripeObject): tax_id_provided: bool """ Whether the company's business ID number was provided. """ class Individual(StripeObject): class CardIssuing(StripeObject): class UserTermsAcceptance(StripeObject): date: Optional[int] """ The Unix timestamp marking when the cardholder accepted the Authorized User Terms. """ ip: Optional[str] """ The IP address from which the cardholder accepted the Authorized User Terms. """ user_agent: Optional[str] """ The user agent of the browser from which the cardholder accepted the Authorized User Terms. """ user_terms_acceptance: Optional[UserTermsAcceptance] """ Information about cardholder acceptance of Celtic [Authorized User Terms](https://stripe.com/docs/issuing/cards#accept-authorized-user-terms). Required for cards backed by a Celtic program. """ _inner_class_types = {"user_terms_acceptance": UserTermsAcceptance} class Dob(StripeObject): day: Optional[int] """ The day of birth, between 1 and 31. """ month: Optional[int] """ The month of birth, between 1 and 12. """ year: Optional[int] """ The four-digit year of birth. """ class Verification(StripeObject): class Document(StripeObject): back: Optional[ExpandableField["File"]] """ The back of a document returned by a [file upload](https://stripe.com/docs/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://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. """ document: Optional[Document] """ An identifying document, either a passport or local ID card. """ _inner_class_types = {"document": Document} card_issuing: Optional[CardIssuing] """ Information related to the card_issuing program for this cardholder. """ dob: Optional[Dob] """ The date of birth of this cardholder. """ first_name: Optional[str] """ The first name of this cardholder. Required before activating Cards. This field cannot contain any numbers, special characters (except periods, commas, hyphens, spaces and apostrophes) or non-latin letters. """ last_name: Optional[str] """ The last name of this cardholder. Required before activating Cards. This field cannot contain any numbers, special characters (except periods, commas, hyphens, spaces and apostrophes) or non-latin letters. """ verification: Optional[Verification] """ Government-issued ID document for this cardholder. """ _inner_class_types = { "card_issuing": CardIssuing, "dob": Dob, "verification": Verification, } class Requirements(StripeObject): disabled_reason: Optional[ Literal[ "listed", "rejected.listed", "requirements.past_due", "under_review", ] ] """ If `disabled_reason` is present, all cards will decline authorizations with `cardholder_verification_required` reason. """ past_due: Optional[ List[ Literal[ "company.tax_id", "individual.card_issuing.user_terms_acceptance.date", "individual.card_issuing.user_terms_acceptance.ip", "individual.dob.day", "individual.dob.month", "individual.dob.year", "individual.first_name", "individual.last_name", "individual.verification.document", ] ] ] """ Array of fields that need to be collected in order to verify and re-enable the cardholder. """ class SpendingControls(StripeObject): class SpendingLimit(StripeObject): amount: int """ Maximum amount allowed to spend per interval. This amount is in the card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ categories: Optional[ List[ Literal[ "ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards", ] ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. Omitting this field will apply the limit to all categories. """ interval: Literal[ "all_time", "daily", "monthly", "per_authorization", "weekly", "yearly", ] """ Interval (or event) to which the amount applies. """ allowed_categories: Optional[ List[ Literal[ "ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards", ] ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. All other categories will be blocked. Cannot be set with `blocked_categories`. """ allowed_merchant_countries: Optional[List[str]] """ Array of strings containing representing countries from which authorizations will be allowed. Authorizations from merchants in all other countries will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `blocked_merchant_countries`. Provide an empty value to unset this control. """ blocked_categories: Optional[ List[ Literal[ "ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards", ] ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. All other categories will be allowed. Cannot be set with `allowed_categories`. """ blocked_merchant_countries: Optional[List[str]] """ Array of strings containing representing countries from which authorizations will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `allowed_merchant_countries`. Provide an empty value to unset this control. """ spending_limits: Optional[List[SpendingLimit]] """ Limit spending with amount-based rules that apply across this cardholder's cards. """ spending_limits_currency: Optional[str] """ Currency of the amounts within `spending_limits`. """ _inner_class_types = {"spending_limits": SpendingLimit} class CreateParams(RequestOptions): billing: "Cardholder.CreateParamsBilling" """ The cardholder's billing address. """ company: NotRequired["Cardholder.CreateParamsCompany"] """ Additional information about a `company` cardholder. """ email: NotRequired[str] """ The cardholder's email address. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ individual: NotRequired["Cardholder.CreateParamsIndividual"] """ Additional information about an `individual` cardholder. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ name: str """ The cardholder's name. This will be printed on cards issued to them. The maximum length of this field is 24 characters. This field cannot contain any special characters or numbers. """ phone_number: NotRequired[str] """ The cardholder's phone number. This will be transformed to [E.164](https://en.wikipedia.org/wiki/E.164) if it is not provided in that format already. This is required for all cardholders who will be creating EU cards. See the [3D Secure documentation](https://stripe.com/docs/issuing/3d-secure#when-is-3d-secure-applied) for more details. """ preferred_locales: NotRequired[ List[Literal["de", "en", "es", "fr", "it"]] ] """ The cardholder's preferred locales (languages), ordered by preference. Locales can be `de`, `en`, `es`, `fr`, or `it`. This changes the language of the [3D Secure flow](https://stripe.com/docs/issuing/3d-secure) and one-time password messages sent to the cardholder. """ spending_controls: NotRequired[ "Cardholder.CreateParamsSpendingControls" ] """ Rules that control spending across this cardholder's cards. Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. """ status: NotRequired[Literal["active", "inactive"]] """ Specifies whether to permit authorizations on this cardholder's cards. Defaults to `active`. """ type: NotRequired[Literal["company", "individual"]] """ One of `individual` or `company`. See [Choose a cardholder type](https://stripe.com/docs/issuing/other/choose-cardholder) for more details. """ class CreateParamsBilling(TypedDict): address: "Cardholder.CreateParamsBillingAddress" """ The cardholder's billing address. """ class CreateParamsBillingAddress(TypedDict): city: str """ City, district, suburb, town, or village. """ country: str """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: str """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: str """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsCompany(TypedDict): tax_id: NotRequired[str] """ The entity's business ID number. """ class CreateParamsIndividual(TypedDict): card_issuing: NotRequired[ "Cardholder.CreateParamsIndividualCardIssuing" ] """ Information related to the card_issuing program for this cardholder. """ dob: NotRequired["Cardholder.CreateParamsIndividualDob"] """ The date of birth of this cardholder. Cardholders must be older than 13 years old. """ first_name: NotRequired[str] """ The first name of this cardholder. Required before activating Cards. This field cannot contain any numbers, special characters (except periods, commas, hyphens, spaces and apostrophes) or non-latin letters. """ last_name: NotRequired[str] """ The last name of this cardholder. Required before activating Cards. This field cannot contain any numbers, special characters (except periods, commas, hyphens, spaces and apostrophes) or non-latin letters. """ verification: NotRequired[ "Cardholder.CreateParamsIndividualVerification" ] """ Government-issued ID document for this cardholder. """ class CreateParamsIndividualCardIssuing(TypedDict): user_terms_acceptance: NotRequired[ "Cardholder.CreateParamsIndividualCardIssuingUserTermsAcceptance" ] """ Information about cardholder acceptance of Celtic [Authorized User Terms](https://stripe.com/docs/issuing/cards#accept-authorized-user-terms). Required for cards backed by a Celtic program. """ class CreateParamsIndividualCardIssuingUserTermsAcceptance(TypedDict): date: NotRequired[int] """ The Unix timestamp marking when the cardholder accepted the Authorized User Terms. Required for Celtic Spend Card users. """ ip: NotRequired[str] """ The IP address from which the cardholder accepted the Authorized User Terms. Required for Celtic Spend Card users. """ user_agent: NotRequired["Literal['']|str"] """ The user agent of the browser from which the cardholder accepted the Authorized User Terms. """ class CreateParamsIndividualDob(TypedDict): day: int """ The day of birth, between 1 and 31. """ month: int """ The month of birth, between 1 and 12. """ year: int """ The four-digit year of birth. """ class CreateParamsIndividualVerification(TypedDict): document: NotRequired[ "Cardholder.CreateParamsIndividualVerificationDocument" ] """ An identifying document, either a passport or local ID card. """ class CreateParamsIndividualVerificationDocument(TypedDict): back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. """ front: NotRequired[str] """ The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. """ class CreateParamsSpendingControls(TypedDict): allowed_categories: NotRequired[ List[ Literal[ "ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards", ] ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. All other categories will be blocked. Cannot be set with `blocked_categories`. """ allowed_merchant_countries: NotRequired[List[str]] """ Array of strings containing representing countries from which authorizations will be allowed. Authorizations from merchants in all other countries will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `blocked_merchant_countries`. Provide an empty value to unset this control. """ blocked_categories: NotRequired[ List[ Literal[ "ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards", ] ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. All other categories will be allowed. Cannot be set with `allowed_categories`. """ blocked_merchant_countries: NotRequired[List[str]] """ Array of strings containing representing countries from which authorizations will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `allowed_merchant_countries`. Provide an empty value to unset this control. """ spending_limits: NotRequired[ List["Cardholder.CreateParamsSpendingControlsSpendingLimit"] ] """ Limit spending with amount-based rules that apply across this cardholder's cards. """ spending_limits_currency: NotRequired[str] """ Currency of amounts within `spending_limits`. Defaults to your merchant country's currency. """ class CreateParamsSpendingControlsSpendingLimit(TypedDict): amount: int """ Maximum amount allowed to spend per interval. """ categories: NotRequired[ List[ Literal[ "ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards", ] ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. Omitting this field will apply the limit to all categories. """ interval: Literal[ "all_time", "daily", "monthly", "per_authorization", "weekly", "yearly", ] """ Interval (or event) to which the amount applies. """ class ListParams(RequestOptions): created: NotRequired["Cardholder.ListParamsCreated|int"] """ Only return cardholders that were created during the given date interval. """ email: NotRequired[str] """ Only return cardholders that have the given email address. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ phone_number: NotRequired[str] """ Only return cardholders that have the given phone number. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[Literal["active", "blocked", "inactive"]] """ Only return cardholders that have the given status. One of `active`, `inactive`, or `blocked`. """ type: NotRequired[Literal["company", "individual"]] """ Only return cardholders that have the given type. One of `individual` or `company`. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): billing: NotRequired["Cardholder.ModifyParamsBilling"] """ The cardholder's billing address. """ company: NotRequired["Cardholder.ModifyParamsCompany"] """ Additional information about a `company` cardholder. """ email: NotRequired[str] """ The cardholder's email address. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ individual: NotRequired["Cardholder.ModifyParamsIndividual"] """ Additional information about an `individual` cardholder. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ phone_number: NotRequired[str] """ The cardholder's phone number. This is required for all cardholders who will be creating EU cards. See the [3D Secure documentation](https://stripe.com/docs/issuing/3d-secure) for more details. """ preferred_locales: NotRequired[ List[Literal["de", "en", "es", "fr", "it"]] ] """ The cardholder's preferred locales (languages), ordered by preference. Locales can be `de`, `en`, `es`, `fr`, or `it`. This changes the language of the [3D Secure flow](https://stripe.com/docs/issuing/3d-secure) and one-time password messages sent to the cardholder. """ spending_controls: NotRequired[ "Cardholder.ModifyParamsSpendingControls" ] """ Rules that control spending across this cardholder's cards. Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. """ status: NotRequired[Literal["active", "inactive"]] """ Specifies whether to permit authorizations on this cardholder's cards. """ class ModifyParamsBilling(TypedDict): address: "Cardholder.ModifyParamsBillingAddress" """ The cardholder's billing address. """ class ModifyParamsBillingAddress(TypedDict): city: str """ City, district, suburb, town, or village. """ country: str """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: str """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: str """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class ModifyParamsCompany(TypedDict): tax_id: NotRequired[str] """ The entity's business ID number. """ class ModifyParamsIndividual(TypedDict): card_issuing: NotRequired[ "Cardholder.ModifyParamsIndividualCardIssuing" ] """ Information related to the card_issuing program for this cardholder. """ dob: NotRequired["Cardholder.ModifyParamsIndividualDob"] """ The date of birth of this cardholder. Cardholders must be older than 13 years old. """ first_name: NotRequired[str] """ The first name of this cardholder. Required before activating Cards. This field cannot contain any numbers, special characters (except periods, commas, hyphens, spaces and apostrophes) or non-latin letters. """ last_name: NotRequired[str] """ The last name of this cardholder. Required before activating Cards. This field cannot contain any numbers, special characters (except periods, commas, hyphens, spaces and apostrophes) or non-latin letters. """ verification: NotRequired[ "Cardholder.ModifyParamsIndividualVerification" ] """ Government-issued ID document for this cardholder. """ class ModifyParamsIndividualCardIssuing(TypedDict): user_terms_acceptance: NotRequired[ "Cardholder.ModifyParamsIndividualCardIssuingUserTermsAcceptance" ] """ Information about cardholder acceptance of Celtic [Authorized User Terms](https://stripe.com/docs/issuing/cards#accept-authorized-user-terms). Required for cards backed by a Celtic program. """ class ModifyParamsIndividualCardIssuingUserTermsAcceptance(TypedDict): date: NotRequired[int] """ The Unix timestamp marking when the cardholder accepted the Authorized User Terms. Required for Celtic Spend Card users. """ ip: NotRequired[str] """ The IP address from which the cardholder accepted the Authorized User Terms. Required for Celtic Spend Card users. """ user_agent: NotRequired["Literal['']|str"] """ The user agent of the browser from which the cardholder accepted the Authorized User Terms. """ class ModifyParamsIndividualDob(TypedDict): day: int """ The day of birth, between 1 and 31. """ month: int """ The month of birth, between 1 and 12. """ year: int """ The four-digit year of birth. """ class ModifyParamsIndividualVerification(TypedDict): document: NotRequired[ "Cardholder.ModifyParamsIndividualVerificationDocument" ] """ An identifying document, either a passport or local ID card. """ class ModifyParamsIndividualVerificationDocument(TypedDict): back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. """ front: NotRequired[str] """ The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. """ class ModifyParamsSpendingControls(TypedDict): allowed_categories: NotRequired[ List[ Literal[ "ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards", ] ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. All other categories will be blocked. Cannot be set with `blocked_categories`. """ allowed_merchant_countries: NotRequired[List[str]] """ Array of strings containing representing countries from which authorizations will be allowed. Authorizations from merchants in all other countries will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `blocked_merchant_countries`. Provide an empty value to unset this control. """ blocked_categories: NotRequired[ List[ Literal[ "ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards", ] ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. All other categories will be allowed. Cannot be set with `allowed_categories`. """ blocked_merchant_countries: NotRequired[List[str]] """ Array of strings containing representing countries from which authorizations will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `allowed_merchant_countries`. Provide an empty value to unset this control. """ spending_limits: NotRequired[ List["Cardholder.ModifyParamsSpendingControlsSpendingLimit"] ] """ Limit spending with amount-based rules that apply across this cardholder's cards. """ spending_limits_currency: NotRequired[str] """ Currency of amounts within `spending_limits`. Defaults to your merchant country's currency. """ class ModifyParamsSpendingControlsSpendingLimit(TypedDict): amount: int """ Maximum amount allowed to spend per interval. """ categories: NotRequired[ List[ Literal[ "ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards", ] ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. Omitting this field will apply the limit to all categories. """ interval: Literal[ "all_time", "daily", "monthly", "per_authorization", "weekly", "yearly", ] """ Interval (or event) to which the amount applies. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ billing: Billing company: Optional[Company] """ Additional information about a `company` cardholder. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ email: Optional[str] """ The cardholder's email address. """ id: str """ Unique identifier for the object. """ individual: Optional[Individual] """ Additional information about an `individual` cardholder. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ metadata: Dict[str, str] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ name: str """ The cardholder's name. This will be printed on cards issued to them. """ object: Literal["issuing.cardholder"] """ String representing the object's type. Objects of the same type share the same value. """ phone_number: Optional[str] """ The cardholder's phone number. This is required for all cardholders who will be creating EU cards. See the [3D Secure documentation](https://stripe.com/docs/issuing/3d-secure#when-is-3d-secure-applied) for more details. """ preferred_locales: Optional[List[Literal["de", "en", "es", "fr", "it"]]] """ The cardholder's preferred locales (languages), ordered by preference. Locales can be `de`, `en`, `es`, `fr`, or `it`. This changes the language of the [3D Secure flow](https://stripe.com/docs/issuing/3d-secure) and one-time password messages sent to the cardholder. """ requirements: Requirements spending_controls: Optional[SpendingControls] """ Rules that control spending across this cardholder's cards. Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. """ status: Literal["active", "blocked", "inactive"] """ Specifies whether to permit authorizations on this cardholder's cards. """ type: Literal["company", "individual"] """ One of `individual` or `company`. See [Choose a cardholder type](https://stripe.com/docs/issuing/other/choose-cardholder) for more details. """ @classmethod def create( cls, **params: Unpack["Cardholder.CreateParams"] ) -> "Cardholder": """ Creates a new Issuing Cardholder object that can be issued cards. """ return cast( "Cardholder", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["Cardholder.CreateParams"] ) -> "Cardholder": """ Creates a new Issuing Cardholder object that can be issued cards. """ return cast( "Cardholder", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def list( cls, **params: Unpack["Cardholder.ListParams"] ) -> ListObject["Cardholder"]: """ Returns a list of Issuing Cardholder objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["Cardholder.ListParams"] ) -> ListObject["Cardholder"]: """ Returns a list of Issuing Cardholder objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def modify( cls, id: str, **params: Unpack["Cardholder.ModifyParams"] ) -> "Cardholder": """ Updates the specified Issuing Cardholder object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Cardholder", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["Cardholder.ModifyParams"] ) -> "Cardholder": """ Updates the specified Issuing Cardholder object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Cardholder", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["Cardholder.RetrieveParams"] ) -> "Cardholder": """ Retrieves an Issuing Cardholder object. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["Cardholder.RetrieveParams"] ) -> "Cardholder": """ Retrieves an Issuing Cardholder object. """ instance = cls(id, **params) await instance.refresh_async() return instance _inner_class_types = { "billing": Billing, "company": Company, "individual": Individual, "requirements": Requirements, "spending_controls": SpendingControls, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/issuing/_cardholder_service.py0000644000175100001770000034065714637354563022072 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.issuing._cardholder import Cardholder from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class CardholderService(StripeService): class CreateParams(TypedDict): billing: "CardholderService.CreateParamsBilling" """ The cardholder's billing address. """ company: NotRequired["CardholderService.CreateParamsCompany"] """ Additional information about a `company` cardholder. """ email: NotRequired[str] """ The cardholder's email address. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ individual: NotRequired["CardholderService.CreateParamsIndividual"] """ Additional information about an `individual` cardholder. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ name: str """ The cardholder's name. This will be printed on cards issued to them. The maximum length of this field is 24 characters. This field cannot contain any special characters or numbers. """ phone_number: NotRequired[str] """ The cardholder's phone number. This will be transformed to [E.164](https://en.wikipedia.org/wiki/E.164) if it is not provided in that format already. This is required for all cardholders who will be creating EU cards. See the [3D Secure documentation](https://stripe.com/docs/issuing/3d-secure#when-is-3d-secure-applied) for more details. """ preferred_locales: NotRequired[ List[Literal["de", "en", "es", "fr", "it"]] ] """ The cardholder's preferred locales (languages), ordered by preference. Locales can be `de`, `en`, `es`, `fr`, or `it`. This changes the language of the [3D Secure flow](https://stripe.com/docs/issuing/3d-secure) and one-time password messages sent to the cardholder. """ spending_controls: NotRequired[ "CardholderService.CreateParamsSpendingControls" ] """ Rules that control spending across this cardholder's cards. Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. """ status: NotRequired[Literal["active", "inactive"]] """ Specifies whether to permit authorizations on this cardholder's cards. Defaults to `active`. """ type: NotRequired[Literal["company", "individual"]] """ One of `individual` or `company`. See [Choose a cardholder type](https://stripe.com/docs/issuing/other/choose-cardholder) for more details. """ class CreateParamsBilling(TypedDict): address: "CardholderService.CreateParamsBillingAddress" """ The cardholder's billing address. """ class CreateParamsBillingAddress(TypedDict): city: str """ City, district, suburb, town, or village. """ country: str """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: str """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: str """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsCompany(TypedDict): tax_id: NotRequired[str] """ The entity's business ID number. """ class CreateParamsIndividual(TypedDict): card_issuing: NotRequired[ "CardholderService.CreateParamsIndividualCardIssuing" ] """ Information related to the card_issuing program for this cardholder. """ dob: NotRequired["CardholderService.CreateParamsIndividualDob"] """ The date of birth of this cardholder. Cardholders must be older than 13 years old. """ first_name: NotRequired[str] """ The first name of this cardholder. Required before activating Cards. This field cannot contain any numbers, special characters (except periods, commas, hyphens, spaces and apostrophes) or non-latin letters. """ last_name: NotRequired[str] """ The last name of this cardholder. Required before activating Cards. This field cannot contain any numbers, special characters (except periods, commas, hyphens, spaces and apostrophes) or non-latin letters. """ verification: NotRequired[ "CardholderService.CreateParamsIndividualVerification" ] """ Government-issued ID document for this cardholder. """ class CreateParamsIndividualCardIssuing(TypedDict): user_terms_acceptance: NotRequired[ "CardholderService.CreateParamsIndividualCardIssuingUserTermsAcceptance" ] """ Information about cardholder acceptance of Celtic [Authorized User Terms](https://stripe.com/docs/issuing/cards#accept-authorized-user-terms). Required for cards backed by a Celtic program. """ class CreateParamsIndividualCardIssuingUserTermsAcceptance(TypedDict): date: NotRequired[int] """ The Unix timestamp marking when the cardholder accepted the Authorized User Terms. Required for Celtic Spend Card users. """ ip: NotRequired[str] """ The IP address from which the cardholder accepted the Authorized User Terms. Required for Celtic Spend Card users. """ user_agent: NotRequired["Literal['']|str"] """ The user agent of the browser from which the cardholder accepted the Authorized User Terms. """ class CreateParamsIndividualDob(TypedDict): day: int """ The day of birth, between 1 and 31. """ month: int """ The month of birth, between 1 and 12. """ year: int """ The four-digit year of birth. """ class CreateParamsIndividualVerification(TypedDict): document: NotRequired[ "CardholderService.CreateParamsIndividualVerificationDocument" ] """ An identifying document, either a passport or local ID card. """ class CreateParamsIndividualVerificationDocument(TypedDict): back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. """ front: NotRequired[str] """ The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. """ class CreateParamsSpendingControls(TypedDict): allowed_categories: NotRequired[ List[ Literal[ "ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards", ] ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. All other categories will be blocked. Cannot be set with `blocked_categories`. """ allowed_merchant_countries: NotRequired[List[str]] """ Array of strings containing representing countries from which authorizations will be allowed. Authorizations from merchants in all other countries will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `blocked_merchant_countries`. Provide an empty value to unset this control. """ blocked_categories: NotRequired[ List[ Literal[ "ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards", ] ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. All other categories will be allowed. Cannot be set with `allowed_categories`. """ blocked_merchant_countries: NotRequired[List[str]] """ Array of strings containing representing countries from which authorizations will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `allowed_merchant_countries`. Provide an empty value to unset this control. """ spending_limits: NotRequired[ List["CardholderService.CreateParamsSpendingControlsSpendingLimit"] ] """ Limit spending with amount-based rules that apply across this cardholder's cards. """ spending_limits_currency: NotRequired[str] """ Currency of amounts within `spending_limits`. Defaults to your merchant country's currency. """ class CreateParamsSpendingControlsSpendingLimit(TypedDict): amount: int """ Maximum amount allowed to spend per interval. """ categories: NotRequired[ List[ Literal[ "ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards", ] ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. Omitting this field will apply the limit to all categories. """ interval: Literal[ "all_time", "daily", "monthly", "per_authorization", "weekly", "yearly", ] """ Interval (or event) to which the amount applies. """ class ListParams(TypedDict): created: NotRequired["CardholderService.ListParamsCreated|int"] """ Only return cardholders that were created during the given date interval. """ email: NotRequired[str] """ Only return cardholders that have the given email address. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ phone_number: NotRequired[str] """ Only return cardholders that have the given phone number. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[Literal["active", "blocked", "inactive"]] """ Only return cardholders that have the given status. One of `active`, `inactive`, or `blocked`. """ type: NotRequired[Literal["company", "individual"]] """ Only return cardholders that have the given type. One of `individual` or `company`. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): billing: NotRequired["CardholderService.UpdateParamsBilling"] """ The cardholder's billing address. """ company: NotRequired["CardholderService.UpdateParamsCompany"] """ Additional information about a `company` cardholder. """ email: NotRequired[str] """ The cardholder's email address. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ individual: NotRequired["CardholderService.UpdateParamsIndividual"] """ Additional information about an `individual` cardholder. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ phone_number: NotRequired[str] """ The cardholder's phone number. This is required for all cardholders who will be creating EU cards. See the [3D Secure documentation](https://stripe.com/docs/issuing/3d-secure) for more details. """ preferred_locales: NotRequired[ List[Literal["de", "en", "es", "fr", "it"]] ] """ The cardholder's preferred locales (languages), ordered by preference. Locales can be `de`, `en`, `es`, `fr`, or `it`. This changes the language of the [3D Secure flow](https://stripe.com/docs/issuing/3d-secure) and one-time password messages sent to the cardholder. """ spending_controls: NotRequired[ "CardholderService.UpdateParamsSpendingControls" ] """ Rules that control spending across this cardholder's cards. Refer to our [documentation](https://stripe.com/docs/issuing/controls/spending-controls) for more details. """ status: NotRequired[Literal["active", "inactive"]] """ Specifies whether to permit authorizations on this cardholder's cards. """ class UpdateParamsBilling(TypedDict): address: "CardholderService.UpdateParamsBillingAddress" """ The cardholder's billing address. """ class UpdateParamsBillingAddress(TypedDict): city: str """ City, district, suburb, town, or village. """ country: str """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: str """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: str """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class UpdateParamsCompany(TypedDict): tax_id: NotRequired[str] """ The entity's business ID number. """ class UpdateParamsIndividual(TypedDict): card_issuing: NotRequired[ "CardholderService.UpdateParamsIndividualCardIssuing" ] """ Information related to the card_issuing program for this cardholder. """ dob: NotRequired["CardholderService.UpdateParamsIndividualDob"] """ The date of birth of this cardholder. Cardholders must be older than 13 years old. """ first_name: NotRequired[str] """ The first name of this cardholder. Required before activating Cards. This field cannot contain any numbers, special characters (except periods, commas, hyphens, spaces and apostrophes) or non-latin letters. """ last_name: NotRequired[str] """ The last name of this cardholder. Required before activating Cards. This field cannot contain any numbers, special characters (except periods, commas, hyphens, spaces and apostrophes) or non-latin letters. """ verification: NotRequired[ "CardholderService.UpdateParamsIndividualVerification" ] """ Government-issued ID document for this cardholder. """ class UpdateParamsIndividualCardIssuing(TypedDict): user_terms_acceptance: NotRequired[ "CardholderService.UpdateParamsIndividualCardIssuingUserTermsAcceptance" ] """ Information about cardholder acceptance of Celtic [Authorized User Terms](https://stripe.com/docs/issuing/cards#accept-authorized-user-terms). Required for cards backed by a Celtic program. """ class UpdateParamsIndividualCardIssuingUserTermsAcceptance(TypedDict): date: NotRequired[int] """ The Unix timestamp marking when the cardholder accepted the Authorized User Terms. Required for Celtic Spend Card users. """ ip: NotRequired[str] """ The IP address from which the cardholder accepted the Authorized User Terms. Required for Celtic Spend Card users. """ user_agent: NotRequired["Literal['']|str"] """ The user agent of the browser from which the cardholder accepted the Authorized User Terms. """ class UpdateParamsIndividualDob(TypedDict): day: int """ The day of birth, between 1 and 31. """ month: int """ The month of birth, between 1 and 12. """ year: int """ The four-digit year of birth. """ class UpdateParamsIndividualVerification(TypedDict): document: NotRequired[ "CardholderService.UpdateParamsIndividualVerificationDocument" ] """ An identifying document, either a passport or local ID card. """ class UpdateParamsIndividualVerificationDocument(TypedDict): back: NotRequired[str] """ The back of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. """ front: NotRequired[str] """ The front of an ID returned by a [file upload](https://stripe.com/docs/api#create_file) with a `purpose` value of `identity_document`. """ class UpdateParamsSpendingControls(TypedDict): allowed_categories: NotRequired[ List[ Literal[ "ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards", ] ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to allow. All other categories will be blocked. Cannot be set with `blocked_categories`. """ allowed_merchant_countries: NotRequired[List[str]] """ Array of strings containing representing countries from which authorizations will be allowed. Authorizations from merchants in all other countries will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `blocked_merchant_countries`. Provide an empty value to unset this control. """ blocked_categories: NotRequired[ List[ Literal[ "ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards", ] ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) of authorizations to decline. All other categories will be allowed. Cannot be set with `allowed_categories`. """ blocked_merchant_countries: NotRequired[List[str]] """ Array of strings containing representing countries from which authorizations will be declined. Country codes should be ISO 3166 alpha-2 country codes (e.g. `US`). Cannot be set with `allowed_merchant_countries`. Provide an empty value to unset this control. """ spending_limits: NotRequired[ List["CardholderService.UpdateParamsSpendingControlsSpendingLimit"] ] """ Limit spending with amount-based rules that apply across this cardholder's cards. """ spending_limits_currency: NotRequired[str] """ Currency of amounts within `spending_limits`. Defaults to your merchant country's currency. """ class UpdateParamsSpendingControlsSpendingLimit(TypedDict): amount: int """ Maximum amount allowed to spend per interval. """ categories: NotRequired[ List[ Literal[ "ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards", ] ] ] """ Array of strings containing [categories](https://stripe.com/docs/api#issuing_authorization_object-merchant_data-category) this limit applies to. Omitting this field will apply the limit to all categories. """ interval: Literal[ "all_time", "daily", "monthly", "per_authorization", "weekly", "yearly", ] """ Interval (or event) to which the amount applies. """ def list( self, params: "CardholderService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Cardholder]: """ Returns a list of Issuing Cardholder objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. """ return cast( ListObject[Cardholder], self._request( "get", "/v1/issuing/cardholders", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "CardholderService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Cardholder]: """ Returns a list of Issuing Cardholder objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. """ return cast( ListObject[Cardholder], await self._request_async( "get", "/v1/issuing/cardholders", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "CardholderService.CreateParams", options: RequestOptions = {}, ) -> Cardholder: """ Creates a new Issuing Cardholder object that can be issued cards. """ return cast( Cardholder, self._request( "post", "/v1/issuing/cardholders", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "CardholderService.CreateParams", options: RequestOptions = {}, ) -> Cardholder: """ Creates a new Issuing Cardholder object that can be issued cards. """ return cast( Cardholder, await self._request_async( "post", "/v1/issuing/cardholders", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, cardholder: str, params: "CardholderService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Cardholder: """ Retrieves an Issuing Cardholder object. """ return cast( Cardholder, self._request( "get", "/v1/issuing/cardholders/{cardholder}".format( cardholder=sanitize_id(cardholder), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, cardholder: str, params: "CardholderService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Cardholder: """ Retrieves an Issuing Cardholder object. """ return cast( Cardholder, await self._request_async( "get", "/v1/issuing/cardholders/{cardholder}".format( cardholder=sanitize_id(cardholder), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, cardholder: str, params: "CardholderService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Cardholder: """ Updates the specified Issuing Cardholder object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. """ return cast( Cardholder, self._request( "post", "/v1/issuing/cardholders/{cardholder}".format( cardholder=sanitize_id(cardholder), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, cardholder: str, params: "CardholderService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Cardholder: """ Updates the specified Issuing Cardholder object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. """ return cast( Cardholder, await self._request_async( "post", "/v1/issuing/cardholders/{cardholder}".format( cardholder=sanitize_id(cardholder), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/issuing/_dispute.py0000644000175100001770000013302314637354563017703 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._balance_transaction import BalanceTransaction from stripe._file import File from stripe.issuing._transaction import Transaction class Dispute( CreateableAPIResource["Dispute"], ListableAPIResource["Dispute"], UpdateableAPIResource["Dispute"], ): """ As a [card issuer](https://stripe.com/docs/issuing), you can dispute transactions that the cardholder does not recognize, suspects to be fraudulent, or has other issues with. Related guide: [Issuing disputes](https://stripe.com/docs/issuing/purchases/disputes) """ OBJECT_NAME: ClassVar[Literal["issuing.dispute"]] = "issuing.dispute" class Evidence(StripeObject): class Canceled(StripeObject): additional_documentation: Optional[ExpandableField["File"]] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. """ canceled_at: Optional[int] """ Date when order was canceled. """ cancellation_policy_provided: Optional[bool] """ Whether the cardholder was provided with a cancellation policy. """ cancellation_reason: Optional[str] """ Reason for canceling the order. """ expected_at: Optional[int] """ Date when the cardholder expected to receive the product. """ explanation: Optional[str] """ Explanation of why the cardholder is disputing this transaction. """ product_description: Optional[str] """ Description of the merchandise or service that was purchased. """ product_type: Optional[Literal["merchandise", "service"]] """ Whether the product was a merchandise or service. """ return_status: Optional[Literal["merchant_rejected", "successful"]] """ Result of cardholder's attempt to return the product. """ returned_at: Optional[int] """ Date when the product was returned or attempted to be returned. """ class Duplicate(StripeObject): additional_documentation: Optional[ExpandableField["File"]] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. """ card_statement: Optional[ExpandableField["File"]] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the card statement showing that the product had already been paid for. """ cash_receipt: Optional[ExpandableField["File"]] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the receipt showing that the product had been paid for in cash. """ check_image: Optional[ExpandableField["File"]] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Image of the front and back of the check that was used to pay for the product. """ explanation: Optional[str] """ Explanation of why the cardholder is disputing this transaction. """ original_transaction: Optional[str] """ Transaction (e.g., ipi_...) that the disputed transaction is a duplicate of. Of the two or more transactions that are copies of each other, this is original undisputed one. """ class Fraudulent(StripeObject): additional_documentation: Optional[ExpandableField["File"]] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. """ explanation: Optional[str] """ Explanation of why the cardholder is disputing this transaction. """ class MerchandiseNotAsDescribed(StripeObject): additional_documentation: Optional[ExpandableField["File"]] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. """ explanation: Optional[str] """ Explanation of why the cardholder is disputing this transaction. """ received_at: Optional[int] """ Date when the product was received. """ return_description: Optional[str] """ Description of the cardholder's attempt to return the product. """ return_status: Optional[Literal["merchant_rejected", "successful"]] """ Result of cardholder's attempt to return the product. """ returned_at: Optional[int] """ Date when the product was returned or attempted to be returned. """ class NoValidAuthorization(StripeObject): additional_documentation: Optional[ExpandableField["File"]] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. """ explanation: Optional[str] """ Explanation of why the cardholder is disputing this transaction. """ class NotReceived(StripeObject): additional_documentation: Optional[ExpandableField["File"]] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. """ expected_at: Optional[int] """ Date when the cardholder expected to receive the product. """ explanation: Optional[str] """ Explanation of why the cardholder is disputing this transaction. """ product_description: Optional[str] """ Description of the merchandise or service that was purchased. """ product_type: Optional[Literal["merchandise", "service"]] """ Whether the product was a merchandise or service. """ class Other(StripeObject): additional_documentation: Optional[ExpandableField["File"]] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. """ explanation: Optional[str] """ Explanation of why the cardholder is disputing this transaction. """ product_description: Optional[str] """ Description of the merchandise or service that was purchased. """ product_type: Optional[Literal["merchandise", "service"]] """ Whether the product was a merchandise or service. """ class ServiceNotAsDescribed(StripeObject): additional_documentation: Optional[ExpandableField["File"]] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. """ canceled_at: Optional[int] """ Date when order was canceled. """ cancellation_reason: Optional[str] """ Reason for canceling the order. """ explanation: Optional[str] """ Explanation of why the cardholder is disputing this transaction. """ received_at: Optional[int] """ Date when the product was received. """ canceled: Optional[Canceled] duplicate: Optional[Duplicate] fraudulent: Optional[Fraudulent] merchandise_not_as_described: Optional[MerchandiseNotAsDescribed] no_valid_authorization: Optional[NoValidAuthorization] not_received: Optional[NotReceived] other: Optional[Other] reason: Literal[ "canceled", "duplicate", "fraudulent", "merchandise_not_as_described", "no_valid_authorization", "not_received", "other", "service_not_as_described", ] """ The reason for filing the dispute. Its value will match the field containing the evidence. """ service_not_as_described: Optional[ServiceNotAsDescribed] _inner_class_types = { "canceled": Canceled, "duplicate": Duplicate, "fraudulent": Fraudulent, "merchandise_not_as_described": MerchandiseNotAsDescribed, "no_valid_authorization": NoValidAuthorization, "not_received": NotReceived, "other": Other, "service_not_as_described": ServiceNotAsDescribed, } class Treasury(StripeObject): debit_reversal: Optional[str] """ The Treasury [DebitReversal](https://stripe.com/docs/api/treasury/debit_reversals) representing this Issuing dispute """ received_debit: str """ The Treasury [ReceivedDebit](https://stripe.com/docs/api/treasury/received_debits) that is being disputed. """ class CreateParams(RequestOptions): amount: NotRequired[int] """ The dispute amount in the card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). If not set, defaults to the full transaction amount. """ evidence: NotRequired["Dispute.CreateParamsEvidence"] """ Evidence provided for the dispute. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ transaction: NotRequired[str] """ The ID of the issuing transaction to create a dispute for. For transaction on Treasury FinancialAccounts, use `treasury.received_debit`. """ treasury: NotRequired["Dispute.CreateParamsTreasury"] """ Params for disputes related to Treasury FinancialAccounts """ class CreateParamsEvidence(TypedDict): canceled: NotRequired[ "Literal['']|Dispute.CreateParamsEvidenceCanceled" ] """ Evidence provided when `reason` is 'canceled'. """ duplicate: NotRequired[ "Literal['']|Dispute.CreateParamsEvidenceDuplicate" ] """ Evidence provided when `reason` is 'duplicate'. """ fraudulent: NotRequired[ "Literal['']|Dispute.CreateParamsEvidenceFraudulent" ] """ Evidence provided when `reason` is 'fraudulent'. """ merchandise_not_as_described: NotRequired[ "Literal['']|Dispute.CreateParamsEvidenceMerchandiseNotAsDescribed" ] """ Evidence provided when `reason` is 'merchandise_not_as_described'. """ no_valid_authorization: NotRequired[ "Literal['']|Dispute.CreateParamsEvidenceNoValidAuthorization" ] """ Evidence provided when `reason` is 'no_valid_authorization'. """ not_received: NotRequired[ "Literal['']|Dispute.CreateParamsEvidenceNotReceived" ] """ Evidence provided when `reason` is 'not_received'. """ other: NotRequired["Literal['']|Dispute.CreateParamsEvidenceOther"] """ Evidence provided when `reason` is 'other'. """ reason: NotRequired[ Literal[ "canceled", "duplicate", "fraudulent", "merchandise_not_as_described", "no_valid_authorization", "not_received", "other", "service_not_as_described", ] ] """ The reason for filing the dispute. The evidence should be submitted in the field of the same name. """ service_not_as_described: NotRequired[ "Literal['']|Dispute.CreateParamsEvidenceServiceNotAsDescribed" ] """ Evidence provided when `reason` is 'service_not_as_described'. """ class CreateParamsEvidenceCanceled(TypedDict): additional_documentation: NotRequired["Literal['']|str"] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. """ canceled_at: NotRequired["Literal['']|int"] """ Date when order was canceled. """ cancellation_policy_provided: NotRequired["Literal['']|bool"] """ Whether the cardholder was provided with a cancellation policy. """ cancellation_reason: NotRequired["Literal['']|str"] """ Reason for canceling the order. """ expected_at: NotRequired["Literal['']|int"] """ Date when the cardholder expected to receive the product. """ explanation: NotRequired["Literal['']|str"] """ Explanation of why the cardholder is disputing this transaction. """ product_description: NotRequired["Literal['']|str"] """ Description of the merchandise or service that was purchased. """ product_type: NotRequired[ "Literal['']|Literal['merchandise', 'service']" ] """ Whether the product was a merchandise or service. """ return_status: NotRequired[ "Literal['']|Literal['merchant_rejected', 'successful']" ] """ Result of cardholder's attempt to return the product. """ returned_at: NotRequired["Literal['']|int"] """ Date when the product was returned or attempted to be returned. """ class CreateParamsEvidenceDuplicate(TypedDict): additional_documentation: NotRequired["Literal['']|str"] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. """ card_statement: NotRequired["Literal['']|str"] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the card statement showing that the product had already been paid for. """ cash_receipt: NotRequired["Literal['']|str"] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the receipt showing that the product had been paid for in cash. """ check_image: NotRequired["Literal['']|str"] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Image of the front and back of the check that was used to pay for the product. """ explanation: NotRequired["Literal['']|str"] """ Explanation of why the cardholder is disputing this transaction. """ original_transaction: NotRequired[str] """ Transaction (e.g., ipi_...) that the disputed transaction is a duplicate of. Of the two or more transactions that are copies of each other, this is original undisputed one. """ class CreateParamsEvidenceFraudulent(TypedDict): additional_documentation: NotRequired["Literal['']|str"] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. """ explanation: NotRequired["Literal['']|str"] """ Explanation of why the cardholder is disputing this transaction. """ class CreateParamsEvidenceMerchandiseNotAsDescribed(TypedDict): additional_documentation: NotRequired["Literal['']|str"] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. """ explanation: NotRequired["Literal['']|str"] """ Explanation of why the cardholder is disputing this transaction. """ received_at: NotRequired["Literal['']|int"] """ Date when the product was received. """ return_description: NotRequired["Literal['']|str"] """ Description of the cardholder's attempt to return the product. """ return_status: NotRequired[ "Literal['']|Literal['merchant_rejected', 'successful']" ] """ Result of cardholder's attempt to return the product. """ returned_at: NotRequired["Literal['']|int"] """ Date when the product was returned or attempted to be returned. """ class CreateParamsEvidenceNoValidAuthorization(TypedDict): additional_documentation: NotRequired["Literal['']|str"] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. """ explanation: NotRequired["Literal['']|str"] """ Explanation of why the cardholder is disputing this transaction. """ class CreateParamsEvidenceNotReceived(TypedDict): additional_documentation: NotRequired["Literal['']|str"] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. """ expected_at: NotRequired["Literal['']|int"] """ Date when the cardholder expected to receive the product. """ explanation: NotRequired["Literal['']|str"] """ Explanation of why the cardholder is disputing this transaction. """ product_description: NotRequired["Literal['']|str"] """ Description of the merchandise or service that was purchased. """ product_type: NotRequired[ "Literal['']|Literal['merchandise', 'service']" ] """ Whether the product was a merchandise or service. """ class CreateParamsEvidenceOther(TypedDict): additional_documentation: NotRequired["Literal['']|str"] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. """ explanation: NotRequired["Literal['']|str"] """ Explanation of why the cardholder is disputing this transaction. """ product_description: NotRequired["Literal['']|str"] """ Description of the merchandise or service that was purchased. """ product_type: NotRequired[ "Literal['']|Literal['merchandise', 'service']" ] """ Whether the product was a merchandise or service. """ class CreateParamsEvidenceServiceNotAsDescribed(TypedDict): additional_documentation: NotRequired["Literal['']|str"] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. """ canceled_at: NotRequired["Literal['']|int"] """ Date when order was canceled. """ cancellation_reason: NotRequired["Literal['']|str"] """ Reason for canceling the order. """ explanation: NotRequired["Literal['']|str"] """ Explanation of why the cardholder is disputing this transaction. """ received_at: NotRequired["Literal['']|int"] """ Date when the product was received. """ class CreateParamsTreasury(TypedDict): received_debit: str """ The ID of the ReceivedDebit to initiate an Issuings dispute for. """ class ListParams(RequestOptions): created: NotRequired["Dispute.ListParamsCreated|int"] """ Only return Issuing disputes that were created during the given date interval. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ Literal["expired", "lost", "submitted", "unsubmitted", "won"] ] """ Select Issuing disputes with the given status. """ transaction: NotRequired[str] """ Select the Issuing dispute for the given transaction. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): amount: NotRequired[int] """ The dispute amount in the card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ evidence: NotRequired["Dispute.ModifyParamsEvidence"] """ Evidence provided for the dispute. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ class ModifyParamsEvidence(TypedDict): canceled: NotRequired[ "Literal['']|Dispute.ModifyParamsEvidenceCanceled" ] """ Evidence provided when `reason` is 'canceled'. """ duplicate: NotRequired[ "Literal['']|Dispute.ModifyParamsEvidenceDuplicate" ] """ Evidence provided when `reason` is 'duplicate'. """ fraudulent: NotRequired[ "Literal['']|Dispute.ModifyParamsEvidenceFraudulent" ] """ Evidence provided when `reason` is 'fraudulent'. """ merchandise_not_as_described: NotRequired[ "Literal['']|Dispute.ModifyParamsEvidenceMerchandiseNotAsDescribed" ] """ Evidence provided when `reason` is 'merchandise_not_as_described'. """ no_valid_authorization: NotRequired[ "Literal['']|Dispute.ModifyParamsEvidenceNoValidAuthorization" ] """ Evidence provided when `reason` is 'no_valid_authorization'. """ not_received: NotRequired[ "Literal['']|Dispute.ModifyParamsEvidenceNotReceived" ] """ Evidence provided when `reason` is 'not_received'. """ other: NotRequired["Literal['']|Dispute.ModifyParamsEvidenceOther"] """ Evidence provided when `reason` is 'other'. """ reason: NotRequired[ Literal[ "canceled", "duplicate", "fraudulent", "merchandise_not_as_described", "no_valid_authorization", "not_received", "other", "service_not_as_described", ] ] """ The reason for filing the dispute. The evidence should be submitted in the field of the same name. """ service_not_as_described: NotRequired[ "Literal['']|Dispute.ModifyParamsEvidenceServiceNotAsDescribed" ] """ Evidence provided when `reason` is 'service_not_as_described'. """ class ModifyParamsEvidenceCanceled(TypedDict): additional_documentation: NotRequired["Literal['']|str"] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. """ canceled_at: NotRequired["Literal['']|int"] """ Date when order was canceled. """ cancellation_policy_provided: NotRequired["Literal['']|bool"] """ Whether the cardholder was provided with a cancellation policy. """ cancellation_reason: NotRequired["Literal['']|str"] """ Reason for canceling the order. """ expected_at: NotRequired["Literal['']|int"] """ Date when the cardholder expected to receive the product. """ explanation: NotRequired["Literal['']|str"] """ Explanation of why the cardholder is disputing this transaction. """ product_description: NotRequired["Literal['']|str"] """ Description of the merchandise or service that was purchased. """ product_type: NotRequired[ "Literal['']|Literal['merchandise', 'service']" ] """ Whether the product was a merchandise or service. """ return_status: NotRequired[ "Literal['']|Literal['merchant_rejected', 'successful']" ] """ Result of cardholder's attempt to return the product. """ returned_at: NotRequired["Literal['']|int"] """ Date when the product was returned or attempted to be returned. """ class ModifyParamsEvidenceDuplicate(TypedDict): additional_documentation: NotRequired["Literal['']|str"] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. """ card_statement: NotRequired["Literal['']|str"] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the card statement showing that the product had already been paid for. """ cash_receipt: NotRequired["Literal['']|str"] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the receipt showing that the product had been paid for in cash. """ check_image: NotRequired["Literal['']|str"] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Image of the front and back of the check that was used to pay for the product. """ explanation: NotRequired["Literal['']|str"] """ Explanation of why the cardholder is disputing this transaction. """ original_transaction: NotRequired[str] """ Transaction (e.g., ipi_...) that the disputed transaction is a duplicate of. Of the two or more transactions that are copies of each other, this is original undisputed one. """ class ModifyParamsEvidenceFraudulent(TypedDict): additional_documentation: NotRequired["Literal['']|str"] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. """ explanation: NotRequired["Literal['']|str"] """ Explanation of why the cardholder is disputing this transaction. """ class ModifyParamsEvidenceMerchandiseNotAsDescribed(TypedDict): additional_documentation: NotRequired["Literal['']|str"] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. """ explanation: NotRequired["Literal['']|str"] """ Explanation of why the cardholder is disputing this transaction. """ received_at: NotRequired["Literal['']|int"] """ Date when the product was received. """ return_description: NotRequired["Literal['']|str"] """ Description of the cardholder's attempt to return the product. """ return_status: NotRequired[ "Literal['']|Literal['merchant_rejected', 'successful']" ] """ Result of cardholder's attempt to return the product. """ returned_at: NotRequired["Literal['']|int"] """ Date when the product was returned or attempted to be returned. """ class ModifyParamsEvidenceNoValidAuthorization(TypedDict): additional_documentation: NotRequired["Literal['']|str"] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. """ explanation: NotRequired["Literal['']|str"] """ Explanation of why the cardholder is disputing this transaction. """ class ModifyParamsEvidenceNotReceived(TypedDict): additional_documentation: NotRequired["Literal['']|str"] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. """ expected_at: NotRequired["Literal['']|int"] """ Date when the cardholder expected to receive the product. """ explanation: NotRequired["Literal['']|str"] """ Explanation of why the cardholder is disputing this transaction. """ product_description: NotRequired["Literal['']|str"] """ Description of the merchandise or service that was purchased. """ product_type: NotRequired[ "Literal['']|Literal['merchandise', 'service']" ] """ Whether the product was a merchandise or service. """ class ModifyParamsEvidenceOther(TypedDict): additional_documentation: NotRequired["Literal['']|str"] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. """ explanation: NotRequired["Literal['']|str"] """ Explanation of why the cardholder is disputing this transaction. """ product_description: NotRequired["Literal['']|str"] """ Description of the merchandise or service that was purchased. """ product_type: NotRequired[ "Literal['']|Literal['merchandise', 'service']" ] """ Whether the product was a merchandise or service. """ class ModifyParamsEvidenceServiceNotAsDescribed(TypedDict): additional_documentation: NotRequired["Literal['']|str"] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. """ canceled_at: NotRequired["Literal['']|int"] """ Date when order was canceled. """ cancellation_reason: NotRequired["Literal['']|str"] """ Reason for canceling the order. """ explanation: NotRequired["Literal['']|str"] """ Explanation of why the cardholder is disputing this transaction. """ received_at: NotRequired["Literal['']|int"] """ Date when the product was received. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class SubmitParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ amount: int """ Disputed amount in the card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). Usually the amount of the `transaction`, but can differ (usually because of currency fluctuation). """ balance_transactions: Optional[List["BalanceTransaction"]] """ List of balance transactions associated with the dispute. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ currency: str """ The currency the `transaction` was made in. """ evidence: Evidence id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ loss_reason: Optional[ Literal[ "cardholder_authentication_issuer_liability", "eci5_token_transaction_with_tavv", "excess_disputes_in_timeframe", "has_not_met_the_minimum_dispute_amount_requirements", "invalid_duplicate_dispute", "invalid_incorrect_amount_dispute", "invalid_no_authorization", "invalid_use_of_disputes", "merchandise_delivered_or_shipped", "merchandise_or_service_as_described", "not_cancelled", "other", "refund_issued", "submitted_beyond_allowable_time_limit", "transaction_3ds_required", "transaction_approved_after_prior_fraud_dispute", "transaction_authorized", "transaction_electronically_read", "transaction_qualifies_for_visa_easy_payment_service", "transaction_unattended", ] ] """ The enum that describes the dispute loss outcome. If the dispute is not lost, this field will be absent. New enum values may be added in the future, so be sure to handle unknown values. """ metadata: Dict[str, str] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ object: Literal["issuing.dispute"] """ String representing the object's type. Objects of the same type share the same value. """ status: Literal["expired", "lost", "submitted", "unsubmitted", "won"] """ Current status of the dispute. """ transaction: ExpandableField["Transaction"] """ The transaction being disputed. """ treasury: Optional[Treasury] """ [Treasury](https://stripe.com/docs/api/treasury) details related to this dispute if it was created on a [FinancialAccount](/docs/api/treasury/financial_accounts """ @classmethod def create(cls, **params: Unpack["Dispute.CreateParams"]) -> "Dispute": """ Creates an Issuing Dispute object. Individual pieces of evidence within the evidence object are optional at this point. Stripe only validates that required evidence is present during submission. Refer to [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence) for more details about evidence requirements. """ return cast( "Dispute", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["Dispute.CreateParams"] ) -> "Dispute": """ Creates an Issuing Dispute object. Individual pieces of evidence within the evidence object are optional at this point. Stripe only validates that required evidence is present during submission. Refer to [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence) for more details about evidence requirements. """ return cast( "Dispute", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def list( cls, **params: Unpack["Dispute.ListParams"] ) -> ListObject["Dispute"]: """ Returns a list of Issuing Dispute objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["Dispute.ListParams"] ) -> ListObject["Dispute"]: """ Returns a list of Issuing Dispute objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def modify( cls, id: str, **params: Unpack["Dispute.ModifyParams"] ) -> "Dispute": """ Updates the specified Issuing Dispute object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Properties on the evidence object can be unset by passing in an empty string. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Dispute", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["Dispute.ModifyParams"] ) -> "Dispute": """ Updates the specified Issuing Dispute object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Properties on the evidence object can be unset by passing in an empty string. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Dispute", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["Dispute.RetrieveParams"] ) -> "Dispute": """ Retrieves an Issuing Dispute object. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["Dispute.RetrieveParams"] ) -> "Dispute": """ Retrieves an Issuing Dispute object. """ instance = cls(id, **params) await instance.refresh_async() return instance @classmethod def _cls_submit( cls, dispute: str, **params: Unpack["Dispute.SubmitParams"] ) -> "Dispute": """ Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence). """ return cast( "Dispute", cls._static_request( "post", "/v1/issuing/disputes/{dispute}/submit".format( dispute=sanitize_id(dispute) ), params=params, ), ) @overload @staticmethod def submit( dispute: str, **params: Unpack["Dispute.SubmitParams"] ) -> "Dispute": """ Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence). """ ... @overload def submit(self, **params: Unpack["Dispute.SubmitParams"]) -> "Dispute": """ Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence). """ ... @class_method_variant("_cls_submit") def submit( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Dispute.SubmitParams"] ) -> "Dispute": """ Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence). """ return cast( "Dispute", self._request( "post", "/v1/issuing/disputes/{dispute}/submit".format( dispute=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_submit_async( cls, dispute: str, **params: Unpack["Dispute.SubmitParams"] ) -> "Dispute": """ Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence). """ return cast( "Dispute", await cls._static_request_async( "post", "/v1/issuing/disputes/{dispute}/submit".format( dispute=sanitize_id(dispute) ), params=params, ), ) @overload @staticmethod async def submit_async( dispute: str, **params: Unpack["Dispute.SubmitParams"] ) -> "Dispute": """ Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence). """ ... @overload async def submit_async( self, **params: Unpack["Dispute.SubmitParams"] ) -> "Dispute": """ Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence). """ ... @class_method_variant("_cls_submit_async") async def submit_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Dispute.SubmitParams"] ) -> "Dispute": """ Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence). """ return cast( "Dispute", await self._request_async( "post", "/v1/issuing/disputes/{dispute}/submit".format( dispute=sanitize_id(self.get("id")) ), params=params, ), ) _inner_class_types = {"evidence": Evidence, "treasury": Treasury} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/issuing/_dispute_service.py0000644000175100001770000007670114637354563021434 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.issuing._dispute import Dispute from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class DisputeService(StripeService): class CreateParams(TypedDict): amount: NotRequired[int] """ The dispute amount in the card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). If not set, defaults to the full transaction amount. """ evidence: NotRequired["DisputeService.CreateParamsEvidence"] """ Evidence provided for the dispute. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ transaction: NotRequired[str] """ The ID of the issuing transaction to create a dispute for. For transaction on Treasury FinancialAccounts, use `treasury.received_debit`. """ treasury: NotRequired["DisputeService.CreateParamsTreasury"] """ Params for disputes related to Treasury FinancialAccounts """ class CreateParamsEvidence(TypedDict): canceled: NotRequired[ "Literal['']|DisputeService.CreateParamsEvidenceCanceled" ] """ Evidence provided when `reason` is 'canceled'. """ duplicate: NotRequired[ "Literal['']|DisputeService.CreateParamsEvidenceDuplicate" ] """ Evidence provided when `reason` is 'duplicate'. """ fraudulent: NotRequired[ "Literal['']|DisputeService.CreateParamsEvidenceFraudulent" ] """ Evidence provided when `reason` is 'fraudulent'. """ merchandise_not_as_described: NotRequired[ "Literal['']|DisputeService.CreateParamsEvidenceMerchandiseNotAsDescribed" ] """ Evidence provided when `reason` is 'merchandise_not_as_described'. """ no_valid_authorization: NotRequired[ "Literal['']|DisputeService.CreateParamsEvidenceNoValidAuthorization" ] """ Evidence provided when `reason` is 'no_valid_authorization'. """ not_received: NotRequired[ "Literal['']|DisputeService.CreateParamsEvidenceNotReceived" ] """ Evidence provided when `reason` is 'not_received'. """ other: NotRequired[ "Literal['']|DisputeService.CreateParamsEvidenceOther" ] """ Evidence provided when `reason` is 'other'. """ reason: NotRequired[ Literal[ "canceled", "duplicate", "fraudulent", "merchandise_not_as_described", "no_valid_authorization", "not_received", "other", "service_not_as_described", ] ] """ The reason for filing the dispute. The evidence should be submitted in the field of the same name. """ service_not_as_described: NotRequired[ "Literal['']|DisputeService.CreateParamsEvidenceServiceNotAsDescribed" ] """ Evidence provided when `reason` is 'service_not_as_described'. """ class CreateParamsEvidenceCanceled(TypedDict): additional_documentation: NotRequired["Literal['']|str"] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. """ canceled_at: NotRequired["Literal['']|int"] """ Date when order was canceled. """ cancellation_policy_provided: NotRequired["Literal['']|bool"] """ Whether the cardholder was provided with a cancellation policy. """ cancellation_reason: NotRequired["Literal['']|str"] """ Reason for canceling the order. """ expected_at: NotRequired["Literal['']|int"] """ Date when the cardholder expected to receive the product. """ explanation: NotRequired["Literal['']|str"] """ Explanation of why the cardholder is disputing this transaction. """ product_description: NotRequired["Literal['']|str"] """ Description of the merchandise or service that was purchased. """ product_type: NotRequired[ "Literal['']|Literal['merchandise', 'service']" ] """ Whether the product was a merchandise or service. """ return_status: NotRequired[ "Literal['']|Literal['merchant_rejected', 'successful']" ] """ Result of cardholder's attempt to return the product. """ returned_at: NotRequired["Literal['']|int"] """ Date when the product was returned or attempted to be returned. """ class CreateParamsEvidenceDuplicate(TypedDict): additional_documentation: NotRequired["Literal['']|str"] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. """ card_statement: NotRequired["Literal['']|str"] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the card statement showing that the product had already been paid for. """ cash_receipt: NotRequired["Literal['']|str"] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the receipt showing that the product had been paid for in cash. """ check_image: NotRequired["Literal['']|str"] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Image of the front and back of the check that was used to pay for the product. """ explanation: NotRequired["Literal['']|str"] """ Explanation of why the cardholder is disputing this transaction. """ original_transaction: NotRequired[str] """ Transaction (e.g., ipi_...) that the disputed transaction is a duplicate of. Of the two or more transactions that are copies of each other, this is original undisputed one. """ class CreateParamsEvidenceFraudulent(TypedDict): additional_documentation: NotRequired["Literal['']|str"] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. """ explanation: NotRequired["Literal['']|str"] """ Explanation of why the cardholder is disputing this transaction. """ class CreateParamsEvidenceMerchandiseNotAsDescribed(TypedDict): additional_documentation: NotRequired["Literal['']|str"] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. """ explanation: NotRequired["Literal['']|str"] """ Explanation of why the cardholder is disputing this transaction. """ received_at: NotRequired["Literal['']|int"] """ Date when the product was received. """ return_description: NotRequired["Literal['']|str"] """ Description of the cardholder's attempt to return the product. """ return_status: NotRequired[ "Literal['']|Literal['merchant_rejected', 'successful']" ] """ Result of cardholder's attempt to return the product. """ returned_at: NotRequired["Literal['']|int"] """ Date when the product was returned or attempted to be returned. """ class CreateParamsEvidenceNoValidAuthorization(TypedDict): additional_documentation: NotRequired["Literal['']|str"] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. """ explanation: NotRequired["Literal['']|str"] """ Explanation of why the cardholder is disputing this transaction. """ class CreateParamsEvidenceNotReceived(TypedDict): additional_documentation: NotRequired["Literal['']|str"] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. """ expected_at: NotRequired["Literal['']|int"] """ Date when the cardholder expected to receive the product. """ explanation: NotRequired["Literal['']|str"] """ Explanation of why the cardholder is disputing this transaction. """ product_description: NotRequired["Literal['']|str"] """ Description of the merchandise or service that was purchased. """ product_type: NotRequired[ "Literal['']|Literal['merchandise', 'service']" ] """ Whether the product was a merchandise or service. """ class CreateParamsEvidenceOther(TypedDict): additional_documentation: NotRequired["Literal['']|str"] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. """ explanation: NotRequired["Literal['']|str"] """ Explanation of why the cardholder is disputing this transaction. """ product_description: NotRequired["Literal['']|str"] """ Description of the merchandise or service that was purchased. """ product_type: NotRequired[ "Literal['']|Literal['merchandise', 'service']" ] """ Whether the product was a merchandise or service. """ class CreateParamsEvidenceServiceNotAsDescribed(TypedDict): additional_documentation: NotRequired["Literal['']|str"] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. """ canceled_at: NotRequired["Literal['']|int"] """ Date when order was canceled. """ cancellation_reason: NotRequired["Literal['']|str"] """ Reason for canceling the order. """ explanation: NotRequired["Literal['']|str"] """ Explanation of why the cardholder is disputing this transaction. """ received_at: NotRequired["Literal['']|int"] """ Date when the product was received. """ class CreateParamsTreasury(TypedDict): received_debit: str """ The ID of the ReceivedDebit to initiate an Issuings dispute for. """ class ListParams(TypedDict): created: NotRequired["DisputeService.ListParamsCreated|int"] """ Only return Issuing disputes that were created during the given date interval. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ Literal["expired", "lost", "submitted", "unsubmitted", "won"] ] """ Select Issuing disputes with the given status. """ transaction: NotRequired[str] """ Select the Issuing dispute for the given transaction. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class SubmitParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ class UpdateParams(TypedDict): amount: NotRequired[int] """ The dispute amount in the card's currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ evidence: NotRequired["DisputeService.UpdateParamsEvidence"] """ Evidence provided for the dispute. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ class UpdateParamsEvidence(TypedDict): canceled: NotRequired[ "Literal['']|DisputeService.UpdateParamsEvidenceCanceled" ] """ Evidence provided when `reason` is 'canceled'. """ duplicate: NotRequired[ "Literal['']|DisputeService.UpdateParamsEvidenceDuplicate" ] """ Evidence provided when `reason` is 'duplicate'. """ fraudulent: NotRequired[ "Literal['']|DisputeService.UpdateParamsEvidenceFraudulent" ] """ Evidence provided when `reason` is 'fraudulent'. """ merchandise_not_as_described: NotRequired[ "Literal['']|DisputeService.UpdateParamsEvidenceMerchandiseNotAsDescribed" ] """ Evidence provided when `reason` is 'merchandise_not_as_described'. """ no_valid_authorization: NotRequired[ "Literal['']|DisputeService.UpdateParamsEvidenceNoValidAuthorization" ] """ Evidence provided when `reason` is 'no_valid_authorization'. """ not_received: NotRequired[ "Literal['']|DisputeService.UpdateParamsEvidenceNotReceived" ] """ Evidence provided when `reason` is 'not_received'. """ other: NotRequired[ "Literal['']|DisputeService.UpdateParamsEvidenceOther" ] """ Evidence provided when `reason` is 'other'. """ reason: NotRequired[ Literal[ "canceled", "duplicate", "fraudulent", "merchandise_not_as_described", "no_valid_authorization", "not_received", "other", "service_not_as_described", ] ] """ The reason for filing the dispute. The evidence should be submitted in the field of the same name. """ service_not_as_described: NotRequired[ "Literal['']|DisputeService.UpdateParamsEvidenceServiceNotAsDescribed" ] """ Evidence provided when `reason` is 'service_not_as_described'. """ class UpdateParamsEvidenceCanceled(TypedDict): additional_documentation: NotRequired["Literal['']|str"] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. """ canceled_at: NotRequired["Literal['']|int"] """ Date when order was canceled. """ cancellation_policy_provided: NotRequired["Literal['']|bool"] """ Whether the cardholder was provided with a cancellation policy. """ cancellation_reason: NotRequired["Literal['']|str"] """ Reason for canceling the order. """ expected_at: NotRequired["Literal['']|int"] """ Date when the cardholder expected to receive the product. """ explanation: NotRequired["Literal['']|str"] """ Explanation of why the cardholder is disputing this transaction. """ product_description: NotRequired["Literal['']|str"] """ Description of the merchandise or service that was purchased. """ product_type: NotRequired[ "Literal['']|Literal['merchandise', 'service']" ] """ Whether the product was a merchandise or service. """ return_status: NotRequired[ "Literal['']|Literal['merchant_rejected', 'successful']" ] """ Result of cardholder's attempt to return the product. """ returned_at: NotRequired["Literal['']|int"] """ Date when the product was returned or attempted to be returned. """ class UpdateParamsEvidenceDuplicate(TypedDict): additional_documentation: NotRequired["Literal['']|str"] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. """ card_statement: NotRequired["Literal['']|str"] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the card statement showing that the product had already been paid for. """ cash_receipt: NotRequired["Literal['']|str"] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Copy of the receipt showing that the product had been paid for in cash. """ check_image: NotRequired["Literal['']|str"] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Image of the front and back of the check that was used to pay for the product. """ explanation: NotRequired["Literal['']|str"] """ Explanation of why the cardholder is disputing this transaction. """ original_transaction: NotRequired[str] """ Transaction (e.g., ipi_...) that the disputed transaction is a duplicate of. Of the two or more transactions that are copies of each other, this is original undisputed one. """ class UpdateParamsEvidenceFraudulent(TypedDict): additional_documentation: NotRequired["Literal['']|str"] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. """ explanation: NotRequired["Literal['']|str"] """ Explanation of why the cardholder is disputing this transaction. """ class UpdateParamsEvidenceMerchandiseNotAsDescribed(TypedDict): additional_documentation: NotRequired["Literal['']|str"] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. """ explanation: NotRequired["Literal['']|str"] """ Explanation of why the cardholder is disputing this transaction. """ received_at: NotRequired["Literal['']|int"] """ Date when the product was received. """ return_description: NotRequired["Literal['']|str"] """ Description of the cardholder's attempt to return the product. """ return_status: NotRequired[ "Literal['']|Literal['merchant_rejected', 'successful']" ] """ Result of cardholder's attempt to return the product. """ returned_at: NotRequired["Literal['']|int"] """ Date when the product was returned or attempted to be returned. """ class UpdateParamsEvidenceNoValidAuthorization(TypedDict): additional_documentation: NotRequired["Literal['']|str"] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. """ explanation: NotRequired["Literal['']|str"] """ Explanation of why the cardholder is disputing this transaction. """ class UpdateParamsEvidenceNotReceived(TypedDict): additional_documentation: NotRequired["Literal['']|str"] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. """ expected_at: NotRequired["Literal['']|int"] """ Date when the cardholder expected to receive the product. """ explanation: NotRequired["Literal['']|str"] """ Explanation of why the cardholder is disputing this transaction. """ product_description: NotRequired["Literal['']|str"] """ Description of the merchandise or service that was purchased. """ product_type: NotRequired[ "Literal['']|Literal['merchandise', 'service']" ] """ Whether the product was a merchandise or service. """ class UpdateParamsEvidenceOther(TypedDict): additional_documentation: NotRequired["Literal['']|str"] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. """ explanation: NotRequired["Literal['']|str"] """ Explanation of why the cardholder is disputing this transaction. """ product_description: NotRequired["Literal['']|str"] """ Description of the merchandise or service that was purchased. """ product_type: NotRequired[ "Literal['']|Literal['merchandise', 'service']" ] """ Whether the product was a merchandise or service. """ class UpdateParamsEvidenceServiceNotAsDescribed(TypedDict): additional_documentation: NotRequired["Literal['']|str"] """ (ID of a [file upload](https://stripe.com/docs/guides/file-upload)) Additional documentation supporting the dispute. """ canceled_at: NotRequired["Literal['']|int"] """ Date when order was canceled. """ cancellation_reason: NotRequired["Literal['']|str"] """ Reason for canceling the order. """ explanation: NotRequired["Literal['']|str"] """ Explanation of why the cardholder is disputing this transaction. """ received_at: NotRequired["Literal['']|int"] """ Date when the product was received. """ def list( self, params: "DisputeService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Dispute]: """ Returns a list of Issuing Dispute objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. """ return cast( ListObject[Dispute], self._request( "get", "/v1/issuing/disputes", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "DisputeService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Dispute]: """ Returns a list of Issuing Dispute objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. """ return cast( ListObject[Dispute], await self._request_async( "get", "/v1/issuing/disputes", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "DisputeService.CreateParams" = {}, options: RequestOptions = {}, ) -> Dispute: """ Creates an Issuing Dispute object. Individual pieces of evidence within the evidence object are optional at this point. Stripe only validates that required evidence is present during submission. Refer to [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence) for more details about evidence requirements. """ return cast( Dispute, self._request( "post", "/v1/issuing/disputes", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "DisputeService.CreateParams" = {}, options: RequestOptions = {}, ) -> Dispute: """ Creates an Issuing Dispute object. Individual pieces of evidence within the evidence object are optional at this point. Stripe only validates that required evidence is present during submission. Refer to [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence) for more details about evidence requirements. """ return cast( Dispute, await self._request_async( "post", "/v1/issuing/disputes", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, dispute: str, params: "DisputeService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Dispute: """ Retrieves an Issuing Dispute object. """ return cast( Dispute, self._request( "get", "/v1/issuing/disputes/{dispute}".format( dispute=sanitize_id(dispute), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, dispute: str, params: "DisputeService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Dispute: """ Retrieves an Issuing Dispute object. """ return cast( Dispute, await self._request_async( "get", "/v1/issuing/disputes/{dispute}".format( dispute=sanitize_id(dispute), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, dispute: str, params: "DisputeService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Dispute: """ Updates the specified Issuing Dispute object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Properties on the evidence object can be unset by passing in an empty string. """ return cast( Dispute, self._request( "post", "/v1/issuing/disputes/{dispute}".format( dispute=sanitize_id(dispute), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, dispute: str, params: "DisputeService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Dispute: """ Updates the specified Issuing Dispute object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Properties on the evidence object can be unset by passing in an empty string. """ return cast( Dispute, await self._request_async( "post", "/v1/issuing/disputes/{dispute}".format( dispute=sanitize_id(dispute), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def submit( self, dispute: str, params: "DisputeService.SubmitParams" = {}, options: RequestOptions = {}, ) -> Dispute: """ Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence). """ return cast( Dispute, self._request( "post", "/v1/issuing/disputes/{dispute}/submit".format( dispute=sanitize_id(dispute), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def submit_async( self, dispute: str, params: "DisputeService.SubmitParams" = {}, options: RequestOptions = {}, ) -> Dispute: """ Submits an Issuing Dispute to the card network. Stripe validates that all evidence fields required for the dispute's reason are present. For more details, see [Dispute reasons and evidence](https://stripe.com/docs/issuing/purchases/disputes#dispute-reasons-and-evidence). """ return cast( Dispute, await self._request_async( "post", "/v1/issuing/disputes/{dispute}/submit".format( dispute=sanitize_id(dispute), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/issuing/_personalization_design.py0000644000175100001770000010026414637354563023001 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._test_helpers import APIResourceTestHelpers from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, NotRequired, Type, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._file import File from stripe.issuing._physical_bundle import PhysicalBundle class PersonalizationDesign( CreateableAPIResource["PersonalizationDesign"], ListableAPIResource["PersonalizationDesign"], UpdateableAPIResource["PersonalizationDesign"], ): """ A Personalization Design is a logical grouping of a Physical Bundle, card logo, and carrier text that represents a product line. """ OBJECT_NAME: ClassVar[Literal["issuing.personalization_design"]] = ( "issuing.personalization_design" ) class CarrierText(StripeObject): footer_body: Optional[str] """ The footer body text of the carrier letter. """ footer_title: Optional[str] """ The footer title text of the carrier letter. """ header_body: Optional[str] """ The header body text of the carrier letter. """ header_title: Optional[str] """ The header title text of the carrier letter. """ class Preferences(StripeObject): is_default: bool """ Whether we use this personalization design to create cards when one isn't specified. A connected account uses the Connect platform's default design if no personalization design is set as the default design. """ is_platform_default: Optional[bool] """ Whether this personalization design is used to create cards when one is not specified and a default for this connected account does not exist. """ class RejectionReasons(StripeObject): card_logo: Optional[ List[ Literal[ "geographic_location", "inappropriate", "network_name", "non_binary_image", "non_fiat_currency", "other", "other_entity", "promotional_material", ] ] ] """ The reason(s) the card logo was rejected. """ carrier_text: Optional[ List[ Literal[ "geographic_location", "inappropriate", "network_name", "non_fiat_currency", "other", "other_entity", "promotional_material", ] ] ] """ The reason(s) the carrier text was rejected. """ class ActivateParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CreateParams(RequestOptions): card_logo: NotRequired[str] """ The file for the card logo, for use with physical bundles that support card logos. Must have a `purpose` value of `issuing_logo`. """ carrier_text: NotRequired[ "PersonalizationDesign.CreateParamsCarrierText" ] """ Hash containing carrier text, for use with physical bundles that support carrier text. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ lookup_key: NotRequired[str] """ A lookup key used to retrieve personalization designs dynamically from a static string. This may be up to 200 characters. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ name: NotRequired[str] """ Friendly display name. """ physical_bundle: str """ The physical bundle object belonging to this personalization design. """ preferences: NotRequired[ "PersonalizationDesign.CreateParamsPreferences" ] """ Information on whether this personalization design is used to create cards when one is not specified. """ transfer_lookup_key: NotRequired[bool] """ If set to true, will atomically remove the lookup key from the existing personalization design, and assign it to this personalization design. """ class CreateParamsCarrierText(TypedDict): footer_body: NotRequired["Literal['']|str"] """ The footer body text of the carrier letter. """ footer_title: NotRequired["Literal['']|str"] """ The footer title text of the carrier letter. """ header_body: NotRequired["Literal['']|str"] """ The header body text of the carrier letter. """ header_title: NotRequired["Literal['']|str"] """ The header title text of the carrier letter. """ class CreateParamsPreferences(TypedDict): is_default: bool """ Whether we use this personalization design to create cards when one isn't specified. A connected account uses the Connect platform's default design if no personalization design is set as the default design. """ class DeactivateParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ListParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ lookup_keys: NotRequired[List[str]] """ Only return personalization designs with the given lookup keys. """ preferences: NotRequired["PersonalizationDesign.ListParamsPreferences"] """ Only return personalization designs with the given preferences. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ Literal["active", "inactive", "rejected", "review"] ] """ Only return personalization designs with the given status. """ class ListParamsPreferences(TypedDict): is_default: NotRequired[bool] """ Only return the personalization design that's set as the default. A connected account uses the Connect platform's default design if no personalization design is set as the default. """ is_platform_default: NotRequired[bool] """ Only return the personalization design that is set as the Connect platform's default. This parameter is only applicable to connected accounts. """ class ModifyParams(RequestOptions): card_logo: NotRequired["Literal['']|str"] """ The file for the card logo, for use with physical bundles that support card logos. Must have a `purpose` value of `issuing_logo`. """ carrier_text: NotRequired[ "Literal['']|PersonalizationDesign.ModifyParamsCarrierText" ] """ Hash containing carrier text, for use with physical bundles that support carrier text. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ lookup_key: NotRequired["Literal['']|str"] """ A lookup key used to retrieve personalization designs dynamically from a static string. This may be up to 200 characters. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ name: NotRequired["Literal['']|str"] """ Friendly display name. Providing an empty string will set the field to null. """ physical_bundle: NotRequired[str] """ The physical bundle object belonging to this personalization design. """ preferences: NotRequired[ "PersonalizationDesign.ModifyParamsPreferences" ] """ Information on whether this personalization design is used to create cards when one is not specified. """ transfer_lookup_key: NotRequired[bool] """ If set to true, will atomically remove the lookup key from the existing personalization design, and assign it to this personalization design. """ class ModifyParamsCarrierText(TypedDict): footer_body: NotRequired["Literal['']|str"] """ The footer body text of the carrier letter. """ footer_title: NotRequired["Literal['']|str"] """ The footer title text of the carrier letter. """ header_body: NotRequired["Literal['']|str"] """ The header body text of the carrier letter. """ header_title: NotRequired["Literal['']|str"] """ The header title text of the carrier letter. """ class ModifyParamsPreferences(TypedDict): is_default: bool """ Whether we use this personalization design to create cards when one isn't specified. A connected account uses the Connect platform's default design if no personalization design is set as the default design. """ class RejectParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ rejection_reasons: "PersonalizationDesign.RejectParamsRejectionReasons" """ The reason(s) the personalization design was rejected. """ class RejectParamsRejectionReasons(TypedDict): card_logo: NotRequired[ List[ Literal[ "geographic_location", "inappropriate", "network_name", "non_binary_image", "non_fiat_currency", "other", "other_entity", "promotional_material", ] ] ] """ The reason(s) the card logo was rejected. """ carrier_text: NotRequired[ List[ Literal[ "geographic_location", "inappropriate", "network_name", "non_fiat_currency", "other", "other_entity", "promotional_material", ] ] ] """ The reason(s) the carrier text was rejected. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ card_logo: Optional[ExpandableField["File"]] """ The file for the card logo to use with physical bundles that support card logos. Must have a `purpose` value of `issuing_logo`. """ carrier_text: Optional[CarrierText] """ Hash containing carrier text, for use with physical bundles that support carrier text. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ lookup_key: Optional[str] """ A lookup key used to retrieve personalization designs dynamically from a static string. This may be up to 200 characters. """ metadata: Dict[str, str] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ name: Optional[str] """ Friendly display name. """ object: Literal["issuing.personalization_design"] """ String representing the object's type. Objects of the same type share the same value. """ physical_bundle: ExpandableField["PhysicalBundle"] """ The physical bundle object belonging to this personalization design. """ preferences: Preferences rejection_reasons: RejectionReasons status: Literal["active", "inactive", "rejected", "review"] """ Whether this personalization design can be used to create cards. """ @classmethod def create( cls, **params: Unpack["PersonalizationDesign.CreateParams"] ) -> "PersonalizationDesign": """ Creates a personalization design object. """ return cast( "PersonalizationDesign", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["PersonalizationDesign.CreateParams"] ) -> "PersonalizationDesign": """ Creates a personalization design object. """ return cast( "PersonalizationDesign", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def list( cls, **params: Unpack["PersonalizationDesign.ListParams"] ) -> ListObject["PersonalizationDesign"]: """ Returns a list of personalization design objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["PersonalizationDesign.ListParams"] ) -> ListObject["PersonalizationDesign"]: """ Returns a list of personalization design objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def modify( cls, id: str, **params: Unpack["PersonalizationDesign.ModifyParams"] ) -> "PersonalizationDesign": """ Updates a card personalization object. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "PersonalizationDesign", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["PersonalizationDesign.ModifyParams"] ) -> "PersonalizationDesign": """ Updates a card personalization object. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "PersonalizationDesign", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["PersonalizationDesign.RetrieveParams"] ) -> "PersonalizationDesign": """ Retrieves a personalization design object. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["PersonalizationDesign.RetrieveParams"] ) -> "PersonalizationDesign": """ Retrieves a personalization design object. """ instance = cls(id, **params) await instance.refresh_async() return instance class TestHelpers(APIResourceTestHelpers["PersonalizationDesign"]): _resource_cls: Type["PersonalizationDesign"] @classmethod def _cls_activate( cls, personalization_design: str, **params: Unpack["PersonalizationDesign.ActivateParams"], ) -> "PersonalizationDesign": """ Updates the status of the specified testmode personalization design object to active. """ return cast( "PersonalizationDesign", cls._static_request( "post", "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/activate".format( personalization_design=sanitize_id( personalization_design ) ), params=params, ), ) @overload @staticmethod def activate( personalization_design: str, **params: Unpack["PersonalizationDesign.ActivateParams"], ) -> "PersonalizationDesign": """ Updates the status of the specified testmode personalization design object to active. """ ... @overload def activate( self, **params: Unpack["PersonalizationDesign.ActivateParams"] ) -> "PersonalizationDesign": """ Updates the status of the specified testmode personalization design object to active. """ ... @class_method_variant("_cls_activate") def activate( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["PersonalizationDesign.ActivateParams"] ) -> "PersonalizationDesign": """ Updates the status of the specified testmode personalization design object to active. """ return cast( "PersonalizationDesign", self.resource._request( "post", "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/activate".format( personalization_design=sanitize_id( self.resource.get("id") ) ), params=params, ), ) @classmethod async def _cls_activate_async( cls, personalization_design: str, **params: Unpack["PersonalizationDesign.ActivateParams"], ) -> "PersonalizationDesign": """ Updates the status of the specified testmode personalization design object to active. """ return cast( "PersonalizationDesign", await cls._static_request_async( "post", "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/activate".format( personalization_design=sanitize_id( personalization_design ) ), params=params, ), ) @overload @staticmethod async def activate_async( personalization_design: str, **params: Unpack["PersonalizationDesign.ActivateParams"], ) -> "PersonalizationDesign": """ Updates the status of the specified testmode personalization design object to active. """ ... @overload async def activate_async( self, **params: Unpack["PersonalizationDesign.ActivateParams"] ) -> "PersonalizationDesign": """ Updates the status of the specified testmode personalization design object to active. """ ... @class_method_variant("_cls_activate_async") async def activate_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["PersonalizationDesign.ActivateParams"] ) -> "PersonalizationDesign": """ Updates the status of the specified testmode personalization design object to active. """ return cast( "PersonalizationDesign", await self.resource._request_async( "post", "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/activate".format( personalization_design=sanitize_id( self.resource.get("id") ) ), params=params, ), ) @classmethod def _cls_deactivate( cls, personalization_design: str, **params: Unpack["PersonalizationDesign.DeactivateParams"], ) -> "PersonalizationDesign": """ Updates the status of the specified testmode personalization design object to inactive. """ return cast( "PersonalizationDesign", cls._static_request( "post", "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/deactivate".format( personalization_design=sanitize_id( personalization_design ) ), params=params, ), ) @overload @staticmethod def deactivate( personalization_design: str, **params: Unpack["PersonalizationDesign.DeactivateParams"], ) -> "PersonalizationDesign": """ Updates the status of the specified testmode personalization design object to inactive. """ ... @overload def deactivate( self, **params: Unpack["PersonalizationDesign.DeactivateParams"] ) -> "PersonalizationDesign": """ Updates the status of the specified testmode personalization design object to inactive. """ ... @class_method_variant("_cls_deactivate") def deactivate( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["PersonalizationDesign.DeactivateParams"] ) -> "PersonalizationDesign": """ Updates the status of the specified testmode personalization design object to inactive. """ return cast( "PersonalizationDesign", self.resource._request( "post", "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/deactivate".format( personalization_design=sanitize_id( self.resource.get("id") ) ), params=params, ), ) @classmethod async def _cls_deactivate_async( cls, personalization_design: str, **params: Unpack["PersonalizationDesign.DeactivateParams"], ) -> "PersonalizationDesign": """ Updates the status of the specified testmode personalization design object to inactive. """ return cast( "PersonalizationDesign", await cls._static_request_async( "post", "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/deactivate".format( personalization_design=sanitize_id( personalization_design ) ), params=params, ), ) @overload @staticmethod async def deactivate_async( personalization_design: str, **params: Unpack["PersonalizationDesign.DeactivateParams"], ) -> "PersonalizationDesign": """ Updates the status of the specified testmode personalization design object to inactive. """ ... @overload async def deactivate_async( self, **params: Unpack["PersonalizationDesign.DeactivateParams"] ) -> "PersonalizationDesign": """ Updates the status of the specified testmode personalization design object to inactive. """ ... @class_method_variant("_cls_deactivate_async") async def deactivate_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["PersonalizationDesign.DeactivateParams"] ) -> "PersonalizationDesign": """ Updates the status of the specified testmode personalization design object to inactive. """ return cast( "PersonalizationDesign", await self.resource._request_async( "post", "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/deactivate".format( personalization_design=sanitize_id( self.resource.get("id") ) ), params=params, ), ) @classmethod def _cls_reject( cls, personalization_design: str, **params: Unpack["PersonalizationDesign.RejectParams"], ) -> "PersonalizationDesign": """ Updates the status of the specified testmode personalization design object to rejected. """ return cast( "PersonalizationDesign", cls._static_request( "post", "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/reject".format( personalization_design=sanitize_id( personalization_design ) ), params=params, ), ) @overload @staticmethod def reject( personalization_design: str, **params: Unpack["PersonalizationDesign.RejectParams"], ) -> "PersonalizationDesign": """ Updates the status of the specified testmode personalization design object to rejected. """ ... @overload def reject( self, **params: Unpack["PersonalizationDesign.RejectParams"] ) -> "PersonalizationDesign": """ Updates the status of the specified testmode personalization design object to rejected. """ ... @class_method_variant("_cls_reject") def reject( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["PersonalizationDesign.RejectParams"] ) -> "PersonalizationDesign": """ Updates the status of the specified testmode personalization design object to rejected. """ return cast( "PersonalizationDesign", self.resource._request( "post", "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/reject".format( personalization_design=sanitize_id( self.resource.get("id") ) ), params=params, ), ) @classmethod async def _cls_reject_async( cls, personalization_design: str, **params: Unpack["PersonalizationDesign.RejectParams"], ) -> "PersonalizationDesign": """ Updates the status of the specified testmode personalization design object to rejected. """ return cast( "PersonalizationDesign", await cls._static_request_async( "post", "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/reject".format( personalization_design=sanitize_id( personalization_design ) ), params=params, ), ) @overload @staticmethod async def reject_async( personalization_design: str, **params: Unpack["PersonalizationDesign.RejectParams"], ) -> "PersonalizationDesign": """ Updates the status of the specified testmode personalization design object to rejected. """ ... @overload async def reject_async( self, **params: Unpack["PersonalizationDesign.RejectParams"] ) -> "PersonalizationDesign": """ Updates the status of the specified testmode personalization design object to rejected. """ ... @class_method_variant("_cls_reject_async") async def reject_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["PersonalizationDesign.RejectParams"] ) -> "PersonalizationDesign": """ Updates the status of the specified testmode personalization design object to rejected. """ return cast( "PersonalizationDesign", await self.resource._request_async( "post", "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/reject".format( personalization_design=sanitize_id( self.resource.get("id") ) ), params=params, ), ) @property def test_helpers(self): return self.TestHelpers(self) _inner_class_types = { "carrier_text": CarrierText, "preferences": Preferences, "rejection_reasons": RejectionReasons, } PersonalizationDesign.TestHelpers._resource_cls = PersonalizationDesign ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/issuing/_personalization_design_service.py0000644000175100001770000003306614637354563024526 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.issuing._personalization_design import PersonalizationDesign from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class PersonalizationDesignService(StripeService): class CreateParams(TypedDict): card_logo: NotRequired[str] """ The file for the card logo, for use with physical bundles that support card logos. Must have a `purpose` value of `issuing_logo`. """ carrier_text: NotRequired[ "PersonalizationDesignService.CreateParamsCarrierText" ] """ Hash containing carrier text, for use with physical bundles that support carrier text. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ lookup_key: NotRequired[str] """ A lookup key used to retrieve personalization designs dynamically from a static string. This may be up to 200 characters. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ name: NotRequired[str] """ Friendly display name. """ physical_bundle: str """ The physical bundle object belonging to this personalization design. """ preferences: NotRequired[ "PersonalizationDesignService.CreateParamsPreferences" ] """ Information on whether this personalization design is used to create cards when one is not specified. """ transfer_lookup_key: NotRequired[bool] """ If set to true, will atomically remove the lookup key from the existing personalization design, and assign it to this personalization design. """ class CreateParamsCarrierText(TypedDict): footer_body: NotRequired["Literal['']|str"] """ The footer body text of the carrier letter. """ footer_title: NotRequired["Literal['']|str"] """ The footer title text of the carrier letter. """ header_body: NotRequired["Literal['']|str"] """ The header body text of the carrier letter. """ header_title: NotRequired["Literal['']|str"] """ The header title text of the carrier letter. """ class CreateParamsPreferences(TypedDict): is_default: bool """ Whether we use this personalization design to create cards when one isn't specified. A connected account uses the Connect platform's default design if no personalization design is set as the default design. """ class ListParams(TypedDict): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ lookup_keys: NotRequired[List[str]] """ Only return personalization designs with the given lookup keys. """ preferences: NotRequired[ "PersonalizationDesignService.ListParamsPreferences" ] """ Only return personalization designs with the given preferences. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ Literal["active", "inactive", "rejected", "review"] ] """ Only return personalization designs with the given status. """ class ListParamsPreferences(TypedDict): is_default: NotRequired[bool] """ Only return the personalization design that's set as the default. A connected account uses the Connect platform's default design if no personalization design is set as the default. """ is_platform_default: NotRequired[bool] """ Only return the personalization design that is set as the Connect platform's default. This parameter is only applicable to connected accounts. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): card_logo: NotRequired["Literal['']|str"] """ The file for the card logo, for use with physical bundles that support card logos. Must have a `purpose` value of `issuing_logo`. """ carrier_text: NotRequired[ "Literal['']|PersonalizationDesignService.UpdateParamsCarrierText" ] """ Hash containing carrier text, for use with physical bundles that support carrier text. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ lookup_key: NotRequired["Literal['']|str"] """ A lookup key used to retrieve personalization designs dynamically from a static string. This may be up to 200 characters. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ name: NotRequired["Literal['']|str"] """ Friendly display name. Providing an empty string will set the field to null. """ physical_bundle: NotRequired[str] """ The physical bundle object belonging to this personalization design. """ preferences: NotRequired[ "PersonalizationDesignService.UpdateParamsPreferences" ] """ Information on whether this personalization design is used to create cards when one is not specified. """ transfer_lookup_key: NotRequired[bool] """ If set to true, will atomically remove the lookup key from the existing personalization design, and assign it to this personalization design. """ class UpdateParamsCarrierText(TypedDict): footer_body: NotRequired["Literal['']|str"] """ The footer body text of the carrier letter. """ footer_title: NotRequired["Literal['']|str"] """ The footer title text of the carrier letter. """ header_body: NotRequired["Literal['']|str"] """ The header body text of the carrier letter. """ header_title: NotRequired["Literal['']|str"] """ The header title text of the carrier letter. """ class UpdateParamsPreferences(TypedDict): is_default: bool """ Whether we use this personalization design to create cards when one isn't specified. A connected account uses the Connect platform's default design if no personalization design is set as the default design. """ def list( self, params: "PersonalizationDesignService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[PersonalizationDesign]: """ Returns a list of personalization design objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. """ return cast( ListObject[PersonalizationDesign], self._request( "get", "/v1/issuing/personalization_designs", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "PersonalizationDesignService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[PersonalizationDesign]: """ Returns a list of personalization design objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. """ return cast( ListObject[PersonalizationDesign], await self._request_async( "get", "/v1/issuing/personalization_designs", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "PersonalizationDesignService.CreateParams", options: RequestOptions = {}, ) -> PersonalizationDesign: """ Creates a personalization design object. """ return cast( PersonalizationDesign, self._request( "post", "/v1/issuing/personalization_designs", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "PersonalizationDesignService.CreateParams", options: RequestOptions = {}, ) -> PersonalizationDesign: """ Creates a personalization design object. """ return cast( PersonalizationDesign, await self._request_async( "post", "/v1/issuing/personalization_designs", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, personalization_design: str, params: "PersonalizationDesignService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> PersonalizationDesign: """ Retrieves a personalization design object. """ return cast( PersonalizationDesign, self._request( "get", "/v1/issuing/personalization_designs/{personalization_design}".format( personalization_design=sanitize_id(personalization_design), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, personalization_design: str, params: "PersonalizationDesignService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> PersonalizationDesign: """ Retrieves a personalization design object. """ return cast( PersonalizationDesign, await self._request_async( "get", "/v1/issuing/personalization_designs/{personalization_design}".format( personalization_design=sanitize_id(personalization_design), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, personalization_design: str, params: "PersonalizationDesignService.UpdateParams" = {}, options: RequestOptions = {}, ) -> PersonalizationDesign: """ Updates a card personalization object. """ return cast( PersonalizationDesign, self._request( "post", "/v1/issuing/personalization_designs/{personalization_design}".format( personalization_design=sanitize_id(personalization_design), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, personalization_design: str, params: "PersonalizationDesignService.UpdateParams" = {}, options: RequestOptions = {}, ) -> PersonalizationDesign: """ Updates a card personalization object. """ return cast( PersonalizationDesign, await self._request_async( "post", "/v1/issuing/personalization_designs/{personalization_design}".format( personalization_design=sanitize_id(personalization_design), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/issuing/_physical_bundle.py0000644000175100001770000001266714637354563021405 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from typing import ClassVar, List from typing_extensions import Literal, NotRequired, Unpack class PhysicalBundle(ListableAPIResource["PhysicalBundle"]): """ A Physical Bundle represents the bundle of physical items - card stock, carrier letter, and envelope - that is shipped to a cardholder when you create a physical card. """ OBJECT_NAME: ClassVar[Literal["issuing.physical_bundle"]] = ( "issuing.physical_bundle" ) class Features(StripeObject): card_logo: Literal["optional", "required", "unsupported"] """ The policy for how to use card logo images in a card design with this physical bundle. """ carrier_text: Literal["optional", "required", "unsupported"] """ The policy for how to use carrier letter text in a card design with this physical bundle. """ second_line: Literal["optional", "required", "unsupported"] """ The policy for how to use a second line on a card with this physical bundle. """ class ListParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[Literal["active", "inactive", "review"]] """ Only return physical bundles with the given status. """ type: NotRequired[Literal["custom", "standard"]] """ Only return physical bundles with the given type. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ features: Features id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ name: str """ Friendly display name. """ object: Literal["issuing.physical_bundle"] """ String representing the object's type. Objects of the same type share the same value. """ status: Literal["active", "inactive", "review"] """ Whether this physical bundle can be used to create cards. """ type: Literal["custom", "standard"] """ Whether this physical bundle is a standard Stripe offering or custom-made for you. """ @classmethod def list( cls, **params: Unpack["PhysicalBundle.ListParams"] ) -> ListObject["PhysicalBundle"]: """ Returns a list of physical bundle objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["PhysicalBundle.ListParams"] ) -> ListObject["PhysicalBundle"]: """ Returns a list of physical bundle objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def retrieve( cls, id: str, **params: Unpack["PhysicalBundle.RetrieveParams"] ) -> "PhysicalBundle": """ Retrieves a physical bundle object. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["PhysicalBundle.RetrieveParams"] ) -> "PhysicalBundle": """ Retrieves a physical bundle object. """ instance = cls(id, **params) await instance.refresh_async() return instance _inner_class_types = {"features": Features} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/issuing/_physical_bundle_service.py0000644000175100001770000001112114637354563023105 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.issuing._physical_bundle import PhysicalBundle from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict class PhysicalBundleService(StripeService): class ListParams(TypedDict): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[Literal["active", "inactive", "review"]] """ Only return physical bundles with the given status. """ type: NotRequired[Literal["custom", "standard"]] """ Only return physical bundles with the given type. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def list( self, params: "PhysicalBundleService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[PhysicalBundle]: """ Returns a list of physical bundle objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. """ return cast( ListObject[PhysicalBundle], self._request( "get", "/v1/issuing/physical_bundles", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "PhysicalBundleService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[PhysicalBundle]: """ Returns a list of physical bundle objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. """ return cast( ListObject[PhysicalBundle], await self._request_async( "get", "/v1/issuing/physical_bundles", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, physical_bundle: str, params: "PhysicalBundleService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> PhysicalBundle: """ Retrieves a physical bundle object. """ return cast( PhysicalBundle, self._request( "get", "/v1/issuing/physical_bundles/{physical_bundle}".format( physical_bundle=sanitize_id(physical_bundle), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, physical_bundle: str, params: "PhysicalBundleService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> PhysicalBundle: """ Retrieves a physical bundle object. """ return cast( PhysicalBundle, await self._request_async( "get", "/v1/issuing/physical_bundles/{physical_bundle}".format( physical_bundle=sanitize_id(physical_bundle), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/issuing/_token.py0000644000175100001770000003346014637354563017352 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import sanitize_id from typing import ClassVar, List, Optional, cast from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe.issuing._card import Card class Token(ListableAPIResource["Token"], UpdateableAPIResource["Token"]): """ An issuing token object is created when an issued card is added to a digital wallet. As a [card issuer](https://stripe.com/docs/issuing), you can [view and manage these tokens](https://stripe.com/docs/issuing/controls/token-management) through Stripe. """ OBJECT_NAME: ClassVar[Literal["issuing.token"]] = "issuing.token" class NetworkData(StripeObject): class Device(StripeObject): device_fingerprint: Optional[str] """ An obfuscated ID derived from the device ID. """ ip_address: Optional[str] """ The IP address of the device at provisioning time. """ location: Optional[str] """ The geographic latitude/longitude coordinates of the device at provisioning time. The format is [+-]decimal/[+-]decimal. """ name: Optional[str] """ The name of the device used for tokenization. """ phone_number: Optional[str] """ The phone number of the device used for tokenization. """ type: Optional[Literal["other", "phone", "watch"]] """ The type of device used for tokenization. """ class Mastercard(StripeObject): card_reference_id: Optional[str] """ A unique reference ID from MasterCard to represent the card account number. """ token_reference_id: str """ The network-unique identifier for the token. """ token_requestor_id: str """ 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. """ class Visa(StripeObject): card_reference_id: str """ A unique reference ID from Visa to represent the card account number. """ token_reference_id: str """ The network-unique identifier for the token. """ token_requestor_id: str """ The ID of the entity requesting tokenization, specific to Visa. """ token_risk_score: Optional[str] """ Degree of risk associated with the token between `01` and `99`, with higher number indicating higher risk. A `00` value indicates the token was not scored by Visa. """ class WalletProvider(StripeObject): class CardholderAddress(StripeObject): line1: str """ The street address of the cardholder tokenizing the card. """ postal_code: str """ The postal code of the cardholder tokenizing the card. """ account_id: Optional[str] """ The wallet provider-given account ID of the digital wallet the token belongs to. """ account_trust_score: Optional[int] """ An evaluation on the trustworthiness of the wallet account between 1 and 5. A higher score indicates more trustworthy. """ card_number_source: Optional[ Literal["app", "manual", "on_file", "other"] ] """ The method used for tokenizing a card. """ cardholder_address: Optional[CardholderAddress] cardholder_name: Optional[str] """ The name of the cardholder tokenizing the card. """ device_trust_score: Optional[int] """ An evaluation on the trustworthiness of the device. A higher score indicates more trustworthy. """ hashed_account_email_address: Optional[str] """ The hashed email address of the cardholder's account with the wallet provider. """ reason_codes: Optional[ List[ Literal[ "account_card_too_new", "account_recently_changed", "account_too_new", "account_too_new_since_launch", "additional_device", "data_expired", "defer_id_v_decision", "device_recently_lost", "good_activity_history", "has_suspended_tokens", "high_risk", "inactive_account", "long_account_tenure", "low_account_score", "low_device_score", "low_phone_number_score", "network_service_error", "outside_home_territory", "provisioning_cardholder_mismatch", "provisioning_device_and_cardholder_mismatch", "provisioning_device_mismatch", "same_device_no_prior_authentication", "same_device_successful_prior_authentication", "software_update", "suspicious_activity", "too_many_different_cardholders", "too_many_recent_attempts", "too_many_recent_tokens", ] ] ] """ The reasons for suggested tokenization given by the card network. """ suggested_decision: Optional[ Literal["approve", "decline", "require_auth"] ] """ The recommendation on responding to the tokenization request. """ suggested_decision_version: Optional[str] """ The version of the standard for mapping reason codes followed by the wallet provider. """ _inner_class_types = {"cardholder_address": CardholderAddress} device: Optional[Device] mastercard: Optional[Mastercard] type: Literal["mastercard", "visa"] """ The network that the token is associated with. An additional hash is included with a name matching this value, containing tokenization data specific to the card network. """ visa: Optional[Visa] wallet_provider: Optional[WalletProvider] _inner_class_types = { "device": Device, "mastercard": Mastercard, "visa": Visa, "wallet_provider": WalletProvider, } class ListParams(RequestOptions): card: str """ The Issuing card identifier to list tokens for. """ created: NotRequired["Token.ListParamsCreated|int"] """ Only return Issuing tokens that were created during the given date interval. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ Literal["active", "deleted", "requested", "suspended"] ] """ Select Issuing tokens with the given status. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ status: Literal["active", "deleted", "suspended"] """ Specifies which status the token should be updated to. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ card: ExpandableField["Card"] """ Card associated with this token. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ device_fingerprint: Optional[str] """ The hashed ID derived from the device ID from the card network associated with the token. """ id: str """ Unique identifier for the object. """ last4: Optional[str] """ The last four digits of the token. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ network: Literal["mastercard", "visa"] """ The token service provider / card network associated with the token. """ network_data: Optional[NetworkData] network_updated_at: int """ Time at which the token was last updated by the card network. Measured in seconds since the Unix epoch. """ object: Literal["issuing.token"] """ String representing the object's type. Objects of the same type share the same value. """ status: Literal["active", "deleted", "requested", "suspended"] """ The usage state of the token. """ wallet_provider: Optional[ Literal["apple_pay", "google_pay", "samsung_pay"] ] """ The digital wallet for this token, if one was used. """ @classmethod def list(cls, **params: Unpack["Token.ListParams"]) -> ListObject["Token"]: """ Lists all Issuing Token objects for a given card. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["Token.ListParams"] ) -> ListObject["Token"]: """ Lists all Issuing Token objects for a given card. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def modify( cls, id: str, **params: Unpack["Token.ModifyParams"] ) -> "Token": """ Attempts to update the specified Issuing Token object to the status specified. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Token", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["Token.ModifyParams"] ) -> "Token": """ Attempts to update the specified Issuing Token object to the status specified. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Token", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["Token.RetrieveParams"] ) -> "Token": """ Retrieves an Issuing Token object. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["Token.RetrieveParams"] ) -> "Token": """ Retrieves an Issuing Token object. """ instance = cls(id, **params) await instance.refresh_async() return instance _inner_class_types = {"network_data": NetworkData} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/issuing/_token_service.py0000644000175100001770000001410014637354563021060 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.issuing._token import Token from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict class TokenService(StripeService): class ListParams(TypedDict): card: str """ The Issuing card identifier to list tokens for. """ created: NotRequired["TokenService.ListParamsCreated|int"] """ Only return Issuing tokens that were created during the given date interval. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ Literal["active", "deleted", "requested", "suspended"] ] """ Select Issuing tokens with the given status. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ status: Literal["active", "deleted", "suspended"] """ Specifies which status the token should be updated to. """ def list( self, params: "TokenService.ListParams", options: RequestOptions = {} ) -> ListObject[Token]: """ Lists all Issuing Token objects for a given card. """ return cast( ListObject[Token], self._request( "get", "/v1/issuing/tokens", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "TokenService.ListParams", options: RequestOptions = {} ) -> ListObject[Token]: """ Lists all Issuing Token objects for a given card. """ return cast( ListObject[Token], await self._request_async( "get", "/v1/issuing/tokens", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, token: str, params: "TokenService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Token: """ Retrieves an Issuing Token object. """ return cast( Token, self._request( "get", "/v1/issuing/tokens/{token}".format(token=sanitize_id(token)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, token: str, params: "TokenService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Token: """ Retrieves an Issuing Token object. """ return cast( Token, await self._request_async( "get", "/v1/issuing/tokens/{token}".format(token=sanitize_id(token)), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, token: str, params: "TokenService.UpdateParams", options: RequestOptions = {}, ) -> Token: """ Attempts to update the specified Issuing Token object to the status specified. """ return cast( Token, self._request( "post", "/v1/issuing/tokens/{token}".format(token=sanitize_id(token)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, token: str, params: "TokenService.UpdateParams", options: RequestOptions = {}, ) -> Token: """ Attempts to update the specified Issuing Token object to the status specified. """ return cast( Token, await self._request_async( "post", "/v1/issuing/tokens/{token}".format(token=sanitize_id(token)), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/issuing/_transaction.py0000644000175100001770000022762714637354563020571 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._test_helpers import APIResourceTestHelpers from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, NotRequired, Type, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._balance_transaction import BalanceTransaction from stripe.issuing._authorization import Authorization from stripe.issuing._card import Card from stripe.issuing._cardholder import Cardholder from stripe.issuing._dispute import Dispute from stripe.issuing._token import Token class Transaction( ListableAPIResource["Transaction"], UpdateableAPIResource["Transaction"], ): """ Any use of an [issued card](https://stripe.com/docs/issuing) that results in funds entering or leaving your Stripe account, such as a completed purchase or refund, is represented by an Issuing `Transaction` object. Related guide: [Issued card transactions](https://stripe.com/docs/issuing/purchases/transactions) """ OBJECT_NAME: ClassVar[Literal["issuing.transaction"]] = ( "issuing.transaction" ) class AmountDetails(StripeObject): atm_fee: Optional[int] """ The fee charged by the ATM for the cash withdrawal. """ cashback_amount: Optional[int] """ The amount of cash requested by the cardholder. """ class MerchantData(StripeObject): category: str """ A categorization of the seller's type of business. See our [merchant categories guide](https://stripe.com/docs/issuing/merchant-categories) for a list of possible values. """ category_code: str """ The merchant category code for the seller's business """ city: Optional[str] """ City where the seller is located """ country: Optional[str] """ Country where the seller is located """ name: Optional[str] """ Name of the seller """ network_id: str """ Identifier assigned to the seller by the card network. Different card networks may assign different network_id fields to the same merchant. """ postal_code: Optional[str] """ Postal code where the seller is located """ state: Optional[str] """ State where the seller is located """ terminal_id: Optional[str] """ An ID assigned by the seller to the location of the sale. """ url: Optional[str] """ URL provided by the merchant on a 3DS request """ class NetworkData(StripeObject): authorization_code: Optional[str] """ A code created by Stripe which is shared with the merchant to validate the authorization. This field will be populated if the authorization message was approved. The code typically starts with the letter "S", followed by a six-digit number. For example, "S498162". Please note that the code is not guaranteed to be unique across authorizations. """ processing_date: Optional[str] """ The date the transaction was processed by the card network. This can be different from the date the seller recorded the transaction depending on when the acquirer submits the transaction to the network. """ transaction_id: Optional[str] """ Unique identifier for the authorization assigned by the card network used to match subsequent messages, disputes, and transactions. """ class PurchaseDetails(StripeObject): class Fleet(StripeObject): class CardholderPromptData(StripeObject): driver_id: Optional[str] """ Driver ID. """ odometer: Optional[int] """ Odometer reading. """ unspecified_id: Optional[str] """ An alphanumeric ID. This field is used when a vehicle ID, driver ID, or generic ID is entered by the cardholder, but the merchant or card network did not specify the prompt type. """ user_id: Optional[str] """ User ID. """ vehicle_number: Optional[str] """ Vehicle number. """ class ReportedBreakdown(StripeObject): class Fuel(StripeObject): gross_amount_decimal: Optional[str] """ Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. """ class NonFuel(StripeObject): gross_amount_decimal: Optional[str] """ Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes. """ class Tax(StripeObject): local_amount_decimal: Optional[str] """ Amount of state or provincial Sales Tax included in the transaction amount. Null if not reported by merchant or not subject to tax. """ national_amount_decimal: Optional[str] """ Amount of national Sales Tax or VAT included in the transaction amount. Null if not reported by merchant or not subject to tax. """ fuel: Optional[Fuel] """ Breakdown of fuel portion of the purchase. """ non_fuel: Optional[NonFuel] """ Breakdown of non-fuel portion of the purchase. """ tax: Optional[Tax] """ Information about tax included in this transaction. """ _inner_class_types = { "fuel": Fuel, "non_fuel": NonFuel, "tax": Tax, } cardholder_prompt_data: Optional[CardholderPromptData] """ Answers to prompts presented to cardholder at point of sale. """ purchase_type: Optional[str] """ The type of purchase. One of `fuel_purchase`, `non_fuel_purchase`, or `fuel_and_non_fuel_purchase`. """ reported_breakdown: Optional[ReportedBreakdown] """ More information about the total amount. This information is not guaranteed to be accurate as some merchants may provide unreliable data. """ service_type: Optional[str] """ The type of fuel service. One of `non_fuel_transaction`, `full_service`, or `self_service`. """ _inner_class_types = { "cardholder_prompt_data": CardholderPromptData, "reported_breakdown": ReportedBreakdown, } class Flight(StripeObject): class Segment(StripeObject): arrival_airport_code: Optional[str] """ The three-letter IATA airport code of the flight's destination. """ carrier: Optional[str] """ The airline carrier code. """ departure_airport_code: Optional[str] """ The three-letter IATA airport code that the flight departed from. """ flight_number: Optional[str] """ The flight number. """ service_class: Optional[str] """ The flight's service class. """ stopover_allowed: Optional[bool] """ Whether a stopover is allowed on this flight. """ departure_at: Optional[int] """ The time that the flight departed. """ passenger_name: Optional[str] """ The name of the passenger. """ refundable: Optional[bool] """ Whether the ticket is refundable. """ segments: Optional[List[Segment]] """ The legs of the trip. """ travel_agency: Optional[str] """ The travel agency that issued the ticket. """ _inner_class_types = {"segments": Segment} class Fuel(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[str] """ The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places. """ type: str """ The type of fuel that was purchased. One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. """ unit: str """ The units for `quantity_decimal`. One of `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `liter`, `pound`, `us_gallon`, or `other`. """ unit_cost_decimal: str """ The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. """ class Lodging(StripeObject): check_in_at: Optional[int] """ The time of checking into the lodging. """ nights: Optional[int] """ The number of nights stayed at the lodging. """ class Receipt(StripeObject): description: Optional[str] """ The description of the item. The maximum length of this field is 26 characters. """ quantity: Optional[float] """ The quantity of the item. """ total: Optional[int] """ The total for this line item in cents. """ unit_cost: Optional[int] """ The unit cost of the item in cents. """ fleet: Optional[Fleet] """ Fleet-specific information for transactions using Fleet cards. """ flight: Optional[Flight] """ Information about the flight that was purchased with this transaction. """ fuel: Optional[Fuel] """ Information about fuel that was purchased with this transaction. """ lodging: Optional[Lodging] """ Information about lodging that was purchased with this transaction. """ receipt: Optional[List[Receipt]] """ The line items in the purchase. """ reference: Optional[str] """ A merchant-specific order number. """ _inner_class_types = { "fleet": Fleet, "flight": Flight, "fuel": Fuel, "lodging": Lodging, "receipt": Receipt, } class Treasury(StripeObject): received_credit: Optional[str] """ The Treasury [ReceivedCredit](https://stripe.com/docs/api/treasury/received_credits) representing this Issuing transaction if it is a refund """ received_debit: Optional[str] """ The Treasury [ReceivedDebit](https://stripe.com/docs/api/treasury/received_debits) representing this Issuing transaction if it is a capture """ class CreateForceCaptureParams(RequestOptions): amount: int """ The total amount to attempt to capture. This amount is in the provided currency, or defaults to the cards currency, and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ card: str """ Card associated with this transaction. """ currency: NotRequired[str] """ The currency of the capture. If not provided, defaults to the currency of the card. 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). """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ merchant_data: NotRequired[ "Transaction.CreateForceCaptureParamsMerchantData" ] """ Details about the seller (grocery store, e-commerce website, etc.) where the card authorization happened. """ purchase_details: NotRequired[ "Transaction.CreateForceCaptureParamsPurchaseDetails" ] """ Additional purchase information that is optionally provided by the merchant. """ class CreateForceCaptureParamsMerchantData(TypedDict): category: NotRequired[ Literal[ "ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards", ] ] """ A categorization of the seller's type of business. See our [merchant categories guide](https://stripe.com/docs/issuing/merchant-categories) for a list of possible values. """ city: NotRequired[str] """ City where the seller is located """ country: NotRequired[str] """ Country where the seller is located """ name: NotRequired[str] """ Name of the seller """ network_id: NotRequired[str] """ Identifier assigned to the seller by the card network. Different card networks may assign different network_id fields to the same merchant. """ postal_code: NotRequired[str] """ Postal code where the seller is located """ state: NotRequired[str] """ State where the seller is located """ terminal_id: NotRequired[str] """ An ID assigned by the seller to the location of the sale. """ url: NotRequired[str] """ URL provided by the merchant on a 3DS request """ class CreateForceCaptureParamsPurchaseDetails(TypedDict): fleet: NotRequired[ "Transaction.CreateForceCaptureParamsPurchaseDetailsFleet" ] """ Fleet-specific information for transactions using Fleet cards. """ flight: NotRequired[ "Transaction.CreateForceCaptureParamsPurchaseDetailsFlight" ] """ Information about the flight that was purchased with this transaction. """ fuel: NotRequired[ "Transaction.CreateForceCaptureParamsPurchaseDetailsFuel" ] """ Information about fuel that was purchased with this transaction. """ lodging: NotRequired[ "Transaction.CreateForceCaptureParamsPurchaseDetailsLodging" ] """ Information about lodging that was purchased with this transaction. """ receipt: NotRequired[ List["Transaction.CreateForceCaptureParamsPurchaseDetailsReceipt"] ] """ The line items in the purchase. """ reference: NotRequired[str] """ A merchant-specific order number. """ class CreateForceCaptureParamsPurchaseDetailsFleet(TypedDict): cardholder_prompt_data: NotRequired[ "Transaction.CreateForceCaptureParamsPurchaseDetailsFleetCardholderPromptData" ] """ Answers to prompts presented to the cardholder at the point of sale. Prompted fields vary depending on the configuration of your physical fleet cards. Typical points of sale support only numeric entry. """ purchase_type: NotRequired[ Literal[ "fuel_and_non_fuel_purchase", "fuel_purchase", "non_fuel_purchase", ] ] """ The type of purchase. One of `fuel_purchase`, `non_fuel_purchase`, or `fuel_and_non_fuel_purchase`. """ reported_breakdown: NotRequired[ "Transaction.CreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdown" ] """ More information about the total amount. This information is not guaranteed to be accurate as some merchants may provide unreliable data. """ service_type: NotRequired[ Literal["full_service", "non_fuel_transaction", "self_service"] ] """ The type of fuel service. One of `non_fuel_transaction`, `full_service`, or `self_service`. """ class CreateForceCaptureParamsPurchaseDetailsFleetCardholderPromptData( TypedDict, ): driver_id: NotRequired[str] """ Driver ID. """ odometer: NotRequired[int] """ Odometer reading. """ unspecified_id: NotRequired[str] """ An alphanumeric ID. This field is used when a vehicle ID, driver ID, or generic ID is entered by the cardholder, but the merchant or card network did not specify the prompt type. """ user_id: NotRequired[str] """ User ID. """ vehicle_number: NotRequired[str] """ Vehicle number. """ class CreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdown( TypedDict, ): fuel: NotRequired[ "Transaction.CreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdownFuel" ] """ Breakdown of fuel portion of the purchase. """ non_fuel: NotRequired[ "Transaction.CreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdownNonFuel" ] """ Breakdown of non-fuel portion of the purchase. """ tax: NotRequired[ "Transaction.CreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdownTax" ] """ Information about tax included in this transaction. """ class CreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdownFuel( TypedDict, ): gross_amount_decimal: NotRequired[str] """ Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. """ class CreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdownNonFuel( TypedDict, ): gross_amount_decimal: NotRequired[str] """ Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes. """ class CreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdownTax( TypedDict, ): local_amount_decimal: NotRequired[str] """ Amount of state or provincial Sales Tax included in the transaction amount. Null if not reported by merchant or not subject to tax. """ national_amount_decimal: NotRequired[str] """ Amount of national Sales Tax or VAT included in the transaction amount. Null if not reported by merchant or not subject to tax. """ class CreateForceCaptureParamsPurchaseDetailsFlight(TypedDict): departure_at: NotRequired[int] """ The time that the flight departed. """ passenger_name: NotRequired[str] """ The name of the passenger. """ refundable: NotRequired[bool] """ Whether the ticket is refundable. """ segments: NotRequired[ List[ "Transaction.CreateForceCaptureParamsPurchaseDetailsFlightSegment" ] ] """ The legs of the trip. """ travel_agency: NotRequired[str] """ The travel agency that issued the ticket. """ class CreateForceCaptureParamsPurchaseDetailsFlightSegment(TypedDict): arrival_airport_code: NotRequired[str] """ The three-letter IATA airport code of the flight's destination. """ carrier: NotRequired[str] """ The airline carrier code. """ departure_airport_code: NotRequired[str] """ The three-letter IATA airport code that the flight departed from. """ flight_number: NotRequired[str] """ The flight number. """ service_class: NotRequired[str] """ The flight's service class. """ stopover_allowed: NotRequired[bool] """ Whether a stopover is allowed on this flight. """ class CreateForceCaptureParamsPurchaseDetailsFuel(TypedDict): industry_product_code: NotRequired[str] """ [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased. """ quantity_decimal: NotRequired[str] """ The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places. """ type: NotRequired[ Literal[ "diesel", "other", "unleaded_plus", "unleaded_regular", "unleaded_super", ] ] """ The type of fuel that was purchased. One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. """ unit: NotRequired[ Literal[ "charging_minute", "imperial_gallon", "kilogram", "kilowatt_hour", "liter", "other", "pound", "us_gallon", ] ] """ The units for `quantity_decimal`. One of `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `liter`, `pound`, `us_gallon`, or `other`. """ unit_cost_decimal: NotRequired[str] """ The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. """ class CreateForceCaptureParamsPurchaseDetailsLodging(TypedDict): check_in_at: NotRequired[int] """ The time of checking into the lodging. """ nights: NotRequired[int] """ The number of nights stayed at the lodging. """ class CreateForceCaptureParamsPurchaseDetailsReceipt(TypedDict): description: NotRequired[str] quantity: NotRequired[str] total: NotRequired[int] unit_cost: NotRequired[int] class CreateUnlinkedRefundParams(RequestOptions): amount: int """ The total amount to attempt to refund. This amount is in the provided currency, or defaults to the cards currency, and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ card: str """ Card associated with this unlinked refund transaction. """ currency: NotRequired[str] """ The currency of the unlinked refund. If not provided, defaults to the currency of the card. 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). """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ merchant_data: NotRequired[ "Transaction.CreateUnlinkedRefundParamsMerchantData" ] """ Details about the seller (grocery store, e-commerce website, etc.) where the card authorization happened. """ purchase_details: NotRequired[ "Transaction.CreateUnlinkedRefundParamsPurchaseDetails" ] """ Additional purchase information that is optionally provided by the merchant. """ class CreateUnlinkedRefundParamsMerchantData(TypedDict): category: NotRequired[ Literal[ "ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards", ] ] """ A categorization of the seller's type of business. See our [merchant categories guide](https://stripe.com/docs/issuing/merchant-categories) for a list of possible values. """ city: NotRequired[str] """ City where the seller is located """ country: NotRequired[str] """ Country where the seller is located """ name: NotRequired[str] """ Name of the seller """ network_id: NotRequired[str] """ Identifier assigned to the seller by the card network. Different card networks may assign different network_id fields to the same merchant. """ postal_code: NotRequired[str] """ Postal code where the seller is located """ state: NotRequired[str] """ State where the seller is located """ terminal_id: NotRequired[str] """ An ID assigned by the seller to the location of the sale. """ url: NotRequired[str] """ URL provided by the merchant on a 3DS request """ class CreateUnlinkedRefundParamsPurchaseDetails(TypedDict): fleet: NotRequired[ "Transaction.CreateUnlinkedRefundParamsPurchaseDetailsFleet" ] """ Fleet-specific information for transactions using Fleet cards. """ flight: NotRequired[ "Transaction.CreateUnlinkedRefundParamsPurchaseDetailsFlight" ] """ Information about the flight that was purchased with this transaction. """ fuel: NotRequired[ "Transaction.CreateUnlinkedRefundParamsPurchaseDetailsFuel" ] """ Information about fuel that was purchased with this transaction. """ lodging: NotRequired[ "Transaction.CreateUnlinkedRefundParamsPurchaseDetailsLodging" ] """ Information about lodging that was purchased with this transaction. """ receipt: NotRequired[ List[ "Transaction.CreateUnlinkedRefundParamsPurchaseDetailsReceipt" ] ] """ The line items in the purchase. """ reference: NotRequired[str] """ A merchant-specific order number. """ class CreateUnlinkedRefundParamsPurchaseDetailsFleet(TypedDict): cardholder_prompt_data: NotRequired[ "Transaction.CreateUnlinkedRefundParamsPurchaseDetailsFleetCardholderPromptData" ] """ Answers to prompts presented to the cardholder at the point of sale. Prompted fields vary depending on the configuration of your physical fleet cards. Typical points of sale support only numeric entry. """ purchase_type: NotRequired[ Literal[ "fuel_and_non_fuel_purchase", "fuel_purchase", "non_fuel_purchase", ] ] """ The type of purchase. One of `fuel_purchase`, `non_fuel_purchase`, or `fuel_and_non_fuel_purchase`. """ reported_breakdown: NotRequired[ "Transaction.CreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdown" ] """ More information about the total amount. This information is not guaranteed to be accurate as some merchants may provide unreliable data. """ service_type: NotRequired[ Literal["full_service", "non_fuel_transaction", "self_service"] ] """ The type of fuel service. One of `non_fuel_transaction`, `full_service`, or `self_service`. """ class CreateUnlinkedRefundParamsPurchaseDetailsFleetCardholderPromptData( TypedDict, ): driver_id: NotRequired[str] """ Driver ID. """ odometer: NotRequired[int] """ Odometer reading. """ unspecified_id: NotRequired[str] """ An alphanumeric ID. This field is used when a vehicle ID, driver ID, or generic ID is entered by the cardholder, but the merchant or card network did not specify the prompt type. """ user_id: NotRequired[str] """ User ID. """ vehicle_number: NotRequired[str] """ Vehicle number. """ class CreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdown( TypedDict, ): fuel: NotRequired[ "Transaction.CreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdownFuel" ] """ Breakdown of fuel portion of the purchase. """ non_fuel: NotRequired[ "Transaction.CreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdownNonFuel" ] """ Breakdown of non-fuel portion of the purchase. """ tax: NotRequired[ "Transaction.CreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdownTax" ] """ Information about tax included in this transaction. """ class CreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdownFuel( TypedDict, ): gross_amount_decimal: NotRequired[str] """ Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. """ class CreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdownNonFuel( TypedDict, ): gross_amount_decimal: NotRequired[str] """ Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes. """ class CreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdownTax( TypedDict, ): local_amount_decimal: NotRequired[str] """ Amount of state or provincial Sales Tax included in the transaction amount. Null if not reported by merchant or not subject to tax. """ national_amount_decimal: NotRequired[str] """ Amount of national Sales Tax or VAT included in the transaction amount. Null if not reported by merchant or not subject to tax. """ class CreateUnlinkedRefundParamsPurchaseDetailsFlight(TypedDict): departure_at: NotRequired[int] """ The time that the flight departed. """ passenger_name: NotRequired[str] """ The name of the passenger. """ refundable: NotRequired[bool] """ Whether the ticket is refundable. """ segments: NotRequired[ List[ "Transaction.CreateUnlinkedRefundParamsPurchaseDetailsFlightSegment" ] ] """ The legs of the trip. """ travel_agency: NotRequired[str] """ The travel agency that issued the ticket. """ class CreateUnlinkedRefundParamsPurchaseDetailsFlightSegment(TypedDict): arrival_airport_code: NotRequired[str] """ The three-letter IATA airport code of the flight's destination. """ carrier: NotRequired[str] """ The airline carrier code. """ departure_airport_code: NotRequired[str] """ The three-letter IATA airport code that the flight departed from. """ flight_number: NotRequired[str] """ The flight number. """ service_class: NotRequired[str] """ The flight's service class. """ stopover_allowed: NotRequired[bool] """ Whether a stopover is allowed on this flight. """ class CreateUnlinkedRefundParamsPurchaseDetailsFuel(TypedDict): industry_product_code: NotRequired[str] """ [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased. """ quantity_decimal: NotRequired[str] """ The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places. """ type: NotRequired[ Literal[ "diesel", "other", "unleaded_plus", "unleaded_regular", "unleaded_super", ] ] """ The type of fuel that was purchased. One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. """ unit: NotRequired[ Literal[ "charging_minute", "imperial_gallon", "kilogram", "kilowatt_hour", "liter", "other", "pound", "us_gallon", ] ] """ The units for `quantity_decimal`. One of `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `liter`, `pound`, `us_gallon`, or `other`. """ unit_cost_decimal: NotRequired[str] """ The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. """ class CreateUnlinkedRefundParamsPurchaseDetailsLodging(TypedDict): check_in_at: NotRequired[int] """ The time of checking into the lodging. """ nights: NotRequired[int] """ The number of nights stayed at the lodging. """ class CreateUnlinkedRefundParamsPurchaseDetailsReceipt(TypedDict): description: NotRequired[str] quantity: NotRequired[str] total: NotRequired[int] unit_cost: NotRequired[int] class ListParams(RequestOptions): card: NotRequired[str] """ Only return transactions that belong to the given card. """ cardholder: NotRequired[str] """ Only return transactions that belong to the given cardholder. """ created: NotRequired["Transaction.ListParamsCreated|int"] """ Only return transactions that were created during the given date interval. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ type: NotRequired[Literal["capture", "refund"]] """ Only return transactions that have the given type. One of `capture` or `refund`. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ class RefundParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ refund_amount: NotRequired[int] """ The total amount to attempt to refund. This amount is in the provided currency, or defaults to the cards currency, and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ amount: int """ The transaction amount, which will be reflected in your balance. This amount is in your currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ amount_details: Optional[AmountDetails] """ Detailed breakdown of amount components. These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ authorization: Optional[ExpandableField["Authorization"]] """ The `Authorization` object that led to this transaction. """ balance_transaction: Optional[ExpandableField["BalanceTransaction"]] """ ID of the [balance transaction](https://stripe.com/docs/api/balance_transactions) associated with this transaction. """ card: ExpandableField["Card"] """ The card used to make this transaction. """ cardholder: Optional[ExpandableField["Cardholder"]] """ The cardholder to whom this transaction belongs. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ 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). """ dispute: Optional[ExpandableField["Dispute"]] """ If you've disputed the transaction, the ID of the dispute. """ id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ merchant_amount: int """ The amount that the merchant will receive, denominated in `merchant_currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). It will be different from `amount` if the merchant is taking payment in a different currency. """ merchant_currency: str """ The currency with which the merchant is taking payment. """ merchant_data: MerchantData metadata: Dict[str, str] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ network_data: Optional[NetworkData] """ Details about the transaction, such as processing dates, set by the card network. """ object: Literal["issuing.transaction"] """ String representing the object's type. Objects of the same type share the same value. """ purchase_details: Optional[PurchaseDetails] """ Additional purchase information that is optionally provided by the merchant. """ token: Optional[ExpandableField["Token"]] """ [Token](https://stripe.com/docs/api/issuing/tokens/object) object used for this transaction. If a network token was not used for this transaction, this field will be null. """ treasury: Optional[Treasury] """ [Treasury](https://stripe.com/docs/api/treasury) details related to this transaction if it was created on a [FinancialAccount](/docs/api/treasury/financial_accounts """ type: Literal["capture", "refund"] """ The nature of the transaction. """ wallet: Optional[Literal["apple_pay", "google_pay", "samsung_pay"]] """ The digital wallet used for this transaction. One of `apple_pay`, `google_pay`, or `samsung_pay`. """ @classmethod def list( cls, **params: Unpack["Transaction.ListParams"] ) -> ListObject["Transaction"]: """ Returns a list of Issuing Transaction objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["Transaction.ListParams"] ) -> ListObject["Transaction"]: """ Returns a list of Issuing Transaction objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def modify( cls, id: str, **params: Unpack["Transaction.ModifyParams"] ) -> "Transaction": """ Updates the specified Issuing Transaction object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Transaction", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["Transaction.ModifyParams"] ) -> "Transaction": """ Updates the specified Issuing Transaction object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Transaction", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["Transaction.RetrieveParams"] ) -> "Transaction": """ Retrieves an Issuing Transaction object. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["Transaction.RetrieveParams"] ) -> "Transaction": """ Retrieves an Issuing Transaction object. """ instance = cls(id, **params) await instance.refresh_async() return instance class TestHelpers(APIResourceTestHelpers["Transaction"]): _resource_cls: Type["Transaction"] @classmethod def create_force_capture( cls, **params: Unpack["Transaction.CreateForceCaptureParams"] ) -> "Transaction": """ Allows the user to capture an arbitrary amount, also known as a forced capture. """ return cast( "Transaction", cls._static_request( "post", "/v1/test_helpers/issuing/transactions/create_force_capture", params=params, ), ) @classmethod async def create_force_capture_async( cls, **params: Unpack["Transaction.CreateForceCaptureParams"] ) -> "Transaction": """ Allows the user to capture an arbitrary amount, also known as a forced capture. """ return cast( "Transaction", await cls._static_request_async( "post", "/v1/test_helpers/issuing/transactions/create_force_capture", params=params, ), ) @classmethod def create_unlinked_refund( cls, **params: Unpack["Transaction.CreateUnlinkedRefundParams"] ) -> "Transaction": """ Allows the user to refund an arbitrary amount, also known as a unlinked refund. """ return cast( "Transaction", cls._static_request( "post", "/v1/test_helpers/issuing/transactions/create_unlinked_refund", params=params, ), ) @classmethod async def create_unlinked_refund_async( cls, **params: Unpack["Transaction.CreateUnlinkedRefundParams"] ) -> "Transaction": """ Allows the user to refund an arbitrary amount, also known as a unlinked refund. """ return cast( "Transaction", await cls._static_request_async( "post", "/v1/test_helpers/issuing/transactions/create_unlinked_refund", params=params, ), ) @classmethod def _cls_refund( cls, transaction: str, **params: Unpack["Transaction.RefundParams"] ) -> "Transaction": """ Refund a test-mode Transaction. """ return cast( "Transaction", cls._static_request( "post", "/v1/test_helpers/issuing/transactions/{transaction}/refund".format( transaction=sanitize_id(transaction) ), params=params, ), ) @overload @staticmethod def refund( transaction: str, **params: Unpack["Transaction.RefundParams"] ) -> "Transaction": """ Refund a test-mode Transaction. """ ... @overload def refund( self, **params: Unpack["Transaction.RefundParams"] ) -> "Transaction": """ Refund a test-mode Transaction. """ ... @class_method_variant("_cls_refund") def refund( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Transaction.RefundParams"] ) -> "Transaction": """ Refund a test-mode Transaction. """ return cast( "Transaction", self.resource._request( "post", "/v1/test_helpers/issuing/transactions/{transaction}/refund".format( transaction=sanitize_id(self.resource.get("id")) ), params=params, ), ) @classmethod async def _cls_refund_async( cls, transaction: str, **params: Unpack["Transaction.RefundParams"] ) -> "Transaction": """ Refund a test-mode Transaction. """ return cast( "Transaction", await cls._static_request_async( "post", "/v1/test_helpers/issuing/transactions/{transaction}/refund".format( transaction=sanitize_id(transaction) ), params=params, ), ) @overload @staticmethod async def refund_async( transaction: str, **params: Unpack["Transaction.RefundParams"] ) -> "Transaction": """ Refund a test-mode Transaction. """ ... @overload async def refund_async( self, **params: Unpack["Transaction.RefundParams"] ) -> "Transaction": """ Refund a test-mode Transaction. """ ... @class_method_variant("_cls_refund_async") async def refund_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Transaction.RefundParams"] ) -> "Transaction": """ Refund a test-mode Transaction. """ return cast( "Transaction", await self.resource._request_async( "post", "/v1/test_helpers/issuing/transactions/{transaction}/refund".format( transaction=sanitize_id(self.resource.get("id")) ), params=params, ), ) @property def test_helpers(self): return self.TestHelpers(self) _inner_class_types = { "amount_details": AmountDetails, "merchant_data": MerchantData, "network_data": NetworkData, "purchase_details": PurchaseDetails, "treasury": Treasury, } Transaction.TestHelpers._resource_cls = Transaction ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/issuing/_transaction_service.py0000644000175100001770000001645414637354563022303 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.issuing._transaction import Transaction from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class TransactionService(StripeService): class ListParams(TypedDict): card: NotRequired[str] """ Only return transactions that belong to the given card. """ cardholder: NotRequired[str] """ Only return transactions that belong to the given cardholder. """ created: NotRequired["TransactionService.ListParamsCreated|int"] """ Only return transactions that were created during the given date interval. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ type: NotRequired[Literal["capture", "refund"]] """ Only return transactions that have the given type. One of `capture` or `refund`. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ def list( self, params: "TransactionService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Transaction]: """ Returns a list of Issuing Transaction objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. """ return cast( ListObject[Transaction], self._request( "get", "/v1/issuing/transactions", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "TransactionService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Transaction]: """ Returns a list of Issuing Transaction objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. """ return cast( ListObject[Transaction], await self._request_async( "get", "/v1/issuing/transactions", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, transaction: str, params: "TransactionService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Transaction: """ Retrieves an Issuing Transaction object. """ return cast( Transaction, self._request( "get", "/v1/issuing/transactions/{transaction}".format( transaction=sanitize_id(transaction), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, transaction: str, params: "TransactionService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Transaction: """ Retrieves an Issuing Transaction object. """ return cast( Transaction, await self._request_async( "get", "/v1/issuing/transactions/{transaction}".format( transaction=sanitize_id(transaction), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, transaction: str, params: "TransactionService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Transaction: """ Updates the specified Issuing Transaction object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. """ return cast( Transaction, self._request( "post", "/v1/issuing/transactions/{transaction}".format( transaction=sanitize_id(transaction), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, transaction: str, params: "TransactionService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Transaction: """ Updates the specified Issuing Transaction object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. """ return cast( Transaction, await self._request_async( "post", "/v1/issuing/transactions/{transaction}".format( transaction=sanitize_id(transaction), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/multipart_data_generator.py0000644000175100001770000000055614637354563021472 0ustar00runnerdocker# -*- coding: utf-8 -*- from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.multipart_data_generator package is deprecated and will become internal in the future. """, DeprecationWarning, ) if not TYPE_CHECKING: from stripe._multipart_data_generator import ( # noqa MultipartDataGenerator, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/oauth.py0000644000175100001770000000066714637354563015535 0ustar00runnerdocker# -*- coding: utf-8 -*- from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.oauth package is deprecated, please change your imports to import from stripe directly. From: from stripe.oauth import OAuth To: from stripe import OAuth """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._oauth import ( # noqa OAuth, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/oauth_error.py0000644000175100001770000000204214637354563016733 0ustar00runnerdocker# Used for global variables import stripe # noqa: IMP101 from stripe._error import StripeError class OAuthError(StripeError): def __init__( self, code, description, http_body=None, http_status=None, json_body=None, headers=None, ): super(OAuthError, self).__init__( description, http_body, http_status, json_body, headers, code ) def _construct_error_object(self): if self.json_body is None: return None return stripe.error_object.OAuthErrorObject._construct_from( # pyright: ignore values=self.json_body, requestor=stripe._APIRequestor._global_instance(), api_mode="V1", ) class InvalidClientError(OAuthError): pass class InvalidGrantError(OAuthError): pass class InvalidRequestError(OAuthError): pass class InvalidScopeError(OAuthError): pass class UnsupportedGrantTypeError(OAuthError): pass class UnsupportedResponseTypeError(OAuthError): pass ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/py.typed0000644000175100001770000000000014637354563015517 0ustar00runnerdocker././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5449405 stripe-10.1.0/stripe/radar/0000755000175100001770000000000014637354616015122 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/radar/__init__.py0000644000175100001770000000113114637354563017230 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe.radar._early_fraud_warning import ( EarlyFraudWarning as EarlyFraudWarning, ) from stripe.radar._early_fraud_warning_service import ( EarlyFraudWarningService as EarlyFraudWarningService, ) from stripe.radar._value_list import ValueList as ValueList from stripe.radar._value_list_item import ValueListItem as ValueListItem from stripe.radar._value_list_item_service import ( ValueListItemService as ValueListItemService, ) from stripe.radar._value_list_service import ( ValueListService as ValueListService, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/radar/_early_fraud_warning.py0000644000175100001770000001462014637354563021661 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from typing import ClassVar, List, Optional from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._charge import Charge from stripe._payment_intent import PaymentIntent class EarlyFraudWarning(ListableAPIResource["EarlyFraudWarning"]): """ An early fraud warning indicates that the card issuer has notified us that a charge may be fraudulent. Related guide: [Early fraud warnings](https://stripe.com/docs/disputes/measuring#early-fraud-warnings) """ OBJECT_NAME: ClassVar[Literal["radar.early_fraud_warning"]] = ( "radar.early_fraud_warning" ) class ListParams(RequestOptions): charge: NotRequired[str] """ Only return early fraud warnings for the charge specified by this charge ID. """ created: NotRequired["EarlyFraudWarning.ListParamsCreated|int"] """ Only return early fraud warnings that were created during the given date interval. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ payment_intent: NotRequired[str] """ Only return early fraud warnings for charges that were created by the PaymentIntent specified by this PaymentIntent ID. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ actionable: bool """ An EFW is actionable if it has not received a dispute and has not been fully refunded. You may wish to proactively refund a charge that receives an EFW, in order to avoid receiving a dispute later. """ charge: ExpandableField["Charge"] """ ID of the charge this early fraud warning is for, optionally expanded. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ fraud_type: str """ The type of fraud labelled by the issuer. One of `card_never_received`, `fraudulent_card_application`, `made_with_counterfeit_card`, `made_with_lost_card`, `made_with_stolen_card`, `misc`, `unauthorized_use_of_card`. """ id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ object: Literal["radar.early_fraud_warning"] """ String representing the object's type. Objects of the same type share the same value. """ payment_intent: Optional[ExpandableField["PaymentIntent"]] """ ID of the Payment Intent this early fraud warning is for, optionally expanded. """ @classmethod def list( cls, **params: Unpack["EarlyFraudWarning.ListParams"] ) -> ListObject["EarlyFraudWarning"]: """ Returns a list of early fraud warnings. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["EarlyFraudWarning.ListParams"] ) -> ListObject["EarlyFraudWarning"]: """ Returns a list of early fraud warnings. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def retrieve( cls, id: str, **params: Unpack["EarlyFraudWarning.RetrieveParams"] ) -> "EarlyFraudWarning": """ Retrieves the details of an early fraud warning that has previously been created. Please refer to the [early fraud warning](https://stripe.com/docs/api#early_fraud_warning_object) object reference for more details. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["EarlyFraudWarning.RetrieveParams"] ) -> "EarlyFraudWarning": """ Retrieves the details of an early fraud warning that has previously been created. Please refer to the [early fraud warning](https://stripe.com/docs/api#early_fraud_warning_object) object reference for more details. """ instance = cls(id, **params) await instance.refresh_async() return instance ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/radar/_early_fraud_warning_service.py0000644000175100001770000001271614637354563023405 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.radar._early_fraud_warning import EarlyFraudWarning from typing import List, cast from typing_extensions import NotRequired, TypedDict class EarlyFraudWarningService(StripeService): class ListParams(TypedDict): charge: NotRequired[str] """ Only return early fraud warnings for the charge specified by this charge ID. """ created: NotRequired["EarlyFraudWarningService.ListParamsCreated|int"] """ Only return early fraud warnings that were created during the given date interval. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ payment_intent: NotRequired[str] """ Only return early fraud warnings for charges that were created by the PaymentIntent specified by this PaymentIntent ID. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def list( self, params: "EarlyFraudWarningService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[EarlyFraudWarning]: """ Returns a list of early fraud warnings. """ return cast( ListObject[EarlyFraudWarning], self._request( "get", "/v1/radar/early_fraud_warnings", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "EarlyFraudWarningService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[EarlyFraudWarning]: """ Returns a list of early fraud warnings. """ return cast( ListObject[EarlyFraudWarning], await self._request_async( "get", "/v1/radar/early_fraud_warnings", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, early_fraud_warning: str, params: "EarlyFraudWarningService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> EarlyFraudWarning: """ Retrieves the details of an early fraud warning that has previously been created. Please refer to the [early fraud warning](https://stripe.com/docs/api#early_fraud_warning_object) object reference for more details. """ return cast( EarlyFraudWarning, self._request( "get", "/v1/radar/early_fraud_warnings/{early_fraud_warning}".format( early_fraud_warning=sanitize_id(early_fraud_warning), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, early_fraud_warning: str, params: "EarlyFraudWarningService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> EarlyFraudWarning: """ Retrieves the details of an early fraud warning that has previously been created. Please refer to the [early fraud warning](https://stripe.com/docs/api#early_fraud_warning_object) object reference for more details. """ return cast( EarlyFraudWarning, await self._request_async( "get", "/v1/radar/early_fraud_warnings/{early_fraud_warning}".format( early_fraud_warning=sanitize_id(early_fraud_warning), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/radar/_value_list.py0000644000175100001770000003441114637354563020006 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._deletable_api_resource import DeletableAPIResource from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe.radar._value_list_item import ValueListItem class ValueList( CreateableAPIResource["ValueList"], DeletableAPIResource["ValueList"], ListableAPIResource["ValueList"], UpdateableAPIResource["ValueList"], ): """ Value lists allow you to group values together which can then be referenced in rules. Related guide: [Default Stripe lists](https://stripe.com/docs/radar/lists#managing-list-items) """ OBJECT_NAME: ClassVar[Literal["radar.value_list"]] = "radar.value_list" class CreateParams(RequestOptions): alias: str """ The name of the value list for use in rules. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ item_type: NotRequired[ Literal[ "card_bin", "card_fingerprint", "case_sensitive_string", "country", "customer_id", "email", "ip_address", "sepa_debit_fingerprint", "string", "us_bank_account_fingerprint", ] ] """ Type of the items in the value list. One of `card_fingerprint`, `us_bank_account_fingerprint`, `sepa_debit_fingerprint`, `card_bin`, `email`, `ip_address`, `country`, `string`, `case_sensitive_string`, or `customer_id`. Use `string` if the item type is unknown or mixed. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ name: str """ The human-readable name of the value list. """ class DeleteParams(RequestOptions): pass class ListParams(RequestOptions): alias: NotRequired[str] """ The alias used to reference the value list when writing rules. """ contains: NotRequired[str] """ A value contained within a value list - returns all value lists containing this value. """ created: NotRequired["ValueList.ListParamsCreated|int"] """ Only return value lists that were created during the given date interval. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): alias: NotRequired[str] """ The name of the value list for use in rules. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ name: NotRequired[str] """ The human-readable name of the value list. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ alias: str """ The name of the value list for use in rules. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ created_by: str """ The name or email address of the user who created this value list. """ id: str """ Unique identifier for the object. """ item_type: Literal[ "card_bin", "card_fingerprint", "case_sensitive_string", "country", "customer_id", "email", "ip_address", "sepa_debit_fingerprint", "string", "us_bank_account_fingerprint", ] """ The type of items in the value list. One of `card_fingerprint`, `us_bank_account_fingerprint`, `sepa_debit_fingerprint`, `card_bin`, `email`, `ip_address`, `country`, `string`, `case_sensitive_string`, or `customer_id`. """ list_items: ListObject["ValueListItem"] """ List of items contained within this value list. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ metadata: Dict[str, str] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ name: str """ The name of the value list. """ object: Literal["radar.value_list"] """ String representing the object's type. Objects of the same type share the same value. """ deleted: Optional[Literal[True]] """ Always true for a deleted object """ @classmethod def create(cls, **params: Unpack["ValueList.CreateParams"]) -> "ValueList": """ Creates a new ValueList object, which can then be referenced in rules. """ return cast( "ValueList", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["ValueList.CreateParams"] ) -> "ValueList": """ Creates a new ValueList object, which can then be referenced in rules. """ return cast( "ValueList", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def _cls_delete( cls, sid: str, **params: Unpack["ValueList.DeleteParams"] ) -> "ValueList": """ Deletes a ValueList object, also deleting any items contained within the value list. To be deleted, a value list must not be referenced in any rules. """ url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "ValueList", cls._static_request( "delete", url, params=params, ), ) @overload @staticmethod def delete( sid: str, **params: Unpack["ValueList.DeleteParams"] ) -> "ValueList": """ Deletes a ValueList object, also deleting any items contained within the value list. To be deleted, a value list must not be referenced in any rules. """ ... @overload def delete( self, **params: Unpack["ValueList.DeleteParams"] ) -> "ValueList": """ Deletes a ValueList object, also deleting any items contained within the value list. To be deleted, a value list must not be referenced in any rules. """ ... @class_method_variant("_cls_delete") def delete( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["ValueList.DeleteParams"] ) -> "ValueList": """ Deletes a ValueList object, also deleting any items contained within the value list. To be deleted, a value list must not be referenced in any rules. """ return self._request_and_refresh( "delete", self.instance_url(), params=params, ) @classmethod async def _cls_delete_async( cls, sid: str, **params: Unpack["ValueList.DeleteParams"] ) -> "ValueList": """ Deletes a ValueList object, also deleting any items contained within the value list. To be deleted, a value list must not be referenced in any rules. """ url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "ValueList", await cls._static_request_async( "delete", url, params=params, ), ) @overload @staticmethod async def delete_async( sid: str, **params: Unpack["ValueList.DeleteParams"] ) -> "ValueList": """ Deletes a ValueList object, also deleting any items contained within the value list. To be deleted, a value list must not be referenced in any rules. """ ... @overload async def delete_async( self, **params: Unpack["ValueList.DeleteParams"] ) -> "ValueList": """ Deletes a ValueList object, also deleting any items contained within the value list. To be deleted, a value list must not be referenced in any rules. """ ... @class_method_variant("_cls_delete_async") async def delete_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["ValueList.DeleteParams"] ) -> "ValueList": """ Deletes a ValueList object, also deleting any items contained within the value list. To be deleted, a value list must not be referenced in any rules. """ return await self._request_and_refresh_async( "delete", self.instance_url(), params=params, ) @classmethod def list( cls, **params: Unpack["ValueList.ListParams"] ) -> ListObject["ValueList"]: """ Returns a list of ValueList objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["ValueList.ListParams"] ) -> ListObject["ValueList"]: """ Returns a list of ValueList objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def modify( cls, id: str, **params: Unpack["ValueList.ModifyParams"] ) -> "ValueList": """ Updates a ValueList object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Note that item_type is immutable. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "ValueList", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["ValueList.ModifyParams"] ) -> "ValueList": """ Updates a ValueList object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Note that item_type is immutable. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "ValueList", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["ValueList.RetrieveParams"] ) -> "ValueList": """ Retrieves a ValueList object. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["ValueList.RetrieveParams"] ) -> "ValueList": """ Retrieves a ValueList object. """ instance = cls(id, **params) await instance.refresh_async() return instance ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/radar/_value_list_item.py0000644000175100001770000002374114637354563021030 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._deletable_api_resource import DeletableAPIResource from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, List, Optional, cast, overload from typing_extensions import Literal, NotRequired, TypedDict, Unpack class ValueListItem( CreateableAPIResource["ValueListItem"], DeletableAPIResource["ValueListItem"], ListableAPIResource["ValueListItem"], ): """ Value list items allow you to add specific values to a given Radar value list, which can then be used in rules. Related guide: [Managing list items](https://stripe.com/docs/radar/lists#managing-list-items) """ OBJECT_NAME: ClassVar[Literal["radar.value_list_item"]] = ( "radar.value_list_item" ) class CreateParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ value: str """ The value of the item (whose type must match the type of the parent value list). """ value_list: str """ The identifier of the value list which the created item will be added to. """ class DeleteParams(RequestOptions): pass class ListParams(RequestOptions): created: NotRequired["ValueListItem.ListParamsCreated|int"] """ Only return items that were created during the given date interval. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ value: NotRequired[str] """ Return items belonging to the parent list whose value matches the specified value (using an "is like" match). """ value_list: str """ Identifier for the parent value list this item belongs to. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ created_by: str """ The name or email address of the user who added this item to the value list. """ id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ object: Literal["radar.value_list_item"] """ String representing the object's type. Objects of the same type share the same value. """ value: str """ The value of the item. """ value_list: str """ The identifier of the value list this item belongs to. """ deleted: Optional[Literal[True]] """ Always true for a deleted object """ @classmethod def create( cls, **params: Unpack["ValueListItem.CreateParams"] ) -> "ValueListItem": """ Creates a new ValueListItem object, which is added to the specified parent value list. """ return cast( "ValueListItem", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["ValueListItem.CreateParams"] ) -> "ValueListItem": """ Creates a new ValueListItem object, which is added to the specified parent value list. """ return cast( "ValueListItem", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def _cls_delete( cls, sid: str, **params: Unpack["ValueListItem.DeleteParams"] ) -> "ValueListItem": """ Deletes a ValueListItem object, removing it from its parent value list. """ url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "ValueListItem", cls._static_request( "delete", url, params=params, ), ) @overload @staticmethod def delete( sid: str, **params: Unpack["ValueListItem.DeleteParams"] ) -> "ValueListItem": """ Deletes a ValueListItem object, removing it from its parent value list. """ ... @overload def delete( self, **params: Unpack["ValueListItem.DeleteParams"] ) -> "ValueListItem": """ Deletes a ValueListItem object, removing it from its parent value list. """ ... @class_method_variant("_cls_delete") def delete( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["ValueListItem.DeleteParams"] ) -> "ValueListItem": """ Deletes a ValueListItem object, removing it from its parent value list. """ return self._request_and_refresh( "delete", self.instance_url(), params=params, ) @classmethod async def _cls_delete_async( cls, sid: str, **params: Unpack["ValueListItem.DeleteParams"] ) -> "ValueListItem": """ Deletes a ValueListItem object, removing it from its parent value list. """ url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "ValueListItem", await cls._static_request_async( "delete", url, params=params, ), ) @overload @staticmethod async def delete_async( sid: str, **params: Unpack["ValueListItem.DeleteParams"] ) -> "ValueListItem": """ Deletes a ValueListItem object, removing it from its parent value list. """ ... @overload async def delete_async( self, **params: Unpack["ValueListItem.DeleteParams"] ) -> "ValueListItem": """ Deletes a ValueListItem object, removing it from its parent value list. """ ... @class_method_variant("_cls_delete_async") async def delete_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["ValueListItem.DeleteParams"] ) -> "ValueListItem": """ Deletes a ValueListItem object, removing it from its parent value list. """ return await self._request_and_refresh_async( "delete", self.instance_url(), params=params, ) @classmethod def list( cls, **params: Unpack["ValueListItem.ListParams"] ) -> ListObject["ValueListItem"]: """ Returns a list of ValueListItem objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["ValueListItem.ListParams"] ) -> ListObject["ValueListItem"]: """ Returns a list of ValueListItem objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def retrieve( cls, id: str, **params: Unpack["ValueListItem.RetrieveParams"] ) -> "ValueListItem": """ Retrieves a ValueListItem object. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["ValueListItem.RetrieveParams"] ) -> "ValueListItem": """ Retrieves a ValueListItem object. """ instance = cls(id, **params) await instance.refresh_async() return instance ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/radar/_value_list_item_service.py0000644000175100001770000001770214637354563022550 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.radar._value_list_item import ValueListItem from typing import List, cast from typing_extensions import NotRequired, TypedDict class ValueListItemService(StripeService): class CreateParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ value: str """ The value of the item (whose type must match the type of the parent value list). """ value_list: str """ The identifier of the value list which the created item will be added to. """ class DeleteParams(TypedDict): pass class ListParams(TypedDict): created: NotRequired["ValueListItemService.ListParamsCreated|int"] """ Only return items that were created during the given date interval. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ value: NotRequired[str] """ Return items belonging to the parent list whose value matches the specified value (using an "is like" match). """ value_list: str """ Identifier for the parent value list this item belongs to. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def delete( self, item: str, params: "ValueListItemService.DeleteParams" = {}, options: RequestOptions = {}, ) -> ValueListItem: """ Deletes a ValueListItem object, removing it from its parent value list. """ return cast( ValueListItem, self._request( "delete", "/v1/radar/value_list_items/{item}".format( item=sanitize_id(item), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def delete_async( self, item: str, params: "ValueListItemService.DeleteParams" = {}, options: RequestOptions = {}, ) -> ValueListItem: """ Deletes a ValueListItem object, removing it from its parent value list. """ return cast( ValueListItem, await self._request_async( "delete", "/v1/radar/value_list_items/{item}".format( item=sanitize_id(item), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, item: str, params: "ValueListItemService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> ValueListItem: """ Retrieves a ValueListItem object. """ return cast( ValueListItem, self._request( "get", "/v1/radar/value_list_items/{item}".format( item=sanitize_id(item), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, item: str, params: "ValueListItemService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> ValueListItem: """ Retrieves a ValueListItem object. """ return cast( ValueListItem, await self._request_async( "get", "/v1/radar/value_list_items/{item}".format( item=sanitize_id(item), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def list( self, params: "ValueListItemService.ListParams", options: RequestOptions = {}, ) -> ListObject[ValueListItem]: """ Returns a list of ValueListItem objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. """ return cast( ListObject[ValueListItem], self._request( "get", "/v1/radar/value_list_items", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "ValueListItemService.ListParams", options: RequestOptions = {}, ) -> ListObject[ValueListItem]: """ Returns a list of ValueListItem objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. """ return cast( ListObject[ValueListItem], await self._request_async( "get", "/v1/radar/value_list_items", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "ValueListItemService.CreateParams", options: RequestOptions = {}, ) -> ValueListItem: """ Creates a new ValueListItem object, which is added to the specified parent value list. """ return cast( ValueListItem, self._request( "post", "/v1/radar/value_list_items", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "ValueListItemService.CreateParams", options: RequestOptions = {}, ) -> ValueListItem: """ Creates a new ValueListItem object, which is added to the specified parent value list. """ return cast( ValueListItem, await self._request_async( "post", "/v1/radar/value_list_items", api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/radar/_value_list_service.py0000644000175100001770000002642314637354563021532 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.radar._value_list import ValueList from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class ValueListService(StripeService): class CreateParams(TypedDict): alias: str """ The name of the value list for use in rules. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ item_type: NotRequired[ Literal[ "card_bin", "card_fingerprint", "case_sensitive_string", "country", "customer_id", "email", "ip_address", "sepa_debit_fingerprint", "string", "us_bank_account_fingerprint", ] ] """ Type of the items in the value list. One of `card_fingerprint`, `us_bank_account_fingerprint`, `sepa_debit_fingerprint`, `card_bin`, `email`, `ip_address`, `country`, `string`, `case_sensitive_string`, or `customer_id`. Use `string` if the item type is unknown or mixed. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ name: str """ The human-readable name of the value list. """ class DeleteParams(TypedDict): pass class ListParams(TypedDict): alias: NotRequired[str] """ The alias used to reference the value list when writing rules. """ contains: NotRequired[str] """ A value contained within a value list - returns all value lists containing this value. """ created: NotRequired["ValueListService.ListParamsCreated|int"] """ Only return value lists that were created during the given date interval. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): alias: NotRequired[str] """ The name of the value list for use in rules. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ name: NotRequired[str] """ The human-readable name of the value list. """ def delete( self, value_list: str, params: "ValueListService.DeleteParams" = {}, options: RequestOptions = {}, ) -> ValueList: """ Deletes a ValueList object, also deleting any items contained within the value list. To be deleted, a value list must not be referenced in any rules. """ return cast( ValueList, self._request( "delete", "/v1/radar/value_lists/{value_list}".format( value_list=sanitize_id(value_list), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def delete_async( self, value_list: str, params: "ValueListService.DeleteParams" = {}, options: RequestOptions = {}, ) -> ValueList: """ Deletes a ValueList object, also deleting any items contained within the value list. To be deleted, a value list must not be referenced in any rules. """ return cast( ValueList, await self._request_async( "delete", "/v1/radar/value_lists/{value_list}".format( value_list=sanitize_id(value_list), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, value_list: str, params: "ValueListService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> ValueList: """ Retrieves a ValueList object. """ return cast( ValueList, self._request( "get", "/v1/radar/value_lists/{value_list}".format( value_list=sanitize_id(value_list), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, value_list: str, params: "ValueListService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> ValueList: """ Retrieves a ValueList object. """ return cast( ValueList, await self._request_async( "get", "/v1/radar/value_lists/{value_list}".format( value_list=sanitize_id(value_list), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, value_list: str, params: "ValueListService.UpdateParams" = {}, options: RequestOptions = {}, ) -> ValueList: """ Updates a ValueList object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Note that item_type is immutable. """ return cast( ValueList, self._request( "post", "/v1/radar/value_lists/{value_list}".format( value_list=sanitize_id(value_list), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, value_list: str, params: "ValueListService.UpdateParams" = {}, options: RequestOptions = {}, ) -> ValueList: """ Updates a ValueList object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. Note that item_type is immutable. """ return cast( ValueList, await self._request_async( "post", "/v1/radar/value_lists/{value_list}".format( value_list=sanitize_id(value_list), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def list( self, params: "ValueListService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[ValueList]: """ Returns a list of ValueList objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. """ return cast( ListObject[ValueList], self._request( "get", "/v1/radar/value_lists", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "ValueListService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[ValueList]: """ Returns a list of ValueList objects. The objects are sorted in descending order by creation date, with the most recently created object appearing first. """ return cast( ListObject[ValueList], await self._request_async( "get", "/v1/radar/value_lists", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "ValueListService.CreateParams", options: RequestOptions = {}, ) -> ValueList: """ Creates a new ValueList object, which can then be referenced in rules. """ return cast( ValueList, self._request( "post", "/v1/radar/value_lists", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "ValueListService.CreateParams", options: RequestOptions = {}, ) -> ValueList: """ Creates a new ValueList object, which can then be referenced in rules. """ return cast( ValueList, await self._request_async( "post", "/v1/radar/value_lists", api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5449405 stripe-10.1.0/stripe/reporting/0000755000175100001770000000000014637354616016042 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/reporting/__init__.py0000644000175100001770000000060314637354563020153 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe.reporting._report_run import ReportRun as ReportRun from stripe.reporting._report_run_service import ( ReportRunService as ReportRunService, ) from stripe.reporting._report_type import ReportType as ReportType from stripe.reporting._report_type_service import ( ReportTypeService as ReportTypeService, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/reporting/_report_run.py0000644000175100001770000010024214637354563020752 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from typing import ClassVar, List, Optional, cast from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._file import File class ReportRun( CreateableAPIResource["ReportRun"], ListableAPIResource["ReportRun"], ): """ The Report Run object represents an instance of a report type generated with specific run parameters. Once the object is created, Stripe begins processing the report. When the report has finished running, it will give you a reference to a file where you can retrieve your results. For an overview, see [API Access to Reports](https://stripe.com/docs/reporting/statements/api). Note that certain report types can only be run based on your live-mode data (not test-mode data), and will error when queried without a [live-mode API key](https://stripe.com/docs/keys#test-live-modes). """ OBJECT_NAME: ClassVar[Literal["reporting.report_run"]] = ( "reporting.report_run" ) class Parameters(StripeObject): columns: Optional[List[str]] """ The set of output columns requested for inclusion in the report run. """ connected_account: Optional[str] """ Connected account ID by which to filter the report run. """ currency: Optional[str] """ Currency of objects to be included in the report run. """ interval_end: Optional[int] """ Ending timestamp of data to be included in the report run. Can be any UTC timestamp between 1 second after the user specified `interval_start` and 1 second before this report's last `data_available_end` value. """ interval_start: Optional[int] """ Starting timestamp of data to be included in the report run. Can be any UTC timestamp between 1 second after this report's `data_available_start` and 1 second before the user specified `interval_end` value. """ payout: Optional[str] """ Payout ID by which to filter the report run. """ reporting_category: Optional[str] """ Category of balance transactions to be included in the report run. """ timezone: Optional[str] """ Defaults to `Etc/UTC`. The output timezone for all timestamps in the report. A list of possible time zone values is maintained at the [IANA Time Zone Database](http://www.iana.org/time-zones). Has no effect on `interval_start` or `interval_end`. """ class CreateParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ parameters: NotRequired["ReportRun.CreateParamsParameters"] """ Parameters specifying how the report should be run. Different Report Types have different required and optional parameters, listed in the [API Access to Reports](https://stripe.com/docs/reporting/statements/api) documentation. """ report_type: str """ The ID of the [report type](https://stripe.com/docs/reporting/statements/api#report-types) to run, such as `"balance.summary.1"`. """ class CreateParamsParameters(TypedDict): columns: NotRequired[List[str]] """ The set of report columns to include in the report output. If omitted, the Report Type is run with its default column set. """ connected_account: NotRequired[str] """ Connected account ID to filter for in the report run. """ currency: NotRequired[str] """ Currency of objects to be included in the report run. """ interval_end: NotRequired[int] """ Ending timestamp of data to be included in the report run (exclusive). """ interval_start: NotRequired[int] """ Starting timestamp of data to be included in the report run. """ payout: NotRequired[str] """ Payout ID by which to filter the report run. """ reporting_category: NotRequired[ Literal[ "advance", "advance_funding", "anticipation_repayment", "charge", "charge_failure", "climate_order_purchase", "climate_order_refund", "connect_collection_transfer", "connect_reserved_funds", "contribution", "dispute", "dispute_reversal", "fee", "financing_paydown", "financing_paydown_reversal", "financing_payout", "financing_payout_reversal", "issuing_authorization_hold", "issuing_authorization_release", "issuing_dispute", "issuing_transaction", "network_cost", "other_adjustment", "partial_capture_reversal", "payout", "payout_reversal", "platform_earning", "platform_earning_refund", "refund", "refund_failure", "risk_reserved_funds", "tax", "topup", "topup_reversal", "transfer", "transfer_reversal", "unreconciled_customer_funds", ] ] """ Category of balance transactions to be included in the report run. """ timezone: NotRequired[ Literal[ "Africa/Abidjan", "Africa/Accra", "Africa/Addis_Ababa", "Africa/Algiers", "Africa/Asmara", "Africa/Asmera", "Africa/Bamako", "Africa/Bangui", "Africa/Banjul", "Africa/Bissau", "Africa/Blantyre", "Africa/Brazzaville", "Africa/Bujumbura", "Africa/Cairo", "Africa/Casablanca", "Africa/Ceuta", "Africa/Conakry", "Africa/Dakar", "Africa/Dar_es_Salaam", "Africa/Djibouti", "Africa/Douala", "Africa/El_Aaiun", "Africa/Freetown", "Africa/Gaborone", "Africa/Harare", "Africa/Johannesburg", "Africa/Juba", "Africa/Kampala", "Africa/Khartoum", "Africa/Kigali", "Africa/Kinshasa", "Africa/Lagos", "Africa/Libreville", "Africa/Lome", "Africa/Luanda", "Africa/Lubumbashi", "Africa/Lusaka", "Africa/Malabo", "Africa/Maputo", "Africa/Maseru", "Africa/Mbabane", "Africa/Mogadishu", "Africa/Monrovia", "Africa/Nairobi", "Africa/Ndjamena", "Africa/Niamey", "Africa/Nouakchott", "Africa/Ouagadougou", "Africa/Porto-Novo", "Africa/Sao_Tome", "Africa/Timbuktu", "Africa/Tripoli", "Africa/Tunis", "Africa/Windhoek", "America/Adak", "America/Anchorage", "America/Anguilla", "America/Antigua", "America/Araguaina", "America/Argentina/Buenos_Aires", "America/Argentina/Catamarca", "America/Argentina/ComodRivadavia", "America/Argentina/Cordoba", "America/Argentina/Jujuy", "America/Argentina/La_Rioja", "America/Argentina/Mendoza", "America/Argentina/Rio_Gallegos", "America/Argentina/Salta", "America/Argentina/San_Juan", "America/Argentina/San_Luis", "America/Argentina/Tucuman", "America/Argentina/Ushuaia", "America/Aruba", "America/Asuncion", "America/Atikokan", "America/Atka", "America/Bahia", "America/Bahia_Banderas", "America/Barbados", "America/Belem", "America/Belize", "America/Blanc-Sablon", "America/Boa_Vista", "America/Bogota", "America/Boise", "America/Buenos_Aires", "America/Cambridge_Bay", "America/Campo_Grande", "America/Cancun", "America/Caracas", "America/Catamarca", "America/Cayenne", "America/Cayman", "America/Chicago", "America/Chihuahua", "America/Ciudad_Juarez", "America/Coral_Harbour", "America/Cordoba", "America/Costa_Rica", "America/Creston", "America/Cuiaba", "America/Curacao", "America/Danmarkshavn", "America/Dawson", "America/Dawson_Creek", "America/Denver", "America/Detroit", "America/Dominica", "America/Edmonton", "America/Eirunepe", "America/El_Salvador", "America/Ensenada", "America/Fort_Nelson", "America/Fort_Wayne", "America/Fortaleza", "America/Glace_Bay", "America/Godthab", "America/Goose_Bay", "America/Grand_Turk", "America/Grenada", "America/Guadeloupe", "America/Guatemala", "America/Guayaquil", "America/Guyana", "America/Halifax", "America/Havana", "America/Hermosillo", "America/Indiana/Indianapolis", "America/Indiana/Knox", "America/Indiana/Marengo", "America/Indiana/Petersburg", "America/Indiana/Tell_City", "America/Indiana/Vevay", "America/Indiana/Vincennes", "America/Indiana/Winamac", "America/Indianapolis", "America/Inuvik", "America/Iqaluit", "America/Jamaica", "America/Jujuy", "America/Juneau", "America/Kentucky/Louisville", "America/Kentucky/Monticello", "America/Knox_IN", "America/Kralendijk", "America/La_Paz", "America/Lima", "America/Los_Angeles", "America/Louisville", "America/Lower_Princes", "America/Maceio", "America/Managua", "America/Manaus", "America/Marigot", "America/Martinique", "America/Matamoros", "America/Mazatlan", "America/Mendoza", "America/Menominee", "America/Merida", "America/Metlakatla", "America/Mexico_City", "America/Miquelon", "America/Moncton", "America/Monterrey", "America/Montevideo", "America/Montreal", "America/Montserrat", "America/Nassau", "America/New_York", "America/Nipigon", "America/Nome", "America/Noronha", "America/North_Dakota/Beulah", "America/North_Dakota/Center", "America/North_Dakota/New_Salem", "America/Nuuk", "America/Ojinaga", "America/Panama", "America/Pangnirtung", "America/Paramaribo", "America/Phoenix", "America/Port-au-Prince", "America/Port_of_Spain", "America/Porto_Acre", "America/Porto_Velho", "America/Puerto_Rico", "America/Punta_Arenas", "America/Rainy_River", "America/Rankin_Inlet", "America/Recife", "America/Regina", "America/Resolute", "America/Rio_Branco", "America/Rosario", "America/Santa_Isabel", "America/Santarem", "America/Santiago", "America/Santo_Domingo", "America/Sao_Paulo", "America/Scoresbysund", "America/Shiprock", "America/Sitka", "America/St_Barthelemy", "America/St_Johns", "America/St_Kitts", "America/St_Lucia", "America/St_Thomas", "America/St_Vincent", "America/Swift_Current", "America/Tegucigalpa", "America/Thule", "America/Thunder_Bay", "America/Tijuana", "America/Toronto", "America/Tortola", "America/Vancouver", "America/Virgin", "America/Whitehorse", "America/Winnipeg", "America/Yakutat", "America/Yellowknife", "Antarctica/Casey", "Antarctica/Davis", "Antarctica/DumontDUrville", "Antarctica/Macquarie", "Antarctica/Mawson", "Antarctica/McMurdo", "Antarctica/Palmer", "Antarctica/Rothera", "Antarctica/South_Pole", "Antarctica/Syowa", "Antarctica/Troll", "Antarctica/Vostok", "Arctic/Longyearbyen", "Asia/Aden", "Asia/Almaty", "Asia/Amman", "Asia/Anadyr", "Asia/Aqtau", "Asia/Aqtobe", "Asia/Ashgabat", "Asia/Ashkhabad", "Asia/Atyrau", "Asia/Baghdad", "Asia/Bahrain", "Asia/Baku", "Asia/Bangkok", "Asia/Barnaul", "Asia/Beirut", "Asia/Bishkek", "Asia/Brunei", "Asia/Calcutta", "Asia/Chita", "Asia/Choibalsan", "Asia/Chongqing", "Asia/Chungking", "Asia/Colombo", "Asia/Dacca", "Asia/Damascus", "Asia/Dhaka", "Asia/Dili", "Asia/Dubai", "Asia/Dushanbe", "Asia/Famagusta", "Asia/Gaza", "Asia/Harbin", "Asia/Hebron", "Asia/Ho_Chi_Minh", "Asia/Hong_Kong", "Asia/Hovd", "Asia/Irkutsk", "Asia/Istanbul", "Asia/Jakarta", "Asia/Jayapura", "Asia/Jerusalem", "Asia/Kabul", "Asia/Kamchatka", "Asia/Karachi", "Asia/Kashgar", "Asia/Kathmandu", "Asia/Katmandu", "Asia/Khandyga", "Asia/Kolkata", "Asia/Krasnoyarsk", "Asia/Kuala_Lumpur", "Asia/Kuching", "Asia/Kuwait", "Asia/Macao", "Asia/Macau", "Asia/Magadan", "Asia/Makassar", "Asia/Manila", "Asia/Muscat", "Asia/Nicosia", "Asia/Novokuznetsk", "Asia/Novosibirsk", "Asia/Omsk", "Asia/Oral", "Asia/Phnom_Penh", "Asia/Pontianak", "Asia/Pyongyang", "Asia/Qatar", "Asia/Qostanay", "Asia/Qyzylorda", "Asia/Rangoon", "Asia/Riyadh", "Asia/Saigon", "Asia/Sakhalin", "Asia/Samarkand", "Asia/Seoul", "Asia/Shanghai", "Asia/Singapore", "Asia/Srednekolymsk", "Asia/Taipei", "Asia/Tashkent", "Asia/Tbilisi", "Asia/Tehran", "Asia/Tel_Aviv", "Asia/Thimbu", "Asia/Thimphu", "Asia/Tokyo", "Asia/Tomsk", "Asia/Ujung_Pandang", "Asia/Ulaanbaatar", "Asia/Ulan_Bator", "Asia/Urumqi", "Asia/Ust-Nera", "Asia/Vientiane", "Asia/Vladivostok", "Asia/Yakutsk", "Asia/Yangon", "Asia/Yekaterinburg", "Asia/Yerevan", "Atlantic/Azores", "Atlantic/Bermuda", "Atlantic/Canary", "Atlantic/Cape_Verde", "Atlantic/Faeroe", "Atlantic/Faroe", "Atlantic/Jan_Mayen", "Atlantic/Madeira", "Atlantic/Reykjavik", "Atlantic/South_Georgia", "Atlantic/St_Helena", "Atlantic/Stanley", "Australia/ACT", "Australia/Adelaide", "Australia/Brisbane", "Australia/Broken_Hill", "Australia/Canberra", "Australia/Currie", "Australia/Darwin", "Australia/Eucla", "Australia/Hobart", "Australia/LHI", "Australia/Lindeman", "Australia/Lord_Howe", "Australia/Melbourne", "Australia/NSW", "Australia/North", "Australia/Perth", "Australia/Queensland", "Australia/South", "Australia/Sydney", "Australia/Tasmania", "Australia/Victoria", "Australia/West", "Australia/Yancowinna", "Brazil/Acre", "Brazil/DeNoronha", "Brazil/East", "Brazil/West", "CET", "CST6CDT", "Canada/Atlantic", "Canada/Central", "Canada/Eastern", "Canada/Mountain", "Canada/Newfoundland", "Canada/Pacific", "Canada/Saskatchewan", "Canada/Yukon", "Chile/Continental", "Chile/EasterIsland", "Cuba", "EET", "EST", "EST5EDT", "Egypt", "Eire", "Etc/GMT", "Etc/GMT+0", "Etc/GMT+1", "Etc/GMT+10", "Etc/GMT+11", "Etc/GMT+12", "Etc/GMT+2", "Etc/GMT+3", "Etc/GMT+4", "Etc/GMT+5", "Etc/GMT+6", "Etc/GMT+7", "Etc/GMT+8", "Etc/GMT+9", "Etc/GMT-0", "Etc/GMT-1", "Etc/GMT-10", "Etc/GMT-11", "Etc/GMT-12", "Etc/GMT-13", "Etc/GMT-14", "Etc/GMT-2", "Etc/GMT-3", "Etc/GMT-4", "Etc/GMT-5", "Etc/GMT-6", "Etc/GMT-7", "Etc/GMT-8", "Etc/GMT-9", "Etc/GMT0", "Etc/Greenwich", "Etc/UCT", "Etc/UTC", "Etc/Universal", "Etc/Zulu", "Europe/Amsterdam", "Europe/Andorra", "Europe/Astrakhan", "Europe/Athens", "Europe/Belfast", "Europe/Belgrade", "Europe/Berlin", "Europe/Bratislava", "Europe/Brussels", "Europe/Bucharest", "Europe/Budapest", "Europe/Busingen", "Europe/Chisinau", "Europe/Copenhagen", "Europe/Dublin", "Europe/Gibraltar", "Europe/Guernsey", "Europe/Helsinki", "Europe/Isle_of_Man", "Europe/Istanbul", "Europe/Jersey", "Europe/Kaliningrad", "Europe/Kiev", "Europe/Kirov", "Europe/Kyiv", "Europe/Lisbon", "Europe/Ljubljana", "Europe/London", "Europe/Luxembourg", "Europe/Madrid", "Europe/Malta", "Europe/Mariehamn", "Europe/Minsk", "Europe/Monaco", "Europe/Moscow", "Europe/Nicosia", "Europe/Oslo", "Europe/Paris", "Europe/Podgorica", "Europe/Prague", "Europe/Riga", "Europe/Rome", "Europe/Samara", "Europe/San_Marino", "Europe/Sarajevo", "Europe/Saratov", "Europe/Simferopol", "Europe/Skopje", "Europe/Sofia", "Europe/Stockholm", "Europe/Tallinn", "Europe/Tirane", "Europe/Tiraspol", "Europe/Ulyanovsk", "Europe/Uzhgorod", "Europe/Vaduz", "Europe/Vatican", "Europe/Vienna", "Europe/Vilnius", "Europe/Volgograd", "Europe/Warsaw", "Europe/Zagreb", "Europe/Zaporozhye", "Europe/Zurich", "Factory", "GB", "GB-Eire", "GMT", "GMT+0", "GMT-0", "GMT0", "Greenwich", "HST", "Hongkong", "Iceland", "Indian/Antananarivo", "Indian/Chagos", "Indian/Christmas", "Indian/Cocos", "Indian/Comoro", "Indian/Kerguelen", "Indian/Mahe", "Indian/Maldives", "Indian/Mauritius", "Indian/Mayotte", "Indian/Reunion", "Iran", "Israel", "Jamaica", "Japan", "Kwajalein", "Libya", "MET", "MST", "MST7MDT", "Mexico/BajaNorte", "Mexico/BajaSur", "Mexico/General", "NZ", "NZ-CHAT", "Navajo", "PRC", "PST8PDT", "Pacific/Apia", "Pacific/Auckland", "Pacific/Bougainville", "Pacific/Chatham", "Pacific/Chuuk", "Pacific/Easter", "Pacific/Efate", "Pacific/Enderbury", "Pacific/Fakaofo", "Pacific/Fiji", "Pacific/Funafuti", "Pacific/Galapagos", "Pacific/Gambier", "Pacific/Guadalcanal", "Pacific/Guam", "Pacific/Honolulu", "Pacific/Johnston", "Pacific/Kanton", "Pacific/Kiritimati", "Pacific/Kosrae", "Pacific/Kwajalein", "Pacific/Majuro", "Pacific/Marquesas", "Pacific/Midway", "Pacific/Nauru", "Pacific/Niue", "Pacific/Norfolk", "Pacific/Noumea", "Pacific/Pago_Pago", "Pacific/Palau", "Pacific/Pitcairn", "Pacific/Pohnpei", "Pacific/Ponape", "Pacific/Port_Moresby", "Pacific/Rarotonga", "Pacific/Saipan", "Pacific/Samoa", "Pacific/Tahiti", "Pacific/Tarawa", "Pacific/Tongatapu", "Pacific/Truk", "Pacific/Wake", "Pacific/Wallis", "Pacific/Yap", "Poland", "Portugal", "ROC", "ROK", "Singapore", "Turkey", "UCT", "US/Alaska", "US/Aleutian", "US/Arizona", "US/Central", "US/East-Indiana", "US/Eastern", "US/Hawaii", "US/Indiana-Starke", "US/Michigan", "US/Mountain", "US/Pacific", "US/Pacific-New", "US/Samoa", "UTC", "Universal", "W-SU", "WET", "Zulu", ] ] """ Defaults to `Etc/UTC`. The output timezone for all timestamps in the report. A list of possible time zone values is maintained at the [IANA Time Zone Database](http://www.iana.org/time-zones). Has no effect on `interval_start` or `interval_end`. """ class ListParams(RequestOptions): created: NotRequired["ReportRun.ListParamsCreated|int"] """ Only return Report Runs that were created during the given date interval. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ error: Optional[str] """ If something should go wrong during the run, a message about the failure (populated when `status=failed`). """ id: str """ Unique identifier for the object. """ livemode: bool """ `true` if the report is run on live mode data and `false` if it is run on test mode data. """ object: Literal["reporting.report_run"] """ String representing the object's type. Objects of the same type share the same value. """ parameters: Parameters report_type: str """ The ID of the [report type](https://stripe.com/docs/reports/report-types) to run, such as `"balance.summary.1"`. """ result: Optional["File"] """ The file object representing the result of the report run (populated when `status=succeeded`). """ status: str """ Status of this report run. This will be `pending` when the run is initially created. When the run finishes, this will be set to `succeeded` and the `result` field will be populated. Rarely, we may encounter an error, at which point this will be set to `failed` and the `error` field will be populated. """ succeeded_at: Optional[int] """ Timestamp at which this run successfully finished (populated when `status=succeeded`). Measured in seconds since the Unix epoch. """ @classmethod def create(cls, **params: Unpack["ReportRun.CreateParams"]) -> "ReportRun": """ Creates a new object and begin running the report. (Certain report types require a [live-mode API key](https://stripe.com/docs/keys#test-live-modes).) """ return cast( "ReportRun", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["ReportRun.CreateParams"] ) -> "ReportRun": """ Creates a new object and begin running the report. (Certain report types require a [live-mode API key](https://stripe.com/docs/keys#test-live-modes).) """ return cast( "ReportRun", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def list( cls, **params: Unpack["ReportRun.ListParams"] ) -> ListObject["ReportRun"]: """ Returns a list of Report Runs, with the most recent appearing first. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["ReportRun.ListParams"] ) -> ListObject["ReportRun"]: """ Returns a list of Report Runs, with the most recent appearing first. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def retrieve( cls, id: str, **params: Unpack["ReportRun.RetrieveParams"] ) -> "ReportRun": """ Retrieves the details of an existing Report Run. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["ReportRun.RetrieveParams"] ) -> "ReportRun": """ Retrieves the details of an existing Report Run. """ instance = cls(id, **params) await instance.refresh_async() return instance _inner_class_types = {"parameters": Parameters} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/reporting/_report_run_service.py0000644000175100001770000007230414637354563022501 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.reporting._report_run import ReportRun from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict class ReportRunService(StripeService): class CreateParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ parameters: NotRequired["ReportRunService.CreateParamsParameters"] """ Parameters specifying how the report should be run. Different Report Types have different required and optional parameters, listed in the [API Access to Reports](https://stripe.com/docs/reporting/statements/api) documentation. """ report_type: str """ The ID of the [report type](https://stripe.com/docs/reporting/statements/api#report-types) to run, such as `"balance.summary.1"`. """ class CreateParamsParameters(TypedDict): columns: NotRequired[List[str]] """ The set of report columns to include in the report output. If omitted, the Report Type is run with its default column set. """ connected_account: NotRequired[str] """ Connected account ID to filter for in the report run. """ currency: NotRequired[str] """ Currency of objects to be included in the report run. """ interval_end: NotRequired[int] """ Ending timestamp of data to be included in the report run (exclusive). """ interval_start: NotRequired[int] """ Starting timestamp of data to be included in the report run. """ payout: NotRequired[str] """ Payout ID by which to filter the report run. """ reporting_category: NotRequired[ Literal[ "advance", "advance_funding", "anticipation_repayment", "charge", "charge_failure", "climate_order_purchase", "climate_order_refund", "connect_collection_transfer", "connect_reserved_funds", "contribution", "dispute", "dispute_reversal", "fee", "financing_paydown", "financing_paydown_reversal", "financing_payout", "financing_payout_reversal", "issuing_authorization_hold", "issuing_authorization_release", "issuing_dispute", "issuing_transaction", "network_cost", "other_adjustment", "partial_capture_reversal", "payout", "payout_reversal", "platform_earning", "platform_earning_refund", "refund", "refund_failure", "risk_reserved_funds", "tax", "topup", "topup_reversal", "transfer", "transfer_reversal", "unreconciled_customer_funds", ] ] """ Category of balance transactions to be included in the report run. """ timezone: NotRequired[ Literal[ "Africa/Abidjan", "Africa/Accra", "Africa/Addis_Ababa", "Africa/Algiers", "Africa/Asmara", "Africa/Asmera", "Africa/Bamako", "Africa/Bangui", "Africa/Banjul", "Africa/Bissau", "Africa/Blantyre", "Africa/Brazzaville", "Africa/Bujumbura", "Africa/Cairo", "Africa/Casablanca", "Africa/Ceuta", "Africa/Conakry", "Africa/Dakar", "Africa/Dar_es_Salaam", "Africa/Djibouti", "Africa/Douala", "Africa/El_Aaiun", "Africa/Freetown", "Africa/Gaborone", "Africa/Harare", "Africa/Johannesburg", "Africa/Juba", "Africa/Kampala", "Africa/Khartoum", "Africa/Kigali", "Africa/Kinshasa", "Africa/Lagos", "Africa/Libreville", "Africa/Lome", "Africa/Luanda", "Africa/Lubumbashi", "Africa/Lusaka", "Africa/Malabo", "Africa/Maputo", "Africa/Maseru", "Africa/Mbabane", "Africa/Mogadishu", "Africa/Monrovia", "Africa/Nairobi", "Africa/Ndjamena", "Africa/Niamey", "Africa/Nouakchott", "Africa/Ouagadougou", "Africa/Porto-Novo", "Africa/Sao_Tome", "Africa/Timbuktu", "Africa/Tripoli", "Africa/Tunis", "Africa/Windhoek", "America/Adak", "America/Anchorage", "America/Anguilla", "America/Antigua", "America/Araguaina", "America/Argentina/Buenos_Aires", "America/Argentina/Catamarca", "America/Argentina/ComodRivadavia", "America/Argentina/Cordoba", "America/Argentina/Jujuy", "America/Argentina/La_Rioja", "America/Argentina/Mendoza", "America/Argentina/Rio_Gallegos", "America/Argentina/Salta", "America/Argentina/San_Juan", "America/Argentina/San_Luis", "America/Argentina/Tucuman", "America/Argentina/Ushuaia", "America/Aruba", "America/Asuncion", "America/Atikokan", "America/Atka", "America/Bahia", "America/Bahia_Banderas", "America/Barbados", "America/Belem", "America/Belize", "America/Blanc-Sablon", "America/Boa_Vista", "America/Bogota", "America/Boise", "America/Buenos_Aires", "America/Cambridge_Bay", "America/Campo_Grande", "America/Cancun", "America/Caracas", "America/Catamarca", "America/Cayenne", "America/Cayman", "America/Chicago", "America/Chihuahua", "America/Ciudad_Juarez", "America/Coral_Harbour", "America/Cordoba", "America/Costa_Rica", "America/Creston", "America/Cuiaba", "America/Curacao", "America/Danmarkshavn", "America/Dawson", "America/Dawson_Creek", "America/Denver", "America/Detroit", "America/Dominica", "America/Edmonton", "America/Eirunepe", "America/El_Salvador", "America/Ensenada", "America/Fort_Nelson", "America/Fort_Wayne", "America/Fortaleza", "America/Glace_Bay", "America/Godthab", "America/Goose_Bay", "America/Grand_Turk", "America/Grenada", "America/Guadeloupe", "America/Guatemala", "America/Guayaquil", "America/Guyana", "America/Halifax", "America/Havana", "America/Hermosillo", "America/Indiana/Indianapolis", "America/Indiana/Knox", "America/Indiana/Marengo", "America/Indiana/Petersburg", "America/Indiana/Tell_City", "America/Indiana/Vevay", "America/Indiana/Vincennes", "America/Indiana/Winamac", "America/Indianapolis", "America/Inuvik", "America/Iqaluit", "America/Jamaica", "America/Jujuy", "America/Juneau", "America/Kentucky/Louisville", "America/Kentucky/Monticello", "America/Knox_IN", "America/Kralendijk", "America/La_Paz", "America/Lima", "America/Los_Angeles", "America/Louisville", "America/Lower_Princes", "America/Maceio", "America/Managua", "America/Manaus", "America/Marigot", "America/Martinique", "America/Matamoros", "America/Mazatlan", "America/Mendoza", "America/Menominee", "America/Merida", "America/Metlakatla", "America/Mexico_City", "America/Miquelon", "America/Moncton", "America/Monterrey", "America/Montevideo", "America/Montreal", "America/Montserrat", "America/Nassau", "America/New_York", "America/Nipigon", "America/Nome", "America/Noronha", "America/North_Dakota/Beulah", "America/North_Dakota/Center", "America/North_Dakota/New_Salem", "America/Nuuk", "America/Ojinaga", "America/Panama", "America/Pangnirtung", "America/Paramaribo", "America/Phoenix", "America/Port-au-Prince", "America/Port_of_Spain", "America/Porto_Acre", "America/Porto_Velho", "America/Puerto_Rico", "America/Punta_Arenas", "America/Rainy_River", "America/Rankin_Inlet", "America/Recife", "America/Regina", "America/Resolute", "America/Rio_Branco", "America/Rosario", "America/Santa_Isabel", "America/Santarem", "America/Santiago", "America/Santo_Domingo", "America/Sao_Paulo", "America/Scoresbysund", "America/Shiprock", "America/Sitka", "America/St_Barthelemy", "America/St_Johns", "America/St_Kitts", "America/St_Lucia", "America/St_Thomas", "America/St_Vincent", "America/Swift_Current", "America/Tegucigalpa", "America/Thule", "America/Thunder_Bay", "America/Tijuana", "America/Toronto", "America/Tortola", "America/Vancouver", "America/Virgin", "America/Whitehorse", "America/Winnipeg", "America/Yakutat", "America/Yellowknife", "Antarctica/Casey", "Antarctica/Davis", "Antarctica/DumontDUrville", "Antarctica/Macquarie", "Antarctica/Mawson", "Antarctica/McMurdo", "Antarctica/Palmer", "Antarctica/Rothera", "Antarctica/South_Pole", "Antarctica/Syowa", "Antarctica/Troll", "Antarctica/Vostok", "Arctic/Longyearbyen", "Asia/Aden", "Asia/Almaty", "Asia/Amman", "Asia/Anadyr", "Asia/Aqtau", "Asia/Aqtobe", "Asia/Ashgabat", "Asia/Ashkhabad", "Asia/Atyrau", "Asia/Baghdad", "Asia/Bahrain", "Asia/Baku", "Asia/Bangkok", "Asia/Barnaul", "Asia/Beirut", "Asia/Bishkek", "Asia/Brunei", "Asia/Calcutta", "Asia/Chita", "Asia/Choibalsan", "Asia/Chongqing", "Asia/Chungking", "Asia/Colombo", "Asia/Dacca", "Asia/Damascus", "Asia/Dhaka", "Asia/Dili", "Asia/Dubai", "Asia/Dushanbe", "Asia/Famagusta", "Asia/Gaza", "Asia/Harbin", "Asia/Hebron", "Asia/Ho_Chi_Minh", "Asia/Hong_Kong", "Asia/Hovd", "Asia/Irkutsk", "Asia/Istanbul", "Asia/Jakarta", "Asia/Jayapura", "Asia/Jerusalem", "Asia/Kabul", "Asia/Kamchatka", "Asia/Karachi", "Asia/Kashgar", "Asia/Kathmandu", "Asia/Katmandu", "Asia/Khandyga", "Asia/Kolkata", "Asia/Krasnoyarsk", "Asia/Kuala_Lumpur", "Asia/Kuching", "Asia/Kuwait", "Asia/Macao", "Asia/Macau", "Asia/Magadan", "Asia/Makassar", "Asia/Manila", "Asia/Muscat", "Asia/Nicosia", "Asia/Novokuznetsk", "Asia/Novosibirsk", "Asia/Omsk", "Asia/Oral", "Asia/Phnom_Penh", "Asia/Pontianak", "Asia/Pyongyang", "Asia/Qatar", "Asia/Qostanay", "Asia/Qyzylorda", "Asia/Rangoon", "Asia/Riyadh", "Asia/Saigon", "Asia/Sakhalin", "Asia/Samarkand", "Asia/Seoul", "Asia/Shanghai", "Asia/Singapore", "Asia/Srednekolymsk", "Asia/Taipei", "Asia/Tashkent", "Asia/Tbilisi", "Asia/Tehran", "Asia/Tel_Aviv", "Asia/Thimbu", "Asia/Thimphu", "Asia/Tokyo", "Asia/Tomsk", "Asia/Ujung_Pandang", "Asia/Ulaanbaatar", "Asia/Ulan_Bator", "Asia/Urumqi", "Asia/Ust-Nera", "Asia/Vientiane", "Asia/Vladivostok", "Asia/Yakutsk", "Asia/Yangon", "Asia/Yekaterinburg", "Asia/Yerevan", "Atlantic/Azores", "Atlantic/Bermuda", "Atlantic/Canary", "Atlantic/Cape_Verde", "Atlantic/Faeroe", "Atlantic/Faroe", "Atlantic/Jan_Mayen", "Atlantic/Madeira", "Atlantic/Reykjavik", "Atlantic/South_Georgia", "Atlantic/St_Helena", "Atlantic/Stanley", "Australia/ACT", "Australia/Adelaide", "Australia/Brisbane", "Australia/Broken_Hill", "Australia/Canberra", "Australia/Currie", "Australia/Darwin", "Australia/Eucla", "Australia/Hobart", "Australia/LHI", "Australia/Lindeman", "Australia/Lord_Howe", "Australia/Melbourne", "Australia/NSW", "Australia/North", "Australia/Perth", "Australia/Queensland", "Australia/South", "Australia/Sydney", "Australia/Tasmania", "Australia/Victoria", "Australia/West", "Australia/Yancowinna", "Brazil/Acre", "Brazil/DeNoronha", "Brazil/East", "Brazil/West", "CET", "CST6CDT", "Canada/Atlantic", "Canada/Central", "Canada/Eastern", "Canada/Mountain", "Canada/Newfoundland", "Canada/Pacific", "Canada/Saskatchewan", "Canada/Yukon", "Chile/Continental", "Chile/EasterIsland", "Cuba", "EET", "EST", "EST5EDT", "Egypt", "Eire", "Etc/GMT", "Etc/GMT+0", "Etc/GMT+1", "Etc/GMT+10", "Etc/GMT+11", "Etc/GMT+12", "Etc/GMT+2", "Etc/GMT+3", "Etc/GMT+4", "Etc/GMT+5", "Etc/GMT+6", "Etc/GMT+7", "Etc/GMT+8", "Etc/GMT+9", "Etc/GMT-0", "Etc/GMT-1", "Etc/GMT-10", "Etc/GMT-11", "Etc/GMT-12", "Etc/GMT-13", "Etc/GMT-14", "Etc/GMT-2", "Etc/GMT-3", "Etc/GMT-4", "Etc/GMT-5", "Etc/GMT-6", "Etc/GMT-7", "Etc/GMT-8", "Etc/GMT-9", "Etc/GMT0", "Etc/Greenwich", "Etc/UCT", "Etc/UTC", "Etc/Universal", "Etc/Zulu", "Europe/Amsterdam", "Europe/Andorra", "Europe/Astrakhan", "Europe/Athens", "Europe/Belfast", "Europe/Belgrade", "Europe/Berlin", "Europe/Bratislava", "Europe/Brussels", "Europe/Bucharest", "Europe/Budapest", "Europe/Busingen", "Europe/Chisinau", "Europe/Copenhagen", "Europe/Dublin", "Europe/Gibraltar", "Europe/Guernsey", "Europe/Helsinki", "Europe/Isle_of_Man", "Europe/Istanbul", "Europe/Jersey", "Europe/Kaliningrad", "Europe/Kiev", "Europe/Kirov", "Europe/Kyiv", "Europe/Lisbon", "Europe/Ljubljana", "Europe/London", "Europe/Luxembourg", "Europe/Madrid", "Europe/Malta", "Europe/Mariehamn", "Europe/Minsk", "Europe/Monaco", "Europe/Moscow", "Europe/Nicosia", "Europe/Oslo", "Europe/Paris", "Europe/Podgorica", "Europe/Prague", "Europe/Riga", "Europe/Rome", "Europe/Samara", "Europe/San_Marino", "Europe/Sarajevo", "Europe/Saratov", "Europe/Simferopol", "Europe/Skopje", "Europe/Sofia", "Europe/Stockholm", "Europe/Tallinn", "Europe/Tirane", "Europe/Tiraspol", "Europe/Ulyanovsk", "Europe/Uzhgorod", "Europe/Vaduz", "Europe/Vatican", "Europe/Vienna", "Europe/Vilnius", "Europe/Volgograd", "Europe/Warsaw", "Europe/Zagreb", "Europe/Zaporozhye", "Europe/Zurich", "Factory", "GB", "GB-Eire", "GMT", "GMT+0", "GMT-0", "GMT0", "Greenwich", "HST", "Hongkong", "Iceland", "Indian/Antananarivo", "Indian/Chagos", "Indian/Christmas", "Indian/Cocos", "Indian/Comoro", "Indian/Kerguelen", "Indian/Mahe", "Indian/Maldives", "Indian/Mauritius", "Indian/Mayotte", "Indian/Reunion", "Iran", "Israel", "Jamaica", "Japan", "Kwajalein", "Libya", "MET", "MST", "MST7MDT", "Mexico/BajaNorte", "Mexico/BajaSur", "Mexico/General", "NZ", "NZ-CHAT", "Navajo", "PRC", "PST8PDT", "Pacific/Apia", "Pacific/Auckland", "Pacific/Bougainville", "Pacific/Chatham", "Pacific/Chuuk", "Pacific/Easter", "Pacific/Efate", "Pacific/Enderbury", "Pacific/Fakaofo", "Pacific/Fiji", "Pacific/Funafuti", "Pacific/Galapagos", "Pacific/Gambier", "Pacific/Guadalcanal", "Pacific/Guam", "Pacific/Honolulu", "Pacific/Johnston", "Pacific/Kanton", "Pacific/Kiritimati", "Pacific/Kosrae", "Pacific/Kwajalein", "Pacific/Majuro", "Pacific/Marquesas", "Pacific/Midway", "Pacific/Nauru", "Pacific/Niue", "Pacific/Norfolk", "Pacific/Noumea", "Pacific/Pago_Pago", "Pacific/Palau", "Pacific/Pitcairn", "Pacific/Pohnpei", "Pacific/Ponape", "Pacific/Port_Moresby", "Pacific/Rarotonga", "Pacific/Saipan", "Pacific/Samoa", "Pacific/Tahiti", "Pacific/Tarawa", "Pacific/Tongatapu", "Pacific/Truk", "Pacific/Wake", "Pacific/Wallis", "Pacific/Yap", "Poland", "Portugal", "ROC", "ROK", "Singapore", "Turkey", "UCT", "US/Alaska", "US/Aleutian", "US/Arizona", "US/Central", "US/East-Indiana", "US/Eastern", "US/Hawaii", "US/Indiana-Starke", "US/Michigan", "US/Mountain", "US/Pacific", "US/Pacific-New", "US/Samoa", "UTC", "Universal", "W-SU", "WET", "Zulu", ] ] """ Defaults to `Etc/UTC`. The output timezone for all timestamps in the report. A list of possible time zone values is maintained at the [IANA Time Zone Database](http://www.iana.org/time-zones). Has no effect on `interval_start` or `interval_end`. """ class ListParams(TypedDict): created: NotRequired["ReportRunService.ListParamsCreated|int"] """ Only return Report Runs that were created during the given date interval. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def list( self, params: "ReportRunService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[ReportRun]: """ Returns a list of Report Runs, with the most recent appearing first. """ return cast( ListObject[ReportRun], self._request( "get", "/v1/reporting/report_runs", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "ReportRunService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[ReportRun]: """ Returns a list of Report Runs, with the most recent appearing first. """ return cast( ListObject[ReportRun], await self._request_async( "get", "/v1/reporting/report_runs", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "ReportRunService.CreateParams", options: RequestOptions = {}, ) -> ReportRun: """ Creates a new object and begin running the report. (Certain report types require a [live-mode API key](https://stripe.com/docs/keys#test-live-modes).) """ return cast( ReportRun, self._request( "post", "/v1/reporting/report_runs", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "ReportRunService.CreateParams", options: RequestOptions = {}, ) -> ReportRun: """ Creates a new object and begin running the report. (Certain report types require a [live-mode API key](https://stripe.com/docs/keys#test-live-modes).) """ return cast( ReportRun, await self._request_async( "post", "/v1/reporting/report_runs", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, report_run: str, params: "ReportRunService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> ReportRun: """ Retrieves the details of an existing Report Run. """ return cast( ReportRun, self._request( "get", "/v1/reporting/report_runs/{report_run}".format( report_run=sanitize_id(report_run), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, report_run: str, params: "ReportRunService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> ReportRun: """ Retrieves the details of an existing Report Run. """ return cast( ReportRun, await self._request_async( "get", "/v1/reporting/report_runs/{report_run}".format( report_run=sanitize_id(report_run), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/reporting/_report_type.py0000644000175100001770000001113614637354563021132 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from typing import ClassVar, List, Optional from typing_extensions import Literal, NotRequired, Unpack class ReportType(ListableAPIResource["ReportType"]): """ The Report Type resource corresponds to a particular type of report, such as the "Activity summary" or "Itemized payouts" reports. These objects are identified by an ID belonging to a set of enumerated values. See [API Access to Reports documentation](https://stripe.com/docs/reporting/statements/api) for those Report Type IDs, along with required and optional parameters. Note that certain report types can only be run based on your live-mode data (not test-mode data), and will error when queried without a [live-mode API key](https://stripe.com/docs/keys#test-live-modes). """ OBJECT_NAME: ClassVar[Literal["reporting.report_type"]] = ( "reporting.report_type" ) class ListParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ data_available_end: int """ Most recent time for which this Report Type is available. Measured in seconds since the Unix epoch. """ data_available_start: int """ Earliest time for which this Report Type is available. Measured in seconds since the Unix epoch. """ default_columns: Optional[List[str]] """ List of column names that are included by default when this Report Type gets run. (If the Report Type doesn't support the `columns` parameter, this will be null.) """ id: str """ The [ID of the Report Type](https://stripe.com/docs/reporting/statements/api#available-report-types), such as `balance.summary.1`. """ 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 Report Type """ object: Literal["reporting.report_type"] """ String representing the object's type. Objects of the same type share the same value. """ updated: int """ When this Report Type was latest updated. Measured in seconds since the Unix epoch. """ version: int """ Version of the Report Type. Different versions report with the same ID will have the same purpose, but may take different run parameters or have different result schemas. """ @classmethod def list( cls, **params: Unpack["ReportType.ListParams"] ) -> ListObject["ReportType"]: """ Returns a full list of Report Types. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["ReportType.ListParams"] ) -> ListObject["ReportType"]: """ Returns a full list of Report Types. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def retrieve( cls, id: str, **params: Unpack["ReportType.RetrieveParams"] ) -> "ReportType": """ Retrieves the details of a Report Type. (Certain report types require a [live-mode API key](https://stripe.com/docs/keys#test-live-modes).) """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["ReportType.RetrieveParams"] ) -> "ReportType": """ Retrieves the details of a Report Type. (Certain report types require a [live-mode API key](https://stripe.com/docs/keys#test-live-modes).) """ instance = cls(id, **params) await instance.refresh_async() return instance ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/reporting/_report_type_service.py0000644000175100001770000000642214637354563022654 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.reporting._report_type import ReportType from typing import List, cast from typing_extensions import NotRequired, TypedDict class ReportTypeService(StripeService): class ListParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def list( self, params: "ReportTypeService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[ReportType]: """ Returns a full list of Report Types. """ return cast( ListObject[ReportType], self._request( "get", "/v1/reporting/report_types", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "ReportTypeService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[ReportType]: """ Returns a full list of Report Types. """ return cast( ListObject[ReportType], await self._request_async( "get", "/v1/reporting/report_types", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, report_type: str, params: "ReportTypeService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> ReportType: """ Retrieves the details of a Report Type. (Certain report types require a [live-mode API key](https://stripe.com/docs/keys#test-live-modes).) """ return cast( ReportType, self._request( "get", "/v1/reporting/report_types/{report_type}".format( report_type=sanitize_id(report_type), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, report_type: str, params: "ReportTypeService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> ReportType: """ Retrieves the details of a Report Type. (Certain report types require a [live-mode API key](https://stripe.com/docs/keys#test-live-modes).) """ return cast( ReportType, await self._request_async( "get", "/v1/reporting/report_types/{report_type}".format( report_type=sanitize_id(report_type), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/request_metrics.py0000644000175100001770000000052414637354563017623 0ustar00runnerdocker# -*- coding: utf-8 -*- from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.request_metrics package is deprecated and will become internal in the future. """, DeprecationWarning, ) if not TYPE_CHECKING: from stripe._request_metrics import ( # noqa RequestMetrics, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/request_options.py0000644000175100001770000000076014637354563017652 0ustar00runnerdocker# -*- coding: utf-8 -*- from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.request_options package is deprecated, please change your imports to import from stripe directly. From: from stripe.request_options import RequestOptions To: from stripe import RequestOptions """, DeprecationWarning, ) __deprecated__ = ["RequestOptions"] if not TYPE_CHECKING: from stripe._request_options import RequestOptions # noqa ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5449405 stripe-10.1.0/stripe/sigma/0000755000175100001770000000000014637354616015131 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/sigma/__init__.py0000644000175100001770000000042114637354563017240 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe.sigma._scheduled_query_run import ( ScheduledQueryRun as ScheduledQueryRun, ) from stripe.sigma._scheduled_query_run_service import ( ScheduledQueryRunService as ScheduledQueryRunService, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/sigma/_scheduled_query_run.py0000644000175100001770000001227214637354563021720 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from typing import ClassVar, List, Optional from typing_extensions import Literal, NotRequired, Unpack, TYPE_CHECKING if TYPE_CHECKING: from stripe._file import File class ScheduledQueryRun(ListableAPIResource["ScheduledQueryRun"]): """ If you have [scheduled a Sigma query](https://stripe.com/docs/sigma/scheduled-queries), you'll receive a `sigma.scheduled_query_run.created` webhook each time the query runs. The webhook contains a `ScheduledQueryRun` object, which you can use to retrieve the query results. """ OBJECT_NAME: ClassVar[Literal["scheduled_query_run"]] = ( "scheduled_query_run" ) class Error(StripeObject): message: str """ Information about the run failure. """ class ListParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ data_load_time: int """ When the query was run, Sigma contained a snapshot of your Stripe data at this time. """ error: Optional[Error] file: Optional["File"] """ The file object representing the results of the query. """ id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ object: Literal["scheduled_query_run"] """ String representing the object's type. Objects of the same type share the same value. """ result_available_until: int """ Time at which the result expires and is no longer available for download. """ sql: str """ SQL for the query. """ status: str """ The query's execution status, which will be `completed` for successful runs, and `canceled`, `failed`, or `timed_out` otherwise. """ title: str """ Title of the query. """ @classmethod def list( cls, **params: Unpack["ScheduledQueryRun.ListParams"] ) -> ListObject["ScheduledQueryRun"]: """ Returns a list of scheduled query runs. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["ScheduledQueryRun.ListParams"] ) -> ListObject["ScheduledQueryRun"]: """ Returns a list of scheduled query runs. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def retrieve( cls, id: str, **params: Unpack["ScheduledQueryRun.RetrieveParams"] ) -> "ScheduledQueryRun": """ Retrieves the details of an scheduled query run. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["ScheduledQueryRun.RetrieveParams"] ) -> "ScheduledQueryRun": """ Retrieves the details of an scheduled query run. """ instance = cls(id, **params) await instance.refresh_async() return instance @classmethod def class_url(cls): return "/v1/sigma/scheduled_query_runs" _inner_class_types = {"error": Error} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/sigma/_scheduled_query_run_service.py0000644000175100001770000001024414637354563023435 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.sigma._scheduled_query_run import ScheduledQueryRun from typing import List, cast from typing_extensions import NotRequired, TypedDict class ScheduledQueryRunService(StripeService): class ListParams(TypedDict): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def list( self, params: "ScheduledQueryRunService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[ScheduledQueryRun]: """ Returns a list of scheduled query runs. """ return cast( ListObject[ScheduledQueryRun], self._request( "get", "/v1/sigma/scheduled_query_runs", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "ScheduledQueryRunService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[ScheduledQueryRun]: """ Returns a list of scheduled query runs. """ return cast( ListObject[ScheduledQueryRun], await self._request_async( "get", "/v1/sigma/scheduled_query_runs", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, scheduled_query_run: str, params: "ScheduledQueryRunService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> ScheduledQueryRun: """ Retrieves the details of an scheduled query run. """ return cast( ScheduledQueryRun, self._request( "get", "/v1/sigma/scheduled_query_runs/{scheduled_query_run}".format( scheduled_query_run=sanitize_id(scheduled_query_run), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, scheduled_query_run: str, params: "ScheduledQueryRunService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> ScheduledQueryRun: """ Retrieves the details of an scheduled query run. """ return cast( ScheduledQueryRun, await self._request_async( "get", "/v1/sigma/scheduled_query_runs/{scheduled_query_run}".format( scheduled_query_run=sanitize_id(scheduled_query_run), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/stripe_object.py0000644000175100001770000000074414637354563017245 0ustar00runnerdocker# -*- coding: utf-8 -*- from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.stripe_object package is deprecated, please change your imports to import from stripe directly. From: from stripe.stripe_object import StripeObject To: from stripe import StripeObject """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._stripe_object import ( # noqa StripeObject, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/stripe_response.py0000644000175100001770000000114714637354563017633 0ustar00runnerdocker# -*- coding: utf-8 -*- from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.stripe_response package is deprecated, please change your imports to import from stripe directly. From: from stripe.stripe_response import StripeResponse To: from stripe import StripeResponse """, DeprecationWarning, ) if not TYPE_CHECKING: from stripe._stripe_response import StripeResponse # noqa: F401 from stripe._stripe_response import StripeResponseBase # noqa: F401 from stripe._stripe_response import StripeStreamResponse # noqa: F401 ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5489407 stripe-10.1.0/stripe/tax/0000755000175100001770000000000014637354616014625 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/tax/__init__.py0000644000175100001770000000212214637354563016734 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe.tax._calculation import Calculation as Calculation from stripe.tax._calculation_line_item import ( CalculationLineItem as CalculationLineItem, ) from stripe.tax._calculation_line_item_service import ( CalculationLineItemService as CalculationLineItemService, ) from stripe.tax._calculation_service import ( CalculationService as CalculationService, ) from stripe.tax._registration import Registration as Registration from stripe.tax._registration_service import ( RegistrationService as RegistrationService, ) from stripe.tax._settings import Settings as Settings from stripe.tax._settings_service import SettingsService as SettingsService from stripe.tax._transaction import Transaction as Transaction from stripe.tax._transaction_line_item import ( TransactionLineItem as TransactionLineItem, ) from stripe.tax._transaction_line_item_service import ( TransactionLineItemService as TransactionLineItemService, ) from stripe.tax._transaction_service import ( TransactionService as TransactionService, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/tax/_calculation.py0000644000175100001770000007710714637354563017651 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, List, Optional, cast, overload from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe.tax._calculation_line_item import CalculationLineItem class Calculation(CreateableAPIResource["Calculation"]): """ A Tax Calculation allows you to calculate the tax to collect from your customer. Related guide: [Calculate tax in your custom payment flow](https://stripe.com/docs/tax/custom) """ OBJECT_NAME: ClassVar[Literal["tax.calculation"]] = "tax.calculation" class CustomerDetails(StripeObject): class Address(StripeObject): city: Optional[str] """ City, district, suburb, town, or village. """ country: str """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: Optional[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix. Example: "NY" or "TX". """ class TaxId(StripeObject): type: Literal[ "ad_nrt", "ae_trn", "ar_cuit", "au_abn", "au_arn", "bg_uic", "bh_vat", "bo_tin", "br_cnpj", "br_cpf", "ca_bn", "ca_gst_hst", "ca_pst_bc", "ca_pst_mb", "ca_pst_sk", "ca_qst", "ch_uid", "ch_vat", "cl_tin", "cn_tin", "co_nit", "cr_tin", "de_stn", "do_rcn", "ec_ruc", "eg_tin", "es_cif", "eu_oss_vat", "eu_vat", "gb_vat", "ge_vat", "hk_br", "hu_tin", "id_npwp", "il_vat", "in_gst", "is_vat", "jp_cn", "jp_rn", "jp_trn", "ke_pin", "kr_brn", "kz_bin", "li_uid", "mx_rfc", "my_frp", "my_itn", "my_sst", "ng_tin", "no_vat", "no_voec", "nz_gst", "om_vat", "pe_ruc", "ph_tin", "ro_tin", "rs_pib", "ru_inn", "ru_kpp", "sa_vat", "sg_gst", "sg_uen", "si_tin", "sv_nit", "th_vat", "tr_tin", "tw_vat", "ua_vat", "unknown", "us_ein", "uy_ruc", "ve_rif", "vn_tin", "za_vat", ] """ The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, or `unknown` """ value: str """ The value of the tax ID. """ address: Optional[Address] """ The customer's postal address (for example, home or business location). """ address_source: Optional[Literal["billing", "shipping"]] """ The type of customer address provided. """ ip_address: Optional[str] """ The customer's IP address (IPv4 or IPv6). """ tax_ids: List[TaxId] """ The customer's tax IDs (for example, EU VAT numbers). """ taxability_override: Literal[ "customer_exempt", "none", "reverse_charge" ] """ The taxability override used for taxation. """ _inner_class_types = {"address": Address, "tax_ids": TaxId} class ShipFromDetails(StripeObject): class Address(StripeObject): city: Optional[str] """ City, district, suburb, town, or village. """ country: str """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: Optional[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix. Example: "NY" or "TX". """ address: Address _inner_class_types = {"address": Address} class ShippingCost(StripeObject): class TaxBreakdown(StripeObject): class Jurisdiction(StripeObject): country: str """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ display_name: str """ A human-readable name for the jurisdiction imposing the tax. """ level: Literal[ "city", "country", "county", "district", "state" ] """ Indicates the level of the jurisdiction imposing the tax. """ state: Optional[str] """ [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. """ class TaxRateDetails(StripeObject): display_name: str """ A localized display name for tax type, intended to be human-readable. For example, "Local Sales and Use Tax", "Value-added tax (VAT)", or "Umsatzsteuer (USt.)". """ percentage_decimal: str """ The tax rate percentage as a string. For example, 8.5% is represented as "8.5". """ tax_type: Literal[ "amusement_tax", "communications_tax", "gst", "hst", "igst", "jct", "lease_tax", "pst", "qst", "rst", "sales_tax", "vat", ] """ The tax type, such as `vat` or `sales_tax`. """ amount: int """ The amount of tax, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ jurisdiction: Jurisdiction sourcing: Literal["destination", "origin"] """ Indicates whether the jurisdiction was determined by the origin (merchant's address) or destination (customer's address). """ tax_rate_details: Optional[TaxRateDetails] """ Details regarding the rate for this tax. This field will be `null` when the tax is not imposed, for example if the product is exempt from tax. """ taxability_reason: Literal[ "customer_exempt", "not_collecting", "not_subject_to_tax", "not_supported", "portion_product_exempt", "portion_reduced_rated", "portion_standard_rated", "product_exempt", "product_exempt_holiday", "proportionally_rated", "reduced_rated", "reverse_charge", "standard_rated", "taxable_basis_reduced", "zero_rated", ] """ The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. """ taxable_amount: int """ The amount on which tax is calculated, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ _inner_class_types = { "jurisdiction": Jurisdiction, "tax_rate_details": TaxRateDetails, } amount: int """ The shipping amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount. """ amount_tax: int """ The amount of tax calculated for shipping, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ shipping_rate: Optional[str] """ The ID of an existing [ShippingRate](https://stripe.com/docs/api/shipping_rates/object). """ tax_behavior: Literal["exclusive", "inclusive"] """ Specifies whether the `amount` includes taxes. If `tax_behavior=inclusive`, then the amount includes taxes. """ tax_breakdown: Optional[List[TaxBreakdown]] """ Detailed account of taxes relevant to shipping cost. """ tax_code: str """ The [tax code](https://stripe.com/docs/tax/tax-categories) ID used for shipping. """ _inner_class_types = {"tax_breakdown": TaxBreakdown} class TaxBreakdown(StripeObject): class TaxRateDetails(StripeObject): country: Optional[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ percentage_decimal: str """ The tax rate percentage as a string. For example, 8.5% is represented as `"8.5"`. """ state: Optional[str] """ State, county, province, or region. """ tax_type: Optional[ Literal[ "amusement_tax", "communications_tax", "gst", "hst", "igst", "jct", "lease_tax", "pst", "qst", "rst", "sales_tax", "vat", ] ] """ The tax type, such as `vat` or `sales_tax`. """ amount: int """ The amount of tax, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ inclusive: bool """ Specifies whether the tax amount is included in the line item amount. """ tax_rate_details: TaxRateDetails taxability_reason: Literal[ "customer_exempt", "not_collecting", "not_subject_to_tax", "not_supported", "portion_product_exempt", "portion_reduced_rated", "portion_standard_rated", "product_exempt", "product_exempt_holiday", "proportionally_rated", "reduced_rated", "reverse_charge", "standard_rated", "taxable_basis_reduced", "zero_rated", ] """ The reasoning behind this tax, for example, if the product is tax exempt. We might extend the possible values for this field to support new tax rules. """ taxable_amount: int """ The amount on which tax is calculated, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ _inner_class_types = {"tax_rate_details": TaxRateDetails} class CreateParams(RequestOptions): 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). """ customer: NotRequired[str] """ The ID of an existing customer to use for this calculation. If provided, the customer's address and tax IDs are copied to `customer_details`. """ customer_details: NotRequired[ "Calculation.CreateParamsCustomerDetails" ] """ Details about the customer, including address and tax IDs. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ line_items: List["Calculation.CreateParamsLineItem"] """ A list of items the customer is purchasing. """ ship_from_details: NotRequired[ "Calculation.CreateParamsShipFromDetails" ] """ Details about the address from which the goods are being shipped. """ shipping_cost: NotRequired["Calculation.CreateParamsShippingCost"] """ Shipping cost details to be used for the calculation. """ tax_date: NotRequired[int] """ Timestamp of date at which the tax rules and rates in effect applies for the calculation. Measured in seconds since the Unix epoch. Can be up to 48 hours in the past, and up to 48 hours in the future. """ class CreateParamsCustomerDetails(TypedDict): address: NotRequired["Calculation.CreateParamsCustomerDetailsAddress"] """ The customer's postal address (for example, home or business location). """ address_source: NotRequired[Literal["billing", "shipping"]] """ The type of customer address provided. """ ip_address: NotRequired[str] """ The customer's IP address (IPv4 or IPv6). """ tax_ids: NotRequired[ List["Calculation.CreateParamsCustomerDetailsTaxId"] ] """ The customer's tax IDs. Stripe Tax might consider a transaction with applicable tax IDs to be B2B, which might affect the tax calculation result. Stripe Tax doesn't validate tax IDs for correctness. """ taxability_override: NotRequired[ Literal["customer_exempt", "none", "reverse_charge"] ] """ Overrides the tax calculation result to allow you to not collect tax from your customer. Use this if you've manually checked your customer's tax exemptions. Prefer providing the customer's `tax_ids` where possible, which automatically determines whether `reverse_charge` applies. """ class CreateParamsCustomerDetailsAddress(TypedDict): city: NotRequired["Literal['']|str"] """ City, district, suburb, town, or village. """ country: str """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired["Literal['']|str"] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired["Literal['']|str"] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired["Literal['']|str"] """ ZIP or postal code. """ state: NotRequired["Literal['']|str"] """ State, county, province, or region. We recommend sending [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code value when possible. """ class CreateParamsCustomerDetailsTaxId(TypedDict): type: Literal[ "ad_nrt", "ae_trn", "ar_cuit", "au_abn", "au_arn", "bg_uic", "bh_vat", "bo_tin", "br_cnpj", "br_cpf", "ca_bn", "ca_gst_hst", "ca_pst_bc", "ca_pst_mb", "ca_pst_sk", "ca_qst", "ch_uid", "ch_vat", "cl_tin", "cn_tin", "co_nit", "cr_tin", "de_stn", "do_rcn", "ec_ruc", "eg_tin", "es_cif", "eu_oss_vat", "eu_vat", "gb_vat", "ge_vat", "hk_br", "hu_tin", "id_npwp", "il_vat", "in_gst", "is_vat", "jp_cn", "jp_rn", "jp_trn", "ke_pin", "kr_brn", "kz_bin", "li_uid", "mx_rfc", "my_frp", "my_itn", "my_sst", "ng_tin", "no_vat", "no_voec", "nz_gst", "om_vat", "pe_ruc", "ph_tin", "ro_tin", "rs_pib", "ru_inn", "ru_kpp", "sa_vat", "sg_gst", "sg_uen", "si_tin", "sv_nit", "th_vat", "tr_tin", "tw_vat", "ua_vat", "us_ein", "uy_ruc", "ve_rif", "vn_tin", "za_vat", ] """ Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ Value of the tax ID. """ class CreateParamsLineItem(TypedDict): amount: int """ A positive integer representing the line item's total price in the [smallest currency unit](https://stripe.com/docs/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.0 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to twelve digits (e.g., a value of 999999999999 for a USD charge of $9,999,999,999.99). If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes are calculated on top of this amount. """ product: NotRequired[str] """ If provided, the product's `tax_code` will be used as the line item's `tax_code`. """ quantity: NotRequired[int] """ The number of units of the item being purchased. Used to calculate the per-unit price from the total `amount` for the line. For example, if `amount=100` and `quantity=4`, the calculated unit price is 25. """ reference: NotRequired[str] """ A custom identifier for this line item, which must be unique across the line items in the calculation. The reference helps identify each line item in exported [tax reports](https://stripe.com/docs/tax/reports). """ tax_behavior: NotRequired[Literal["exclusive", "inclusive"]] """ Specifies whether the `amount` includes taxes. Defaults to `exclusive`. """ tax_code: NotRequired[str] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID to use for this line item. If not provided, we will use the tax code from the provided `product` param. If neither `tax_code` nor `product` is provided, we will use the default tax code from your Tax Settings. """ class CreateParamsShipFromDetails(TypedDict): address: "Calculation.CreateParamsShipFromDetailsAddress" """ The address from which the goods are being shipped from. """ class CreateParamsShipFromDetailsAddress(TypedDict): city: NotRequired["Literal['']|str"] """ City, district, suburb, town, or village. """ country: str """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired["Literal['']|str"] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired["Literal['']|str"] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired["Literal['']|str"] """ ZIP or postal code. """ state: NotRequired["Literal['']|str"] """ State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix. Example: "NY" or "TX". """ class CreateParamsShippingCost(TypedDict): amount: NotRequired[int] """ A positive integer in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) representing the shipping charge. If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes are calculated on top of this amount. """ shipping_rate: NotRequired[str] """ If provided, the [shipping rate](https://stripe.com/docs/api/shipping_rates/object)'s `amount`, `tax_code` and `tax_behavior` are used. If you provide a shipping rate, then you cannot pass the `amount`, `tax_code`, or `tax_behavior` parameters. """ tax_behavior: NotRequired[Literal["exclusive", "inclusive"]] """ Specifies whether the `amount` includes taxes. If `tax_behavior=inclusive`, then the amount includes taxes. Defaults to `exclusive`. """ tax_code: NotRequired[str] """ The [tax code](https://stripe.com/docs/tax/tax-categories) used to calculate tax on shipping. If not provided, the default shipping tax code from your [Tax Settings](https://stripe.com/settings/tax) is used. """ class ListLineItemsParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ amount_total: int """ Total after taxes. """ 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). """ customer: Optional[str] """ The ID of an existing [Customer](https://stripe.com/docs/api/customers/object) used for the resource. """ customer_details: CustomerDetails expires_at: Optional[int] """ Timestamp of date at which the tax calculation will expire. """ id: Optional[str] """ Unique identifier for the calculation. """ line_items: Optional[ListObject["CalculationLineItem"]] """ The list of items the customer is purchasing. """ 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["tax.calculation"] """ String representing the object's type. Objects of the same type share the same value. """ ship_from_details: Optional[ShipFromDetails] """ The details of the ship from location, such as the address. """ shipping_cost: Optional[ShippingCost] """ The shipping cost details for the calculation. """ tax_amount_exclusive: int """ The amount of tax to be collected on top of the line item prices. """ tax_amount_inclusive: int """ The amount of tax already included in the line item prices. """ tax_breakdown: List[TaxBreakdown] """ Breakdown of individual tax amounts that add up to the total. """ tax_date: int """ Timestamp of date at which the tax rules and rates in effect applies for the calculation. """ @classmethod def create( cls, **params: Unpack["Calculation.CreateParams"] ) -> "Calculation": """ Calculates tax based on the input and returns a Tax Calculation object. """ return cast( "Calculation", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["Calculation.CreateParams"] ) -> "Calculation": """ Calculates tax based on the input and returns a Tax Calculation object. """ return cast( "Calculation", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def _cls_list_line_items( cls, calculation: str, **params: Unpack["Calculation.ListLineItemsParams"], ) -> ListObject["CalculationLineItem"]: """ Retrieves the line items of a tax calculation as a collection, if the calculation hasn't expired. """ return cast( ListObject["CalculationLineItem"], cls._static_request( "get", "/v1/tax/calculations/{calculation}/line_items".format( calculation=sanitize_id(calculation) ), params=params, ), ) @overload @staticmethod def list_line_items( calculation: str, **params: Unpack["Calculation.ListLineItemsParams"] ) -> ListObject["CalculationLineItem"]: """ Retrieves the line items of a tax calculation as a collection, if the calculation hasn't expired. """ ... @overload def list_line_items( self, **params: Unpack["Calculation.ListLineItemsParams"] ) -> ListObject["CalculationLineItem"]: """ Retrieves the line items of a tax calculation as a collection, if the calculation hasn't expired. """ ... @class_method_variant("_cls_list_line_items") def list_line_items( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Calculation.ListLineItemsParams"] ) -> ListObject["CalculationLineItem"]: """ Retrieves the line items of a tax calculation as a collection, if the calculation hasn't expired. """ return cast( ListObject["CalculationLineItem"], self._request( "get", "/v1/tax/calculations/{calculation}/line_items".format( calculation=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_list_line_items_async( cls, calculation: str, **params: Unpack["Calculation.ListLineItemsParams"], ) -> ListObject["CalculationLineItem"]: """ Retrieves the line items of a tax calculation as a collection, if the calculation hasn't expired. """ return cast( ListObject["CalculationLineItem"], await cls._static_request_async( "get", "/v1/tax/calculations/{calculation}/line_items".format( calculation=sanitize_id(calculation) ), params=params, ), ) @overload @staticmethod async def list_line_items_async( calculation: str, **params: Unpack["Calculation.ListLineItemsParams"] ) -> ListObject["CalculationLineItem"]: """ Retrieves the line items of a tax calculation as a collection, if the calculation hasn't expired. """ ... @overload async def list_line_items_async( self, **params: Unpack["Calculation.ListLineItemsParams"] ) -> ListObject["CalculationLineItem"]: """ Retrieves the line items of a tax calculation as a collection, if the calculation hasn't expired. """ ... @class_method_variant("_cls_list_line_items_async") async def list_line_items_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Calculation.ListLineItemsParams"] ) -> ListObject["CalculationLineItem"]: """ Retrieves the line items of a tax calculation as a collection, if the calculation hasn't expired. """ return cast( ListObject["CalculationLineItem"], await self._request_async( "get", "/v1/tax/calculations/{calculation}/line_items".format( calculation=sanitize_id(self.get("id")) ), params=params, ), ) _inner_class_types = { "customer_details": CustomerDetails, "ship_from_details": ShipFromDetails, "shipping_cost": ShippingCost, "tax_breakdown": TaxBreakdown, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/tax/_calculation_line_item.py0000644000175100001770000001227414637354563021670 0ustar00runnerdocker# -*- 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 CalculationLineItem(StripeObject): OBJECT_NAME: ClassVar[Literal["tax.calculation_line_item"]] = ( "tax.calculation_line_item" ) class TaxBreakdown(StripeObject): class Jurisdiction(StripeObject): country: str """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ display_name: str """ A human-readable name for the jurisdiction imposing the tax. """ level: Literal["city", "country", "county", "district", "state"] """ Indicates the level of the jurisdiction imposing the tax. """ state: Optional[str] """ [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. """ class TaxRateDetails(StripeObject): display_name: str """ A localized display name for tax type, intended to be human-readable. For example, "Local Sales and Use Tax", "Value-added tax (VAT)", or "Umsatzsteuer (USt.)". """ percentage_decimal: str """ The tax rate percentage as a string. For example, 8.5% is represented as "8.5". """ tax_type: Literal[ "amusement_tax", "communications_tax", "gst", "hst", "igst", "jct", "lease_tax", "pst", "qst", "rst", "sales_tax", "vat", ] """ The tax type, such as `vat` or `sales_tax`. """ amount: int """ The amount of tax, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ jurisdiction: Jurisdiction sourcing: Literal["destination", "origin"] """ Indicates whether the jurisdiction was determined by the origin (merchant's address) or destination (customer's address). """ tax_rate_details: Optional[TaxRateDetails] """ Details regarding the rate for this tax. This field will be `null` when the tax is not imposed, for example if the product is exempt from tax. """ taxability_reason: Literal[ "customer_exempt", "not_collecting", "not_subject_to_tax", "not_supported", "portion_product_exempt", "portion_reduced_rated", "portion_standard_rated", "product_exempt", "product_exempt_holiday", "proportionally_rated", "reduced_rated", "reverse_charge", "standard_rated", "taxable_basis_reduced", "zero_rated", ] """ The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. """ taxable_amount: int """ The amount on which tax is calculated, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ _inner_class_types = { "jurisdiction": Jurisdiction, "tax_rate_details": TaxRateDetails, } amount: int """ The line item amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount. """ amount_tax: int """ The amount of tax calculated for this line item, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ object: Literal["tax.calculation_line_item"] """ String representing the object's type. Objects of the same type share the same value. """ product: Optional[str] """ The ID of an existing [Product](https://stripe.com/docs/api/products/object). """ quantity: int """ The number of units of the item being purchased. For reversals, this is the quantity reversed. """ reference: Optional[str] """ A custom identifier for this line item. """ tax_behavior: Literal["exclusive", "inclusive"] """ Specifies whether the `amount` includes taxes. If `tax_behavior=inclusive`, then the amount includes taxes. """ tax_breakdown: Optional[List[TaxBreakdown]] """ Detailed account of taxes relevant to this line item. """ tax_code: str """ The [tax code](https://stripe.com/docs/tax/tax-categories) ID used for this resource. """ _inner_class_types = {"tax_breakdown": TaxBreakdown} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/tax/_calculation_line_item_service.py0000644000175100001770000000573214637354563023411 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.tax._calculation_line_item import CalculationLineItem from typing import List, cast from typing_extensions import NotRequired, TypedDict class CalculationLineItemService(StripeService): class ListParams(TypedDict): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ def list( self, calculation: str, params: "CalculationLineItemService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[CalculationLineItem]: """ Retrieves the line items of a tax calculation as a collection, if the calculation hasn't expired. """ return cast( ListObject[CalculationLineItem], self._request( "get", "/v1/tax/calculations/{calculation}/line_items".format( calculation=sanitize_id(calculation), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, calculation: str, params: "CalculationLineItemService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[CalculationLineItem]: """ Retrieves the line items of a tax calculation as a collection, if the calculation hasn't expired. """ return cast( ListObject[CalculationLineItem], await self._request_async( "get", "/v1/tax/calculations/{calculation}/line_items".format( calculation=sanitize_id(calculation), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/tax/_calculation_service.py0000644000175100001770000003007014637354563021355 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe.tax._calculation import Calculation from stripe.tax._calculation_line_item_service import ( CalculationLineItemService, ) from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict class CalculationService(StripeService): def __init__(self, requestor): super().__init__(requestor) self.line_items = CalculationLineItemService(self._requestor) class CreateParams(TypedDict): 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). """ customer: NotRequired[str] """ The ID of an existing customer to use for this calculation. If provided, the customer's address and tax IDs are copied to `customer_details`. """ customer_details: NotRequired[ "CalculationService.CreateParamsCustomerDetails" ] """ Details about the customer, including address and tax IDs. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ line_items: List["CalculationService.CreateParamsLineItem"] """ A list of items the customer is purchasing. """ ship_from_details: NotRequired[ "CalculationService.CreateParamsShipFromDetails" ] """ Details about the address from which the goods are being shipped. """ shipping_cost: NotRequired[ "CalculationService.CreateParamsShippingCost" ] """ Shipping cost details to be used for the calculation. """ tax_date: NotRequired[int] """ Timestamp of date at which the tax rules and rates in effect applies for the calculation. Measured in seconds since the Unix epoch. Can be up to 48 hours in the past, and up to 48 hours in the future. """ class CreateParamsCustomerDetails(TypedDict): address: NotRequired[ "CalculationService.CreateParamsCustomerDetailsAddress" ] """ The customer's postal address (for example, home or business location). """ address_source: NotRequired[Literal["billing", "shipping"]] """ The type of customer address provided. """ ip_address: NotRequired[str] """ The customer's IP address (IPv4 or IPv6). """ tax_ids: NotRequired[ List["CalculationService.CreateParamsCustomerDetailsTaxId"] ] """ The customer's tax IDs. Stripe Tax might consider a transaction with applicable tax IDs to be B2B, which might affect the tax calculation result. Stripe Tax doesn't validate tax IDs for correctness. """ taxability_override: NotRequired[ Literal["customer_exempt", "none", "reverse_charge"] ] """ Overrides the tax calculation result to allow you to not collect tax from your customer. Use this if you've manually checked your customer's tax exemptions. Prefer providing the customer's `tax_ids` where possible, which automatically determines whether `reverse_charge` applies. """ class CreateParamsCustomerDetailsAddress(TypedDict): city: NotRequired["Literal['']|str"] """ City, district, suburb, town, or village. """ country: str """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired["Literal['']|str"] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired["Literal['']|str"] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired["Literal['']|str"] """ ZIP or postal code. """ state: NotRequired["Literal['']|str"] """ State, county, province, or region. We recommend sending [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code value when possible. """ class CreateParamsCustomerDetailsTaxId(TypedDict): type: Literal[ "ad_nrt", "ae_trn", "ar_cuit", "au_abn", "au_arn", "bg_uic", "bh_vat", "bo_tin", "br_cnpj", "br_cpf", "ca_bn", "ca_gst_hst", "ca_pst_bc", "ca_pst_mb", "ca_pst_sk", "ca_qst", "ch_uid", "ch_vat", "cl_tin", "cn_tin", "co_nit", "cr_tin", "de_stn", "do_rcn", "ec_ruc", "eg_tin", "es_cif", "eu_oss_vat", "eu_vat", "gb_vat", "ge_vat", "hk_br", "hu_tin", "id_npwp", "il_vat", "in_gst", "is_vat", "jp_cn", "jp_rn", "jp_trn", "ke_pin", "kr_brn", "kz_bin", "li_uid", "mx_rfc", "my_frp", "my_itn", "my_sst", "ng_tin", "no_vat", "no_voec", "nz_gst", "om_vat", "pe_ruc", "ph_tin", "ro_tin", "rs_pib", "ru_inn", "ru_kpp", "sa_vat", "sg_gst", "sg_uen", "si_tin", "sv_nit", "th_vat", "tr_tin", "tw_vat", "ua_vat", "us_ein", "uy_ruc", "ve_rif", "vn_tin", "za_vat", ] """ Type of the tax ID, one of `ad_nrt`, `ae_trn`, `ar_cuit`, `au_abn`, `au_arn`, `bg_uic`, `bh_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `ca_bn`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `ca_qst`, `ch_uid`, `ch_vat`, `cl_tin`, `cn_tin`, `co_nit`, `cr_tin`, `de_stn`, `do_rcn`, `ec_ruc`, `eg_tin`, `es_cif`, `eu_oss_vat`, `eu_vat`, `gb_vat`, `ge_vat`, `hk_br`, `hu_tin`, `id_npwp`, `il_vat`, `in_gst`, `is_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `ke_pin`, `kr_brn`, `kz_bin`, `li_uid`, `mx_rfc`, `my_frp`, `my_itn`, `my_sst`, `ng_tin`, `no_vat`, `no_voec`, `nz_gst`, `om_vat`, `pe_ruc`, `ph_tin`, `ro_tin`, `rs_pib`, `ru_inn`, `ru_kpp`, `sa_vat`, `sg_gst`, `sg_uen`, `si_tin`, `sv_nit`, `th_vat`, `tr_tin`, `tw_vat`, `ua_vat`, `us_ein`, `uy_ruc`, `ve_rif`, `vn_tin`, or `za_vat` """ value: str """ Value of the tax ID. """ class CreateParamsLineItem(TypedDict): amount: int """ A positive integer representing the line item's total price in the [smallest currency unit](https://stripe.com/docs/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.0 US or [equivalent in charge currency](https://stripe.com/docs/currencies#minimum-and-maximum-charge-amounts). The amount value supports up to twelve digits (e.g., a value of 999999999999 for a USD charge of $9,999,999,999.99). If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes are calculated on top of this amount. """ product: NotRequired[str] """ If provided, the product's `tax_code` will be used as the line item's `tax_code`. """ quantity: NotRequired[int] """ The number of units of the item being purchased. Used to calculate the per-unit price from the total `amount` for the line. For example, if `amount=100` and `quantity=4`, the calculated unit price is 25. """ reference: NotRequired[str] """ A custom identifier for this line item, which must be unique across the line items in the calculation. The reference helps identify each line item in exported [tax reports](https://stripe.com/docs/tax/reports). """ tax_behavior: NotRequired[Literal["exclusive", "inclusive"]] """ Specifies whether the `amount` includes taxes. Defaults to `exclusive`. """ tax_code: NotRequired[str] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID to use for this line item. If not provided, we will use the tax code from the provided `product` param. If neither `tax_code` nor `product` is provided, we will use the default tax code from your Tax Settings. """ class CreateParamsShipFromDetails(TypedDict): address: "CalculationService.CreateParamsShipFromDetailsAddress" """ The address from which the goods are being shipped from. """ class CreateParamsShipFromDetailsAddress(TypedDict): city: NotRequired["Literal['']|str"] """ City, district, suburb, town, or village. """ country: str """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired["Literal['']|str"] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired["Literal['']|str"] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired["Literal['']|str"] """ ZIP or postal code. """ state: NotRequired["Literal['']|str"] """ State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix. Example: "NY" or "TX". """ class CreateParamsShippingCost(TypedDict): amount: NotRequired[int] """ A positive integer in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) representing the shipping charge. If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes are calculated on top of this amount. """ shipping_rate: NotRequired[str] """ If provided, the [shipping rate](https://stripe.com/docs/api/shipping_rates/object)'s `amount`, `tax_code` and `tax_behavior` are used. If you provide a shipping rate, then you cannot pass the `amount`, `tax_code`, or `tax_behavior` parameters. """ tax_behavior: NotRequired[Literal["exclusive", "inclusive"]] """ Specifies whether the `amount` includes taxes. If `tax_behavior=inclusive`, then the amount includes taxes. Defaults to `exclusive`. """ tax_code: NotRequired[str] """ The [tax code](https://stripe.com/docs/tax/tax-categories) used to calculate tax on shipping. If not provided, the default shipping tax code from your [Tax Settings](https://stripe.com/settings/tax) is used. """ def create( self, params: "CalculationService.CreateParams", options: RequestOptions = {}, ) -> Calculation: """ Calculates tax based on the input and returns a Tax Calculation object. """ return cast( Calculation, self._request( "post", "/v1/tax/calculations", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "CalculationService.CreateParams", options: RequestOptions = {}, ) -> Calculation: """ Calculates tax based on the input and returns a Tax Calculation object. """ return cast( Calculation, await self._request_async( "post", "/v1/tax/calculations", api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/tax/_registration.py0000644000175100001770000017263514637354563020067 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import sanitize_id from typing import ClassVar, List, Optional, Union, cast from typing_extensions import Literal, NotRequired, TypedDict, Unpack class Registration( CreateableAPIResource["Registration"], ListableAPIResource["Registration"], UpdateableAPIResource["Registration"], ): """ A Tax `Registration` lets us know that your business is registered to collect tax on payments within a region, enabling you to [automatically collect tax](https://stripe.com/docs/tax). Stripe doesn't register on your behalf with the relevant authorities when you create a Tax `Registration` object. For more information on how to register to collect tax, see [our guide](https://stripe.com/docs/tax/registering). Related guide: [Using the Registrations API](https://stripe.com/docs/tax/registrations-api) """ OBJECT_NAME: ClassVar[Literal["tax.registration"]] = "tax.registration" class CountryOptions(StripeObject): class Ae(StripeObject): type: Literal["standard"] """ Type of registration in `country`. """ class At(StripeObject): class Standard(StripeObject): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration in an EU country. """ _inner_class_types = {"standard": Standard} class Au(StripeObject): type: Literal["standard"] """ Type of registration in `country`. """ class Be(StripeObject): class Standard(StripeObject): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration in an EU country. """ _inner_class_types = {"standard": Standard} class Bg(StripeObject): class Standard(StripeObject): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration in an EU country. """ _inner_class_types = {"standard": Standard} class Bh(StripeObject): type: Literal["standard"] """ Type of registration in `country`. """ class Ca(StripeObject): class ProvinceStandard(StripeObject): province: str """ Two-letter CA province code ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). """ province_standard: Optional[ProvinceStandard] type: Literal["province_standard", "simplified", "standard"] """ Type of registration in Canada. """ _inner_class_types = {"province_standard": ProvinceStandard} class Ch(StripeObject): type: Literal["standard"] """ Type of registration in `country`. """ class Cl(StripeObject): type: Literal["simplified"] """ Type of registration in `country`. """ class Co(StripeObject): type: Literal["simplified"] """ Type of registration in `country`. """ class Cy(StripeObject): class Standard(StripeObject): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration in an EU country. """ _inner_class_types = {"standard": Standard} class Cz(StripeObject): class Standard(StripeObject): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration in an EU country. """ _inner_class_types = {"standard": Standard} class De(StripeObject): class Standard(StripeObject): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration in an EU country. """ _inner_class_types = {"standard": Standard} class Dk(StripeObject): class Standard(StripeObject): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration in an EU country. """ _inner_class_types = {"standard": Standard} class Ee(StripeObject): class Standard(StripeObject): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration in an EU country. """ _inner_class_types = {"standard": Standard} class Eg(StripeObject): type: Literal["simplified"] """ Type of registration in `country`. """ class Es(StripeObject): class Standard(StripeObject): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration in an EU country. """ _inner_class_types = {"standard": Standard} class Fi(StripeObject): class Standard(StripeObject): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration in an EU country. """ _inner_class_types = {"standard": Standard} class Fr(StripeObject): class Standard(StripeObject): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration in an EU country. """ _inner_class_types = {"standard": Standard} class Gb(StripeObject): type: Literal["standard"] """ Type of registration in `country`. """ class Ge(StripeObject): type: Literal["simplified"] """ Type of registration in `country`. """ class Gr(StripeObject): class Standard(StripeObject): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration in an EU country. """ _inner_class_types = {"standard": Standard} class Hr(StripeObject): class Standard(StripeObject): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration in an EU country. """ _inner_class_types = {"standard": Standard} class Hu(StripeObject): class Standard(StripeObject): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration in an EU country. """ _inner_class_types = {"standard": Standard} class Id(StripeObject): type: Literal["simplified"] """ Type of registration in `country`. """ class Ie(StripeObject): class Standard(StripeObject): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration in an EU country. """ _inner_class_types = {"standard": Standard} class Is(StripeObject): type: Literal["standard"] """ Type of registration in `country`. """ class It(StripeObject): class Standard(StripeObject): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration in an EU country. """ _inner_class_types = {"standard": Standard} class Jp(StripeObject): type: Literal["standard"] """ Type of registration in `country`. """ class Ke(StripeObject): type: Literal["simplified"] """ Type of registration in `country`. """ class Kr(StripeObject): type: Literal["simplified"] """ Type of registration in `country`. """ class Kz(StripeObject): type: Literal["simplified"] """ Type of registration in `country`. """ class Lt(StripeObject): class Standard(StripeObject): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration in an EU country. """ _inner_class_types = {"standard": Standard} class Lu(StripeObject): class Standard(StripeObject): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration in an EU country. """ _inner_class_types = {"standard": Standard} class Lv(StripeObject): class Standard(StripeObject): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration in an EU country. """ _inner_class_types = {"standard": Standard} class Mt(StripeObject): class Standard(StripeObject): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration in an EU country. """ _inner_class_types = {"standard": Standard} class Mx(StripeObject): type: Literal["simplified"] """ Type of registration in `country`. """ class My(StripeObject): type: Literal["simplified"] """ Type of registration in `country`. """ class Ng(StripeObject): type: Literal["simplified"] """ Type of registration in `country`. """ class Nl(StripeObject): class Standard(StripeObject): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration in an EU country. """ _inner_class_types = {"standard": Standard} class No(StripeObject): type: Literal["standard"] """ Type of registration in `country`. """ class Nz(StripeObject): type: Literal["standard"] """ Type of registration in `country`. """ class Om(StripeObject): type: Literal["standard"] """ Type of registration in `country`. """ class Pl(StripeObject): class Standard(StripeObject): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration in an EU country. """ _inner_class_types = {"standard": Standard} class Pt(StripeObject): class Standard(StripeObject): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration in an EU country. """ _inner_class_types = {"standard": Standard} class Ro(StripeObject): class Standard(StripeObject): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration in an EU country. """ _inner_class_types = {"standard": Standard} class Sa(StripeObject): type: Literal["simplified"] """ Type of registration in `country`. """ class Se(StripeObject): class Standard(StripeObject): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration in an EU country. """ _inner_class_types = {"standard": Standard} class Sg(StripeObject): type: Literal["standard"] """ Type of registration in `country`. """ class Si(StripeObject): class Standard(StripeObject): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration in an EU country. """ _inner_class_types = {"standard": Standard} class Sk(StripeObject): class Standard(StripeObject): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ standard: Optional[Standard] type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration in an EU country. """ _inner_class_types = {"standard": Standard} class Th(StripeObject): type: Literal["simplified"] """ Type of registration in `country`. """ class Tr(StripeObject): type: Literal["simplified"] """ Type of registration in `country`. """ class Us(StripeObject): class LocalAmusementTax(StripeObject): jurisdiction: str """ A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction. """ class LocalLeaseTax(StripeObject): jurisdiction: str """ A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction. """ local_amusement_tax: Optional[LocalAmusementTax] local_lease_tax: Optional[LocalLeaseTax] state: str """ Two-letter US state code ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). """ type: Literal[ "local_amusement_tax", "local_lease_tax", "state_communications_tax", "state_sales_tax", ] """ Type of registration in the US. """ _inner_class_types = { "local_amusement_tax": LocalAmusementTax, "local_lease_tax": LocalLeaseTax, } class Vn(StripeObject): type: Literal["simplified"] """ Type of registration in `country`. """ class Za(StripeObject): type: Literal["standard"] """ Type of registration in `country`. """ ae: Optional[Ae] at: Optional[At] au: Optional[Au] be: Optional[Be] bg: Optional[Bg] bh: Optional[Bh] ca: Optional[Ca] ch: Optional[Ch] cl: Optional[Cl] co: Optional[Co] cy: Optional[Cy] cz: Optional[Cz] de: Optional[De] dk: Optional[Dk] ee: Optional[Ee] eg: Optional[Eg] es: Optional[Es] fi: Optional[Fi] fr: Optional[Fr] gb: Optional[Gb] ge: Optional[Ge] gr: Optional[Gr] hr: Optional[Hr] hu: Optional[Hu] id: Optional[Id] ie: Optional[Ie] is_: Optional[Is] it: Optional[It] jp: Optional[Jp] ke: Optional[Ke] kr: Optional[Kr] kz: Optional[Kz] lt: Optional[Lt] lu: Optional[Lu] lv: Optional[Lv] mt: Optional[Mt] mx: Optional[Mx] my: Optional[My] ng: Optional[Ng] nl: Optional[Nl] no: Optional[No] nz: Optional[Nz] om: Optional[Om] pl: Optional[Pl] pt: Optional[Pt] ro: Optional[Ro] sa: Optional[Sa] se: Optional[Se] sg: Optional[Sg] si: Optional[Si] sk: Optional[Sk] th: Optional[Th] tr: Optional[Tr] us: Optional[Us] vn: Optional[Vn] za: Optional[Za] _inner_class_types = { "ae": Ae, "at": At, "au": Au, "be": Be, "bg": Bg, "bh": Bh, "ca": Ca, "ch": Ch, "cl": Cl, "co": Co, "cy": Cy, "cz": Cz, "de": De, "dk": Dk, "ee": Ee, "eg": Eg, "es": Es, "fi": Fi, "fr": Fr, "gb": Gb, "ge": Ge, "gr": Gr, "hr": Hr, "hu": Hu, "id": Id, "ie": Ie, "is": Is, "it": It, "jp": Jp, "ke": Ke, "kr": Kr, "kz": Kz, "lt": Lt, "lu": Lu, "lv": Lv, "mt": Mt, "mx": Mx, "my": My, "ng": Ng, "nl": Nl, "no": No, "nz": Nz, "om": Om, "pl": Pl, "pt": Pt, "ro": Ro, "sa": Sa, "se": Se, "sg": Sg, "si": Si, "sk": Sk, "th": Th, "tr": Tr, "us": Us, "vn": Vn, "za": Za, } _field_remappings = {"is_": "is"} class CreateParams(RequestOptions): active_from: Union[Literal["now"], int] """ Time at which the Tax Registration becomes active. It can be either `now` to indicate the current time, or a future timestamp measured in seconds since the Unix epoch. """ country: str """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ country_options: "Registration.CreateParamsCountryOptions" """ Specific options for a registration in the specified `country`. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ expires_at: NotRequired[int] """ If set, the Tax Registration stops being active at this time. If not set, the Tax Registration will be active indefinitely. Timestamp measured in seconds since the Unix epoch. """ _CreateParamsCountryOptionsBase = TypedDict( "CreateParamsCountryOptions", {"is": NotRequired["Registration.CreateParamsCountryOptionsIs"]}, ) class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): ae: NotRequired["Registration.CreateParamsCountryOptionsAe"] """ Options for the registration in AE. """ at: NotRequired["Registration.CreateParamsCountryOptionsAt"] """ Options for the registration in AT. """ au: NotRequired["Registration.CreateParamsCountryOptionsAu"] """ Options for the registration in AU. """ be: NotRequired["Registration.CreateParamsCountryOptionsBe"] """ Options for the registration in BE. """ bg: NotRequired["Registration.CreateParamsCountryOptionsBg"] """ Options for the registration in BG. """ bh: NotRequired["Registration.CreateParamsCountryOptionsBh"] """ Options for the registration in BH. """ ca: NotRequired["Registration.CreateParamsCountryOptionsCa"] """ Options for the registration in CA. """ ch: NotRequired["Registration.CreateParamsCountryOptionsCh"] """ Options for the registration in CH. """ cl: NotRequired["Registration.CreateParamsCountryOptionsCl"] """ Options for the registration in CL. """ co: NotRequired["Registration.CreateParamsCountryOptionsCo"] """ Options for the registration in CO. """ cy: NotRequired["Registration.CreateParamsCountryOptionsCy"] """ Options for the registration in CY. """ cz: NotRequired["Registration.CreateParamsCountryOptionsCz"] """ Options for the registration in CZ. """ de: NotRequired["Registration.CreateParamsCountryOptionsDe"] """ Options for the registration in DE. """ dk: NotRequired["Registration.CreateParamsCountryOptionsDk"] """ Options for the registration in DK. """ ee: NotRequired["Registration.CreateParamsCountryOptionsEe"] """ Options for the registration in EE. """ eg: NotRequired["Registration.CreateParamsCountryOptionsEg"] """ Options for the registration in EG. """ es: NotRequired["Registration.CreateParamsCountryOptionsEs"] """ Options for the registration in ES. """ fi: NotRequired["Registration.CreateParamsCountryOptionsFi"] """ Options for the registration in FI. """ fr: NotRequired["Registration.CreateParamsCountryOptionsFr"] """ Options for the registration in FR. """ gb: NotRequired["Registration.CreateParamsCountryOptionsGb"] """ Options for the registration in GB. """ ge: NotRequired["Registration.CreateParamsCountryOptionsGe"] """ Options for the registration in GE. """ gr: NotRequired["Registration.CreateParamsCountryOptionsGr"] """ Options for the registration in GR. """ hr: NotRequired["Registration.CreateParamsCountryOptionsHr"] """ Options for the registration in HR. """ hu: NotRequired["Registration.CreateParamsCountryOptionsHu"] """ Options for the registration in HU. """ id: NotRequired["Registration.CreateParamsCountryOptionsId"] """ Options for the registration in ID. """ ie: NotRequired["Registration.CreateParamsCountryOptionsIe"] """ Options for the registration in IE. """ it: NotRequired["Registration.CreateParamsCountryOptionsIt"] """ Options for the registration in IT. """ jp: NotRequired["Registration.CreateParamsCountryOptionsJp"] """ Options for the registration in JP. """ ke: NotRequired["Registration.CreateParamsCountryOptionsKe"] """ Options for the registration in KE. """ kr: NotRequired["Registration.CreateParamsCountryOptionsKr"] """ Options for the registration in KR. """ kz: NotRequired["Registration.CreateParamsCountryOptionsKz"] """ Options for the registration in KZ. """ lt: NotRequired["Registration.CreateParamsCountryOptionsLt"] """ Options for the registration in LT. """ lu: NotRequired["Registration.CreateParamsCountryOptionsLu"] """ Options for the registration in LU. """ lv: NotRequired["Registration.CreateParamsCountryOptionsLv"] """ Options for the registration in LV. """ mt: NotRequired["Registration.CreateParamsCountryOptionsMt"] """ Options for the registration in MT. """ mx: NotRequired["Registration.CreateParamsCountryOptionsMx"] """ Options for the registration in MX. """ my: NotRequired["Registration.CreateParamsCountryOptionsMy"] """ Options for the registration in MY. """ ng: NotRequired["Registration.CreateParamsCountryOptionsNg"] """ Options for the registration in NG. """ nl: NotRequired["Registration.CreateParamsCountryOptionsNl"] """ Options for the registration in NL. """ no: NotRequired["Registration.CreateParamsCountryOptionsNo"] """ Options for the registration in NO. """ nz: NotRequired["Registration.CreateParamsCountryOptionsNz"] """ Options for the registration in NZ. """ om: NotRequired["Registration.CreateParamsCountryOptionsOm"] """ Options for the registration in OM. """ pl: NotRequired["Registration.CreateParamsCountryOptionsPl"] """ Options for the registration in PL. """ pt: NotRequired["Registration.CreateParamsCountryOptionsPt"] """ Options for the registration in PT. """ ro: NotRequired["Registration.CreateParamsCountryOptionsRo"] """ Options for the registration in RO. """ sa: NotRequired["Registration.CreateParamsCountryOptionsSa"] """ Options for the registration in SA. """ se: NotRequired["Registration.CreateParamsCountryOptionsSe"] """ Options for the registration in SE. """ sg: NotRequired["Registration.CreateParamsCountryOptionsSg"] """ Options for the registration in SG. """ si: NotRequired["Registration.CreateParamsCountryOptionsSi"] """ Options for the registration in SI. """ sk: NotRequired["Registration.CreateParamsCountryOptionsSk"] """ Options for the registration in SK. """ th: NotRequired["Registration.CreateParamsCountryOptionsTh"] """ Options for the registration in TH. """ tr: NotRequired["Registration.CreateParamsCountryOptionsTr"] """ Options for the registration in TR. """ us: NotRequired["Registration.CreateParamsCountryOptionsUs"] """ Options for the registration in US. """ vn: NotRequired["Registration.CreateParamsCountryOptionsVn"] """ Options for the registration in VN. """ za: NotRequired["Registration.CreateParamsCountryOptionsZa"] """ Options for the registration in ZA. """ class CreateParamsCountryOptionsAe(TypedDict): type: Literal["standard"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsAt(TypedDict): standard: NotRequired[ "Registration.CreateParamsCountryOptionsAtStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsAtStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsAu(TypedDict): type: Literal["standard"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsBe(TypedDict): standard: NotRequired[ "Registration.CreateParamsCountryOptionsBeStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsBeStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsBg(TypedDict): standard: NotRequired[ "Registration.CreateParamsCountryOptionsBgStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsBgStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsBh(TypedDict): type: Literal["standard"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsCa(TypedDict): province_standard: NotRequired[ "Registration.CreateParamsCountryOptionsCaProvinceStandard" ] """ Options for the provincial tax registration. """ type: Literal["province_standard", "simplified", "standard"] """ Type of registration to be created in Canada. """ class CreateParamsCountryOptionsCaProvinceStandard(TypedDict): province: str """ Two-letter CA province code ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). """ class CreateParamsCountryOptionsCh(TypedDict): type: Literal["standard"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsCl(TypedDict): type: Literal["simplified"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsCo(TypedDict): type: Literal["simplified"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsCy(TypedDict): standard: NotRequired[ "Registration.CreateParamsCountryOptionsCyStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsCyStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsCz(TypedDict): standard: NotRequired[ "Registration.CreateParamsCountryOptionsCzStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsCzStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsDe(TypedDict): standard: NotRequired[ "Registration.CreateParamsCountryOptionsDeStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsDeStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsDk(TypedDict): standard: NotRequired[ "Registration.CreateParamsCountryOptionsDkStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsDkStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsEe(TypedDict): standard: NotRequired[ "Registration.CreateParamsCountryOptionsEeStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsEeStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsEg(TypedDict): type: Literal["simplified"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsEs(TypedDict): standard: NotRequired[ "Registration.CreateParamsCountryOptionsEsStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsEsStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsFi(TypedDict): standard: NotRequired[ "Registration.CreateParamsCountryOptionsFiStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsFiStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsFr(TypedDict): standard: NotRequired[ "Registration.CreateParamsCountryOptionsFrStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsFrStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsGb(TypedDict): type: Literal["standard"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsGe(TypedDict): type: Literal["simplified"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsGr(TypedDict): standard: NotRequired[ "Registration.CreateParamsCountryOptionsGrStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsGrStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsHr(TypedDict): standard: NotRequired[ "Registration.CreateParamsCountryOptionsHrStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsHrStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsHu(TypedDict): standard: NotRequired[ "Registration.CreateParamsCountryOptionsHuStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsHuStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsId(TypedDict): type: Literal["simplified"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsIe(TypedDict): standard: NotRequired[ "Registration.CreateParamsCountryOptionsIeStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsIeStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsIs(TypedDict): type: Literal["standard"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsIt(TypedDict): standard: NotRequired[ "Registration.CreateParamsCountryOptionsItStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsItStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsJp(TypedDict): type: Literal["standard"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsKe(TypedDict): type: Literal["simplified"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsKr(TypedDict): type: Literal["simplified"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsKz(TypedDict): type: Literal["simplified"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsLt(TypedDict): standard: NotRequired[ "Registration.CreateParamsCountryOptionsLtStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsLtStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsLu(TypedDict): standard: NotRequired[ "Registration.CreateParamsCountryOptionsLuStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsLuStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsLv(TypedDict): standard: NotRequired[ "Registration.CreateParamsCountryOptionsLvStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsLvStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsMt(TypedDict): standard: NotRequired[ "Registration.CreateParamsCountryOptionsMtStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsMtStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsMx(TypedDict): type: Literal["simplified"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsMy(TypedDict): type: Literal["simplified"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsNg(TypedDict): type: Literal["simplified"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsNl(TypedDict): standard: NotRequired[ "Registration.CreateParamsCountryOptionsNlStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsNlStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsNo(TypedDict): type: Literal["standard"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsNz(TypedDict): type: Literal["standard"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsOm(TypedDict): type: Literal["standard"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsPl(TypedDict): standard: NotRequired[ "Registration.CreateParamsCountryOptionsPlStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsPlStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsPt(TypedDict): standard: NotRequired[ "Registration.CreateParamsCountryOptionsPtStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsPtStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsRo(TypedDict): standard: NotRequired[ "Registration.CreateParamsCountryOptionsRoStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsRoStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsSa(TypedDict): type: Literal["simplified"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsSe(TypedDict): standard: NotRequired[ "Registration.CreateParamsCountryOptionsSeStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsSeStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsSg(TypedDict): type: Literal["standard"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsSi(TypedDict): standard: NotRequired[ "Registration.CreateParamsCountryOptionsSiStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsSiStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsSk(TypedDict): standard: NotRequired[ "Registration.CreateParamsCountryOptionsSkStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsSkStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsTh(TypedDict): type: Literal["simplified"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsTr(TypedDict): type: Literal["simplified"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsUs(TypedDict): local_amusement_tax: NotRequired[ "Registration.CreateParamsCountryOptionsUsLocalAmusementTax" ] """ Options for the local amusement tax registration. """ local_lease_tax: NotRequired[ "Registration.CreateParamsCountryOptionsUsLocalLeaseTax" ] """ Options for the local lease tax registration. """ state: str """ Two-letter US state code ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). """ type: Literal[ "local_amusement_tax", "local_lease_tax", "state_communications_tax", "state_sales_tax", ] """ Type of registration to be created in the US. """ class CreateParamsCountryOptionsUsLocalAmusementTax(TypedDict): jurisdiction: str """ A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction. Supported FIPS codes are: `14000` (Chicago), `06613` (Bloomington), `21696` (East Dundee), `24582` (Evanston), and `68081` (Schiller Park). """ class CreateParamsCountryOptionsUsLocalLeaseTax(TypedDict): jurisdiction: str """ A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction. Supported FIPS codes are: `14000` (Chicago). """ class CreateParamsCountryOptionsVn(TypedDict): type: Literal["simplified"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsZa(TypedDict): type: Literal["standard"] """ Type of registration to be created in `country`. """ class ListParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[Literal["active", "all", "expired", "scheduled"]] """ The status of the Tax Registration. """ class ModifyParams(RequestOptions): active_from: NotRequired["Literal['now']|int"] """ Time at which the registration becomes active. It can be either `now` to indicate the current time, or a timestamp measured in seconds since the Unix epoch. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ expires_at: NotRequired["Literal['']|Literal['now']|int"] """ If set, the registration stops being active at this time. If not set, the registration will be active indefinitely. It can be either `now` to indicate the current time, or a timestamp measured in seconds since the Unix epoch. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ active_from: int """ Time at which the registration becomes active. Measured in seconds since the Unix epoch. """ country: str """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ country_options: CountryOptions created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ expires_at: Optional[int] """ If set, the registration stops being active at this time. If not set, the registration will be active indefinitely. Measured in seconds since the Unix epoch. """ id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ object: Literal["tax.registration"] """ String representing the object's type. Objects of the same type share the same value. """ status: Literal["active", "expired", "scheduled"] """ The status of the registration. This field is present for convenience and can be deduced from `active_from` and `expires_at`. """ @classmethod def create( cls, **params: Unpack["Registration.CreateParams"] ) -> "Registration": """ Creates a new Tax Registration object. """ return cast( "Registration", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["Registration.CreateParams"] ) -> "Registration": """ Creates a new Tax Registration object. """ return cast( "Registration", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def list( cls, **params: Unpack["Registration.ListParams"] ) -> ListObject["Registration"]: """ Returns a list of Tax Registration objects. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["Registration.ListParams"] ) -> ListObject["Registration"]: """ Returns a list of Tax Registration objects. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def modify( cls, id: str, **params: Unpack["Registration.ModifyParams"] ) -> "Registration": """ Updates an existing Tax Registration object. A registration cannot be deleted after it has been created. If you wish to end a registration you may do so by setting expires_at. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Registration", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["Registration.ModifyParams"] ) -> "Registration": """ Updates an existing Tax Registration object. A registration cannot be deleted after it has been created. If you wish to end a registration you may do so by setting expires_at. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Registration", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["Registration.RetrieveParams"] ) -> "Registration": """ Returns a Tax Registration object. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["Registration.RetrieveParams"] ) -> "Registration": """ Returns a Tax Registration object. """ instance = cls(id, **params) await instance.refresh_async() return instance _inner_class_types = {"country_options": CountryOptions} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/tax/_registration_service.py0000644000175100001770000011540314637354563021575 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.tax._registration import Registration from typing import List, Union, cast from typing_extensions import Literal, NotRequired, TypedDict class RegistrationService(StripeService): class CreateParams(TypedDict): active_from: Union[Literal["now"], int] """ Time at which the Tax Registration becomes active. It can be either `now` to indicate the current time, or a future timestamp measured in seconds since the Unix epoch. """ country: str """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ country_options: "RegistrationService.CreateParamsCountryOptions" """ Specific options for a registration in the specified `country`. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ expires_at: NotRequired[int] """ If set, the Tax Registration stops being active at this time. If not set, the Tax Registration will be active indefinitely. Timestamp measured in seconds since the Unix epoch. """ _CreateParamsCountryOptionsBase = TypedDict( "CreateParamsCountryOptions", { "is": NotRequired[ "RegistrationService.CreateParamsCountryOptionsIs" ] }, ) class CreateParamsCountryOptions(_CreateParamsCountryOptionsBase): ae: NotRequired["RegistrationService.CreateParamsCountryOptionsAe"] """ Options for the registration in AE. """ at: NotRequired["RegistrationService.CreateParamsCountryOptionsAt"] """ Options for the registration in AT. """ au: NotRequired["RegistrationService.CreateParamsCountryOptionsAu"] """ Options for the registration in AU. """ be: NotRequired["RegistrationService.CreateParamsCountryOptionsBe"] """ Options for the registration in BE. """ bg: NotRequired["RegistrationService.CreateParamsCountryOptionsBg"] """ Options for the registration in BG. """ bh: NotRequired["RegistrationService.CreateParamsCountryOptionsBh"] """ Options for the registration in BH. """ ca: NotRequired["RegistrationService.CreateParamsCountryOptionsCa"] """ Options for the registration in CA. """ ch: NotRequired["RegistrationService.CreateParamsCountryOptionsCh"] """ Options for the registration in CH. """ cl: NotRequired["RegistrationService.CreateParamsCountryOptionsCl"] """ Options for the registration in CL. """ co: NotRequired["RegistrationService.CreateParamsCountryOptionsCo"] """ Options for the registration in CO. """ cy: NotRequired["RegistrationService.CreateParamsCountryOptionsCy"] """ Options for the registration in CY. """ cz: NotRequired["RegistrationService.CreateParamsCountryOptionsCz"] """ Options for the registration in CZ. """ de: NotRequired["RegistrationService.CreateParamsCountryOptionsDe"] """ Options for the registration in DE. """ dk: NotRequired["RegistrationService.CreateParamsCountryOptionsDk"] """ Options for the registration in DK. """ ee: NotRequired["RegistrationService.CreateParamsCountryOptionsEe"] """ Options for the registration in EE. """ eg: NotRequired["RegistrationService.CreateParamsCountryOptionsEg"] """ Options for the registration in EG. """ es: NotRequired["RegistrationService.CreateParamsCountryOptionsEs"] """ Options for the registration in ES. """ fi: NotRequired["RegistrationService.CreateParamsCountryOptionsFi"] """ Options for the registration in FI. """ fr: NotRequired["RegistrationService.CreateParamsCountryOptionsFr"] """ Options for the registration in FR. """ gb: NotRequired["RegistrationService.CreateParamsCountryOptionsGb"] """ Options for the registration in GB. """ ge: NotRequired["RegistrationService.CreateParamsCountryOptionsGe"] """ Options for the registration in GE. """ gr: NotRequired["RegistrationService.CreateParamsCountryOptionsGr"] """ Options for the registration in GR. """ hr: NotRequired["RegistrationService.CreateParamsCountryOptionsHr"] """ Options for the registration in HR. """ hu: NotRequired["RegistrationService.CreateParamsCountryOptionsHu"] """ Options for the registration in HU. """ id: NotRequired["RegistrationService.CreateParamsCountryOptionsId"] """ Options for the registration in ID. """ ie: NotRequired["RegistrationService.CreateParamsCountryOptionsIe"] """ Options for the registration in IE. """ it: NotRequired["RegistrationService.CreateParamsCountryOptionsIt"] """ Options for the registration in IT. """ jp: NotRequired["RegistrationService.CreateParamsCountryOptionsJp"] """ Options for the registration in JP. """ ke: NotRequired["RegistrationService.CreateParamsCountryOptionsKe"] """ Options for the registration in KE. """ kr: NotRequired["RegistrationService.CreateParamsCountryOptionsKr"] """ Options for the registration in KR. """ kz: NotRequired["RegistrationService.CreateParamsCountryOptionsKz"] """ Options for the registration in KZ. """ lt: NotRequired["RegistrationService.CreateParamsCountryOptionsLt"] """ Options for the registration in LT. """ lu: NotRequired["RegistrationService.CreateParamsCountryOptionsLu"] """ Options for the registration in LU. """ lv: NotRequired["RegistrationService.CreateParamsCountryOptionsLv"] """ Options for the registration in LV. """ mt: NotRequired["RegistrationService.CreateParamsCountryOptionsMt"] """ Options for the registration in MT. """ mx: NotRequired["RegistrationService.CreateParamsCountryOptionsMx"] """ Options for the registration in MX. """ my: NotRequired["RegistrationService.CreateParamsCountryOptionsMy"] """ Options for the registration in MY. """ ng: NotRequired["RegistrationService.CreateParamsCountryOptionsNg"] """ Options for the registration in NG. """ nl: NotRequired["RegistrationService.CreateParamsCountryOptionsNl"] """ Options for the registration in NL. """ no: NotRequired["RegistrationService.CreateParamsCountryOptionsNo"] """ Options for the registration in NO. """ nz: NotRequired["RegistrationService.CreateParamsCountryOptionsNz"] """ Options for the registration in NZ. """ om: NotRequired["RegistrationService.CreateParamsCountryOptionsOm"] """ Options for the registration in OM. """ pl: NotRequired["RegistrationService.CreateParamsCountryOptionsPl"] """ Options for the registration in PL. """ pt: NotRequired["RegistrationService.CreateParamsCountryOptionsPt"] """ Options for the registration in PT. """ ro: NotRequired["RegistrationService.CreateParamsCountryOptionsRo"] """ Options for the registration in RO. """ sa: NotRequired["RegistrationService.CreateParamsCountryOptionsSa"] """ Options for the registration in SA. """ se: NotRequired["RegistrationService.CreateParamsCountryOptionsSe"] """ Options for the registration in SE. """ sg: NotRequired["RegistrationService.CreateParamsCountryOptionsSg"] """ Options for the registration in SG. """ si: NotRequired["RegistrationService.CreateParamsCountryOptionsSi"] """ Options for the registration in SI. """ sk: NotRequired["RegistrationService.CreateParamsCountryOptionsSk"] """ Options for the registration in SK. """ th: NotRequired["RegistrationService.CreateParamsCountryOptionsTh"] """ Options for the registration in TH. """ tr: NotRequired["RegistrationService.CreateParamsCountryOptionsTr"] """ Options for the registration in TR. """ us: NotRequired["RegistrationService.CreateParamsCountryOptionsUs"] """ Options for the registration in US. """ vn: NotRequired["RegistrationService.CreateParamsCountryOptionsVn"] """ Options for the registration in VN. """ za: NotRequired["RegistrationService.CreateParamsCountryOptionsZa"] """ Options for the registration in ZA. """ class CreateParamsCountryOptionsAe(TypedDict): type: Literal["standard"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsAt(TypedDict): standard: NotRequired[ "RegistrationService.CreateParamsCountryOptionsAtStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsAtStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsAu(TypedDict): type: Literal["standard"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsBe(TypedDict): standard: NotRequired[ "RegistrationService.CreateParamsCountryOptionsBeStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsBeStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsBg(TypedDict): standard: NotRequired[ "RegistrationService.CreateParamsCountryOptionsBgStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsBgStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsBh(TypedDict): type: Literal["standard"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsCa(TypedDict): province_standard: NotRequired[ "RegistrationService.CreateParamsCountryOptionsCaProvinceStandard" ] """ Options for the provincial tax registration. """ type: Literal["province_standard", "simplified", "standard"] """ Type of registration to be created in Canada. """ class CreateParamsCountryOptionsCaProvinceStandard(TypedDict): province: str """ Two-letter CA province code ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). """ class CreateParamsCountryOptionsCh(TypedDict): type: Literal["standard"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsCl(TypedDict): type: Literal["simplified"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsCo(TypedDict): type: Literal["simplified"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsCy(TypedDict): standard: NotRequired[ "RegistrationService.CreateParamsCountryOptionsCyStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsCyStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsCz(TypedDict): standard: NotRequired[ "RegistrationService.CreateParamsCountryOptionsCzStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsCzStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsDe(TypedDict): standard: NotRequired[ "RegistrationService.CreateParamsCountryOptionsDeStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsDeStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsDk(TypedDict): standard: NotRequired[ "RegistrationService.CreateParamsCountryOptionsDkStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsDkStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsEe(TypedDict): standard: NotRequired[ "RegistrationService.CreateParamsCountryOptionsEeStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsEeStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsEg(TypedDict): type: Literal["simplified"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsEs(TypedDict): standard: NotRequired[ "RegistrationService.CreateParamsCountryOptionsEsStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsEsStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsFi(TypedDict): standard: NotRequired[ "RegistrationService.CreateParamsCountryOptionsFiStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsFiStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsFr(TypedDict): standard: NotRequired[ "RegistrationService.CreateParamsCountryOptionsFrStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsFrStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsGb(TypedDict): type: Literal["standard"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsGe(TypedDict): type: Literal["simplified"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsGr(TypedDict): standard: NotRequired[ "RegistrationService.CreateParamsCountryOptionsGrStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsGrStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsHr(TypedDict): standard: NotRequired[ "RegistrationService.CreateParamsCountryOptionsHrStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsHrStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsHu(TypedDict): standard: NotRequired[ "RegistrationService.CreateParamsCountryOptionsHuStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsHuStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsId(TypedDict): type: Literal["simplified"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsIe(TypedDict): standard: NotRequired[ "RegistrationService.CreateParamsCountryOptionsIeStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsIeStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsIs(TypedDict): type: Literal["standard"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsIt(TypedDict): standard: NotRequired[ "RegistrationService.CreateParamsCountryOptionsItStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsItStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsJp(TypedDict): type: Literal["standard"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsKe(TypedDict): type: Literal["simplified"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsKr(TypedDict): type: Literal["simplified"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsKz(TypedDict): type: Literal["simplified"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsLt(TypedDict): standard: NotRequired[ "RegistrationService.CreateParamsCountryOptionsLtStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsLtStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsLu(TypedDict): standard: NotRequired[ "RegistrationService.CreateParamsCountryOptionsLuStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsLuStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsLv(TypedDict): standard: NotRequired[ "RegistrationService.CreateParamsCountryOptionsLvStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsLvStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsMt(TypedDict): standard: NotRequired[ "RegistrationService.CreateParamsCountryOptionsMtStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsMtStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsMx(TypedDict): type: Literal["simplified"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsMy(TypedDict): type: Literal["simplified"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsNg(TypedDict): type: Literal["simplified"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsNl(TypedDict): standard: NotRequired[ "RegistrationService.CreateParamsCountryOptionsNlStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsNlStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsNo(TypedDict): type: Literal["standard"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsNz(TypedDict): type: Literal["standard"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsOm(TypedDict): type: Literal["standard"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsPl(TypedDict): standard: NotRequired[ "RegistrationService.CreateParamsCountryOptionsPlStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsPlStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsPt(TypedDict): standard: NotRequired[ "RegistrationService.CreateParamsCountryOptionsPtStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsPtStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsRo(TypedDict): standard: NotRequired[ "RegistrationService.CreateParamsCountryOptionsRoStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsRoStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsSa(TypedDict): type: Literal["simplified"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsSe(TypedDict): standard: NotRequired[ "RegistrationService.CreateParamsCountryOptionsSeStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsSeStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsSg(TypedDict): type: Literal["standard"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsSi(TypedDict): standard: NotRequired[ "RegistrationService.CreateParamsCountryOptionsSiStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsSiStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsSk(TypedDict): standard: NotRequired[ "RegistrationService.CreateParamsCountryOptionsSkStandard" ] """ Options for the standard registration. """ type: Literal["ioss", "oss_non_union", "oss_union", "standard"] """ Type of registration to be created in an EU country. """ class CreateParamsCountryOptionsSkStandard(TypedDict): place_of_supply_scheme: Literal["small_seller", "standard"] """ Place of supply scheme used in an EU standard registration. """ class CreateParamsCountryOptionsTh(TypedDict): type: Literal["simplified"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsTr(TypedDict): type: Literal["simplified"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsUs(TypedDict): local_amusement_tax: NotRequired[ "RegistrationService.CreateParamsCountryOptionsUsLocalAmusementTax" ] """ Options for the local amusement tax registration. """ local_lease_tax: NotRequired[ "RegistrationService.CreateParamsCountryOptionsUsLocalLeaseTax" ] """ Options for the local lease tax registration. """ state: str """ Two-letter US state code ([ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2)). """ type: Literal[ "local_amusement_tax", "local_lease_tax", "state_communications_tax", "state_sales_tax", ] """ Type of registration to be created in the US. """ class CreateParamsCountryOptionsUsLocalAmusementTax(TypedDict): jurisdiction: str """ A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction. Supported FIPS codes are: `14000` (Chicago), `06613` (Bloomington), `21696` (East Dundee), `24582` (Evanston), and `68081` (Schiller Park). """ class CreateParamsCountryOptionsUsLocalLeaseTax(TypedDict): jurisdiction: str """ A [FIPS code](https://www.census.gov/library/reference/code-lists/ansi.html) representing the local jurisdiction. Supported FIPS codes are: `14000` (Chicago). """ class CreateParamsCountryOptionsVn(TypedDict): type: Literal["simplified"] """ Type of registration to be created in `country`. """ class CreateParamsCountryOptionsZa(TypedDict): type: Literal["standard"] """ Type of registration to be created in `country`. """ class ListParams(TypedDict): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[Literal["active", "all", "expired", "scheduled"]] """ The status of the Tax Registration. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): active_from: NotRequired["Literal['now']|int"] """ Time at which the registration becomes active. It can be either `now` to indicate the current time, or a timestamp measured in seconds since the Unix epoch. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ expires_at: NotRequired["Literal['']|Literal['now']|int"] """ If set, the registration stops being active at this time. If not set, the registration will be active indefinitely. It can be either `now` to indicate the current time, or a timestamp measured in seconds since the Unix epoch. """ def list( self, params: "RegistrationService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Registration]: """ Returns a list of Tax Registration objects. """ return cast( ListObject[Registration], self._request( "get", "/v1/tax/registrations", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "RegistrationService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Registration]: """ Returns a list of Tax Registration objects. """ return cast( ListObject[Registration], await self._request_async( "get", "/v1/tax/registrations", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "RegistrationService.CreateParams", options: RequestOptions = {}, ) -> Registration: """ Creates a new Tax Registration object. """ return cast( Registration, self._request( "post", "/v1/tax/registrations", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "RegistrationService.CreateParams", options: RequestOptions = {}, ) -> Registration: """ Creates a new Tax Registration object. """ return cast( Registration, await self._request_async( "post", "/v1/tax/registrations", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, id: str, params: "RegistrationService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Registration: """ Returns a Tax Registration object. """ return cast( Registration, self._request( "get", "/v1/tax/registrations/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, id: str, params: "RegistrationService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Registration: """ Returns a Tax Registration object. """ return cast( Registration, await self._request_async( "get", "/v1/tax/registrations/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, id: str, params: "RegistrationService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Registration: """ Updates an existing Tax Registration object. A registration cannot be deleted after it has been created. If you wish to end a registration you may do so by setting expires_at. """ return cast( Registration, self._request( "post", "/v1/tax/registrations/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, id: str, params: "RegistrationService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Registration: """ Updates an existing Tax Registration object. A registration cannot be deleted after it has been created. If you wish to end a registration you may do so by setting expires_at. """ return cast( Registration, await self._request_async( "post", "/v1/tax/registrations/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/tax/_settings.py0000644000175100001770000001703414637354563017204 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._singleton_api_resource import SingletonAPIResource from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from typing import ClassVar, List, Optional, cast from typing_extensions import Literal, NotRequired, TypedDict, Unpack class Settings( SingletonAPIResource["Settings"], UpdateableAPIResource["Settings"], ): """ You can use Tax `Settings` to manage configurations used by Stripe Tax calculations. Related guide: [Using the Settings API](https://stripe.com/docs/tax/settings-api) """ OBJECT_NAME: ClassVar[Literal["tax.settings"]] = "tax.settings" class Defaults(StripeObject): tax_behavior: Optional[ Literal["exclusive", "inclusive", "inferred_by_currency"] ] """ Default [tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#tax-behavior) used to specify whether the price is considered inclusive of taxes or exclusive of taxes. If the item's price has a tax behavior set, it will take precedence over the default tax behavior. """ tax_code: Optional[str] """ Default [tax code](https://stripe.com/docs/tax/tax-categories) used to classify your products and prices. """ class HeadOffice(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 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State, county, province, or region. """ address: Address _inner_class_types = {"address": Address} class StatusDetails(StripeObject): class Active(StripeObject): pass class Pending(StripeObject): missing_fields: Optional[List[str]] """ The list of missing fields that are required to perform calculations. It includes the entry `head_office` when the status is `pending`. It is recommended to set the optional values even if they aren't listed as required for calculating taxes. Calculations can fail if missing fields aren't explicitly provided on every call. """ active: Optional[Active] pending: Optional[Pending] _inner_class_types = {"active": Active, "pending": Pending} class ModifyParams(RequestOptions): defaults: NotRequired["Settings.ModifyParamsDefaults"] """ Default configuration to be used on Stripe Tax calculations. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ head_office: NotRequired["Settings.ModifyParamsHeadOffice"] """ The place where your business is located. """ class ModifyParamsDefaults(TypedDict): tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "inferred_by_currency"] ] """ Specifies the default [tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#tax-behavior) to be used when the item's price has unspecified tax behavior. One of inclusive, exclusive, or inferred_by_currency. Once specified, it cannot be changed back to null. """ tax_code: NotRequired[str] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ class ModifyParamsHeadOffice(TypedDict): address: "Settings.ModifyParamsHeadOfficeAddress" """ The location of the business for tax purposes. """ class ModifyParamsHeadOfficeAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix. Example: "NY" or "TX". """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ defaults: Defaults head_office: Optional[HeadOffice] """ The place where your business is located. """ 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["tax.settings"] """ String representing the object's type. Objects of the same type share the same value. """ status: Literal["active", "pending"] """ The `active` status indicates you have all required settings to calculate tax. A status can transition out of `active` when new required settings are introduced. """ status_details: StatusDetails @classmethod def modify(cls, **params: Unpack["Settings.ModifyParams"]) -> "Settings": """ Updates Tax Settings parameters used in tax calculations. All parameters are editable but none can be removed once set. """ return cast( "Settings", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def modify_async( cls, **params: Unpack["Settings.ModifyParams"] ) -> "Settings": """ Updates Tax Settings parameters used in tax calculations. All parameters are editable but none can be removed once set. """ return cast( "Settings", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def retrieve( cls, **params: Unpack["Settings.RetrieveParams"] ) -> "Settings": """ Retrieves Tax Settings for a merchant. """ instance = cls(None, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, **params: Unpack["Settings.RetrieveParams"] ) -> "Settings": """ Retrieves Tax Settings for a merchant. """ instance = cls(None, **params) await instance.refresh_async() return instance @classmethod def class_url(cls): return "/v1/tax/settings" _inner_class_types = { "defaults": Defaults, "head_office": HeadOffice, "status_details": StatusDetails, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/tax/_settings_service.py0000644000175100001770000001136314637354563020723 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe.tax._settings import Settings from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict class SettingsService(StripeService): class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): defaults: NotRequired["SettingsService.UpdateParamsDefaults"] """ Default configuration to be used on Stripe Tax calculations. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ head_office: NotRequired["SettingsService.UpdateParamsHeadOffice"] """ The place where your business is located. """ class UpdateParamsDefaults(TypedDict): tax_behavior: NotRequired[ Literal["exclusive", "inclusive", "inferred_by_currency"] ] """ Specifies the default [tax behavior](https://stripe.com/docs/tax/products-prices-tax-categories-tax-behavior#tax-behavior) to be used when the item's price has unspecified tax behavior. One of inclusive, exclusive, or inferred_by_currency. Once specified, it cannot be changed back to null. """ tax_code: NotRequired[str] """ A [tax code](https://stripe.com/docs/tax/tax-categories) ID. """ class UpdateParamsHeadOffice(TypedDict): address: "SettingsService.UpdateParamsHeadOfficeAddress" """ The location of the business for tax purposes. """ class UpdateParamsHeadOfficeAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix. Example: "NY" or "TX". """ def retrieve( self, params: "SettingsService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Settings: """ Retrieves Tax Settings for a merchant. """ return cast( Settings, self._request( "get", "/v1/tax/settings", api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, params: "SettingsService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Settings: """ Retrieves Tax Settings for a merchant. """ return cast( Settings, await self._request_async( "get", "/v1/tax/settings", api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, params: "SettingsService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Settings: """ Updates Tax Settings parameters used in tax calculations. All parameters are editable but none can be removed once set. """ return cast( Settings, self._request( "post", "/v1/tax/settings", api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, params: "SettingsService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Settings: """ Updates Tax Settings parameters used in tax calculations. All parameters are editable but none can be removed once set. """ return cast( Settings, await self._request_async( "post", "/v1/tax/settings", api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/tax/_transaction.py0000644000175100001770000006234714637354563017700 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._api_resource import APIResource from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe.tax._transaction_line_item import TransactionLineItem class Transaction(APIResource["Transaction"]): """ A Tax Transaction records the tax collected from or refunded to your customer. Related guide: [Calculate tax in your custom payment flow](https://stripe.com/docs/tax/custom#tax-transaction) """ OBJECT_NAME: ClassVar[Literal["tax.transaction"]] = "tax.transaction" class CustomerDetails(StripeObject): class Address(StripeObject): city: Optional[str] """ City, district, suburb, town, or village. """ country: str """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: Optional[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix. Example: "NY" or "TX". """ class TaxId(StripeObject): type: Literal[ "ad_nrt", "ae_trn", "ar_cuit", "au_abn", "au_arn", "bg_uic", "bh_vat", "bo_tin", "br_cnpj", "br_cpf", "ca_bn", "ca_gst_hst", "ca_pst_bc", "ca_pst_mb", "ca_pst_sk", "ca_qst", "ch_uid", "ch_vat", "cl_tin", "cn_tin", "co_nit", "cr_tin", "de_stn", "do_rcn", "ec_ruc", "eg_tin", "es_cif", "eu_oss_vat", "eu_vat", "gb_vat", "ge_vat", "hk_br", "hu_tin", "id_npwp", "il_vat", "in_gst", "is_vat", "jp_cn", "jp_rn", "jp_trn", "ke_pin", "kr_brn", "kz_bin", "li_uid", "mx_rfc", "my_frp", "my_itn", "my_sst", "ng_tin", "no_vat", "no_voec", "nz_gst", "om_vat", "pe_ruc", "ph_tin", "ro_tin", "rs_pib", "ru_inn", "ru_kpp", "sa_vat", "sg_gst", "sg_uen", "si_tin", "sv_nit", "th_vat", "tr_tin", "tw_vat", "ua_vat", "unknown", "us_ein", "uy_ruc", "ve_rif", "vn_tin", "za_vat", ] """ The type of the tax ID, one of `ad_nrt`, `ar_cuit`, `eu_vat`, `bo_tin`, `br_cnpj`, `br_cpf`, `cn_tin`, `co_nit`, `cr_tin`, `do_rcn`, `ec_ruc`, `eu_oss_vat`, `pe_ruc`, `ro_tin`, `rs_pib`, `sv_nit`, `uy_ruc`, `ve_rif`, `vn_tin`, `gb_vat`, `nz_gst`, `au_abn`, `au_arn`, `in_gst`, `no_vat`, `no_voec`, `za_vat`, `ch_vat`, `mx_rfc`, `sg_uen`, `ru_inn`, `ru_kpp`, `ca_bn`, `hk_br`, `es_cif`, `tw_vat`, `th_vat`, `jp_cn`, `jp_rn`, `jp_trn`, `li_uid`, `my_itn`, `us_ein`, `kr_brn`, `ca_qst`, `ca_gst_hst`, `ca_pst_bc`, `ca_pst_mb`, `ca_pst_sk`, `my_sst`, `sg_gst`, `ae_trn`, `cl_tin`, `sa_vat`, `id_npwp`, `my_frp`, `il_vat`, `ge_vat`, `ua_vat`, `is_vat`, `bg_uic`, `hu_tin`, `si_tin`, `ke_pin`, `tr_tin`, `eg_tin`, `ph_tin`, `bh_vat`, `kz_bin`, `ng_tin`, `om_vat`, `de_stn`, `ch_uid`, or `unknown` """ value: str """ The value of the tax ID. """ address: Optional[Address] """ The customer's postal address (for example, home or business location). """ address_source: Optional[Literal["billing", "shipping"]] """ The type of customer address provided. """ ip_address: Optional[str] """ The customer's IP address (IPv4 or IPv6). """ tax_ids: List[TaxId] """ The customer's tax IDs (for example, EU VAT numbers). """ taxability_override: Literal[ "customer_exempt", "none", "reverse_charge" ] """ The taxability override used for taxation. """ _inner_class_types = {"address": Address, "tax_ids": TaxId} class Reversal(StripeObject): original_transaction: Optional[str] """ The `id` of the reversed `Transaction` object. """ class ShipFromDetails(StripeObject): class Address(StripeObject): city: Optional[str] """ City, district, suburb, town, or village. """ country: str """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: Optional[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State/province as an [ISO 3166-2](https://en.wikipedia.org/wiki/ISO_3166-2) subdivision code, without country prefix. Example: "NY" or "TX". """ address: Address _inner_class_types = {"address": Address} class ShippingCost(StripeObject): class TaxBreakdown(StripeObject): class Jurisdiction(StripeObject): country: str """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ display_name: str """ A human-readable name for the jurisdiction imposing the tax. """ level: Literal[ "city", "country", "county", "district", "state" ] """ Indicates the level of the jurisdiction imposing the tax. """ state: Optional[str] """ [ISO 3166-2 subdivision code](https://en.wikipedia.org/wiki/ISO_3166-2:US), without country prefix. For example, "NY" for New York, United States. """ class TaxRateDetails(StripeObject): display_name: str """ A localized display name for tax type, intended to be human-readable. For example, "Local Sales and Use Tax", "Value-added tax (VAT)", or "Umsatzsteuer (USt.)". """ percentage_decimal: str """ The tax rate percentage as a string. For example, 8.5% is represented as "8.5". """ tax_type: Literal[ "amusement_tax", "communications_tax", "gst", "hst", "igst", "jct", "lease_tax", "pst", "qst", "rst", "sales_tax", "vat", ] """ The tax type, such as `vat` or `sales_tax`. """ amount: int """ The amount of tax, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ jurisdiction: Jurisdiction sourcing: Literal["destination", "origin"] """ Indicates whether the jurisdiction was determined by the origin (merchant's address) or destination (customer's address). """ tax_rate_details: Optional[TaxRateDetails] """ Details regarding the rate for this tax. This field will be `null` when the tax is not imposed, for example if the product is exempt from tax. """ taxability_reason: Literal[ "customer_exempt", "not_collecting", "not_subject_to_tax", "not_supported", "portion_product_exempt", "portion_reduced_rated", "portion_standard_rated", "product_exempt", "product_exempt_holiday", "proportionally_rated", "reduced_rated", "reverse_charge", "standard_rated", "taxable_basis_reduced", "zero_rated", ] """ The reasoning behind this tax, for example, if the product is tax exempt. The possible values for this field may be extended as new tax rules are supported. """ taxable_amount: int """ The amount on which tax is calculated, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ _inner_class_types = { "jurisdiction": Jurisdiction, "tax_rate_details": TaxRateDetails, } amount: int """ The shipping amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount. """ amount_tax: int """ The amount of tax calculated for shipping, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ shipping_rate: Optional[str] """ The ID of an existing [ShippingRate](https://stripe.com/docs/api/shipping_rates/object). """ tax_behavior: Literal["exclusive", "inclusive"] """ Specifies whether the `amount` includes taxes. If `tax_behavior=inclusive`, then the amount includes taxes. """ tax_breakdown: Optional[List[TaxBreakdown]] """ Detailed account of taxes relevant to shipping cost. (It is not populated for the transaction resource object and will be removed in the next API version.) """ tax_code: str """ The [tax code](https://stripe.com/docs/tax/tax-categories) ID used for shipping. """ _inner_class_types = {"tax_breakdown": TaxBreakdown} class CreateFromCalculationParams(RequestOptions): calculation: str """ Tax Calculation ID to be used as input when creating the transaction. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ reference: str """ A custom order or sale identifier, such as 'myOrder_123'. Must be unique across all transactions, including reversals. """ class CreateReversalParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ flat_amount: NotRequired[int] """ A flat amount to reverse across the entire transaction, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) in negative. This value represents the total amount to refund from the transaction, including taxes. """ line_items: NotRequired[ List["Transaction.CreateReversalParamsLineItem"] ] """ The line item amounts to reverse. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ mode: Literal["full", "partial"] """ If `partial`, the provided line item or shipping cost amounts are reversed. If `full`, the original transaction is fully reversed. """ original_transaction: str """ The ID of the Transaction to partially or fully reverse. """ reference: str """ A custom identifier for this reversal, such as `myOrder_123-refund_1`, which must be unique across all transactions. The reference helps identify this reversal transaction in exported [tax reports](https://stripe.com/docs/tax/reports). """ shipping_cost: NotRequired[ "Transaction.CreateReversalParamsShippingCost" ] """ The shipping cost to reverse. """ class CreateReversalParamsLineItem(TypedDict): amount: int """ The amount to reverse, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) in negative. """ amount_tax: int """ The amount of tax to reverse, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) in negative. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ original_line_item: str """ The `id` of the line item to reverse in the original transaction. """ quantity: NotRequired[int] """ The quantity reversed. Appears in [tax exports](https://stripe.com/docs/tax/reports), but does not affect the amount of tax reversed. """ reference: str """ A custom identifier for this line item in the reversal transaction, such as 'L1-refund'. """ class CreateReversalParamsShippingCost(TypedDict): amount: int """ The amount to reverse, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) in negative. """ amount_tax: int """ The amount of tax to reverse, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) in negative. """ class ListLineItemsParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ 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). """ customer: Optional[str] """ The ID of an existing [Customer](https://stripe.com/docs/api/customers/object) used for the resource. """ customer_details: CustomerDetails id: str """ Unique identifier for the transaction. """ line_items: Optional[ListObject["TransactionLineItem"]] """ The tax collected or refunded, by line item. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ metadata: Optional[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ object: Literal["tax.transaction"] """ String representing the object's type. Objects of the same type share the same value. """ reference: str """ A custom unique identifier, such as 'myOrder_123'. """ reversal: Optional[Reversal] """ If `type=reversal`, contains information about what was reversed. """ ship_from_details: Optional[ShipFromDetails] """ The details of the ship from location, such as the address. """ shipping_cost: Optional[ShippingCost] """ The shipping cost details for the transaction. """ tax_date: int """ Timestamp of date at which the tax rules and rates in effect applies for the calculation. """ type: Literal["reversal", "transaction"] """ If `reversal`, this transaction reverses an earlier transaction. """ @classmethod def create_from_calculation( cls, **params: Unpack["Transaction.CreateFromCalculationParams"] ) -> "Transaction": """ Creates a Tax Transaction from a calculation, if that calculation hasn't expired. Calculations expire after 90 days. """ return cast( "Transaction", cls._static_request( "post", "/v1/tax/transactions/create_from_calculation", params=params, ), ) @classmethod async def create_from_calculation_async( cls, **params: Unpack["Transaction.CreateFromCalculationParams"] ) -> "Transaction": """ Creates a Tax Transaction from a calculation, if that calculation hasn't expired. Calculations expire after 90 days. """ return cast( "Transaction", await cls._static_request_async( "post", "/v1/tax/transactions/create_from_calculation", params=params, ), ) @classmethod def create_reversal( cls, **params: Unpack["Transaction.CreateReversalParams"] ) -> "Transaction": """ Partially or fully reverses a previously created Transaction. """ return cast( "Transaction", cls._static_request( "post", "/v1/tax/transactions/create_reversal", params=params, ), ) @classmethod async def create_reversal_async( cls, **params: Unpack["Transaction.CreateReversalParams"] ) -> "Transaction": """ Partially or fully reverses a previously created Transaction. """ return cast( "Transaction", await cls._static_request_async( "post", "/v1/tax/transactions/create_reversal", params=params, ), ) @classmethod def _cls_list_line_items( cls, transaction: str, **params: Unpack["Transaction.ListLineItemsParams"], ) -> ListObject["TransactionLineItem"]: """ Retrieves the line items of a committed standalone transaction as a collection. """ return cast( ListObject["TransactionLineItem"], cls._static_request( "get", "/v1/tax/transactions/{transaction}/line_items".format( transaction=sanitize_id(transaction) ), params=params, ), ) @overload @staticmethod def list_line_items( transaction: str, **params: Unpack["Transaction.ListLineItemsParams"] ) -> ListObject["TransactionLineItem"]: """ Retrieves the line items of a committed standalone transaction as a collection. """ ... @overload def list_line_items( self, **params: Unpack["Transaction.ListLineItemsParams"] ) -> ListObject["TransactionLineItem"]: """ Retrieves the line items of a committed standalone transaction as a collection. """ ... @class_method_variant("_cls_list_line_items") def list_line_items( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Transaction.ListLineItemsParams"] ) -> ListObject["TransactionLineItem"]: """ Retrieves the line items of a committed standalone transaction as a collection. """ return cast( ListObject["TransactionLineItem"], self._request( "get", "/v1/tax/transactions/{transaction}/line_items".format( transaction=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_list_line_items_async( cls, transaction: str, **params: Unpack["Transaction.ListLineItemsParams"], ) -> ListObject["TransactionLineItem"]: """ Retrieves the line items of a committed standalone transaction as a collection. """ return cast( ListObject["TransactionLineItem"], await cls._static_request_async( "get", "/v1/tax/transactions/{transaction}/line_items".format( transaction=sanitize_id(transaction) ), params=params, ), ) @overload @staticmethod async def list_line_items_async( transaction: str, **params: Unpack["Transaction.ListLineItemsParams"] ) -> ListObject["TransactionLineItem"]: """ Retrieves the line items of a committed standalone transaction as a collection. """ ... @overload async def list_line_items_async( self, **params: Unpack["Transaction.ListLineItemsParams"] ) -> ListObject["TransactionLineItem"]: """ Retrieves the line items of a committed standalone transaction as a collection. """ ... @class_method_variant("_cls_list_line_items_async") async def list_line_items_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Transaction.ListLineItemsParams"] ) -> ListObject["TransactionLineItem"]: """ Retrieves the line items of a committed standalone transaction as a collection. """ return cast( ListObject["TransactionLineItem"], await self._request_async( "get", "/v1/tax/transactions/{transaction}/line_items".format( transaction=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["Transaction.RetrieveParams"] ) -> "Transaction": """ Retrieves a Tax Transaction object. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["Transaction.RetrieveParams"] ) -> "Transaction": """ Retrieves a Tax Transaction object. """ instance = cls(id, **params) await instance.refresh_async() return instance _inner_class_types = { "customer_details": CustomerDetails, "reversal": Reversal, "ship_from_details": ShipFromDetails, "shipping_cost": ShippingCost, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/tax/_transaction_line_item.py0000644000175100001770000000472414637354563021720 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_object import StripeObject from typing import ClassVar, Dict, Optional from typing_extensions import Literal class TransactionLineItem(StripeObject): OBJECT_NAME: ClassVar[Literal["tax.transaction_line_item"]] = ( "tax.transaction_line_item" ) class Reversal(StripeObject): original_line_item: str """ The `id` of the line item to reverse in the original transaction. """ amount: int """ The line item amount in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). If `tax_behavior=inclusive`, then this amount includes taxes. Otherwise, taxes were calculated on top of this amount. """ amount_tax: int """ The amount of tax calculated for this line item, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ metadata: Optional[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ object: Literal["tax.transaction_line_item"] """ String representing the object's type. Objects of the same type share the same value. """ product: Optional[str] """ The ID of an existing [Product](https://stripe.com/docs/api/products/object). """ quantity: int """ The number of units of the item being purchased. For reversals, this is the quantity reversed. """ reference: str """ A custom identifier for this line item in the transaction. """ reversal: Optional[Reversal] """ If `type=reversal`, contains information about what was reversed. """ tax_behavior: Literal["exclusive", "inclusive"] """ Specifies whether the `amount` includes taxes. If `tax_behavior=inclusive`, then the amount includes taxes. """ tax_code: str """ The [tax code](https://stripe.com/docs/tax/tax-categories) ID used for this resource. """ type: Literal["reversal", "transaction"] """ If `reversal`, this line item reverses an earlier transaction. """ _inner_class_types = {"reversal": Reversal} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/tax/_transaction_line_item_service.py0000644000175100001770000000566614637354563023446 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.tax._transaction_line_item import TransactionLineItem from typing import List, cast from typing_extensions import NotRequired, TypedDict class TransactionLineItemService(StripeService): class ListParams(TypedDict): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ def list( self, transaction: str, params: "TransactionLineItemService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[TransactionLineItem]: """ Retrieves the line items of a committed standalone transaction as a collection. """ return cast( ListObject[TransactionLineItem], self._request( "get", "/v1/tax/transactions/{transaction}/line_items".format( transaction=sanitize_id(transaction), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, transaction: str, params: "TransactionLineItemService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[TransactionLineItem]: """ Retrieves the line items of a committed standalone transaction as a collection. """ return cast( ListObject[TransactionLineItem], await self._request_async( "get", "/v1/tax/transactions/{transaction}/line_items".format( transaction=sanitize_id(transaction), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/tax/_transaction_service.py0000644000175100001770000002115414637354563021407 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.tax._transaction import Transaction from stripe.tax._transaction_line_item_service import ( TransactionLineItemService, ) from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class TransactionService(StripeService): def __init__(self, requestor): super().__init__(requestor) self.line_items = TransactionLineItemService(self._requestor) class CreateFromCalculationParams(TypedDict): calculation: str """ Tax Calculation ID to be used as input when creating the transaction. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ reference: str """ A custom order or sale identifier, such as 'myOrder_123'. Must be unique across all transactions, including reversals. """ class CreateReversalParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ flat_amount: NotRequired[int] """ A flat amount to reverse across the entire transaction, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) in negative. This value represents the total amount to refund from the transaction, including taxes. """ line_items: NotRequired[ List["TransactionService.CreateReversalParamsLineItem"] ] """ The line item amounts to reverse. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ mode: Literal["full", "partial"] """ If `partial`, the provided line item or shipping cost amounts are reversed. If `full`, the original transaction is fully reversed. """ original_transaction: str """ The ID of the Transaction to partially or fully reverse. """ reference: str """ A custom identifier for this reversal, such as `myOrder_123-refund_1`, which must be unique across all transactions. The reference helps identify this reversal transaction in exported [tax reports](https://stripe.com/docs/tax/reports). """ shipping_cost: NotRequired[ "TransactionService.CreateReversalParamsShippingCost" ] """ The shipping cost to reverse. """ class CreateReversalParamsLineItem(TypedDict): amount: int """ The amount to reverse, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) in negative. """ amount_tax: int """ The amount of tax to reverse, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) in negative. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ original_line_item: str """ The `id` of the line item to reverse in the original transaction. """ quantity: NotRequired[int] """ The quantity reversed. Appears in [tax exports](https://stripe.com/docs/tax/reports), but does not affect the amount of tax reversed. """ reference: str """ A custom identifier for this line item in the reversal transaction, such as 'L1-refund'. """ class CreateReversalParamsShippingCost(TypedDict): amount: int """ The amount to reverse, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) in negative. """ amount_tax: int """ The amount of tax to reverse, in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) in negative. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def retrieve( self, transaction: str, params: "TransactionService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Transaction: """ Retrieves a Tax Transaction object. """ return cast( Transaction, self._request( "get", "/v1/tax/transactions/{transaction}".format( transaction=sanitize_id(transaction), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, transaction: str, params: "TransactionService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Transaction: """ Retrieves a Tax Transaction object. """ return cast( Transaction, await self._request_async( "get", "/v1/tax/transactions/{transaction}".format( transaction=sanitize_id(transaction), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def create_from_calculation( self, params: "TransactionService.CreateFromCalculationParams", options: RequestOptions = {}, ) -> Transaction: """ Creates a Tax Transaction from a calculation, if that calculation hasn't expired. Calculations expire after 90 days. """ return cast( Transaction, self._request( "post", "/v1/tax/transactions/create_from_calculation", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_from_calculation_async( self, params: "TransactionService.CreateFromCalculationParams", options: RequestOptions = {}, ) -> Transaction: """ Creates a Tax Transaction from a calculation, if that calculation hasn't expired. Calculations expire after 90 days. """ return cast( Transaction, await self._request_async( "post", "/v1/tax/transactions/create_from_calculation", api_mode="V1", base_address="api", params=params, options=options, ), ) def create_reversal( self, params: "TransactionService.CreateReversalParams", options: RequestOptions = {}, ) -> Transaction: """ Partially or fully reverses a previously created Transaction. """ return cast( Transaction, self._request( "post", "/v1/tax/transactions/create_reversal", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_reversal_async( self, params: "TransactionService.CreateReversalParams", options: RequestOptions = {}, ) -> Transaction: """ Partially or fully reverses a previously created Transaction. """ return cast( Transaction, await self._request_async( "post", "/v1/tax/transactions/create_reversal", api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5489407 stripe-10.1.0/stripe/terminal/0000755000175100001770000000000014637354616015644 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/terminal/__init__.py0000644000175100001770000000132114637354563017753 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe.terminal._configuration import Configuration as Configuration from stripe.terminal._configuration_service import ( ConfigurationService as ConfigurationService, ) from stripe.terminal._connection_token import ( ConnectionToken as ConnectionToken, ) from stripe.terminal._connection_token_service import ( ConnectionTokenService as ConnectionTokenService, ) from stripe.terminal._location import Location as Location from stripe.terminal._location_service import ( LocationService as LocationService, ) from stripe.terminal._reader import Reader as Reader from stripe.terminal._reader_service import ReaderService as ReaderService ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/terminal/_configuration.py0000644000175100001770000011647614637354563021244 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._deletable_api_resource import DeletableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, List, Optional, cast, overload from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._file import File class Configuration( CreateableAPIResource["Configuration"], DeletableAPIResource["Configuration"], ListableAPIResource["Configuration"], UpdateableAPIResource["Configuration"], ): """ A Configurations object represents how features should be configured for terminal readers. """ OBJECT_NAME: ClassVar[Literal["terminal.configuration"]] = ( "terminal.configuration" ) class BbposWiseposE(StripeObject): splashscreen: Optional[ExpandableField["File"]] """ A File ID representing an image you would like displayed on the reader. """ class Offline(StripeObject): enabled: Optional[bool] """ Determines whether to allow transactions to be collected while reader is offline. Defaults to false. """ class RebootWindow(StripeObject): end_hour: int """ Integer between 0 to 23 that represents the end hour of the reboot time window. The value must be different than the start_hour. """ start_hour: int """ Integer between 0 to 23 that represents the start hour of the reboot time window. """ class StripeS700(StripeObject): splashscreen: Optional[ExpandableField["File"]] """ A File ID representing an image you would like displayed on the reader. """ class Tipping(StripeObject): class Aud(StripeObject): fixed_amounts: Optional[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: Optional[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: Optional[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class Cad(StripeObject): fixed_amounts: Optional[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: Optional[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: Optional[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class Chf(StripeObject): fixed_amounts: Optional[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: Optional[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: Optional[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class Czk(StripeObject): fixed_amounts: Optional[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: Optional[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: Optional[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class Dkk(StripeObject): fixed_amounts: Optional[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: Optional[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: Optional[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class Eur(StripeObject): fixed_amounts: Optional[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: Optional[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: Optional[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class Gbp(StripeObject): fixed_amounts: Optional[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: Optional[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: Optional[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class Hkd(StripeObject): fixed_amounts: Optional[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: Optional[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: Optional[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class Myr(StripeObject): fixed_amounts: Optional[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: Optional[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: Optional[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class Nok(StripeObject): fixed_amounts: Optional[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: Optional[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: Optional[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class Nzd(StripeObject): fixed_amounts: Optional[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: Optional[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: Optional[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class Sek(StripeObject): fixed_amounts: Optional[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: Optional[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: Optional[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class Sgd(StripeObject): fixed_amounts: Optional[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: Optional[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: Optional[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class Usd(StripeObject): fixed_amounts: Optional[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: Optional[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: Optional[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ aud: Optional[Aud] cad: Optional[Cad] chf: Optional[Chf] czk: Optional[Czk] dkk: Optional[Dkk] eur: Optional[Eur] gbp: Optional[Gbp] hkd: Optional[Hkd] myr: Optional[Myr] nok: Optional[Nok] nzd: Optional[Nzd] sek: Optional[Sek] sgd: Optional[Sgd] usd: Optional[Usd] _inner_class_types = { "aud": Aud, "cad": Cad, "chf": Chf, "czk": Czk, "dkk": Dkk, "eur": Eur, "gbp": Gbp, "hkd": Hkd, "myr": Myr, "nok": Nok, "nzd": Nzd, "sek": Sek, "sgd": Sgd, "usd": Usd, } class VerifoneP400(StripeObject): splashscreen: Optional[ExpandableField["File"]] """ A File ID representing an image you would like displayed on the reader. """ class CreateParams(RequestOptions): bbpos_wisepos_e: NotRequired["Configuration.CreateParamsBbposWiseposE"] """ An object containing device type specific settings for BBPOS WisePOS E readers """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ name: NotRequired[str] """ Name of the configuration """ offline: NotRequired["Literal['']|Configuration.CreateParamsOffline"] """ Configurations for collecting transactions offline. """ reboot_window: NotRequired["Configuration.CreateParamsRebootWindow"] """ Reboot time settings for readers that support customized reboot time configuration. """ stripe_s700: NotRequired["Configuration.CreateParamsStripeS700"] """ An object containing device type specific settings for Stripe S700 readers """ tipping: NotRequired["Literal['']|Configuration.CreateParamsTipping"] """ Tipping configurations for readers supporting on-reader tips """ verifone_p400: NotRequired["Configuration.CreateParamsVerifoneP400"] """ An object containing device type specific settings for Verifone P400 readers """ class CreateParamsBbposWiseposE(TypedDict): splashscreen: NotRequired["Literal['']|str"] """ A File ID representing an image you would like displayed on the reader. """ class CreateParamsOffline(TypedDict): enabled: bool """ Determines whether to allow transactions to be collected while reader is offline. Defaults to false. """ class CreateParamsRebootWindow(TypedDict): end_hour: int """ Integer between 0 to 23 that represents the end hour of the reboot time window. The value must be different than the start_hour. """ start_hour: int """ Integer between 0 to 23 that represents the start hour of the reboot time window. """ class CreateParamsStripeS700(TypedDict): splashscreen: NotRequired["Literal['']|str"] """ A File ID representing an image you would like displayed on the reader. """ class CreateParamsTipping(TypedDict): aud: NotRequired["Configuration.CreateParamsTippingAud"] """ Tipping configuration for AUD """ cad: NotRequired["Configuration.CreateParamsTippingCad"] """ Tipping configuration for CAD """ chf: NotRequired["Configuration.CreateParamsTippingChf"] """ Tipping configuration for CHF """ czk: NotRequired["Configuration.CreateParamsTippingCzk"] """ Tipping configuration for CZK """ dkk: NotRequired["Configuration.CreateParamsTippingDkk"] """ Tipping configuration for DKK """ eur: NotRequired["Configuration.CreateParamsTippingEur"] """ Tipping configuration for EUR """ gbp: NotRequired["Configuration.CreateParamsTippingGbp"] """ Tipping configuration for GBP """ hkd: NotRequired["Configuration.CreateParamsTippingHkd"] """ Tipping configuration for HKD """ myr: NotRequired["Configuration.CreateParamsTippingMyr"] """ Tipping configuration for MYR """ nok: NotRequired["Configuration.CreateParamsTippingNok"] """ Tipping configuration for NOK """ nzd: NotRequired["Configuration.CreateParamsTippingNzd"] """ Tipping configuration for NZD """ sek: NotRequired["Configuration.CreateParamsTippingSek"] """ Tipping configuration for SEK """ sgd: NotRequired["Configuration.CreateParamsTippingSgd"] """ Tipping configuration for SGD """ usd: NotRequired["Configuration.CreateParamsTippingUsd"] """ Tipping configuration for USD """ class CreateParamsTippingAud(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingCad(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingChf(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingCzk(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingDkk(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingEur(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingGbp(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingHkd(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingMyr(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingNok(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingNzd(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingSek(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingSgd(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingUsd(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsVerifoneP400(TypedDict): splashscreen: NotRequired["Literal['']|str"] """ A File ID representing an image you would like displayed on the reader. """ class DeleteParams(RequestOptions): pass class ListParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ is_account_default: NotRequired[bool] """ if present, only return the account default or non-default configurations. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ModifyParams(RequestOptions): bbpos_wisepos_e: NotRequired[ "Literal['']|Configuration.ModifyParamsBbposWiseposE" ] """ An object containing device type specific settings for BBPOS WisePOS E readers """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ name: NotRequired[str] """ Name of the configuration """ offline: NotRequired["Literal['']|Configuration.ModifyParamsOffline"] """ Configurations for collecting transactions offline. """ reboot_window: NotRequired[ "Literal['']|Configuration.ModifyParamsRebootWindow" ] """ Reboot time settings for readers that support customized reboot time configuration. """ stripe_s700: NotRequired[ "Literal['']|Configuration.ModifyParamsStripeS700" ] """ An object containing device type specific settings for Stripe S700 readers """ tipping: NotRequired["Literal['']|Configuration.ModifyParamsTipping"] """ Tipping configurations for readers supporting on-reader tips """ verifone_p400: NotRequired[ "Literal['']|Configuration.ModifyParamsVerifoneP400" ] """ An object containing device type specific settings for Verifone P400 readers """ class ModifyParamsBbposWiseposE(TypedDict): splashscreen: NotRequired["Literal['']|str"] """ A File ID representing an image you would like displayed on the reader. """ class ModifyParamsOffline(TypedDict): enabled: bool """ Determines whether to allow transactions to be collected while reader is offline. Defaults to false. """ class ModifyParamsRebootWindow(TypedDict): end_hour: int """ Integer between 0 to 23 that represents the end hour of the reboot time window. The value must be different than the start_hour. """ start_hour: int """ Integer between 0 to 23 that represents the start hour of the reboot time window. """ class ModifyParamsStripeS700(TypedDict): splashscreen: NotRequired["Literal['']|str"] """ A File ID representing an image you would like displayed on the reader. """ class ModifyParamsTipping(TypedDict): aud: NotRequired["Configuration.ModifyParamsTippingAud"] """ Tipping configuration for AUD """ cad: NotRequired["Configuration.ModifyParamsTippingCad"] """ Tipping configuration for CAD """ chf: NotRequired["Configuration.ModifyParamsTippingChf"] """ Tipping configuration for CHF """ czk: NotRequired["Configuration.ModifyParamsTippingCzk"] """ Tipping configuration for CZK """ dkk: NotRequired["Configuration.ModifyParamsTippingDkk"] """ Tipping configuration for DKK """ eur: NotRequired["Configuration.ModifyParamsTippingEur"] """ Tipping configuration for EUR """ gbp: NotRequired["Configuration.ModifyParamsTippingGbp"] """ Tipping configuration for GBP """ hkd: NotRequired["Configuration.ModifyParamsTippingHkd"] """ Tipping configuration for HKD """ myr: NotRequired["Configuration.ModifyParamsTippingMyr"] """ Tipping configuration for MYR """ nok: NotRequired["Configuration.ModifyParamsTippingNok"] """ Tipping configuration for NOK """ nzd: NotRequired["Configuration.ModifyParamsTippingNzd"] """ Tipping configuration for NZD """ sek: NotRequired["Configuration.ModifyParamsTippingSek"] """ Tipping configuration for SEK """ sgd: NotRequired["Configuration.ModifyParamsTippingSgd"] """ Tipping configuration for SGD """ usd: NotRequired["Configuration.ModifyParamsTippingUsd"] """ Tipping configuration for USD """ class ModifyParamsTippingAud(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class ModifyParamsTippingCad(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class ModifyParamsTippingChf(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class ModifyParamsTippingCzk(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class ModifyParamsTippingDkk(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class ModifyParamsTippingEur(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class ModifyParamsTippingGbp(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class ModifyParamsTippingHkd(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class ModifyParamsTippingMyr(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class ModifyParamsTippingNok(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class ModifyParamsTippingNzd(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class ModifyParamsTippingSek(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class ModifyParamsTippingSgd(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class ModifyParamsTippingUsd(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class ModifyParamsVerifoneP400(TypedDict): splashscreen: NotRequired["Literal['']|str"] """ A File ID representing an image you would like displayed on the reader. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ bbpos_wisepos_e: Optional[BbposWiseposE] id: str """ Unique identifier for the object. """ is_account_default: Optional[bool] """ Whether this Configuration is the default for your account """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ name: Optional[str] """ String indicating the name of the Configuration object, set by the user """ object: Literal["terminal.configuration"] """ String representing the object's type. Objects of the same type share the same value. """ offline: Optional[Offline] reboot_window: Optional[RebootWindow] stripe_s700: Optional[StripeS700] tipping: Optional[Tipping] verifone_p400: Optional[VerifoneP400] deleted: Optional[Literal[True]] """ Always true for a deleted object """ @classmethod def create( cls, **params: Unpack["Configuration.CreateParams"] ) -> "Configuration": """ Creates a new Configuration object. """ return cast( "Configuration", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["Configuration.CreateParams"] ) -> "Configuration": """ Creates a new Configuration object. """ return cast( "Configuration", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def _cls_delete( cls, sid: str, **params: Unpack["Configuration.DeleteParams"] ) -> "Configuration": """ Deletes a Configuration object. """ url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "Configuration", cls._static_request( "delete", url, params=params, ), ) @overload @staticmethod def delete( sid: str, **params: Unpack["Configuration.DeleteParams"] ) -> "Configuration": """ Deletes a Configuration object. """ ... @overload def delete( self, **params: Unpack["Configuration.DeleteParams"] ) -> "Configuration": """ Deletes a Configuration object. """ ... @class_method_variant("_cls_delete") def delete( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Configuration.DeleteParams"] ) -> "Configuration": """ Deletes a Configuration object. """ return self._request_and_refresh( "delete", self.instance_url(), params=params, ) @classmethod async def _cls_delete_async( cls, sid: str, **params: Unpack["Configuration.DeleteParams"] ) -> "Configuration": """ Deletes a Configuration object. """ url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "Configuration", await cls._static_request_async( "delete", url, params=params, ), ) @overload @staticmethod async def delete_async( sid: str, **params: Unpack["Configuration.DeleteParams"] ) -> "Configuration": """ Deletes a Configuration object. """ ... @overload async def delete_async( self, **params: Unpack["Configuration.DeleteParams"] ) -> "Configuration": """ Deletes a Configuration object. """ ... @class_method_variant("_cls_delete_async") async def delete_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Configuration.DeleteParams"] ) -> "Configuration": """ Deletes a Configuration object. """ return await self._request_and_refresh_async( "delete", self.instance_url(), params=params, ) @classmethod def list( cls, **params: Unpack["Configuration.ListParams"] ) -> ListObject["Configuration"]: """ Returns a list of Configuration objects. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["Configuration.ListParams"] ) -> ListObject["Configuration"]: """ Returns a list of Configuration objects. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def modify( cls, id: str, **params: Unpack["Configuration.ModifyParams"] ) -> "Configuration": """ Updates a new Configuration object. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Configuration", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["Configuration.ModifyParams"] ) -> "Configuration": """ Updates a new Configuration object. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Configuration", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["Configuration.RetrieveParams"] ) -> "Configuration": """ Retrieves a Configuration object. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["Configuration.RetrieveParams"] ) -> "Configuration": """ Retrieves a Configuration object. """ instance = cls(id, **params) await instance.refresh_async() return instance _inner_class_types = { "bbpos_wisepos_e": BbposWiseposE, "offline": Offline, "reboot_window": RebootWindow, "stripe_s700": StripeS700, "tipping": Tipping, "verifone_p400": VerifoneP400, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/terminal/_configuration_service.py0000644000175100001770000007274014637354563022757 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.terminal._configuration import Configuration from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict class ConfigurationService(StripeService): class CreateParams(TypedDict): bbpos_wisepos_e: NotRequired[ "ConfigurationService.CreateParamsBbposWiseposE" ] """ An object containing device type specific settings for BBPOS WisePOS E readers """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ name: NotRequired[str] """ Name of the configuration """ offline: NotRequired[ "Literal['']|ConfigurationService.CreateParamsOffline" ] """ Configurations for collecting transactions offline. """ reboot_window: NotRequired[ "ConfigurationService.CreateParamsRebootWindow" ] """ Reboot time settings for readers that support customized reboot time configuration. """ stripe_s700: NotRequired["ConfigurationService.CreateParamsStripeS700"] """ An object containing device type specific settings for Stripe S700 readers """ tipping: NotRequired[ "Literal['']|ConfigurationService.CreateParamsTipping" ] """ Tipping configurations for readers supporting on-reader tips """ verifone_p400: NotRequired[ "ConfigurationService.CreateParamsVerifoneP400" ] """ An object containing device type specific settings for Verifone P400 readers """ class CreateParamsBbposWiseposE(TypedDict): splashscreen: NotRequired["Literal['']|str"] """ A File ID representing an image you would like displayed on the reader. """ class CreateParamsOffline(TypedDict): enabled: bool """ Determines whether to allow transactions to be collected while reader is offline. Defaults to false. """ class CreateParamsRebootWindow(TypedDict): end_hour: int """ Integer between 0 to 23 that represents the end hour of the reboot time window. The value must be different than the start_hour. """ start_hour: int """ Integer between 0 to 23 that represents the start hour of the reboot time window. """ class CreateParamsStripeS700(TypedDict): splashscreen: NotRequired["Literal['']|str"] """ A File ID representing an image you would like displayed on the reader. """ class CreateParamsTipping(TypedDict): aud: NotRequired["ConfigurationService.CreateParamsTippingAud"] """ Tipping configuration for AUD """ cad: NotRequired["ConfigurationService.CreateParamsTippingCad"] """ Tipping configuration for CAD """ chf: NotRequired["ConfigurationService.CreateParamsTippingChf"] """ Tipping configuration for CHF """ czk: NotRequired["ConfigurationService.CreateParamsTippingCzk"] """ Tipping configuration for CZK """ dkk: NotRequired["ConfigurationService.CreateParamsTippingDkk"] """ Tipping configuration for DKK """ eur: NotRequired["ConfigurationService.CreateParamsTippingEur"] """ Tipping configuration for EUR """ gbp: NotRequired["ConfigurationService.CreateParamsTippingGbp"] """ Tipping configuration for GBP """ hkd: NotRequired["ConfigurationService.CreateParamsTippingHkd"] """ Tipping configuration for HKD """ myr: NotRequired["ConfigurationService.CreateParamsTippingMyr"] """ Tipping configuration for MYR """ nok: NotRequired["ConfigurationService.CreateParamsTippingNok"] """ Tipping configuration for NOK """ nzd: NotRequired["ConfigurationService.CreateParamsTippingNzd"] """ Tipping configuration for NZD """ sek: NotRequired["ConfigurationService.CreateParamsTippingSek"] """ Tipping configuration for SEK """ sgd: NotRequired["ConfigurationService.CreateParamsTippingSgd"] """ Tipping configuration for SGD """ usd: NotRequired["ConfigurationService.CreateParamsTippingUsd"] """ Tipping configuration for USD """ class CreateParamsTippingAud(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingCad(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingChf(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingCzk(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingDkk(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingEur(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingGbp(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingHkd(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingMyr(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingNok(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingNzd(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingSek(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingSgd(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsTippingUsd(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class CreateParamsVerifoneP400(TypedDict): splashscreen: NotRequired["Literal['']|str"] """ A File ID representing an image you would like displayed on the reader. """ class DeleteParams(TypedDict): pass class ListParams(TypedDict): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ is_account_default: NotRequired[bool] """ if present, only return the account default or non-default configurations. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): bbpos_wisepos_e: NotRequired[ "Literal['']|ConfigurationService.UpdateParamsBbposWiseposE" ] """ An object containing device type specific settings for BBPOS WisePOS E readers """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ name: NotRequired[str] """ Name of the configuration """ offline: NotRequired[ "Literal['']|ConfigurationService.UpdateParamsOffline" ] """ Configurations for collecting transactions offline. """ reboot_window: NotRequired[ "Literal['']|ConfigurationService.UpdateParamsRebootWindow" ] """ Reboot time settings for readers that support customized reboot time configuration. """ stripe_s700: NotRequired[ "Literal['']|ConfigurationService.UpdateParamsStripeS700" ] """ An object containing device type specific settings for Stripe S700 readers """ tipping: NotRequired[ "Literal['']|ConfigurationService.UpdateParamsTipping" ] """ Tipping configurations for readers supporting on-reader tips """ verifone_p400: NotRequired[ "Literal['']|ConfigurationService.UpdateParamsVerifoneP400" ] """ An object containing device type specific settings for Verifone P400 readers """ class UpdateParamsBbposWiseposE(TypedDict): splashscreen: NotRequired["Literal['']|str"] """ A File ID representing an image you would like displayed on the reader. """ class UpdateParamsOffline(TypedDict): enabled: bool """ Determines whether to allow transactions to be collected while reader is offline. Defaults to false. """ class UpdateParamsRebootWindow(TypedDict): end_hour: int """ Integer between 0 to 23 that represents the end hour of the reboot time window. The value must be different than the start_hour. """ start_hour: int """ Integer between 0 to 23 that represents the start hour of the reboot time window. """ class UpdateParamsStripeS700(TypedDict): splashscreen: NotRequired["Literal['']|str"] """ A File ID representing an image you would like displayed on the reader. """ class UpdateParamsTipping(TypedDict): aud: NotRequired["ConfigurationService.UpdateParamsTippingAud"] """ Tipping configuration for AUD """ cad: NotRequired["ConfigurationService.UpdateParamsTippingCad"] """ Tipping configuration for CAD """ chf: NotRequired["ConfigurationService.UpdateParamsTippingChf"] """ Tipping configuration for CHF """ czk: NotRequired["ConfigurationService.UpdateParamsTippingCzk"] """ Tipping configuration for CZK """ dkk: NotRequired["ConfigurationService.UpdateParamsTippingDkk"] """ Tipping configuration for DKK """ eur: NotRequired["ConfigurationService.UpdateParamsTippingEur"] """ Tipping configuration for EUR """ gbp: NotRequired["ConfigurationService.UpdateParamsTippingGbp"] """ Tipping configuration for GBP """ hkd: NotRequired["ConfigurationService.UpdateParamsTippingHkd"] """ Tipping configuration for HKD """ myr: NotRequired["ConfigurationService.UpdateParamsTippingMyr"] """ Tipping configuration for MYR """ nok: NotRequired["ConfigurationService.UpdateParamsTippingNok"] """ Tipping configuration for NOK """ nzd: NotRequired["ConfigurationService.UpdateParamsTippingNzd"] """ Tipping configuration for NZD """ sek: NotRequired["ConfigurationService.UpdateParamsTippingSek"] """ Tipping configuration for SEK """ sgd: NotRequired["ConfigurationService.UpdateParamsTippingSgd"] """ Tipping configuration for SGD """ usd: NotRequired["ConfigurationService.UpdateParamsTippingUsd"] """ Tipping configuration for USD """ class UpdateParamsTippingAud(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class UpdateParamsTippingCad(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class UpdateParamsTippingChf(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class UpdateParamsTippingCzk(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class UpdateParamsTippingDkk(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class UpdateParamsTippingEur(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class UpdateParamsTippingGbp(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class UpdateParamsTippingHkd(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class UpdateParamsTippingMyr(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class UpdateParamsTippingNok(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class UpdateParamsTippingNzd(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class UpdateParamsTippingSek(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class UpdateParamsTippingSgd(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class UpdateParamsTippingUsd(TypedDict): fixed_amounts: NotRequired[List[int]] """ Fixed amounts displayed when collecting a tip """ percentages: NotRequired[List[int]] """ Percentages displayed when collecting a tip """ smart_tip_threshold: NotRequired[int] """ Below this amount, fixed amounts will be displayed; above it, percentages will be displayed """ class UpdateParamsVerifoneP400(TypedDict): splashscreen: NotRequired["Literal['']|str"] """ A File ID representing an image you would like displayed on the reader. """ def delete( self, configuration: str, params: "ConfigurationService.DeleteParams" = {}, options: RequestOptions = {}, ) -> Configuration: """ Deletes a Configuration object. """ return cast( Configuration, self._request( "delete", "/v1/terminal/configurations/{configuration}".format( configuration=sanitize_id(configuration), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def delete_async( self, configuration: str, params: "ConfigurationService.DeleteParams" = {}, options: RequestOptions = {}, ) -> Configuration: """ Deletes a Configuration object. """ return cast( Configuration, await self._request_async( "delete", "/v1/terminal/configurations/{configuration}".format( configuration=sanitize_id(configuration), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, configuration: str, params: "ConfigurationService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Configuration: """ Retrieves a Configuration object. """ return cast( Configuration, self._request( "get", "/v1/terminal/configurations/{configuration}".format( configuration=sanitize_id(configuration), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, configuration: str, params: "ConfigurationService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Configuration: """ Retrieves a Configuration object. """ return cast( Configuration, await self._request_async( "get", "/v1/terminal/configurations/{configuration}".format( configuration=sanitize_id(configuration), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, configuration: str, params: "ConfigurationService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Configuration: """ Updates a new Configuration object. """ return cast( Configuration, self._request( "post", "/v1/terminal/configurations/{configuration}".format( configuration=sanitize_id(configuration), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, configuration: str, params: "ConfigurationService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Configuration: """ Updates a new Configuration object. """ return cast( Configuration, await self._request_async( "post", "/v1/terminal/configurations/{configuration}".format( configuration=sanitize_id(configuration), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def list( self, params: "ConfigurationService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Configuration]: """ Returns a list of Configuration objects. """ return cast( ListObject[Configuration], self._request( "get", "/v1/terminal/configurations", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "ConfigurationService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Configuration]: """ Returns a list of Configuration objects. """ return cast( ListObject[Configuration], await self._request_async( "get", "/v1/terminal/configurations", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "ConfigurationService.CreateParams" = {}, options: RequestOptions = {}, ) -> Configuration: """ Creates a new Configuration object. """ return cast( Configuration, self._request( "post", "/v1/terminal/configurations", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "ConfigurationService.CreateParams" = {}, options: RequestOptions = {}, ) -> Configuration: """ Creates a new Configuration object. """ return cast( Configuration, await self._request_async( "post", "/v1/terminal/configurations", api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/terminal/_connection_token.py0000644000175100001770000000605414637354563021722 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._request_options import RequestOptions from typing import ClassVar, List, Optional, cast from typing_extensions import Literal, NotRequired, Unpack class ConnectionToken(CreateableAPIResource["ConnectionToken"]): """ A Connection Token is used by the Stripe Terminal SDK to connect to a reader. Related guide: [Fleet management](https://stripe.com/docs/terminal/fleet/locations) """ OBJECT_NAME: ClassVar[Literal["terminal.connection_token"]] = ( "terminal.connection_token" ) class CreateParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ location: NotRequired[str] """ The id of the location that this connection token is scoped to. If specified the connection token will only be usable with readers assigned to that location, otherwise the connection token will be usable with all readers. Note that location scoping only applies to internet-connected readers. For more details, see [the docs on scoping connection tokens](https://docs.stripe.com/terminal/fleet/locations-and-zones?dashboard-or-api=api#connection-tokens). """ location: Optional[str] """ The id of the location that this connection token is scoped to. Note that location scoping only applies to internet-connected readers. For more details, see [the docs on scoping connection tokens](https://docs.stripe.com/terminal/fleet/locations-and-zones?dashboard-or-api=api#connection-tokens). """ object: Literal["terminal.connection_token"] """ String representing the object's type. Objects of the same type share the same value. """ secret: str """ Your application should pass this token to the Stripe Terminal SDK. """ @classmethod def create( cls, **params: Unpack["ConnectionToken.CreateParams"] ) -> "ConnectionToken": """ To connect to a reader the Stripe Terminal SDK needs to retrieve a short-lived connection token from Stripe, proxied through your server. On your backend, add an endpoint that creates and returns a connection token. """ return cast( "ConnectionToken", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["ConnectionToken.CreateParams"] ) -> "ConnectionToken": """ To connect to a reader the Stripe Terminal SDK needs to retrieve a short-lived connection token from Stripe, proxied through your server. On your backend, add an endpoint that creates and returns a connection token. """ return cast( "ConnectionToken", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/terminal/_connection_token_service.py0000644000175100001770000000466614637354563023451 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe.terminal._connection_token import ConnectionToken from typing import List, cast from typing_extensions import NotRequired, TypedDict class ConnectionTokenService(StripeService): class CreateParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ location: NotRequired[str] """ The id of the location that this connection token is scoped to. If specified the connection token will only be usable with readers assigned to that location, otherwise the connection token will be usable with all readers. Note that location scoping only applies to internet-connected readers. For more details, see [the docs on scoping connection tokens](https://docs.stripe.com/terminal/fleet/locations-and-zones?dashboard-or-api=api#connection-tokens). """ def create( self, params: "ConnectionTokenService.CreateParams" = {}, options: RequestOptions = {}, ) -> ConnectionToken: """ To connect to a reader the Stripe Terminal SDK needs to retrieve a short-lived connection token from Stripe, proxied through your server. On your backend, add an endpoint that creates and returns a connection token. """ return cast( ConnectionToken, self._request( "post", "/v1/terminal/connection_tokens", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "ConnectionTokenService.CreateParams" = {}, options: RequestOptions = {}, ) -> ConnectionToken: """ To connect to a reader the Stripe Terminal SDK needs to retrieve a short-lived connection token from Stripe, proxied through your server. On your backend, add an endpoint that creates and returns a connection token. """ return cast( ConnectionToken, await self._request_async( "post", "/v1/terminal/connection_tokens", api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/terminal/_location.py0000644000175100001770000003307014637354563020171 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._deletable_api_resource import DeletableAPIResource from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import Literal, NotRequired, TypedDict, Unpack class Location( CreateableAPIResource["Location"], DeletableAPIResource["Location"], ListableAPIResource["Location"], UpdateableAPIResource["Location"], ): """ A Location represents a grouping of readers. Related guide: [Fleet management](https://stripe.com/docs/terminal/fleet/locations) """ OBJECT_NAME: ClassVar[Literal["terminal.location"]] = "terminal.location" 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 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State, county, province, or region. """ class CreateParams(RequestOptions): address: "Location.CreateParamsAddress" """ The full address of the location. """ configuration_overrides: NotRequired[str] """ The ID of a configuration that will be used to customize all readers in this location. """ display_name: str """ A name for the location. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ class CreateParamsAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: str """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class DeleteParams(RequestOptions): pass class ListParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class ModifyParams(RequestOptions): address: NotRequired["Location.ModifyParamsAddress"] """ The full address of the location. If you're updating the `address` field, avoid changing the `country`. If you need to modify the `country` field, create a new `Location` object and re-register any existing readers to that location. """ configuration_overrides: NotRequired["Literal['']|str"] """ The ID of a configuration that will be used to customize all readers in this location. """ display_name: NotRequired[str] """ A name for the location. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ class ModifyParamsAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ address: Address configuration_overrides: Optional[str] """ The ID of a configuration that will be used to customize all readers in this location. """ display_name: str """ The display name of the location. """ id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ metadata: Dict[str, str] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ object: Literal["terminal.location"] """ String representing the object's type. Objects of the same type share the same value. """ deleted: Optional[Literal[True]] """ Always true for a deleted object """ @classmethod def create(cls, **params: Unpack["Location.CreateParams"]) -> "Location": """ Creates a new Location object. For further details, including which address fields are required in each country, see the [Manage locations](https://stripe.com/docs/terminal/fleet/locations) guide. """ return cast( "Location", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["Location.CreateParams"] ) -> "Location": """ Creates a new Location object. For further details, including which address fields are required in each country, see the [Manage locations](https://stripe.com/docs/terminal/fleet/locations) guide. """ return cast( "Location", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def _cls_delete( cls, sid: str, **params: Unpack["Location.DeleteParams"] ) -> "Location": """ Deletes a Location object. """ url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "Location", cls._static_request( "delete", url, params=params, ), ) @overload @staticmethod def delete( sid: str, **params: Unpack["Location.DeleteParams"] ) -> "Location": """ Deletes a Location object. """ ... @overload def delete(self, **params: Unpack["Location.DeleteParams"]) -> "Location": """ Deletes a Location object. """ ... @class_method_variant("_cls_delete") def delete( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Location.DeleteParams"] ) -> "Location": """ Deletes a Location object. """ return self._request_and_refresh( "delete", self.instance_url(), params=params, ) @classmethod async def _cls_delete_async( cls, sid: str, **params: Unpack["Location.DeleteParams"] ) -> "Location": """ Deletes a Location object. """ url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "Location", await cls._static_request_async( "delete", url, params=params, ), ) @overload @staticmethod async def delete_async( sid: str, **params: Unpack["Location.DeleteParams"] ) -> "Location": """ Deletes a Location object. """ ... @overload async def delete_async( self, **params: Unpack["Location.DeleteParams"] ) -> "Location": """ Deletes a Location object. """ ... @class_method_variant("_cls_delete_async") async def delete_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Location.DeleteParams"] ) -> "Location": """ Deletes a Location object. """ return await self._request_and_refresh_async( "delete", self.instance_url(), params=params, ) @classmethod def list( cls, **params: Unpack["Location.ListParams"] ) -> ListObject["Location"]: """ Returns a list of Location objects. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["Location.ListParams"] ) -> ListObject["Location"]: """ Returns a list of Location objects. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def modify( cls, id: str, **params: Unpack["Location.ModifyParams"] ) -> "Location": """ Updates a Location object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Location", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["Location.ModifyParams"] ) -> "Location": """ Updates a Location object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Location", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["Location.RetrieveParams"] ) -> "Location": """ Retrieves a Location object. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["Location.RetrieveParams"] ) -> "Location": """ Retrieves a Location object. """ instance = cls(id, **params) await instance.refresh_async() return instance _inner_class_types = {"address": Address} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/terminal/_location_service.py0000644000175100001770000002661414637354563021717 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.terminal._location import Location from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class LocationService(StripeService): class CreateParams(TypedDict): address: "LocationService.CreateParamsAddress" """ The full address of the location. """ configuration_overrides: NotRequired[str] """ The ID of a configuration that will be used to customize all readers in this location. """ display_name: str """ A name for the location. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ class CreateParamsAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: str """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class DeleteParams(TypedDict): pass class ListParams(TypedDict): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): address: NotRequired["LocationService.UpdateParamsAddress"] """ The full address of the location. If you're updating the `address` field, avoid changing the `country`. If you need to modify the `country` field, create a new `Location` object and re-register any existing readers to that location. """ configuration_overrides: NotRequired["Literal['']|str"] """ The ID of a configuration that will be used to customize all readers in this location. """ display_name: NotRequired[str] """ A name for the location. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ class UpdateParamsAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ def delete( self, location: str, params: "LocationService.DeleteParams" = {}, options: RequestOptions = {}, ) -> Location: """ Deletes a Location object. """ return cast( Location, self._request( "delete", "/v1/terminal/locations/{location}".format( location=sanitize_id(location), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def delete_async( self, location: str, params: "LocationService.DeleteParams" = {}, options: RequestOptions = {}, ) -> Location: """ Deletes a Location object. """ return cast( Location, await self._request_async( "delete", "/v1/terminal/locations/{location}".format( location=sanitize_id(location), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, location: str, params: "LocationService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Location: """ Retrieves a Location object. """ return cast( Location, self._request( "get", "/v1/terminal/locations/{location}".format( location=sanitize_id(location), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, location: str, params: "LocationService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Location: """ Retrieves a Location object. """ return cast( Location, await self._request_async( "get", "/v1/terminal/locations/{location}".format( location=sanitize_id(location), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, location: str, params: "LocationService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Location: """ Updates a Location object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. """ return cast( Location, self._request( "post", "/v1/terminal/locations/{location}".format( location=sanitize_id(location), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, location: str, params: "LocationService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Location: """ Updates a Location object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. """ return cast( Location, await self._request_async( "post", "/v1/terminal/locations/{location}".format( location=sanitize_id(location), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def list( self, params: "LocationService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Location]: """ Returns a list of Location objects. """ return cast( ListObject[Location], self._request( "get", "/v1/terminal/locations", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "LocationService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Location]: """ Returns a list of Location objects. """ return cast( ListObject[Location], await self._request_async( "get", "/v1/terminal/locations", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "LocationService.CreateParams", options: RequestOptions = {}, ) -> Location: """ Creates a new Location object. For further details, including which address fields are required in each country, see the [Manage locations](https://stripe.com/docs/terminal/fleet/locations) guide. """ return cast( Location, self._request( "post", "/v1/terminal/locations", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "LocationService.CreateParams", options: RequestOptions = {}, ) -> Location: """ Creates a new Location object. For further details, including which address fields are required in each country, see the [Manage locations](https://stripe.com/docs/terminal/fleet/locations) guide. """ return cast( Location, await self._request_async( "post", "/v1/terminal/locations", api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/terminal/_reader.py0000644000175100001770000013560314637354563017630 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._deletable_api_resource import DeletableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._test_helpers import APIResourceTestHelpers from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, NotRequired, Type, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._charge import Charge from stripe._payment_intent import PaymentIntent from stripe._refund import Refund from stripe._setup_intent import SetupIntent from stripe.terminal._location import Location class Reader( CreateableAPIResource["Reader"], DeletableAPIResource["Reader"], ListableAPIResource["Reader"], UpdateableAPIResource["Reader"], ): """ A Reader represents a physical device for accepting payment details. Related guide: [Connecting to a reader](https://stripe.com/docs/terminal/payments/connect-reader) """ OBJECT_NAME: ClassVar[Literal["terminal.reader"]] = "terminal.reader" class Action(StripeObject): class ProcessPaymentIntent(StripeObject): class ProcessConfig(StripeObject): class Tipping(StripeObject): amount_eligible: Optional[int] """ Amount used to calculate tip suggestions on tipping selection screen for this transaction. Must be a positive integer in the smallest currency unit (e.g., 100 cents to represent $1.00 or 100 to represent ¥100, a zero-decimal currency). """ enable_customer_cancellation: Optional[bool] """ Enable customer initiated cancellation when processing this payment. """ skip_tipping: Optional[bool] """ Override showing a tipping selection screen on this transaction. """ tipping: Optional[Tipping] """ Represents a per-transaction tipping configuration """ _inner_class_types = {"tipping": Tipping} payment_intent: ExpandableField["PaymentIntent"] """ Most recent PaymentIntent processed by the reader. """ process_config: Optional[ProcessConfig] """ Represents a per-transaction override of a reader configuration """ _inner_class_types = {"process_config": ProcessConfig} class ProcessSetupIntent(StripeObject): class ProcessConfig(StripeObject): enable_customer_cancellation: Optional[bool] """ Enable customer initiated cancellation when processing this SetupIntent. """ generated_card: Optional[str] """ ID of a card PaymentMethod generated from the card_present PaymentMethod that may be attached to a Customer for future transactions. Only present if it was possible to generate a card PaymentMethod. """ process_config: Optional[ProcessConfig] """ Represents a per-setup override of a reader configuration """ setup_intent: ExpandableField["SetupIntent"] """ Most recent SetupIntent processed by the reader. """ _inner_class_types = {"process_config": ProcessConfig} class RefundPayment(StripeObject): class RefundPaymentConfig(StripeObject): enable_customer_cancellation: Optional[bool] """ Enable customer initiated cancellation when refunding this payment. """ amount: Optional[int] """ The amount being refunded. """ charge: Optional[ExpandableField["Charge"]] """ Charge that is being refunded. """ metadata: Optional[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ payment_intent: Optional[ExpandableField["PaymentIntent"]] """ Payment intent that is being refunded. """ reason: Optional[ Literal["duplicate", "fraudulent", "requested_by_customer"] ] """ The reason for the refund. """ refund: Optional[ExpandableField["Refund"]] """ Unique identifier for the refund object. """ refund_application_fee: Optional[bool] """ Boolean indicating whether the application fee should be refunded when refunding this charge. If a full charge refund is given, the full application fee will be refunded. Otherwise, the application fee will be refunded in an amount proportional to the amount of the charge refunded. An application fee can be refunded only by the application that created the charge. """ refund_payment_config: Optional[RefundPaymentConfig] """ Represents a per-transaction override of a reader configuration """ reverse_transfer: Optional[bool] """ Boolean indicating whether the transfer should be reversed when refunding this charge. The transfer will be reversed proportionally to the amount being refunded (either the entire or partial amount). A transfer can be reversed only by the application that created the charge. """ _inner_class_types = {"refund_payment_config": RefundPaymentConfig} class SetReaderDisplay(StripeObject): class Cart(StripeObject): class LineItem(StripeObject): amount: int """ The amount of the line item. A positive integer in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ description: str """ Description of the line item. """ quantity: int """ The quantity of the line item. """ 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). """ line_items: List[LineItem] """ List of line items in the cart. """ tax: Optional[int] """ Tax amount for the entire cart. A positive integer in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ total: int """ Total amount for the entire cart, including tax. A positive integer in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ _inner_class_types = {"line_items": LineItem} cart: Optional[Cart] """ Cart object to be displayed by the reader. """ type: Literal["cart"] """ Type of information to be displayed by the reader. """ _inner_class_types = {"cart": Cart} failure_code: Optional[str] """ Failure code, only set if status is `failed`. """ failure_message: Optional[str] """ Detailed failure message, only set if status is `failed`. """ process_payment_intent: Optional[ProcessPaymentIntent] """ Represents a reader action to process a payment intent """ process_setup_intent: Optional[ProcessSetupIntent] """ Represents a reader action to process a setup intent """ refund_payment: Optional[RefundPayment] """ Represents a reader action to refund a payment """ set_reader_display: Optional[SetReaderDisplay] """ Represents a reader action to set the reader display """ status: Literal["failed", "in_progress", "succeeded"] """ Status of the action performed by the reader. """ type: Literal[ "process_payment_intent", "process_setup_intent", "refund_payment", "set_reader_display", ] """ Type of action performed by the reader. """ _inner_class_types = { "process_payment_intent": ProcessPaymentIntent, "process_setup_intent": ProcessSetupIntent, "refund_payment": RefundPayment, "set_reader_display": SetReaderDisplay, } class CancelActionParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CreateParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ label: NotRequired[str] """ Custom label given to the reader for easier identification. If no label is specified, the registration code will be used. """ location: NotRequired[str] """ The location to assign the reader to. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ registration_code: str """ A code generated by the reader used for registering to an account. """ class DeleteParams(RequestOptions): pass class ListParams(RequestOptions): device_type: NotRequired[ Literal[ "bbpos_chipper2x", "bbpos_wisepad3", "bbpos_wisepos_e", "mobile_phone_reader", "simulated_wisepos_e", "stripe_m2", "verifone_P400", ] ] """ Filters readers by device type """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ location: NotRequired[str] """ A location ID to filter the response list to only readers at the specific location """ serial_number: NotRequired[str] """ Filters readers by serial number """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[Literal["offline", "online"]] """ A status filter to filter readers to only offline or online readers """ class ModifyParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ label: NotRequired["Literal['']|str"] """ The new label of the reader. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ class PresentPaymentMethodParams(RequestOptions): amount_tip: NotRequired[int] """ Simulated on-reader tip amount. """ card_present: NotRequired[ "Reader.PresentPaymentMethodParamsCardPresent" ] """ Simulated data for the card_present payment method. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ interac_present: NotRequired[ "Reader.PresentPaymentMethodParamsInteracPresent" ] """ Simulated data for the interac_present payment method. """ type: NotRequired[Literal["card_present", "interac_present"]] """ Simulated payment type. """ class PresentPaymentMethodParamsCardPresent(TypedDict): number: NotRequired[str] """ The card number, as a string without any separators. """ class PresentPaymentMethodParamsInteracPresent(TypedDict): number: NotRequired[str] """ Card Number """ class ProcessPaymentIntentParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ payment_intent: str """ PaymentIntent ID """ process_config: NotRequired[ "Reader.ProcessPaymentIntentParamsProcessConfig" ] """ Configuration overrides """ class ProcessPaymentIntentParamsProcessConfig(TypedDict): enable_customer_cancellation: NotRequired[bool] """ Enables cancel button on transaction screens. """ skip_tipping: NotRequired[bool] """ Override showing a tipping selection screen on this transaction. """ tipping: NotRequired[ "Reader.ProcessPaymentIntentParamsProcessConfigTipping" ] """ Tipping configuration for this transaction. """ class ProcessPaymentIntentParamsProcessConfigTipping(TypedDict): amount_eligible: NotRequired[int] """ Amount used to calculate tip suggestions on tipping selection screen for this transaction. Must be a positive integer in the smallest currency unit (e.g., 100 cents to represent $1.00 or 100 to represent ¥100, a zero-decimal currency). """ class ProcessSetupIntentParams(RequestOptions): customer_consent_collected: bool """ Customer Consent Collected """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ process_config: NotRequired[ "Reader.ProcessSetupIntentParamsProcessConfig" ] """ Configuration overrides """ setup_intent: str """ SetupIntent ID """ class ProcessSetupIntentParamsProcessConfig(TypedDict): enable_customer_cancellation: NotRequired[bool] """ Enables cancel button on transaction screens. """ class RefundPaymentParams(RequestOptions): amount: NotRequired[int] """ A positive integer in __cents__ representing how much of this charge to refund. """ charge: NotRequired[str] """ ID of the Charge to refund. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ payment_intent: NotRequired[str] """ ID of the PaymentIntent to refund. """ refund_application_fee: NotRequired[bool] """ Boolean indicating whether the application fee should be refunded when refunding this charge. If a full charge refund is given, the full application fee will be refunded. Otherwise, the application fee will be refunded in an amount proportional to the amount of the charge refunded. An application fee can be refunded only by the application that created the charge. """ refund_payment_config: NotRequired[ "Reader.RefundPaymentParamsRefundPaymentConfig" ] """ Configuration overrides """ reverse_transfer: NotRequired[bool] """ Boolean indicating whether the transfer should be reversed when refunding this charge. The transfer will be reversed proportionally to the amount being refunded (either the entire or partial amount). A transfer can be reversed only by the application that created the charge. """ class RefundPaymentParamsRefundPaymentConfig(TypedDict): enable_customer_cancellation: NotRequired[bool] """ Enables cancel button on transaction screens. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class SetReaderDisplayParams(RequestOptions): cart: NotRequired["Reader.SetReaderDisplayParamsCart"] """ Cart """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ type: Literal["cart"] """ Type """ class SetReaderDisplayParamsCart(TypedDict): 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). """ line_items: List["Reader.SetReaderDisplayParamsCartLineItem"] """ Array of line items that were purchased. """ tax: NotRequired[int] """ The amount of tax in cents. """ total: int """ Total balance of cart due in cents. """ class SetReaderDisplayParamsCartLineItem(TypedDict): amount: int """ The price of the item in cents. """ description: str """ The description or name of the item. """ quantity: int """ The quantity of the line item being purchased. """ action: Optional[Action] """ The most recent action performed by the reader. """ device_sw_version: Optional[str] """ The current software version of the reader. """ device_type: Literal[ "bbpos_chipper2x", "bbpos_wisepad3", "bbpos_wisepos_e", "mobile_phone_reader", "simulated_wisepos_e", "stripe_m2", "verifone_P400", ] """ Type of reader, one of `bbpos_wisepad3`, `stripe_m2`, `bbpos_chipper2x`, `bbpos_wisepos_e`, `verifone_P400`, `simulated_wisepos_e`, or `mobile_phone_reader`. """ id: str """ Unique identifier for the object. """ ip_address: Optional[str] """ The local IP address of the reader. """ label: str """ Custom label given to the reader for easier identification. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ location: Optional[ExpandableField["Location"]] """ The location identifier of the reader. """ metadata: Dict[str, str] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ object: Literal["terminal.reader"] """ String representing the object's type. Objects of the same type share the same value. """ serial_number: str """ Serial number of the reader. """ status: Optional[Literal["offline", "online"]] """ The networking status of the reader. """ deleted: Optional[Literal[True]] """ Always true for a deleted object """ @classmethod def _cls_cancel_action( cls, reader: str, **params: Unpack["Reader.CancelActionParams"] ) -> "Reader": """ Cancels the current reader action. """ return cast( "Reader", cls._static_request( "post", "/v1/terminal/readers/{reader}/cancel_action".format( reader=sanitize_id(reader) ), params=params, ), ) @overload @staticmethod def cancel_action( reader: str, **params: Unpack["Reader.CancelActionParams"] ) -> "Reader": """ Cancels the current reader action. """ ... @overload def cancel_action( self, **params: Unpack["Reader.CancelActionParams"] ) -> "Reader": """ Cancels the current reader action. """ ... @class_method_variant("_cls_cancel_action") def cancel_action( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Reader.CancelActionParams"] ) -> "Reader": """ Cancels the current reader action. """ return cast( "Reader", self._request( "post", "/v1/terminal/readers/{reader}/cancel_action".format( reader=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_cancel_action_async( cls, reader: str, **params: Unpack["Reader.CancelActionParams"] ) -> "Reader": """ Cancels the current reader action. """ return cast( "Reader", await cls._static_request_async( "post", "/v1/terminal/readers/{reader}/cancel_action".format( reader=sanitize_id(reader) ), params=params, ), ) @overload @staticmethod async def cancel_action_async( reader: str, **params: Unpack["Reader.CancelActionParams"] ) -> "Reader": """ Cancels the current reader action. """ ... @overload async def cancel_action_async( self, **params: Unpack["Reader.CancelActionParams"] ) -> "Reader": """ Cancels the current reader action. """ ... @class_method_variant("_cls_cancel_action_async") async def cancel_action_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Reader.CancelActionParams"] ) -> "Reader": """ Cancels the current reader action. """ return cast( "Reader", await self._request_async( "post", "/v1/terminal/readers/{reader}/cancel_action".format( reader=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def create(cls, **params: Unpack["Reader.CreateParams"]) -> "Reader": """ Creates a new Reader object. """ return cast( "Reader", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["Reader.CreateParams"] ) -> "Reader": """ Creates a new Reader object. """ return cast( "Reader", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def _cls_delete( cls, sid: str, **params: Unpack["Reader.DeleteParams"] ) -> "Reader": """ Deletes a Reader object. """ url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "Reader", cls._static_request( "delete", url, params=params, ), ) @overload @staticmethod def delete(sid: str, **params: Unpack["Reader.DeleteParams"]) -> "Reader": """ Deletes a Reader object. """ ... @overload def delete(self, **params: Unpack["Reader.DeleteParams"]) -> "Reader": """ Deletes a Reader object. """ ... @class_method_variant("_cls_delete") def delete( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Reader.DeleteParams"] ) -> "Reader": """ Deletes a Reader object. """ return self._request_and_refresh( "delete", self.instance_url(), params=params, ) @classmethod async def _cls_delete_async( cls, sid: str, **params: Unpack["Reader.DeleteParams"] ) -> "Reader": """ Deletes a Reader object. """ url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "Reader", await cls._static_request_async( "delete", url, params=params, ), ) @overload @staticmethod async def delete_async( sid: str, **params: Unpack["Reader.DeleteParams"] ) -> "Reader": """ Deletes a Reader object. """ ... @overload async def delete_async( self, **params: Unpack["Reader.DeleteParams"] ) -> "Reader": """ Deletes a Reader object. """ ... @class_method_variant("_cls_delete_async") async def delete_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Reader.DeleteParams"] ) -> "Reader": """ Deletes a Reader object. """ return await self._request_and_refresh_async( "delete", self.instance_url(), params=params, ) @classmethod def list( cls, **params: Unpack["Reader.ListParams"] ) -> ListObject["Reader"]: """ Returns a list of Reader objects. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["Reader.ListParams"] ) -> ListObject["Reader"]: """ Returns a list of Reader objects. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def modify( cls, id: str, **params: Unpack["Reader.ModifyParams"] ) -> "Reader": """ Updates a Reader object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Reader", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["Reader.ModifyParams"] ) -> "Reader": """ Updates a Reader object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "Reader", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def _cls_process_payment_intent( cls, reader: str, **params: Unpack["Reader.ProcessPaymentIntentParams"] ) -> "Reader": """ Initiates a payment flow on a Reader. """ return cast( "Reader", cls._static_request( "post", "/v1/terminal/readers/{reader}/process_payment_intent".format( reader=sanitize_id(reader) ), params=params, ), ) @overload @staticmethod def process_payment_intent( reader: str, **params: Unpack["Reader.ProcessPaymentIntentParams"] ) -> "Reader": """ Initiates a payment flow on a Reader. """ ... @overload def process_payment_intent( self, **params: Unpack["Reader.ProcessPaymentIntentParams"] ) -> "Reader": """ Initiates a payment flow on a Reader. """ ... @class_method_variant("_cls_process_payment_intent") def process_payment_intent( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Reader.ProcessPaymentIntentParams"] ) -> "Reader": """ Initiates a payment flow on a Reader. """ return cast( "Reader", self._request( "post", "/v1/terminal/readers/{reader}/process_payment_intent".format( reader=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_process_payment_intent_async( cls, reader: str, **params: Unpack["Reader.ProcessPaymentIntentParams"] ) -> "Reader": """ Initiates a payment flow on a Reader. """ return cast( "Reader", await cls._static_request_async( "post", "/v1/terminal/readers/{reader}/process_payment_intent".format( reader=sanitize_id(reader) ), params=params, ), ) @overload @staticmethod async def process_payment_intent_async( reader: str, **params: Unpack["Reader.ProcessPaymentIntentParams"] ) -> "Reader": """ Initiates a payment flow on a Reader. """ ... @overload async def process_payment_intent_async( self, **params: Unpack["Reader.ProcessPaymentIntentParams"] ) -> "Reader": """ Initiates a payment flow on a Reader. """ ... @class_method_variant("_cls_process_payment_intent_async") async def process_payment_intent_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Reader.ProcessPaymentIntentParams"] ) -> "Reader": """ Initiates a payment flow on a Reader. """ return cast( "Reader", await self._request_async( "post", "/v1/terminal/readers/{reader}/process_payment_intent".format( reader=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def _cls_process_setup_intent( cls, reader: str, **params: Unpack["Reader.ProcessSetupIntentParams"] ) -> "Reader": """ Initiates a setup intent flow on a Reader. """ return cast( "Reader", cls._static_request( "post", "/v1/terminal/readers/{reader}/process_setup_intent".format( reader=sanitize_id(reader) ), params=params, ), ) @overload @staticmethod def process_setup_intent( reader: str, **params: Unpack["Reader.ProcessSetupIntentParams"] ) -> "Reader": """ Initiates a setup intent flow on a Reader. """ ... @overload def process_setup_intent( self, **params: Unpack["Reader.ProcessSetupIntentParams"] ) -> "Reader": """ Initiates a setup intent flow on a Reader. """ ... @class_method_variant("_cls_process_setup_intent") def process_setup_intent( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Reader.ProcessSetupIntentParams"] ) -> "Reader": """ Initiates a setup intent flow on a Reader. """ return cast( "Reader", self._request( "post", "/v1/terminal/readers/{reader}/process_setup_intent".format( reader=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_process_setup_intent_async( cls, reader: str, **params: Unpack["Reader.ProcessSetupIntentParams"] ) -> "Reader": """ Initiates a setup intent flow on a Reader. """ return cast( "Reader", await cls._static_request_async( "post", "/v1/terminal/readers/{reader}/process_setup_intent".format( reader=sanitize_id(reader) ), params=params, ), ) @overload @staticmethod async def process_setup_intent_async( reader: str, **params: Unpack["Reader.ProcessSetupIntentParams"] ) -> "Reader": """ Initiates a setup intent flow on a Reader. """ ... @overload async def process_setup_intent_async( self, **params: Unpack["Reader.ProcessSetupIntentParams"] ) -> "Reader": """ Initiates a setup intent flow on a Reader. """ ... @class_method_variant("_cls_process_setup_intent_async") async def process_setup_intent_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Reader.ProcessSetupIntentParams"] ) -> "Reader": """ Initiates a setup intent flow on a Reader. """ return cast( "Reader", await self._request_async( "post", "/v1/terminal/readers/{reader}/process_setup_intent".format( reader=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def _cls_refund_payment( cls, reader: str, **params: Unpack["Reader.RefundPaymentParams"] ) -> "Reader": """ Initiates a refund on a Reader """ return cast( "Reader", cls._static_request( "post", "/v1/terminal/readers/{reader}/refund_payment".format( reader=sanitize_id(reader) ), params=params, ), ) @overload @staticmethod def refund_payment( reader: str, **params: Unpack["Reader.RefundPaymentParams"] ) -> "Reader": """ Initiates a refund on a Reader """ ... @overload def refund_payment( self, **params: Unpack["Reader.RefundPaymentParams"] ) -> "Reader": """ Initiates a refund on a Reader """ ... @class_method_variant("_cls_refund_payment") def refund_payment( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Reader.RefundPaymentParams"] ) -> "Reader": """ Initiates a refund on a Reader """ return cast( "Reader", self._request( "post", "/v1/terminal/readers/{reader}/refund_payment".format( reader=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_refund_payment_async( cls, reader: str, **params: Unpack["Reader.RefundPaymentParams"] ) -> "Reader": """ Initiates a refund on a Reader """ return cast( "Reader", await cls._static_request_async( "post", "/v1/terminal/readers/{reader}/refund_payment".format( reader=sanitize_id(reader) ), params=params, ), ) @overload @staticmethod async def refund_payment_async( reader: str, **params: Unpack["Reader.RefundPaymentParams"] ) -> "Reader": """ Initiates a refund on a Reader """ ... @overload async def refund_payment_async( self, **params: Unpack["Reader.RefundPaymentParams"] ) -> "Reader": """ Initiates a refund on a Reader """ ... @class_method_variant("_cls_refund_payment_async") async def refund_payment_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Reader.RefundPaymentParams"] ) -> "Reader": """ Initiates a refund on a Reader """ return cast( "Reader", await self._request_async( "post", "/v1/terminal/readers/{reader}/refund_payment".format( reader=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["Reader.RetrieveParams"] ) -> "Reader": """ Retrieves a Reader object. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["Reader.RetrieveParams"] ) -> "Reader": """ Retrieves a Reader object. """ instance = cls(id, **params) await instance.refresh_async() return instance @classmethod def _cls_set_reader_display( cls, reader: str, **params: Unpack["Reader.SetReaderDisplayParams"] ) -> "Reader": """ Sets reader display to show cart details. """ return cast( "Reader", cls._static_request( "post", "/v1/terminal/readers/{reader}/set_reader_display".format( reader=sanitize_id(reader) ), params=params, ), ) @overload @staticmethod def set_reader_display( reader: str, **params: Unpack["Reader.SetReaderDisplayParams"] ) -> "Reader": """ Sets reader display to show cart details. """ ... @overload def set_reader_display( self, **params: Unpack["Reader.SetReaderDisplayParams"] ) -> "Reader": """ Sets reader display to show cart details. """ ... @class_method_variant("_cls_set_reader_display") def set_reader_display( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Reader.SetReaderDisplayParams"] ) -> "Reader": """ Sets reader display to show cart details. """ return cast( "Reader", self._request( "post", "/v1/terminal/readers/{reader}/set_reader_display".format( reader=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_set_reader_display_async( cls, reader: str, **params: Unpack["Reader.SetReaderDisplayParams"] ) -> "Reader": """ Sets reader display to show cart details. """ return cast( "Reader", await cls._static_request_async( "post", "/v1/terminal/readers/{reader}/set_reader_display".format( reader=sanitize_id(reader) ), params=params, ), ) @overload @staticmethod async def set_reader_display_async( reader: str, **params: Unpack["Reader.SetReaderDisplayParams"] ) -> "Reader": """ Sets reader display to show cart details. """ ... @overload async def set_reader_display_async( self, **params: Unpack["Reader.SetReaderDisplayParams"] ) -> "Reader": """ Sets reader display to show cart details. """ ... @class_method_variant("_cls_set_reader_display_async") async def set_reader_display_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Reader.SetReaderDisplayParams"] ) -> "Reader": """ Sets reader display to show cart details. """ return cast( "Reader", await self._request_async( "post", "/v1/terminal/readers/{reader}/set_reader_display".format( reader=sanitize_id(self.get("id")) ), params=params, ), ) class TestHelpers(APIResourceTestHelpers["Reader"]): _resource_cls: Type["Reader"] @classmethod def _cls_present_payment_method( cls, reader: str, **params: Unpack["Reader.PresentPaymentMethodParams"], ) -> "Reader": """ Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction. """ return cast( "Reader", cls._static_request( "post", "/v1/test_helpers/terminal/readers/{reader}/present_payment_method".format( reader=sanitize_id(reader) ), params=params, ), ) @overload @staticmethod def present_payment_method( reader: str, **params: Unpack["Reader.PresentPaymentMethodParams"] ) -> "Reader": """ Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction. """ ... @overload def present_payment_method( self, **params: Unpack["Reader.PresentPaymentMethodParams"] ) -> "Reader": """ Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction. """ ... @class_method_variant("_cls_present_payment_method") def present_payment_method( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Reader.PresentPaymentMethodParams"] ) -> "Reader": """ Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction. """ return cast( "Reader", self.resource._request( "post", "/v1/test_helpers/terminal/readers/{reader}/present_payment_method".format( reader=sanitize_id(self.resource.get("id")) ), params=params, ), ) @classmethod async def _cls_present_payment_method_async( cls, reader: str, **params: Unpack["Reader.PresentPaymentMethodParams"], ) -> "Reader": """ Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction. """ return cast( "Reader", await cls._static_request_async( "post", "/v1/test_helpers/terminal/readers/{reader}/present_payment_method".format( reader=sanitize_id(reader) ), params=params, ), ) @overload @staticmethod async def present_payment_method_async( reader: str, **params: Unpack["Reader.PresentPaymentMethodParams"] ) -> "Reader": """ Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction. """ ... @overload async def present_payment_method_async( self, **params: Unpack["Reader.PresentPaymentMethodParams"] ) -> "Reader": """ Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction. """ ... @class_method_variant("_cls_present_payment_method_async") async def present_payment_method_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["Reader.PresentPaymentMethodParams"] ) -> "Reader": """ Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction. """ return cast( "Reader", await self.resource._request_async( "post", "/v1/test_helpers/terminal/readers/{reader}/present_payment_method".format( reader=sanitize_id(self.resource.get("id")) ), params=params, ), ) @property def test_helpers(self): return self.TestHelpers(self) _inner_class_types = {"action": Action} Reader.TestHelpers._resource_cls = Reader ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/terminal/_reader_service.py0000644000175100001770000005311214637354563021342 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.terminal._reader import Reader from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class ReaderService(StripeService): class CancelActionParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CreateParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ label: NotRequired[str] """ Custom label given to the reader for easier identification. If no label is specified, the registration code will be used. """ location: NotRequired[str] """ The location to assign the reader to. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ registration_code: str """ A code generated by the reader used for registering to an account. """ class DeleteParams(TypedDict): pass class ListParams(TypedDict): device_type: NotRequired[ Literal[ "bbpos_chipper2x", "bbpos_wisepad3", "bbpos_wisepos_e", "mobile_phone_reader", "simulated_wisepos_e", "stripe_m2", "verifone_P400", ] ] """ Filters readers by device type """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ location: NotRequired[str] """ A location ID to filter the response list to only readers at the specific location """ serial_number: NotRequired[str] """ Filters readers by serial number """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[Literal["offline", "online"]] """ A status filter to filter readers to only offline or online readers """ class ProcessPaymentIntentParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ payment_intent: str """ PaymentIntent ID """ process_config: NotRequired[ "ReaderService.ProcessPaymentIntentParamsProcessConfig" ] """ Configuration overrides """ class ProcessPaymentIntentParamsProcessConfig(TypedDict): enable_customer_cancellation: NotRequired[bool] """ Enables cancel button on transaction screens. """ skip_tipping: NotRequired[bool] """ Override showing a tipping selection screen on this transaction. """ tipping: NotRequired[ "ReaderService.ProcessPaymentIntentParamsProcessConfigTipping" ] """ Tipping configuration for this transaction. """ class ProcessPaymentIntentParamsProcessConfigTipping(TypedDict): amount_eligible: NotRequired[int] """ Amount used to calculate tip suggestions on tipping selection screen for this transaction. Must be a positive integer in the smallest currency unit (e.g., 100 cents to represent $1.00 or 100 to represent ¥100, a zero-decimal currency). """ class ProcessSetupIntentParams(TypedDict): customer_consent_collected: bool """ Customer Consent Collected """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ process_config: NotRequired[ "ReaderService.ProcessSetupIntentParamsProcessConfig" ] """ Configuration overrides """ setup_intent: str """ SetupIntent ID """ class ProcessSetupIntentParamsProcessConfig(TypedDict): enable_customer_cancellation: NotRequired[bool] """ Enables cancel button on transaction screens. """ class RefundPaymentParams(TypedDict): amount: NotRequired[int] """ A positive integer in __cents__ representing how much of this charge to refund. """ charge: NotRequired[str] """ ID of the Charge to refund. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ payment_intent: NotRequired[str] """ ID of the PaymentIntent to refund. """ refund_application_fee: NotRequired[bool] """ Boolean indicating whether the application fee should be refunded when refunding this charge. If a full charge refund is given, the full application fee will be refunded. Otherwise, the application fee will be refunded in an amount proportional to the amount of the charge refunded. An application fee can be refunded only by the application that created the charge. """ refund_payment_config: NotRequired[ "ReaderService.RefundPaymentParamsRefundPaymentConfig" ] """ Configuration overrides """ reverse_transfer: NotRequired[bool] """ Boolean indicating whether the transfer should be reversed when refunding this charge. The transfer will be reversed proportionally to the amount being refunded (either the entire or partial amount). A transfer can be reversed only by the application that created the charge. """ class RefundPaymentParamsRefundPaymentConfig(TypedDict): enable_customer_cancellation: NotRequired[bool] """ Enables cancel button on transaction screens. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class SetReaderDisplayParams(TypedDict): cart: NotRequired["ReaderService.SetReaderDisplayParamsCart"] """ Cart """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ type: Literal["cart"] """ Type """ class SetReaderDisplayParamsCart(TypedDict): 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). """ line_items: List["ReaderService.SetReaderDisplayParamsCartLineItem"] """ Array of line items that were purchased. """ tax: NotRequired[int] """ The amount of tax in cents. """ total: int """ Total balance of cart due in cents. """ class SetReaderDisplayParamsCartLineItem(TypedDict): amount: int """ The price of the item in cents. """ description: str """ The description or name of the item. """ quantity: int """ The quantity of the line item being purchased. """ class UpdateParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ label: NotRequired["Literal['']|str"] """ The new label of the reader. """ metadata: NotRequired["Literal['']|Dict[str, str]"] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ def delete( self, reader: str, params: "ReaderService.DeleteParams" = {}, options: RequestOptions = {}, ) -> Reader: """ Deletes a Reader object. """ return cast( Reader, self._request( "delete", "/v1/terminal/readers/{reader}".format( reader=sanitize_id(reader), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def delete_async( self, reader: str, params: "ReaderService.DeleteParams" = {}, options: RequestOptions = {}, ) -> Reader: """ Deletes a Reader object. """ return cast( Reader, await self._request_async( "delete", "/v1/terminal/readers/{reader}".format( reader=sanitize_id(reader), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, reader: str, params: "ReaderService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Reader: """ Retrieves a Reader object. """ return cast( Reader, self._request( "get", "/v1/terminal/readers/{reader}".format( reader=sanitize_id(reader), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, reader: str, params: "ReaderService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Reader: """ Retrieves a Reader object. """ return cast( Reader, await self._request_async( "get", "/v1/terminal/readers/{reader}".format( reader=sanitize_id(reader), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, reader: str, params: "ReaderService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Reader: """ Updates a Reader object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. """ return cast( Reader, self._request( "post", "/v1/terminal/readers/{reader}".format( reader=sanitize_id(reader), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, reader: str, params: "ReaderService.UpdateParams" = {}, options: RequestOptions = {}, ) -> Reader: """ Updates a Reader object by setting the values of the parameters passed. Any parameters not provided will be left unchanged. """ return cast( Reader, await self._request_async( "post", "/v1/terminal/readers/{reader}".format( reader=sanitize_id(reader), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def list( self, params: "ReaderService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Reader]: """ Returns a list of Reader objects. """ return cast( ListObject[Reader], self._request( "get", "/v1/terminal/readers", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "ReaderService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[Reader]: """ Returns a list of Reader objects. """ return cast( ListObject[Reader], await self._request_async( "get", "/v1/terminal/readers", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "ReaderService.CreateParams", options: RequestOptions = {}, ) -> Reader: """ Creates a new Reader object. """ return cast( Reader, self._request( "post", "/v1/terminal/readers", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "ReaderService.CreateParams", options: RequestOptions = {}, ) -> Reader: """ Creates a new Reader object. """ return cast( Reader, await self._request_async( "post", "/v1/terminal/readers", api_mode="V1", base_address="api", params=params, options=options, ), ) def cancel_action( self, reader: str, params: "ReaderService.CancelActionParams" = {}, options: RequestOptions = {}, ) -> Reader: """ Cancels the current reader action. """ return cast( Reader, self._request( "post", "/v1/terminal/readers/{reader}/cancel_action".format( reader=sanitize_id(reader), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def cancel_action_async( self, reader: str, params: "ReaderService.CancelActionParams" = {}, options: RequestOptions = {}, ) -> Reader: """ Cancels the current reader action. """ return cast( Reader, await self._request_async( "post", "/v1/terminal/readers/{reader}/cancel_action".format( reader=sanitize_id(reader), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def process_payment_intent( self, reader: str, params: "ReaderService.ProcessPaymentIntentParams", options: RequestOptions = {}, ) -> Reader: """ Initiates a payment flow on a Reader. """ return cast( Reader, self._request( "post", "/v1/terminal/readers/{reader}/process_payment_intent".format( reader=sanitize_id(reader), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def process_payment_intent_async( self, reader: str, params: "ReaderService.ProcessPaymentIntentParams", options: RequestOptions = {}, ) -> Reader: """ Initiates a payment flow on a Reader. """ return cast( Reader, await self._request_async( "post", "/v1/terminal/readers/{reader}/process_payment_intent".format( reader=sanitize_id(reader), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def process_setup_intent( self, reader: str, params: "ReaderService.ProcessSetupIntentParams", options: RequestOptions = {}, ) -> Reader: """ Initiates a setup intent flow on a Reader. """ return cast( Reader, self._request( "post", "/v1/terminal/readers/{reader}/process_setup_intent".format( reader=sanitize_id(reader), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def process_setup_intent_async( self, reader: str, params: "ReaderService.ProcessSetupIntentParams", options: RequestOptions = {}, ) -> Reader: """ Initiates a setup intent flow on a Reader. """ return cast( Reader, await self._request_async( "post", "/v1/terminal/readers/{reader}/process_setup_intent".format( reader=sanitize_id(reader), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def refund_payment( self, reader: str, params: "ReaderService.RefundPaymentParams" = {}, options: RequestOptions = {}, ) -> Reader: """ Initiates a refund on a Reader """ return cast( Reader, self._request( "post", "/v1/terminal/readers/{reader}/refund_payment".format( reader=sanitize_id(reader), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def refund_payment_async( self, reader: str, params: "ReaderService.RefundPaymentParams" = {}, options: RequestOptions = {}, ) -> Reader: """ Initiates a refund on a Reader """ return cast( Reader, await self._request_async( "post", "/v1/terminal/readers/{reader}/refund_payment".format( reader=sanitize_id(reader), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def set_reader_display( self, reader: str, params: "ReaderService.SetReaderDisplayParams", options: RequestOptions = {}, ) -> Reader: """ Sets reader display to show cart details. """ return cast( Reader, self._request( "post", "/v1/terminal/readers/{reader}/set_reader_display".format( reader=sanitize_id(reader), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def set_reader_display_async( self, reader: str, params: "ReaderService.SetReaderDisplayParams", options: RequestOptions = {}, ) -> Reader: """ Sets reader display to show cart details. """ return cast( Reader, await self._request_async( "post", "/v1/terminal/readers/{reader}/set_reader_display".format( reader=sanitize_id(reader), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5489407 stripe-10.1.0/stripe/test_helpers/0000755000175100001770000000000014637354616016532 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/test_helpers/__init__.py0000644000175100001770000000162214637354563020645 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe.test_helpers import ( issuing as issuing, terminal as terminal, treasury as treasury, ) from stripe.test_helpers._confirmation_token_service import ( ConfirmationTokenService as ConfirmationTokenService, ) from stripe.test_helpers._customer_service import ( CustomerService as CustomerService, ) from stripe.test_helpers._issuing_service import ( IssuingService as IssuingService, ) from stripe.test_helpers._refund_service import RefundService as RefundService from stripe.test_helpers._terminal_service import ( TerminalService as TerminalService, ) from stripe.test_helpers._test_clock import TestClock as TestClock from stripe.test_helpers._test_clock_service import ( TestClockService as TestClockService, ) from stripe.test_helpers._treasury_service import ( TreasuryService as TreasuryService, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/test_helpers/_confirmation_token_service.py0000644000175100001770000006230714637354563024664 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._confirmation_token import ConfirmationToken from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class ConfirmationTokenService(StripeService): class CreateParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ payment_method: NotRequired[str] """ ID of an existing PaymentMethod. """ payment_method_data: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodData" ] """ If provided, this hash will be used to create a PaymentMethod. """ return_url: NotRequired[str] """ Return URL used to confirm the Intent. """ setup_future_usage: NotRequired[Literal["off_session", "on_session"]] """ Indicates that you intend to make future payments with this ConfirmationToken's payment method. The presence of this property will [attach the payment method](https://stripe.com/docs/payments/save-during-payment) to the PaymentIntent's Customer, if present, after the PaymentIntent is confirmed and any required actions from the user are complete. """ shipping: NotRequired["ConfirmationTokenService.CreateParamsShipping"] """ Shipping information for this ConfirmationToken. """ class CreateParamsPaymentMethodData(TypedDict): acss_debit: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataAcssDebit" ] """ If this is an `acss_debit` PaymentMethod, this hash contains details about the ACSS Debit payment method. """ affirm: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataAffirm" ] """ If this is an `affirm` PaymentMethod, this hash contains details about the Affirm payment method. """ afterpay_clearpay: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataAfterpayClearpay" ] """ If this is an `AfterpayClearpay` PaymentMethod, this hash contains details about the AfterpayClearpay payment method. """ alipay: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataAlipay" ] """ If this is an `Alipay` PaymentMethod, this hash contains details about the Alipay payment method. """ allow_redisplay: NotRequired[ Literal["always", "limited", "unspecified"] ] """ This field indicates whether this payment method can be shown again to its customer in a checkout flow. Stripe products such as Checkout and Elements use this field to determine whether a payment method can be shown as a saved payment method in a checkout flow. The field defaults to `unspecified`. """ amazon_pay: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataAmazonPay" ] """ If this is a AmazonPay PaymentMethod, this hash contains details about the AmazonPay payment method. """ au_becs_debit: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataAuBecsDebit" ] """ If this is an `au_becs_debit` PaymentMethod, this hash contains details about the bank account. """ bacs_debit: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataBacsDebit" ] """ If this is a `bacs_debit` PaymentMethod, this hash contains details about the Bacs Direct Debit bank account. """ bancontact: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataBancontact" ] """ If this is a `bancontact` PaymentMethod, this hash contains details about the Bancontact payment method. """ billing_details: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataBillingDetails" ] """ Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. """ blik: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataBlik" ] """ If this is a `blik` PaymentMethod, this hash contains details about the BLIK payment method. """ boleto: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataBoleto" ] """ If this is a `boleto` PaymentMethod, this hash contains details about the Boleto payment method. """ cashapp: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataCashapp" ] """ If this is a `cashapp` PaymentMethod, this hash contains details about the Cash App Pay payment method. """ customer_balance: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataCustomerBalance" ] """ If this is a `customer_balance` PaymentMethod, this hash contains details about the CustomerBalance payment method. """ eps: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataEps" ] """ If this is an `eps` PaymentMethod, this hash contains details about the EPS payment method. """ fpx: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataFpx" ] """ If this is an `fpx` PaymentMethod, this hash contains details about the FPX payment method. """ giropay: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataGiropay" ] """ If this is a `giropay` PaymentMethod, this hash contains details about the Giropay payment method. """ grabpay: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataGrabpay" ] """ If this is a `grabpay` PaymentMethod, this hash contains details about the GrabPay payment method. """ ideal: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataIdeal" ] """ If this is an `ideal` PaymentMethod, this hash contains details about the iDEAL payment method. """ interac_present: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataInteracPresent" ] """ If this is an `interac_present` PaymentMethod, this hash contains details about the Interac Present payment method. """ klarna: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataKlarna" ] """ If this is a `klarna` PaymentMethod, this hash contains details about the Klarna payment method. """ konbini: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataKonbini" ] """ If this is a `konbini` PaymentMethod, this hash contains details about the Konbini payment method. """ link: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataLink" ] """ If this is an `Link` PaymentMethod, this hash contains details about the Link payment method. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ mobilepay: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataMobilepay" ] """ If this is a `mobilepay` PaymentMethod, this hash contains details about the MobilePay payment method. """ multibanco: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataMultibanco" ] """ If this is a `multibanco` PaymentMethod, this hash contains details about the Multibanco payment method. """ oxxo: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataOxxo" ] """ If this is an `oxxo` PaymentMethod, this hash contains details about the OXXO payment method. """ p24: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataP24" ] """ If this is a `p24` PaymentMethod, this hash contains details about the P24 payment method. """ paynow: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataPaynow" ] """ If this is a `paynow` PaymentMethod, this hash contains details about the PayNow payment method. """ paypal: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataPaypal" ] """ If this is a `paypal` PaymentMethod, this hash contains details about the PayPal payment method. """ pix: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataPix" ] """ If this is a `pix` PaymentMethod, this hash contains details about the Pix payment method. """ promptpay: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataPromptpay" ] """ If this is a `promptpay` PaymentMethod, this hash contains details about the PromptPay payment method. """ radar_options: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataRadarOptions" ] """ Options to configure Radar. See [Radar Session](https://stripe.com/docs/radar/radar-session) for more information. """ revolut_pay: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataRevolutPay" ] """ If this is a `Revolut Pay` PaymentMethod, this hash contains details about the Revolut Pay payment method. """ sepa_debit: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataSepaDebit" ] """ If this is a `sepa_debit` PaymentMethod, this hash contains details about the SEPA debit bank account. """ sofort: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataSofort" ] """ If this is a `sofort` PaymentMethod, this hash contains details about the SOFORT payment method. """ swish: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataSwish" ] """ If this is a `swish` PaymentMethod, this hash contains details about the Swish payment method. """ twint: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataTwint" ] """ If this is a TWINT PaymentMethod, this hash contains details about the TWINT payment method. """ type: Literal[ "acss_debit", "affirm", "afterpay_clearpay", "alipay", "amazon_pay", "au_becs_debit", "bacs_debit", "bancontact", "blik", "boleto", "cashapp", "customer_balance", "eps", "fpx", "giropay", "grabpay", "ideal", "klarna", "konbini", "link", "mobilepay", "multibanco", "oxxo", "p24", "paynow", "paypal", "pix", "promptpay", "revolut_pay", "sepa_debit", "sofort", "swish", "twint", "us_bank_account", "wechat_pay", "zip", ] """ The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. """ us_bank_account: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataUsBankAccount" ] """ If this is an `us_bank_account` PaymentMethod, this hash contains details about the US bank account payment method. """ wechat_pay: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataWechatPay" ] """ If this is an `wechat_pay` PaymentMethod, this hash contains details about the wechat_pay payment method. """ zip: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataZip" ] """ If this is a `zip` PaymentMethod, this hash contains details about the Zip payment method. """ class CreateParamsPaymentMethodDataAcssDebit(TypedDict): account_number: str """ Customer's bank account number. """ institution_number: str """ Institution number of the customer's bank. """ transit_number: str """ Transit number of the customer's bank. """ class CreateParamsPaymentMethodDataAffirm(TypedDict): pass class CreateParamsPaymentMethodDataAfterpayClearpay(TypedDict): pass class CreateParamsPaymentMethodDataAlipay(TypedDict): pass class CreateParamsPaymentMethodDataAmazonPay(TypedDict): pass class CreateParamsPaymentMethodDataAuBecsDebit(TypedDict): account_number: str """ The account number for the bank account. """ bsb_number: str """ Bank-State-Branch number of the bank account. """ class CreateParamsPaymentMethodDataBacsDebit(TypedDict): account_number: NotRequired[str] """ Account number of the bank account that the funds will be debited from. """ sort_code: NotRequired[str] """ Sort code of the bank account. (e.g., `10-20-30`) """ class CreateParamsPaymentMethodDataBancontact(TypedDict): pass class CreateParamsPaymentMethodDataBillingDetails(TypedDict): address: NotRequired[ "Literal['']|ConfirmationTokenService.CreateParamsPaymentMethodDataBillingDetailsAddress" ] """ Billing address. """ email: NotRequired["Literal['']|str"] """ Email address. """ name: NotRequired["Literal['']|str"] """ Full name. """ phone: NotRequired["Literal['']|str"] """ Billing phone number (including extension). """ class CreateParamsPaymentMethodDataBillingDetailsAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsPaymentMethodDataBlik(TypedDict): pass class CreateParamsPaymentMethodDataBoleto(TypedDict): tax_id: str """ The tax ID of the customer (CPF for individual consumers or CNPJ for businesses consumers) """ class CreateParamsPaymentMethodDataCashapp(TypedDict): pass class CreateParamsPaymentMethodDataCustomerBalance(TypedDict): pass class CreateParamsPaymentMethodDataEps(TypedDict): bank: NotRequired[ Literal[ "arzte_und_apotheker_bank", "austrian_anadi_bank_ag", "bank_austria", "bankhaus_carl_spangler", "bankhaus_schelhammer_und_schattera_ag", "bawag_psk_ag", "bks_bank_ag", "brull_kallmus_bank_ag", "btv_vier_lander_bank", "capital_bank_grawe_gruppe_ag", "deutsche_bank_ag", "dolomitenbank", "easybank_ag", "erste_bank_und_sparkassen", "hypo_alpeadriabank_international_ag", "hypo_bank_burgenland_aktiengesellschaft", "hypo_noe_lb_fur_niederosterreich_u_wien", "hypo_oberosterreich_salzburg_steiermark", "hypo_tirol_bank_ag", "hypo_vorarlberg_bank_ag", "marchfelder_bank", "oberbank_ag", "raiffeisen_bankengruppe_osterreich", "schoellerbank_ag", "sparda_bank_wien", "volksbank_gruppe", "volkskreditbank_ag", "vr_bank_braunau", ] ] """ The customer's bank. """ class CreateParamsPaymentMethodDataFpx(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type for FPX transaction """ bank: Literal[ "affin_bank", "agrobank", "alliance_bank", "ambank", "bank_islam", "bank_muamalat", "bank_of_china", "bank_rakyat", "bsn", "cimb", "deutsche_bank", "hong_leong_bank", "hsbc", "kfh", "maybank2e", "maybank2u", "ocbc", "pb_enterprise", "public_bank", "rhb", "standard_chartered", "uob", ] """ The customer's bank. """ class CreateParamsPaymentMethodDataGiropay(TypedDict): pass class CreateParamsPaymentMethodDataGrabpay(TypedDict): pass class CreateParamsPaymentMethodDataIdeal(TypedDict): bank: NotRequired[ Literal[ "abn_amro", "asn_bank", "bunq", "handelsbanken", "ing", "knab", "moneyou", "n26", "nn", "rabobank", "regiobank", "revolut", "sns_bank", "triodos_bank", "van_lanschot", "yoursafe", ] ] """ The customer's bank. """ class CreateParamsPaymentMethodDataInteracPresent(TypedDict): pass class CreateParamsPaymentMethodDataKlarna(TypedDict): dob: NotRequired[ "ConfirmationTokenService.CreateParamsPaymentMethodDataKlarnaDob" ] """ Customer's date of birth """ class CreateParamsPaymentMethodDataKlarnaDob(TypedDict): day: int """ The day of birth, between 1 and 31. """ month: int """ The month of birth, between 1 and 12. """ year: int """ The four-digit year of birth. """ class CreateParamsPaymentMethodDataKonbini(TypedDict): pass class CreateParamsPaymentMethodDataLink(TypedDict): pass class CreateParamsPaymentMethodDataMobilepay(TypedDict): pass class CreateParamsPaymentMethodDataMultibanco(TypedDict): pass class CreateParamsPaymentMethodDataOxxo(TypedDict): pass class CreateParamsPaymentMethodDataP24(TypedDict): bank: NotRequired[ Literal[ "alior_bank", "bank_millennium", "bank_nowy_bfg_sa", "bank_pekao_sa", "banki_spbdzielcze", "blik", "bnp_paribas", "boz", "citi_handlowy", "credit_agricole", "envelobank", "etransfer_pocztowy24", "getin_bank", "ideabank", "ing", "inteligo", "mbank_mtransfer", "nest_przelew", "noble_pay", "pbac_z_ipko", "plus_bank", "santander_przelew24", "tmobile_usbugi_bankowe", "toyota_bank", "velobank", "volkswagen_bank", ] ] """ The customer's bank. """ class CreateParamsPaymentMethodDataPaynow(TypedDict): pass class CreateParamsPaymentMethodDataPaypal(TypedDict): pass class CreateParamsPaymentMethodDataPix(TypedDict): pass class CreateParamsPaymentMethodDataPromptpay(TypedDict): pass class CreateParamsPaymentMethodDataRadarOptions(TypedDict): session: NotRequired[str] """ A [Radar Session](https://stripe.com/docs/radar/radar-session) is a snapshot of the browser metadata and device details that help Radar make more accurate predictions on your payments. """ class CreateParamsPaymentMethodDataRevolutPay(TypedDict): pass class CreateParamsPaymentMethodDataSepaDebit(TypedDict): iban: str """ IBAN of the bank account. """ class CreateParamsPaymentMethodDataSofort(TypedDict): country: Literal["AT", "BE", "DE", "ES", "IT", "NL"] """ Two-letter ISO code representing the country the bank account is located in. """ class CreateParamsPaymentMethodDataSwish(TypedDict): pass class CreateParamsPaymentMethodDataTwint(TypedDict): pass class CreateParamsPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type: individual or company. """ account_number: NotRequired[str] """ Account number of the bank account. """ account_type: NotRequired[Literal["checking", "savings"]] """ Account type: checkings or savings. Defaults to checking if omitted. """ financial_connections_account: NotRequired[str] """ The ID of a Financial Connections Account to use as a payment method. """ routing_number: NotRequired[str] """ Routing number of the bank account. """ class CreateParamsPaymentMethodDataWechatPay(TypedDict): pass class CreateParamsPaymentMethodDataZip(TypedDict): pass class CreateParamsShipping(TypedDict): address: "ConfirmationTokenService.CreateParamsShippingAddress" """ Shipping address """ name: str """ Recipient name. """ phone: NotRequired["Literal['']|str"] """ Recipient phone (including extension) """ class CreateParamsShippingAddress(TypedDict): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ def create( self, params: "ConfirmationTokenService.CreateParams" = {}, options: RequestOptions = {}, ) -> ConfirmationToken: """ Creates a test mode Confirmation Token server side for your integration tests. """ return cast( ConfirmationToken, self._request( "post", "/v1/test_helpers/confirmation_tokens", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "ConfirmationTokenService.CreateParams" = {}, options: RequestOptions = {}, ) -> ConfirmationToken: """ Creates a test mode Confirmation Token server side for your integration tests. """ return cast( ConfirmationToken, await self._request_async( "post", "/v1/test_helpers/confirmation_tokens", api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/test_helpers/_customer_service.py0000644000175100001770000000556214637354563022635 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._customer_cash_balance_transaction import ( CustomerCashBalanceTransaction, ) from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict class CustomerService(StripeService): class FundCashBalanceParams(TypedDict): amount: int """ Amount to be used for this test cash balance transaction. A positive integer representing how much to fund in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal) (e.g., 100 cents to fund $1.00 or 100 to fund ¥100, 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). """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ reference: NotRequired[str] """ A description of the test funding. This simulates free-text references supplied by customers when making bank transfers to their cash balance. You can use this to test how Stripe's [reconciliation algorithm](https://stripe.com/docs/payments/customer-balance/reconciliation) applies to different user inputs. """ def fund_cash_balance( self, customer: str, params: "CustomerService.FundCashBalanceParams", options: RequestOptions = {}, ) -> CustomerCashBalanceTransaction: """ Create an incoming testmode bank transfer """ return cast( CustomerCashBalanceTransaction, self._request( "post", "/v1/test_helpers/customers/{customer}/fund_cash_balance".format( customer=sanitize_id(customer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def fund_cash_balance_async( self, customer: str, params: "CustomerService.FundCashBalanceParams", options: RequestOptions = {}, ) -> CustomerCashBalanceTransaction: """ Create an incoming testmode bank transfer """ return cast( CustomerCashBalanceTransaction, await self._request_async( "post", "/v1/test_helpers/customers/{customer}/fund_cash_balance".format( customer=sanitize_id(customer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/test_helpers/_issuing_service.py0000644000175100001770000000153514637354563022451 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_service import StripeService from stripe.test_helpers.issuing._authorization_service import ( AuthorizationService, ) from stripe.test_helpers.issuing._card_service import CardService from stripe.test_helpers.issuing._personalization_design_service import ( PersonalizationDesignService, ) from stripe.test_helpers.issuing._transaction_service import TransactionService class IssuingService(StripeService): def __init__(self, requestor): super().__init__(requestor) self.authorizations = AuthorizationService(self._requestor) self.cards = CardService(self._requestor) self.personalization_designs = PersonalizationDesignService( self._requestor, ) self.transactions = TransactionService(self._requestor) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/test_helpers/_refund_service.py0000644000175100001770000000337414637354563022256 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._refund import Refund from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from typing import List, cast from typing_extensions import NotRequired, TypedDict class RefundService(StripeService): class ExpireParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def expire( self, refund: str, params: "RefundService.ExpireParams" = {}, options: RequestOptions = {}, ) -> Refund: """ Expire a refund with a status of requires_action. """ return cast( Refund, self._request( "post", "/v1/test_helpers/refunds/{refund}/expire".format( refund=sanitize_id(refund), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def expire_async( self, refund: str, params: "RefundService.ExpireParams" = {}, options: RequestOptions = {}, ) -> Refund: """ Expire a refund with a status of requires_action. """ return cast( Refund, await self._request_async( "post", "/v1/test_helpers/refunds/{refund}/expire".format( refund=sanitize_id(refund), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/test_helpers/_terminal_service.py0000644000175100001770000000053414637354563022601 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_service import StripeService from stripe.test_helpers.terminal._reader_service import ReaderService class TerminalService(StripeService): def __init__(self, requestor): super().__init__(requestor) self.readers = ReaderService(self._requestor) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/test_helpers/_test_clock.py0000644000175100001770000003124214637354563021400 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._deletable_api_resource import DeletableAPIResource from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, List, Optional, cast, overload from typing_extensions import Literal, NotRequired, Unpack class TestClock( CreateableAPIResource["TestClock"], DeletableAPIResource["TestClock"], ListableAPIResource["TestClock"], ): """ A test clock enables deterministic control over objects in testmode. With a test clock, you can create objects at a frozen time in the past or future, and advance to a specific future time to observe webhooks and state changes. After the clock advances, you can either validate the current state of your scenario (and test your assumptions), change the current state of your scenario (and test more complex scenarios), or keep advancing forward in time. """ OBJECT_NAME: ClassVar[Literal["test_helpers.test_clock"]] = ( "test_helpers.test_clock" ) class AdvanceParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ frozen_time: int """ The time to advance the test clock. Must be after the test clock's current frozen time. Cannot be more than two intervals in the future from the shortest subscription in this test clock. If there are no subscriptions in this test clock, it cannot be more than two years in the future. """ class CreateParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ frozen_time: int """ The initial frozen time for this test clock. """ name: NotRequired[str] """ The name for this test clock. """ class DeleteParams(RequestOptions): pass class ListParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ deletes_after: int """ Time at which this clock is scheduled to auto delete. """ frozen_time: int """ Time at which all objects belonging to this clock are frozen. """ id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ name: Optional[str] """ The custom name supplied at creation. """ object: Literal["test_helpers.test_clock"] """ String representing the object's type. Objects of the same type share the same value. """ status: Literal["advancing", "internal_failure", "ready"] """ The status of the Test Clock. """ deleted: Optional[Literal[True]] """ Always true for a deleted object """ @classmethod def _cls_advance( cls, test_clock: str, **params: Unpack["TestClock.AdvanceParams"] ) -> "TestClock": """ Starts advancing a test clock to a specified time in the future. Advancement is done when status changes to Ready. """ return cast( "TestClock", cls._static_request( "post", "/v1/test_helpers/test_clocks/{test_clock}/advance".format( test_clock=sanitize_id(test_clock) ), params=params, ), ) @overload @staticmethod def advance( test_clock: str, **params: Unpack["TestClock.AdvanceParams"] ) -> "TestClock": """ Starts advancing a test clock to a specified time in the future. Advancement is done when status changes to Ready. """ ... @overload def advance( self, **params: Unpack["TestClock.AdvanceParams"] ) -> "TestClock": """ Starts advancing a test clock to a specified time in the future. Advancement is done when status changes to Ready. """ ... @class_method_variant("_cls_advance") def advance( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["TestClock.AdvanceParams"] ) -> "TestClock": """ Starts advancing a test clock to a specified time in the future. Advancement is done when status changes to Ready. """ return cast( "TestClock", self._request( "post", "/v1/test_helpers/test_clocks/{test_clock}/advance".format( test_clock=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_advance_async( cls, test_clock: str, **params: Unpack["TestClock.AdvanceParams"] ) -> "TestClock": """ Starts advancing a test clock to a specified time in the future. Advancement is done when status changes to Ready. """ return cast( "TestClock", await cls._static_request_async( "post", "/v1/test_helpers/test_clocks/{test_clock}/advance".format( test_clock=sanitize_id(test_clock) ), params=params, ), ) @overload @staticmethod async def advance_async( test_clock: str, **params: Unpack["TestClock.AdvanceParams"] ) -> "TestClock": """ Starts advancing a test clock to a specified time in the future. Advancement is done when status changes to Ready. """ ... @overload async def advance_async( self, **params: Unpack["TestClock.AdvanceParams"] ) -> "TestClock": """ Starts advancing a test clock to a specified time in the future. Advancement is done when status changes to Ready. """ ... @class_method_variant("_cls_advance_async") async def advance_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["TestClock.AdvanceParams"] ) -> "TestClock": """ Starts advancing a test clock to a specified time in the future. Advancement is done when status changes to Ready. """ return cast( "TestClock", await self._request_async( "post", "/v1/test_helpers/test_clocks/{test_clock}/advance".format( test_clock=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def create(cls, **params: Unpack["TestClock.CreateParams"]) -> "TestClock": """ Creates a new test clock that can be attached to new customers and quotes. """ return cast( "TestClock", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["TestClock.CreateParams"] ) -> "TestClock": """ Creates a new test clock that can be attached to new customers and quotes. """ return cast( "TestClock", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def _cls_delete( cls, sid: str, **params: Unpack["TestClock.DeleteParams"] ) -> "TestClock": """ Deletes a test clock. """ url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "TestClock", cls._static_request( "delete", url, params=params, ), ) @overload @staticmethod def delete( sid: str, **params: Unpack["TestClock.DeleteParams"] ) -> "TestClock": """ Deletes a test clock. """ ... @overload def delete( self, **params: Unpack["TestClock.DeleteParams"] ) -> "TestClock": """ Deletes a test clock. """ ... @class_method_variant("_cls_delete") def delete( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["TestClock.DeleteParams"] ) -> "TestClock": """ Deletes a test clock. """ return self._request_and_refresh( "delete", self.instance_url(), params=params, ) @classmethod async def _cls_delete_async( cls, sid: str, **params: Unpack["TestClock.DeleteParams"] ) -> "TestClock": """ Deletes a test clock. """ url = "%s/%s" % (cls.class_url(), sanitize_id(sid)) return cast( "TestClock", await cls._static_request_async( "delete", url, params=params, ), ) @overload @staticmethod async def delete_async( sid: str, **params: Unpack["TestClock.DeleteParams"] ) -> "TestClock": """ Deletes a test clock. """ ... @overload async def delete_async( self, **params: Unpack["TestClock.DeleteParams"] ) -> "TestClock": """ Deletes a test clock. """ ... @class_method_variant("_cls_delete_async") async def delete_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["TestClock.DeleteParams"] ) -> "TestClock": """ Deletes a test clock. """ return await self._request_and_refresh_async( "delete", self.instance_url(), params=params, ) @classmethod def list( cls, **params: Unpack["TestClock.ListParams"] ) -> ListObject["TestClock"]: """ Returns a list of your test clocks. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["TestClock.ListParams"] ) -> ListObject["TestClock"]: """ Returns a list of your test clocks. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def retrieve( cls, id: str, **params: Unpack["TestClock.RetrieveParams"] ) -> "TestClock": """ Retrieves a test clock. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["TestClock.RetrieveParams"] ) -> "TestClock": """ Retrieves a test clock. """ instance = cls(id, **params) await instance.refresh_async() return instance ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/test_helpers/_test_clock_service.py0000644000175100001770000002105714637354563023123 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.test_helpers._test_clock import TestClock from typing import List, cast from typing_extensions import NotRequired, TypedDict class TestClockService(StripeService): class AdvanceParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ frozen_time: int """ The time to advance the test clock. Must be after the test clock's current frozen time. Cannot be more than two intervals in the future from the shortest subscription in this test clock. If there are no subscriptions in this test clock, it cannot be more than two years in the future. """ class CreateParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ frozen_time: int """ The initial frozen time for this test clock. """ name: NotRequired[str] """ The name for this test clock. """ class DeleteParams(TypedDict): pass class ListParams(TypedDict): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def delete( self, test_clock: str, params: "TestClockService.DeleteParams" = {}, options: RequestOptions = {}, ) -> TestClock: """ Deletes a test clock. """ return cast( TestClock, self._request( "delete", "/v1/test_helpers/test_clocks/{test_clock}".format( test_clock=sanitize_id(test_clock), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def delete_async( self, test_clock: str, params: "TestClockService.DeleteParams" = {}, options: RequestOptions = {}, ) -> TestClock: """ Deletes a test clock. """ return cast( TestClock, await self._request_async( "delete", "/v1/test_helpers/test_clocks/{test_clock}".format( test_clock=sanitize_id(test_clock), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, test_clock: str, params: "TestClockService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> TestClock: """ Retrieves a test clock. """ return cast( TestClock, self._request( "get", "/v1/test_helpers/test_clocks/{test_clock}".format( test_clock=sanitize_id(test_clock), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, test_clock: str, params: "TestClockService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> TestClock: """ Retrieves a test clock. """ return cast( TestClock, await self._request_async( "get", "/v1/test_helpers/test_clocks/{test_clock}".format( test_clock=sanitize_id(test_clock), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def list( self, params: "TestClockService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[TestClock]: """ Returns a list of your test clocks. """ return cast( ListObject[TestClock], self._request( "get", "/v1/test_helpers/test_clocks", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "TestClockService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[TestClock]: """ Returns a list of your test clocks. """ return cast( ListObject[TestClock], await self._request_async( "get", "/v1/test_helpers/test_clocks", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "TestClockService.CreateParams", options: RequestOptions = {}, ) -> TestClock: """ Creates a new test clock that can be attached to new customers and quotes. """ return cast( TestClock, self._request( "post", "/v1/test_helpers/test_clocks", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "TestClockService.CreateParams", options: RequestOptions = {}, ) -> TestClock: """ Creates a new test clock that can be attached to new customers and quotes. """ return cast( TestClock, await self._request_async( "post", "/v1/test_helpers/test_clocks", api_mode="V1", base_address="api", params=params, options=options, ), ) def advance( self, test_clock: str, params: "TestClockService.AdvanceParams", options: RequestOptions = {}, ) -> TestClock: """ Starts advancing a test clock to a specified time in the future. Advancement is done when status changes to Ready. """ return cast( TestClock, self._request( "post", "/v1/test_helpers/test_clocks/{test_clock}/advance".format( test_clock=sanitize_id(test_clock), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def advance_async( self, test_clock: str, params: "TestClockService.AdvanceParams", options: RequestOptions = {}, ) -> TestClock: """ Starts advancing a test clock to a specified time in the future. Advancement is done when status changes to Ready. """ return cast( TestClock, await self._request_async( "post", "/v1/test_helpers/test_clocks/{test_clock}/advance".format( test_clock=sanitize_id(test_clock), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/test_helpers/_treasury_service.py0000644000175100001770000000206314637354563022643 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._stripe_service import StripeService from stripe.test_helpers.treasury._inbound_transfer_service import ( InboundTransferService, ) from stripe.test_helpers.treasury._outbound_payment_service import ( OutboundPaymentService, ) from stripe.test_helpers.treasury._outbound_transfer_service import ( OutboundTransferService, ) from stripe.test_helpers.treasury._received_credit_service import ( ReceivedCreditService, ) from stripe.test_helpers.treasury._received_debit_service import ( ReceivedDebitService, ) class TreasuryService(StripeService): def __init__(self, requestor): super().__init__(requestor) self.inbound_transfers = InboundTransferService(self._requestor) self.outbound_payments = OutboundPaymentService(self._requestor) self.outbound_transfers = OutboundTransferService(self._requestor) self.received_credits = ReceivedCreditService(self._requestor) self.received_debits = ReceivedDebitService(self._requestor) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5529406 stripe-10.1.0/stripe/test_helpers/issuing/0000755000175100001770000000000014637354616020213 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/test_helpers/issuing/__init__.py0000644000175100001770000000101314637354563022320 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe.test_helpers.issuing._authorization_service import ( AuthorizationService as AuthorizationService, ) from stripe.test_helpers.issuing._card_service import ( CardService as CardService, ) from stripe.test_helpers.issuing._personalization_design_service import ( PersonalizationDesignService as PersonalizationDesignService, ) from stripe.test_helpers.issuing._transaction_service import ( TransactionService as TransactionService, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/test_helpers/issuing/_authorization_service.py0000644000175100001770000014155214637354563025355 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.issuing._authorization import Authorization from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict class AuthorizationService(StripeService): class CaptureParams(TypedDict): capture_amount: NotRequired[int] """ The amount to capture from the authorization. If not provided, the full amount of the authorization will be captured. This amount is in the authorization currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ close_authorization: NotRequired[bool] """ Whether to close the authorization after capture. Defaults to true. Set to false to enable multi-capture flows. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ purchase_details: NotRequired[ "AuthorizationService.CaptureParamsPurchaseDetails" ] """ Additional purchase information that is optionally provided by the merchant. """ class CaptureParamsPurchaseDetails(TypedDict): fleet: NotRequired[ "AuthorizationService.CaptureParamsPurchaseDetailsFleet" ] """ Fleet-specific information for transactions using Fleet cards. """ flight: NotRequired[ "AuthorizationService.CaptureParamsPurchaseDetailsFlight" ] """ Information about the flight that was purchased with this transaction. """ fuel: NotRequired[ "AuthorizationService.CaptureParamsPurchaseDetailsFuel" ] """ Information about fuel that was purchased with this transaction. """ lodging: NotRequired[ "AuthorizationService.CaptureParamsPurchaseDetailsLodging" ] """ Information about lodging that was purchased with this transaction. """ receipt: NotRequired[ List["AuthorizationService.CaptureParamsPurchaseDetailsReceipt"] ] """ The line items in the purchase. """ reference: NotRequired[str] """ A merchant-specific order number. """ class CaptureParamsPurchaseDetailsFleet(TypedDict): cardholder_prompt_data: NotRequired[ "AuthorizationService.CaptureParamsPurchaseDetailsFleetCardholderPromptData" ] """ Answers to prompts presented to the cardholder at the point of sale. Prompted fields vary depending on the configuration of your physical fleet cards. Typical points of sale support only numeric entry. """ purchase_type: NotRequired[ Literal[ "fuel_and_non_fuel_purchase", "fuel_purchase", "non_fuel_purchase", ] ] """ The type of purchase. One of `fuel_purchase`, `non_fuel_purchase`, or `fuel_and_non_fuel_purchase`. """ reported_breakdown: NotRequired[ "AuthorizationService.CaptureParamsPurchaseDetailsFleetReportedBreakdown" ] """ More information about the total amount. This information is not guaranteed to be accurate as some merchants may provide unreliable data. """ service_type: NotRequired[ Literal["full_service", "non_fuel_transaction", "self_service"] ] """ The type of fuel service. One of `non_fuel_transaction`, `full_service`, or `self_service`. """ class CaptureParamsPurchaseDetailsFleetCardholderPromptData(TypedDict): driver_id: NotRequired[str] """ Driver ID. """ odometer: NotRequired[int] """ Odometer reading. """ unspecified_id: NotRequired[str] """ An alphanumeric ID. This field is used when a vehicle ID, driver ID, or generic ID is entered by the cardholder, but the merchant or card network did not specify the prompt type. """ user_id: NotRequired[str] """ User ID. """ vehicle_number: NotRequired[str] """ Vehicle number. """ class CaptureParamsPurchaseDetailsFleetReportedBreakdown(TypedDict): fuel: NotRequired[ "AuthorizationService.CaptureParamsPurchaseDetailsFleetReportedBreakdownFuel" ] """ Breakdown of fuel portion of the purchase. """ non_fuel: NotRequired[ "AuthorizationService.CaptureParamsPurchaseDetailsFleetReportedBreakdownNonFuel" ] """ Breakdown of non-fuel portion of the purchase. """ tax: NotRequired[ "AuthorizationService.CaptureParamsPurchaseDetailsFleetReportedBreakdownTax" ] """ Information about tax included in this transaction. """ class CaptureParamsPurchaseDetailsFleetReportedBreakdownFuel(TypedDict): gross_amount_decimal: NotRequired[str] """ Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. """ class CaptureParamsPurchaseDetailsFleetReportedBreakdownNonFuel(TypedDict): gross_amount_decimal: NotRequired[str] """ Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes. """ class CaptureParamsPurchaseDetailsFleetReportedBreakdownTax(TypedDict): local_amount_decimal: NotRequired[str] """ Amount of state or provincial Sales Tax included in the transaction amount. Null if not reported by merchant or not subject to tax. """ national_amount_decimal: NotRequired[str] """ Amount of national Sales Tax or VAT included in the transaction amount. Null if not reported by merchant or not subject to tax. """ class CaptureParamsPurchaseDetailsFlight(TypedDict): departure_at: NotRequired[int] """ The time that the flight departed. """ passenger_name: NotRequired[str] """ The name of the passenger. """ refundable: NotRequired[bool] """ Whether the ticket is refundable. """ segments: NotRequired[ List[ "AuthorizationService.CaptureParamsPurchaseDetailsFlightSegment" ] ] """ The legs of the trip. """ travel_agency: NotRequired[str] """ The travel agency that issued the ticket. """ class CaptureParamsPurchaseDetailsFlightSegment(TypedDict): arrival_airport_code: NotRequired[str] """ The three-letter IATA airport code of the flight's destination. """ carrier: NotRequired[str] """ The airline carrier code. """ departure_airport_code: NotRequired[str] """ The three-letter IATA airport code that the flight departed from. """ flight_number: NotRequired[str] """ The flight number. """ service_class: NotRequired[str] """ The flight's service class. """ stopover_allowed: NotRequired[bool] """ Whether a stopover is allowed on this flight. """ class CaptureParamsPurchaseDetailsFuel(TypedDict): industry_product_code: NotRequired[str] """ [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased. """ quantity_decimal: NotRequired[str] """ The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places. """ type: NotRequired[ Literal[ "diesel", "other", "unleaded_plus", "unleaded_regular", "unleaded_super", ] ] """ The type of fuel that was purchased. One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. """ unit: NotRequired[ Literal[ "charging_minute", "imperial_gallon", "kilogram", "kilowatt_hour", "liter", "other", "pound", "us_gallon", ] ] """ The units for `quantity_decimal`. One of `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `liter`, `pound`, `us_gallon`, or `other`. """ unit_cost_decimal: NotRequired[str] """ The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. """ class CaptureParamsPurchaseDetailsLodging(TypedDict): check_in_at: NotRequired[int] """ The time of checking into the lodging. """ nights: NotRequired[int] """ The number of nights stayed at the lodging. """ class CaptureParamsPurchaseDetailsReceipt(TypedDict): description: NotRequired[str] quantity: NotRequired[str] total: NotRequired[int] unit_cost: NotRequired[int] class CreateParams(TypedDict): amount: int """ The total amount to attempt to authorize. This amount is in the provided currency, or defaults to the card's currency, and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ amount_details: NotRequired[ "AuthorizationService.CreateParamsAmountDetails" ] """ Detailed breakdown of amount components. These amounts are denominated in `currency` and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ authorization_method: NotRequired[ Literal["chip", "contactless", "keyed_in", "online", "swipe"] ] """ How the card details were provided. Defaults to online. """ card: str """ Card associated with this authorization. """ currency: NotRequired[str] """ The currency of the authorization. If not provided, defaults to the currency of the card. 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). """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ fleet: NotRequired["AuthorizationService.CreateParamsFleet"] """ Fleet-specific information for authorizations using Fleet cards. """ fuel: NotRequired["AuthorizationService.CreateParamsFuel"] """ Information about fuel that was purchased with this transaction. """ is_amount_controllable: NotRequired[bool] """ If set `true`, you may provide [amount](https://stripe.com/docs/api/issuing/authorizations/approve#approve_issuing_authorization-amount) to control how much to hold for the authorization. """ merchant_data: NotRequired[ "AuthorizationService.CreateParamsMerchantData" ] """ Details about the seller (grocery store, e-commerce website, etc.) where the card authorization happened. """ network_data: NotRequired[ "AuthorizationService.CreateParamsNetworkData" ] """ Details about the authorization, such as identifiers, set by the card network. """ verification_data: NotRequired[ "AuthorizationService.CreateParamsVerificationData" ] """ Verifications that Stripe performed on information that the cardholder provided to the merchant. """ wallet: NotRequired[Literal["apple_pay", "google_pay", "samsung_pay"]] """ The digital wallet used for this transaction. One of `apple_pay`, `google_pay`, or `samsung_pay`. Will populate as `null` when no digital wallet was utilized. """ class CreateParamsAmountDetails(TypedDict): atm_fee: NotRequired[int] """ The ATM withdrawal fee. """ cashback_amount: NotRequired[int] """ The amount of cash requested by the cardholder. """ class CreateParamsFleet(TypedDict): cardholder_prompt_data: NotRequired[ "AuthorizationService.CreateParamsFleetCardholderPromptData" ] """ Answers to prompts presented to the cardholder at the point of sale. Prompted fields vary depending on the configuration of your physical fleet cards. Typical points of sale support only numeric entry. """ purchase_type: NotRequired[ Literal[ "fuel_and_non_fuel_purchase", "fuel_purchase", "non_fuel_purchase", ] ] """ The type of purchase. One of `fuel_purchase`, `non_fuel_purchase`, or `fuel_and_non_fuel_purchase`. """ reported_breakdown: NotRequired[ "AuthorizationService.CreateParamsFleetReportedBreakdown" ] """ More information about the total amount. This information is not guaranteed to be accurate as some merchants may provide unreliable data. """ service_type: NotRequired[ Literal["full_service", "non_fuel_transaction", "self_service"] ] """ The type of fuel service. One of `non_fuel_transaction`, `full_service`, or `self_service`. """ class CreateParamsFleetCardholderPromptData(TypedDict): driver_id: NotRequired[str] """ Driver ID. """ odometer: NotRequired[int] """ Odometer reading. """ unspecified_id: NotRequired[str] """ An alphanumeric ID. This field is used when a vehicle ID, driver ID, or generic ID is entered by the cardholder, but the merchant or card network did not specify the prompt type. """ user_id: NotRequired[str] """ User ID. """ vehicle_number: NotRequired[str] """ Vehicle number. """ class CreateParamsFleetReportedBreakdown(TypedDict): fuel: NotRequired[ "AuthorizationService.CreateParamsFleetReportedBreakdownFuel" ] """ Breakdown of fuel portion of the purchase. """ non_fuel: NotRequired[ "AuthorizationService.CreateParamsFleetReportedBreakdownNonFuel" ] """ Breakdown of non-fuel portion of the purchase. """ tax: NotRequired[ "AuthorizationService.CreateParamsFleetReportedBreakdownTax" ] """ Information about tax included in this transaction. """ class CreateParamsFleetReportedBreakdownFuel(TypedDict): gross_amount_decimal: NotRequired[str] """ Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. """ class CreateParamsFleetReportedBreakdownNonFuel(TypedDict): gross_amount_decimal: NotRequired[str] """ Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes. """ class CreateParamsFleetReportedBreakdownTax(TypedDict): local_amount_decimal: NotRequired[str] """ Amount of state or provincial Sales Tax included in the transaction amount. Null if not reported by merchant or not subject to tax. """ national_amount_decimal: NotRequired[str] """ Amount of national Sales Tax or VAT included in the transaction amount. Null if not reported by merchant or not subject to tax. """ class CreateParamsFuel(TypedDict): industry_product_code: NotRequired[str] """ [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased. """ quantity_decimal: NotRequired[str] """ The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places. """ type: NotRequired[ Literal[ "diesel", "other", "unleaded_plus", "unleaded_regular", "unleaded_super", ] ] """ The type of fuel that was purchased. One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. """ unit: NotRequired[ Literal[ "charging_minute", "imperial_gallon", "kilogram", "kilowatt_hour", "liter", "other", "pound", "us_gallon", ] ] """ The units for `quantity_decimal`. One of `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `liter`, `pound`, `us_gallon`, or `other`. """ unit_cost_decimal: NotRequired[str] """ The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. """ class CreateParamsMerchantData(TypedDict): category: NotRequired[ Literal[ "ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards", ] ] """ A categorization of the seller's type of business. See our [merchant categories guide](https://stripe.com/docs/issuing/merchant-categories) for a list of possible values. """ city: NotRequired[str] """ City where the seller is located """ country: NotRequired[str] """ Country where the seller is located """ name: NotRequired[str] """ Name of the seller """ network_id: NotRequired[str] """ Identifier assigned to the seller by the card network. Different card networks may assign different network_id fields to the same merchant. """ postal_code: NotRequired[str] """ Postal code where the seller is located """ state: NotRequired[str] """ State where the seller is located """ terminal_id: NotRequired[str] """ An ID assigned by the seller to the location of the sale. """ url: NotRequired[str] """ URL provided by the merchant on a 3DS request """ class CreateParamsNetworkData(TypedDict): acquiring_institution_id: NotRequired[str] """ Identifier assigned to the acquirer by the card network. """ class CreateParamsVerificationData(TypedDict): address_line1_check: NotRequired[ Literal["match", "mismatch", "not_provided"] ] """ Whether the cardholder provided an address first line and if it matched the cardholder's `billing.address.line1`. """ address_postal_code_check: NotRequired[ Literal["match", "mismatch", "not_provided"] ] """ Whether the cardholder provided a postal code and if it matched the cardholder's `billing.address.postal_code`. """ authentication_exemption: NotRequired[ "AuthorizationService.CreateParamsVerificationDataAuthenticationExemption" ] """ The exemption applied to this authorization. """ cvc_check: NotRequired[Literal["match", "mismatch", "not_provided"]] """ Whether the cardholder provided a CVC and if it matched Stripe's record. """ expiry_check: NotRequired[Literal["match", "mismatch", "not_provided"]] """ Whether the cardholder provided an expiry date and if it matched Stripe's record. """ three_d_secure: NotRequired[ "AuthorizationService.CreateParamsVerificationDataThreeDSecure" ] """ 3D Secure details. """ class CreateParamsVerificationDataAuthenticationExemption(TypedDict): claimed_by: Literal["acquirer", "issuer"] """ The entity that requested the exemption, either the acquiring merchant or the Issuing user. """ type: Literal[ "low_value_transaction", "transaction_risk_analysis", "unknown" ] """ The specific exemption claimed for this authorization. """ class CreateParamsVerificationDataThreeDSecure(TypedDict): result: Literal[ "attempt_acknowledged", "authenticated", "failed", "required" ] """ The outcome of the 3D Secure authentication request. """ class ExpireParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class FinalizeAmountParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ final_amount: int """ The final authorization amount that will be captured by the merchant. This amount is in the authorization currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ fleet: NotRequired["AuthorizationService.FinalizeAmountParamsFleet"] """ Fleet-specific information for authorizations using Fleet cards. """ fuel: NotRequired["AuthorizationService.FinalizeAmountParamsFuel"] """ Information about fuel that was purchased with this transaction. """ class FinalizeAmountParamsFleet(TypedDict): cardholder_prompt_data: NotRequired[ "AuthorizationService.FinalizeAmountParamsFleetCardholderPromptData" ] """ Answers to prompts presented to the cardholder at the point of sale. Prompted fields vary depending on the configuration of your physical fleet cards. Typical points of sale support only numeric entry. """ purchase_type: NotRequired[ Literal[ "fuel_and_non_fuel_purchase", "fuel_purchase", "non_fuel_purchase", ] ] """ The type of purchase. One of `fuel_purchase`, `non_fuel_purchase`, or `fuel_and_non_fuel_purchase`. """ reported_breakdown: NotRequired[ "AuthorizationService.FinalizeAmountParamsFleetReportedBreakdown" ] """ More information about the total amount. This information is not guaranteed to be accurate as some merchants may provide unreliable data. """ service_type: NotRequired[ Literal["full_service", "non_fuel_transaction", "self_service"] ] """ The type of fuel service. One of `non_fuel_transaction`, `full_service`, or `self_service`. """ class FinalizeAmountParamsFleetCardholderPromptData(TypedDict): driver_id: NotRequired[str] """ Driver ID. """ odometer: NotRequired[int] """ Odometer reading. """ unspecified_id: NotRequired[str] """ An alphanumeric ID. This field is used when a vehicle ID, driver ID, or generic ID is entered by the cardholder, but the merchant or card network did not specify the prompt type. """ user_id: NotRequired[str] """ User ID. """ vehicle_number: NotRequired[str] """ Vehicle number. """ class FinalizeAmountParamsFleetReportedBreakdown(TypedDict): fuel: NotRequired[ "AuthorizationService.FinalizeAmountParamsFleetReportedBreakdownFuel" ] """ Breakdown of fuel portion of the purchase. """ non_fuel: NotRequired[ "AuthorizationService.FinalizeAmountParamsFleetReportedBreakdownNonFuel" ] """ Breakdown of non-fuel portion of the purchase. """ tax: NotRequired[ "AuthorizationService.FinalizeAmountParamsFleetReportedBreakdownTax" ] """ Information about tax included in this transaction. """ class FinalizeAmountParamsFleetReportedBreakdownFuel(TypedDict): gross_amount_decimal: NotRequired[str] """ Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. """ class FinalizeAmountParamsFleetReportedBreakdownNonFuel(TypedDict): gross_amount_decimal: NotRequired[str] """ Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes. """ class FinalizeAmountParamsFleetReportedBreakdownTax(TypedDict): local_amount_decimal: NotRequired[str] """ Amount of state or provincial Sales Tax included in the transaction amount. Null if not reported by merchant or not subject to tax. """ national_amount_decimal: NotRequired[str] """ Amount of national Sales Tax or VAT included in the transaction amount. Null if not reported by merchant or not subject to tax. """ class FinalizeAmountParamsFuel(TypedDict): industry_product_code: NotRequired[str] """ [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased. """ quantity_decimal: NotRequired[str] """ The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places. """ type: NotRequired[ Literal[ "diesel", "other", "unleaded_plus", "unleaded_regular", "unleaded_super", ] ] """ The type of fuel that was purchased. One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. """ unit: NotRequired[ Literal[ "charging_minute", "imperial_gallon", "kilogram", "kilowatt_hour", "liter", "other", "pound", "us_gallon", ] ] """ The units for `quantity_decimal`. One of `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `liter`, `pound`, `us_gallon`, or `other`. """ unit_cost_decimal: NotRequired[str] """ The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. """ class IncrementParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ increment_amount: int """ The amount to increment the authorization by. This amount is in the authorization currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ is_amount_controllable: NotRequired[bool] """ If set `true`, you may provide [amount](https://stripe.com/docs/api/issuing/authorizations/approve#approve_issuing_authorization-amount) to control how much to hold for the authorization. """ class ReverseParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ reverse_amount: NotRequired[int] """ The amount to reverse from the authorization. If not provided, the full amount of the authorization will be reversed. This amount is in the authorization currency and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ def create( self, params: "AuthorizationService.CreateParams", options: RequestOptions = {}, ) -> Authorization: """ Create a test-mode authorization. """ return cast( Authorization, self._request( "post", "/v1/test_helpers/issuing/authorizations", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "AuthorizationService.CreateParams", options: RequestOptions = {}, ) -> Authorization: """ Create a test-mode authorization. """ return cast( Authorization, await self._request_async( "post", "/v1/test_helpers/issuing/authorizations", api_mode="V1", base_address="api", params=params, options=options, ), ) def capture( self, authorization: str, params: "AuthorizationService.CaptureParams" = {}, options: RequestOptions = {}, ) -> Authorization: """ Capture a test-mode authorization. """ return cast( Authorization, self._request( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/capture".format( authorization=sanitize_id(authorization), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def capture_async( self, authorization: str, params: "AuthorizationService.CaptureParams" = {}, options: RequestOptions = {}, ) -> Authorization: """ Capture a test-mode authorization. """ return cast( Authorization, await self._request_async( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/capture".format( authorization=sanitize_id(authorization), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def expire( self, authorization: str, params: "AuthorizationService.ExpireParams" = {}, options: RequestOptions = {}, ) -> Authorization: """ Expire a test-mode Authorization. """ return cast( Authorization, self._request( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/expire".format( authorization=sanitize_id(authorization), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def expire_async( self, authorization: str, params: "AuthorizationService.ExpireParams" = {}, options: RequestOptions = {}, ) -> Authorization: """ Expire a test-mode Authorization. """ return cast( Authorization, await self._request_async( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/expire".format( authorization=sanitize_id(authorization), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def finalize_amount( self, authorization: str, params: "AuthorizationService.FinalizeAmountParams", options: RequestOptions = {}, ) -> Authorization: """ Finalize the amount on an Authorization prior to capture, when the initial authorization was for an estimated amount. """ return cast( Authorization, self._request( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/finalize_amount".format( authorization=sanitize_id(authorization), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def finalize_amount_async( self, authorization: str, params: "AuthorizationService.FinalizeAmountParams", options: RequestOptions = {}, ) -> Authorization: """ Finalize the amount on an Authorization prior to capture, when the initial authorization was for an estimated amount. """ return cast( Authorization, await self._request_async( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/finalize_amount".format( authorization=sanitize_id(authorization), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def increment( self, authorization: str, params: "AuthorizationService.IncrementParams", options: RequestOptions = {}, ) -> Authorization: """ Increment a test-mode Authorization. """ return cast( Authorization, self._request( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/increment".format( authorization=sanitize_id(authorization), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def increment_async( self, authorization: str, params: "AuthorizationService.IncrementParams", options: RequestOptions = {}, ) -> Authorization: """ Increment a test-mode Authorization. """ return cast( Authorization, await self._request_async( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/increment".format( authorization=sanitize_id(authorization), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def reverse( self, authorization: str, params: "AuthorizationService.ReverseParams" = {}, options: RequestOptions = {}, ) -> Authorization: """ Reverse a test-mode Authorization. """ return cast( Authorization, self._request( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/reverse".format( authorization=sanitize_id(authorization), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def reverse_async( self, authorization: str, params: "AuthorizationService.ReverseParams" = {}, options: RequestOptions = {}, ) -> Authorization: """ Reverse a test-mode Authorization. """ return cast( Authorization, await self._request_async( "post", "/v1/test_helpers/issuing/authorizations/{authorization}/reverse".format( authorization=sanitize_id(authorization), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/test_helpers/issuing/_card_service.py0000644000175100001770000001436514637354563023367 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.issuing._card import Card from typing import List, cast from typing_extensions import NotRequired, TypedDict class CardService(StripeService): class DeliverCardParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class FailCardParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ReturnCardParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ShipCardParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def deliver_card( self, card: str, params: "CardService.DeliverCardParams" = {}, options: RequestOptions = {}, ) -> Card: """ Updates the shipping status of the specified Issuing Card object to delivered. """ return cast( Card, self._request( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/deliver".format( card=sanitize_id(card), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def deliver_card_async( self, card: str, params: "CardService.DeliverCardParams" = {}, options: RequestOptions = {}, ) -> Card: """ Updates the shipping status of the specified Issuing Card object to delivered. """ return cast( Card, await self._request_async( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/deliver".format( card=sanitize_id(card), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def fail_card( self, card: str, params: "CardService.FailCardParams" = {}, options: RequestOptions = {}, ) -> Card: """ Updates the shipping status of the specified Issuing Card object to failure. """ return cast( Card, self._request( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/fail".format( card=sanitize_id(card), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def fail_card_async( self, card: str, params: "CardService.FailCardParams" = {}, options: RequestOptions = {}, ) -> Card: """ Updates the shipping status of the specified Issuing Card object to failure. """ return cast( Card, await self._request_async( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/fail".format( card=sanitize_id(card), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def return_card( self, card: str, params: "CardService.ReturnCardParams" = {}, options: RequestOptions = {}, ) -> Card: """ Updates the shipping status of the specified Issuing Card object to returned. """ return cast( Card, self._request( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/return".format( card=sanitize_id(card), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def return_card_async( self, card: str, params: "CardService.ReturnCardParams" = {}, options: RequestOptions = {}, ) -> Card: """ Updates the shipping status of the specified Issuing Card object to returned. """ return cast( Card, await self._request_async( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/return".format( card=sanitize_id(card), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def ship_card( self, card: str, params: "CardService.ShipCardParams" = {}, options: RequestOptions = {}, ) -> Card: """ Updates the shipping status of the specified Issuing Card object to shipped. """ return cast( Card, self._request( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/ship".format( card=sanitize_id(card), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def ship_card_async( self, card: str, params: "CardService.ShipCardParams" = {}, options: RequestOptions = {}, ) -> Card: """ Updates the shipping status of the specified Issuing Card object to shipped. """ return cast( Card, await self._request_async( "post", "/v1/test_helpers/issuing/cards/{card}/shipping/ship".format( card=sanitize_id(card), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/test_helpers/issuing/_personalization_design_service.py0000644000175100001770000001550714637354563027227 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.issuing._personalization_design import PersonalizationDesign from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict class PersonalizationDesignService(StripeService): class ActivateParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class DeactivateParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RejectParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ rejection_reasons: ( "PersonalizationDesignService.RejectParamsRejectionReasons" ) """ The reason(s) the personalization design was rejected. """ class RejectParamsRejectionReasons(TypedDict): card_logo: NotRequired[ List[ Literal[ "geographic_location", "inappropriate", "network_name", "non_binary_image", "non_fiat_currency", "other", "other_entity", "promotional_material", ] ] ] """ The reason(s) the card logo was rejected. """ carrier_text: NotRequired[ List[ Literal[ "geographic_location", "inappropriate", "network_name", "non_fiat_currency", "other", "other_entity", "promotional_material", ] ] ] """ The reason(s) the carrier text was rejected. """ def activate( self, personalization_design: str, params: "PersonalizationDesignService.ActivateParams" = {}, options: RequestOptions = {}, ) -> PersonalizationDesign: """ Updates the status of the specified testmode personalization design object to active. """ return cast( PersonalizationDesign, self._request( "post", "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/activate".format( personalization_design=sanitize_id(personalization_design), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def activate_async( self, personalization_design: str, params: "PersonalizationDesignService.ActivateParams" = {}, options: RequestOptions = {}, ) -> PersonalizationDesign: """ Updates the status of the specified testmode personalization design object to active. """ return cast( PersonalizationDesign, await self._request_async( "post", "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/activate".format( personalization_design=sanitize_id(personalization_design), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def deactivate( self, personalization_design: str, params: "PersonalizationDesignService.DeactivateParams" = {}, options: RequestOptions = {}, ) -> PersonalizationDesign: """ Updates the status of the specified testmode personalization design object to inactive. """ return cast( PersonalizationDesign, self._request( "post", "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/deactivate".format( personalization_design=sanitize_id(personalization_design), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def deactivate_async( self, personalization_design: str, params: "PersonalizationDesignService.DeactivateParams" = {}, options: RequestOptions = {}, ) -> PersonalizationDesign: """ Updates the status of the specified testmode personalization design object to inactive. """ return cast( PersonalizationDesign, await self._request_async( "post", "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/deactivate".format( personalization_design=sanitize_id(personalization_design), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def reject( self, personalization_design: str, params: "PersonalizationDesignService.RejectParams", options: RequestOptions = {}, ) -> PersonalizationDesign: """ Updates the status of the specified testmode personalization design object to rejected. """ return cast( PersonalizationDesign, self._request( "post", "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/reject".format( personalization_design=sanitize_id(personalization_design), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def reject_async( self, personalization_design: str, params: "PersonalizationDesignService.RejectParams", options: RequestOptions = {}, ) -> PersonalizationDesign: """ Updates the status of the specified testmode personalization design object to rejected. """ return cast( PersonalizationDesign, await self._request_async( "post", "/v1/test_helpers/issuing/personalization_designs/{personalization_design}/reject".format( personalization_design=sanitize_id(personalization_design), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/test_helpers/issuing/_transaction_service.py0000644000175100001770000015133614637354563025003 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.issuing._transaction import Transaction from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict class TransactionService(StripeService): class CreateForceCaptureParams(TypedDict): amount: int """ The total amount to attempt to capture. This amount is in the provided currency, or defaults to the cards currency, and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ card: str """ Card associated with this transaction. """ currency: NotRequired[str] """ The currency of the capture. If not provided, defaults to the currency of the card. 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). """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ merchant_data: NotRequired[ "TransactionService.CreateForceCaptureParamsMerchantData" ] """ Details about the seller (grocery store, e-commerce website, etc.) where the card authorization happened. """ purchase_details: NotRequired[ "TransactionService.CreateForceCaptureParamsPurchaseDetails" ] """ Additional purchase information that is optionally provided by the merchant. """ class CreateForceCaptureParamsMerchantData(TypedDict): category: NotRequired[ Literal[ "ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards", ] ] """ A categorization of the seller's type of business. See our [merchant categories guide](https://stripe.com/docs/issuing/merchant-categories) for a list of possible values. """ city: NotRequired[str] """ City where the seller is located """ country: NotRequired[str] """ Country where the seller is located """ name: NotRequired[str] """ Name of the seller """ network_id: NotRequired[str] """ Identifier assigned to the seller by the card network. Different card networks may assign different network_id fields to the same merchant. """ postal_code: NotRequired[str] """ Postal code where the seller is located """ state: NotRequired[str] """ State where the seller is located """ terminal_id: NotRequired[str] """ An ID assigned by the seller to the location of the sale. """ url: NotRequired[str] """ URL provided by the merchant on a 3DS request """ class CreateForceCaptureParamsPurchaseDetails(TypedDict): fleet: NotRequired[ "TransactionService.CreateForceCaptureParamsPurchaseDetailsFleet" ] """ Fleet-specific information for transactions using Fleet cards. """ flight: NotRequired[ "TransactionService.CreateForceCaptureParamsPurchaseDetailsFlight" ] """ Information about the flight that was purchased with this transaction. """ fuel: NotRequired[ "TransactionService.CreateForceCaptureParamsPurchaseDetailsFuel" ] """ Information about fuel that was purchased with this transaction. """ lodging: NotRequired[ "TransactionService.CreateForceCaptureParamsPurchaseDetailsLodging" ] """ Information about lodging that was purchased with this transaction. """ receipt: NotRequired[ List[ "TransactionService.CreateForceCaptureParamsPurchaseDetailsReceipt" ] ] """ The line items in the purchase. """ reference: NotRequired[str] """ A merchant-specific order number. """ class CreateForceCaptureParamsPurchaseDetailsFleet(TypedDict): cardholder_prompt_data: NotRequired[ "TransactionService.CreateForceCaptureParamsPurchaseDetailsFleetCardholderPromptData" ] """ Answers to prompts presented to the cardholder at the point of sale. Prompted fields vary depending on the configuration of your physical fleet cards. Typical points of sale support only numeric entry. """ purchase_type: NotRequired[ Literal[ "fuel_and_non_fuel_purchase", "fuel_purchase", "non_fuel_purchase", ] ] """ The type of purchase. One of `fuel_purchase`, `non_fuel_purchase`, or `fuel_and_non_fuel_purchase`. """ reported_breakdown: NotRequired[ "TransactionService.CreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdown" ] """ More information about the total amount. This information is not guaranteed to be accurate as some merchants may provide unreliable data. """ service_type: NotRequired[ Literal["full_service", "non_fuel_transaction", "self_service"] ] """ The type of fuel service. One of `non_fuel_transaction`, `full_service`, or `self_service`. """ class CreateForceCaptureParamsPurchaseDetailsFleetCardholderPromptData( TypedDict, ): driver_id: NotRequired[str] """ Driver ID. """ odometer: NotRequired[int] """ Odometer reading. """ unspecified_id: NotRequired[str] """ An alphanumeric ID. This field is used when a vehicle ID, driver ID, or generic ID is entered by the cardholder, but the merchant or card network did not specify the prompt type. """ user_id: NotRequired[str] """ User ID. """ vehicle_number: NotRequired[str] """ Vehicle number. """ class CreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdown( TypedDict, ): fuel: NotRequired[ "TransactionService.CreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdownFuel" ] """ Breakdown of fuel portion of the purchase. """ non_fuel: NotRequired[ "TransactionService.CreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdownNonFuel" ] """ Breakdown of non-fuel portion of the purchase. """ tax: NotRequired[ "TransactionService.CreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdownTax" ] """ Information about tax included in this transaction. """ class CreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdownFuel( TypedDict, ): gross_amount_decimal: NotRequired[str] """ Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. """ class CreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdownNonFuel( TypedDict, ): gross_amount_decimal: NotRequired[str] """ Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes. """ class CreateForceCaptureParamsPurchaseDetailsFleetReportedBreakdownTax( TypedDict, ): local_amount_decimal: NotRequired[str] """ Amount of state or provincial Sales Tax included in the transaction amount. Null if not reported by merchant or not subject to tax. """ national_amount_decimal: NotRequired[str] """ Amount of national Sales Tax or VAT included in the transaction amount. Null if not reported by merchant or not subject to tax. """ class CreateForceCaptureParamsPurchaseDetailsFlight(TypedDict): departure_at: NotRequired[int] """ The time that the flight departed. """ passenger_name: NotRequired[str] """ The name of the passenger. """ refundable: NotRequired[bool] """ Whether the ticket is refundable. """ segments: NotRequired[ List[ "TransactionService.CreateForceCaptureParamsPurchaseDetailsFlightSegment" ] ] """ The legs of the trip. """ travel_agency: NotRequired[str] """ The travel agency that issued the ticket. """ class CreateForceCaptureParamsPurchaseDetailsFlightSegment(TypedDict): arrival_airport_code: NotRequired[str] """ The three-letter IATA airport code of the flight's destination. """ carrier: NotRequired[str] """ The airline carrier code. """ departure_airport_code: NotRequired[str] """ The three-letter IATA airport code that the flight departed from. """ flight_number: NotRequired[str] """ The flight number. """ service_class: NotRequired[str] """ The flight's service class. """ stopover_allowed: NotRequired[bool] """ Whether a stopover is allowed on this flight. """ class CreateForceCaptureParamsPurchaseDetailsFuel(TypedDict): industry_product_code: NotRequired[str] """ [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased. """ quantity_decimal: NotRequired[str] """ The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places. """ type: NotRequired[ Literal[ "diesel", "other", "unleaded_plus", "unleaded_regular", "unleaded_super", ] ] """ The type of fuel that was purchased. One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. """ unit: NotRequired[ Literal[ "charging_minute", "imperial_gallon", "kilogram", "kilowatt_hour", "liter", "other", "pound", "us_gallon", ] ] """ The units for `quantity_decimal`. One of `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `liter`, `pound`, `us_gallon`, or `other`. """ unit_cost_decimal: NotRequired[str] """ The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. """ class CreateForceCaptureParamsPurchaseDetailsLodging(TypedDict): check_in_at: NotRequired[int] """ The time of checking into the lodging. """ nights: NotRequired[int] """ The number of nights stayed at the lodging. """ class CreateForceCaptureParamsPurchaseDetailsReceipt(TypedDict): description: NotRequired[str] quantity: NotRequired[str] total: NotRequired[int] unit_cost: NotRequired[int] class CreateUnlinkedRefundParams(TypedDict): amount: int """ The total amount to attempt to refund. This amount is in the provided currency, or defaults to the cards currency, and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ card: str """ Card associated with this unlinked refund transaction. """ currency: NotRequired[str] """ The currency of the unlinked refund. If not provided, defaults to the currency of the card. 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). """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ merchant_data: NotRequired[ "TransactionService.CreateUnlinkedRefundParamsMerchantData" ] """ Details about the seller (grocery store, e-commerce website, etc.) where the card authorization happened. """ purchase_details: NotRequired[ "TransactionService.CreateUnlinkedRefundParamsPurchaseDetails" ] """ Additional purchase information that is optionally provided by the merchant. """ class CreateUnlinkedRefundParamsMerchantData(TypedDict): category: NotRequired[ Literal[ "ac_refrigeration_repair", "accounting_bookkeeping_services", "advertising_services", "agricultural_cooperative", "airlines_air_carriers", "airports_flying_fields", "ambulance_services", "amusement_parks_carnivals", "antique_reproductions", "antique_shops", "aquariums", "architectural_surveying_services", "art_dealers_and_galleries", "artists_supply_and_craft_shops", "auto_and_home_supply_stores", "auto_body_repair_shops", "auto_paint_shops", "auto_service_shops", "automated_cash_disburse", "automated_fuel_dispensers", "automobile_associations", "automotive_parts_and_accessories_stores", "automotive_tire_stores", "bail_and_bond_payments", "bakeries", "bands_orchestras", "barber_and_beauty_shops", "betting_casino_gambling", "bicycle_shops", "billiard_pool_establishments", "boat_dealers", "boat_rentals_and_leases", "book_stores", "books_periodicals_and_newspapers", "bowling_alleys", "bus_lines", "business_secretarial_schools", "buying_shopping_services", "cable_satellite_and_other_pay_television_and_radio", "camera_and_photographic_supply_stores", "candy_nut_and_confectionery_stores", "car_and_truck_dealers_new_used", "car_and_truck_dealers_used_only", "car_rental_agencies", "car_washes", "carpentry_services", "carpet_upholstery_cleaning", "caterers", "charitable_and_social_service_organizations_fundraising", "chemicals_and_allied_products", "child_care_services", "childrens_and_infants_wear_stores", "chiropodists_podiatrists", "chiropractors", "cigar_stores_and_stands", "civic_social_fraternal_associations", "cleaning_and_maintenance", "clothing_rental", "colleges_universities", "commercial_equipment", "commercial_footwear", "commercial_photography_art_and_graphics", "commuter_transport_and_ferries", "computer_network_services", "computer_programming", "computer_repair", "computer_software_stores", "computers_peripherals_and_software", "concrete_work_services", "construction_materials", "consulting_public_relations", "correspondence_schools", "cosmetic_stores", "counseling_services", "country_clubs", "courier_services", "court_costs", "credit_reporting_agencies", "cruise_lines", "dairy_products_stores", "dance_hall_studios_schools", "dating_escort_services", "dentists_orthodontists", "department_stores", "detective_agencies", "digital_goods_applications", "digital_goods_games", "digital_goods_large_volume", "digital_goods_media", "direct_marketing_catalog_merchant", "direct_marketing_combination_catalog_and_retail_merchant", "direct_marketing_inbound_telemarketing", "direct_marketing_insurance_services", "direct_marketing_other", "direct_marketing_outbound_telemarketing", "direct_marketing_subscription", "direct_marketing_travel", "discount_stores", "doctors", "door_to_door_sales", "drapery_window_covering_and_upholstery_stores", "drinking_places", "drug_stores_and_pharmacies", "drugs_drug_proprietaries_and_druggist_sundries", "dry_cleaners", "durable_goods", "duty_free_stores", "eating_places_restaurants", "educational_services", "electric_razor_stores", "electric_vehicle_charging", "electrical_parts_and_equipment", "electrical_services", "electronics_repair_shops", "electronics_stores", "elementary_secondary_schools", "emergency_services_gcas_visa_use_only", "employment_temp_agencies", "equipment_rental", "exterminating_services", "family_clothing_stores", "fast_food_restaurants", "financial_institutions", "fines_government_administrative_entities", "fireplace_fireplace_screens_and_accessories_stores", "floor_covering_stores", "florists", "florists_supplies_nursery_stock_and_flowers", "freezer_and_locker_meat_provisioners", "fuel_dealers_non_automotive", "funeral_services_crematories", "furniture_home_furnishings_and_equipment_stores_except_appliances", "furniture_repair_refinishing", "furriers_and_fur_shops", "general_services", "gift_card_novelty_and_souvenir_shops", "glass_paint_and_wallpaper_stores", "glassware_crystal_stores", "golf_courses_public", "government_licensed_horse_dog_racing_us_region_only", "government_licensed_online_casions_online_gambling_us_region_only", "government_owned_lotteries_non_us_region", "government_owned_lotteries_us_region_only", "government_services", "grocery_stores_supermarkets", "hardware_equipment_and_supplies", "hardware_stores", "health_and_beauty_spas", "hearing_aids_sales_and_supplies", "heating_plumbing_a_c", "hobby_toy_and_game_shops", "home_supply_warehouse_stores", "hospitals", "hotels_motels_and_resorts", "household_appliance_stores", "industrial_supplies", "information_retrieval_services", "insurance_default", "insurance_underwriting_premiums", "intra_company_purchases", "jewelry_stores_watches_clocks_and_silverware_stores", "landscaping_services", "laundries", "laundry_cleaning_services", "legal_services_attorneys", "luggage_and_leather_goods_stores", "lumber_building_materials_stores", "manual_cash_disburse", "marinas_service_and_supplies", "marketplaces", "masonry_stonework_and_plaster", "massage_parlors", "medical_and_dental_labs", "medical_dental_ophthalmic_and_hospital_equipment_and_supplies", "medical_services", "membership_organizations", "mens_and_boys_clothing_and_accessories_stores", "mens_womens_clothing_stores", "metal_service_centers", "miscellaneous_apparel_and_accessory_shops", "miscellaneous_auto_dealers", "miscellaneous_business_services", "miscellaneous_food_stores", "miscellaneous_general_merchandise", "miscellaneous_general_services", "miscellaneous_home_furnishing_specialty_stores", "miscellaneous_publishing_and_printing", "miscellaneous_recreation_services", "miscellaneous_repair_shops", "miscellaneous_specialty_retail", "mobile_home_dealers", "motion_picture_theaters", "motor_freight_carriers_and_trucking", "motor_homes_dealers", "motor_vehicle_supplies_and_new_parts", "motorcycle_shops_and_dealers", "motorcycle_shops_dealers", "music_stores_musical_instruments_pianos_and_sheet_music", "news_dealers_and_newsstands", "non_fi_money_orders", "non_fi_stored_value_card_purchase_load", "nondurable_goods", "nurseries_lawn_and_garden_supply_stores", "nursing_personal_care", "office_and_commercial_furniture", "opticians_eyeglasses", "optometrists_ophthalmologist", "orthopedic_goods_prosthetic_devices", "osteopaths", "package_stores_beer_wine_and_liquor", "paints_varnishes_and_supplies", "parking_lots_garages", "passenger_railways", "pawn_shops", "pet_shops_pet_food_and_supplies", "petroleum_and_petroleum_products", "photo_developing", "photographic_photocopy_microfilm_equipment_and_supplies", "photographic_studios", "picture_video_production", "piece_goods_notions_and_other_dry_goods", "plumbing_heating_equipment_and_supplies", "political_organizations", "postal_services_government_only", "precious_stones_and_metals_watches_and_jewelry", "professional_services", "public_warehousing_and_storage", "quick_copy_repro_and_blueprint", "railroads", "real_estate_agents_and_managers_rentals", "record_stores", "recreational_vehicle_rentals", "religious_goods_stores", "religious_organizations", "roofing_siding_sheet_metal", "secretarial_support_services", "security_brokers_dealers", "service_stations", "sewing_needlework_fabric_and_piece_goods_stores", "shoe_repair_hat_cleaning", "shoe_stores", "small_appliance_repair", "snowmobile_dealers", "special_trade_services", "specialty_cleaning", "sporting_goods_stores", "sporting_recreation_camps", "sports_and_riding_apparel_stores", "sports_clubs_fields", "stamp_and_coin_stores", "stationary_office_supplies_printing_and_writing_paper", "stationery_stores_office_and_school_supply_stores", "swimming_pools_sales", "t_ui_travel_germany", "tailors_alterations", "tax_payments_government_agencies", "tax_preparation_services", "taxicabs_limousines", "telecommunication_equipment_and_telephone_sales", "telecommunication_services", "telegraph_services", "tent_and_awning_shops", "testing_laboratories", "theatrical_ticket_agencies", "timeshares", "tire_retreading_and_repair", "tolls_bridge_fees", "tourist_attractions_and_exhibits", "towing_services", "trailer_parks_campgrounds", "transportation_services", "travel_agencies_tour_operators", "truck_stop_iteration", "truck_utility_trailer_rentals", "typesetting_plate_making_and_related_services", "typewriter_stores", "u_s_federal_government_agencies_or_departments", "uniforms_commercial_clothing", "used_merchandise_and_secondhand_stores", "utilities", "variety_stores", "veterinary_services", "video_amusement_game_supplies", "video_game_arcades", "video_tape_rental_stores", "vocational_trade_schools", "watch_jewelry_repair", "welding_repair", "wholesale_clubs", "wig_and_toupee_stores", "wires_money_orders", "womens_accessory_and_specialty_shops", "womens_ready_to_wear_stores", "wrecking_and_salvage_yards", ] ] """ A categorization of the seller's type of business. See our [merchant categories guide](https://stripe.com/docs/issuing/merchant-categories) for a list of possible values. """ city: NotRequired[str] """ City where the seller is located """ country: NotRequired[str] """ Country where the seller is located """ name: NotRequired[str] """ Name of the seller """ network_id: NotRequired[str] """ Identifier assigned to the seller by the card network. Different card networks may assign different network_id fields to the same merchant. """ postal_code: NotRequired[str] """ Postal code where the seller is located """ state: NotRequired[str] """ State where the seller is located """ terminal_id: NotRequired[str] """ An ID assigned by the seller to the location of the sale. """ url: NotRequired[str] """ URL provided by the merchant on a 3DS request """ class CreateUnlinkedRefundParamsPurchaseDetails(TypedDict): fleet: NotRequired[ "TransactionService.CreateUnlinkedRefundParamsPurchaseDetailsFleet" ] """ Fleet-specific information for transactions using Fleet cards. """ flight: NotRequired[ "TransactionService.CreateUnlinkedRefundParamsPurchaseDetailsFlight" ] """ Information about the flight that was purchased with this transaction. """ fuel: NotRequired[ "TransactionService.CreateUnlinkedRefundParamsPurchaseDetailsFuel" ] """ Information about fuel that was purchased with this transaction. """ lodging: NotRequired[ "TransactionService.CreateUnlinkedRefundParamsPurchaseDetailsLodging" ] """ Information about lodging that was purchased with this transaction. """ receipt: NotRequired[ List[ "TransactionService.CreateUnlinkedRefundParamsPurchaseDetailsReceipt" ] ] """ The line items in the purchase. """ reference: NotRequired[str] """ A merchant-specific order number. """ class CreateUnlinkedRefundParamsPurchaseDetailsFleet(TypedDict): cardholder_prompt_data: NotRequired[ "TransactionService.CreateUnlinkedRefundParamsPurchaseDetailsFleetCardholderPromptData" ] """ Answers to prompts presented to the cardholder at the point of sale. Prompted fields vary depending on the configuration of your physical fleet cards. Typical points of sale support only numeric entry. """ purchase_type: NotRequired[ Literal[ "fuel_and_non_fuel_purchase", "fuel_purchase", "non_fuel_purchase", ] ] """ The type of purchase. One of `fuel_purchase`, `non_fuel_purchase`, or `fuel_and_non_fuel_purchase`. """ reported_breakdown: NotRequired[ "TransactionService.CreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdown" ] """ More information about the total amount. This information is not guaranteed to be accurate as some merchants may provide unreliable data. """ service_type: NotRequired[ Literal["full_service", "non_fuel_transaction", "self_service"] ] """ The type of fuel service. One of `non_fuel_transaction`, `full_service`, or `self_service`. """ class CreateUnlinkedRefundParamsPurchaseDetailsFleetCardholderPromptData( TypedDict, ): driver_id: NotRequired[str] """ Driver ID. """ odometer: NotRequired[int] """ Odometer reading. """ unspecified_id: NotRequired[str] """ An alphanumeric ID. This field is used when a vehicle ID, driver ID, or generic ID is entered by the cardholder, but the merchant or card network did not specify the prompt type. """ user_id: NotRequired[str] """ User ID. """ vehicle_number: NotRequired[str] """ Vehicle number. """ class CreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdown( TypedDict, ): fuel: NotRequired[ "TransactionService.CreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdownFuel" ] """ Breakdown of fuel portion of the purchase. """ non_fuel: NotRequired[ "TransactionService.CreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdownNonFuel" ] """ Breakdown of non-fuel portion of the purchase. """ tax: NotRequired[ "TransactionService.CreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdownTax" ] """ Information about tax included in this transaction. """ class CreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdownFuel( TypedDict, ): gross_amount_decimal: NotRequired[str] """ Gross fuel amount that should equal Fuel Volume multipled by Fuel Unit Cost, inclusive of taxes. """ class CreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdownNonFuel( TypedDict, ): gross_amount_decimal: NotRequired[str] """ Gross non-fuel amount that should equal the sum of the line items, inclusive of taxes. """ class CreateUnlinkedRefundParamsPurchaseDetailsFleetReportedBreakdownTax( TypedDict, ): local_amount_decimal: NotRequired[str] """ Amount of state or provincial Sales Tax included in the transaction amount. Null if not reported by merchant or not subject to tax. """ national_amount_decimal: NotRequired[str] """ Amount of national Sales Tax or VAT included in the transaction amount. Null if not reported by merchant or not subject to tax. """ class CreateUnlinkedRefundParamsPurchaseDetailsFlight(TypedDict): departure_at: NotRequired[int] """ The time that the flight departed. """ passenger_name: NotRequired[str] """ The name of the passenger. """ refundable: NotRequired[bool] """ Whether the ticket is refundable. """ segments: NotRequired[ List[ "TransactionService.CreateUnlinkedRefundParamsPurchaseDetailsFlightSegment" ] ] """ The legs of the trip. """ travel_agency: NotRequired[str] """ The travel agency that issued the ticket. """ class CreateUnlinkedRefundParamsPurchaseDetailsFlightSegment(TypedDict): arrival_airport_code: NotRequired[str] """ The three-letter IATA airport code of the flight's destination. """ carrier: NotRequired[str] """ The airline carrier code. """ departure_airport_code: NotRequired[str] """ The three-letter IATA airport code that the flight departed from. """ flight_number: NotRequired[str] """ The flight number. """ service_class: NotRequired[str] """ The flight's service class. """ stopover_allowed: NotRequired[bool] """ Whether a stopover is allowed on this flight. """ class CreateUnlinkedRefundParamsPurchaseDetailsFuel(TypedDict): industry_product_code: NotRequired[str] """ [Conexxus Payment System Product Code](https://www.conexxus.org/conexxus-payment-system-product-codes) identifying the primary fuel product purchased. """ quantity_decimal: NotRequired[str] """ The quantity of `unit`s of fuel that was dispensed, represented as a decimal string with at most 12 decimal places. """ type: NotRequired[ Literal[ "diesel", "other", "unleaded_plus", "unleaded_regular", "unleaded_super", ] ] """ The type of fuel that was purchased. One of `diesel`, `unleaded_plus`, `unleaded_regular`, `unleaded_super`, or `other`. """ unit: NotRequired[ Literal[ "charging_minute", "imperial_gallon", "kilogram", "kilowatt_hour", "liter", "other", "pound", "us_gallon", ] ] """ The units for `quantity_decimal`. One of `charging_minute`, `imperial_gallon`, `kilogram`, `kilowatt_hour`, `liter`, `pound`, `us_gallon`, or `other`. """ unit_cost_decimal: NotRequired[str] """ The cost in cents per each unit of fuel, represented as a decimal string with at most 12 decimal places. """ class CreateUnlinkedRefundParamsPurchaseDetailsLodging(TypedDict): check_in_at: NotRequired[int] """ The time of checking into the lodging. """ nights: NotRequired[int] """ The number of nights stayed at the lodging. """ class CreateUnlinkedRefundParamsPurchaseDetailsReceipt(TypedDict): description: NotRequired[str] quantity: NotRequired[str] total: NotRequired[int] unit_cost: NotRequired[int] class RefundParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ refund_amount: NotRequired[int] """ The total amount to attempt to refund. This amount is in the provided currency, or defaults to the cards currency, and in the [smallest currency unit](https://stripe.com/docs/currencies#zero-decimal). """ def refund( self, transaction: str, params: "TransactionService.RefundParams" = {}, options: RequestOptions = {}, ) -> Transaction: """ Refund a test-mode Transaction. """ return cast( Transaction, self._request( "post", "/v1/test_helpers/issuing/transactions/{transaction}/refund".format( transaction=sanitize_id(transaction), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def refund_async( self, transaction: str, params: "TransactionService.RefundParams" = {}, options: RequestOptions = {}, ) -> Transaction: """ Refund a test-mode Transaction. """ return cast( Transaction, await self._request_async( "post", "/v1/test_helpers/issuing/transactions/{transaction}/refund".format( transaction=sanitize_id(transaction), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def create_force_capture( self, params: "TransactionService.CreateForceCaptureParams", options: RequestOptions = {}, ) -> Transaction: """ Allows the user to capture an arbitrary amount, also known as a forced capture. """ return cast( Transaction, self._request( "post", "/v1/test_helpers/issuing/transactions/create_force_capture", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_force_capture_async( self, params: "TransactionService.CreateForceCaptureParams", options: RequestOptions = {}, ) -> Transaction: """ Allows the user to capture an arbitrary amount, also known as a forced capture. """ return cast( Transaction, await self._request_async( "post", "/v1/test_helpers/issuing/transactions/create_force_capture", api_mode="V1", base_address="api", params=params, options=options, ), ) def create_unlinked_refund( self, params: "TransactionService.CreateUnlinkedRefundParams", options: RequestOptions = {}, ) -> Transaction: """ Allows the user to refund an arbitrary amount, also known as a unlinked refund. """ return cast( Transaction, self._request( "post", "/v1/test_helpers/issuing/transactions/create_unlinked_refund", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_unlinked_refund_async( self, params: "TransactionService.CreateUnlinkedRefundParams", options: RequestOptions = {}, ) -> Transaction: """ Allows the user to refund an arbitrary amount, also known as a unlinked refund. """ return cast( Transaction, await self._request_async( "post", "/v1/test_helpers/issuing/transactions/create_unlinked_refund", api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5529406 stripe-10.1.0/stripe/test_helpers/terminal/0000755000175100001770000000000014637354616020345 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/test_helpers/terminal/__init__.py0000644000175100001770000000024014637354563022453 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe.test_helpers.terminal._reader_service import ( ReaderService as ReaderService, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/test_helpers/terminal/_reader_service.py0000644000175100001770000000575014637354563024050 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.terminal._reader import Reader from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict class ReaderService(StripeService): class PresentPaymentMethodParams(TypedDict): amount_tip: NotRequired[int] """ Simulated on-reader tip amount. """ card_present: NotRequired[ "ReaderService.PresentPaymentMethodParamsCardPresent" ] """ Simulated data for the card_present payment method. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ interac_present: NotRequired[ "ReaderService.PresentPaymentMethodParamsInteracPresent" ] """ Simulated data for the interac_present payment method. """ type: NotRequired[Literal["card_present", "interac_present"]] """ Simulated payment type. """ class PresentPaymentMethodParamsCardPresent(TypedDict): number: NotRequired[str] """ The card number, as a string without any separators. """ class PresentPaymentMethodParamsInteracPresent(TypedDict): number: NotRequired[str] """ Card Number """ def present_payment_method( self, reader: str, params: "ReaderService.PresentPaymentMethodParams" = {}, options: RequestOptions = {}, ) -> Reader: """ Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction. """ return cast( Reader, self._request( "post", "/v1/test_helpers/terminal/readers/{reader}/present_payment_method".format( reader=sanitize_id(reader), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def present_payment_method_async( self, reader: str, params: "ReaderService.PresentPaymentMethodParams" = {}, options: RequestOptions = {}, ) -> Reader: """ Presents a payment method on a simulated reader. Can be used to simulate accepting a payment, saving a card or refunding a transaction. """ return cast( Reader, await self._request_async( "post", "/v1/test_helpers/terminal/readers/{reader}/present_payment_method".format( reader=sanitize_id(reader), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5529406 stripe-10.1.0/stripe/test_helpers/treasury/0000755000175100001770000000000014637354616020410 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/test_helpers/treasury/__init__.py0000644000175100001770000000125214637354563022522 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe.test_helpers.treasury._inbound_transfer_service import ( InboundTransferService as InboundTransferService, ) from stripe.test_helpers.treasury._outbound_payment_service import ( OutboundPaymentService as OutboundPaymentService, ) from stripe.test_helpers.treasury._outbound_transfer_service import ( OutboundTransferService as OutboundTransferService, ) from stripe.test_helpers.treasury._received_credit_service import ( ReceivedCreditService as ReceivedCreditService, ) from stripe.test_helpers.treasury._received_debit_service import ( ReceivedDebitService as ReceivedDebitService, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/test_helpers/treasury/_inbound_transfer_service.py0000644000175100001770000001436414637354563026214 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.treasury._inbound_transfer import InboundTransfer from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict class InboundTransferService(StripeService): class FailParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ failure_details: NotRequired[ "InboundTransferService.FailParamsFailureDetails" ] """ Details about a failed InboundTransfer. """ class FailParamsFailureDetails(TypedDict): code: NotRequired[ Literal[ "account_closed", "account_frozen", "bank_account_restricted", "bank_ownership_changed", "debit_not_authorized", "incorrect_account_holder_address", "incorrect_account_holder_name", "incorrect_account_holder_tax_id", "insufficient_funds", "invalid_account_number", "invalid_currency", "no_account", "other", ] ] """ Reason for the failure. """ class ReturnInboundTransferParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class SucceedParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def fail( self, id: str, params: "InboundTransferService.FailParams" = {}, options: RequestOptions = {}, ) -> InboundTransfer: """ Transitions a test mode created InboundTransfer to the failed status. The InboundTransfer must already be in the processing state. """ return cast( InboundTransfer, self._request( "post", "/v1/test_helpers/treasury/inbound_transfers/{id}/fail".format( id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def fail_async( self, id: str, params: "InboundTransferService.FailParams" = {}, options: RequestOptions = {}, ) -> InboundTransfer: """ Transitions a test mode created InboundTransfer to the failed status. The InboundTransfer must already be in the processing state. """ return cast( InboundTransfer, await self._request_async( "post", "/v1/test_helpers/treasury/inbound_transfers/{id}/fail".format( id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def return_inbound_transfer( self, id: str, params: "InboundTransferService.ReturnInboundTransferParams" = {}, options: RequestOptions = {}, ) -> InboundTransfer: """ Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a ReceivedDebit. The InboundTransfer must already be in the succeeded state. """ return cast( InboundTransfer, self._request( "post", "/v1/test_helpers/treasury/inbound_transfers/{id}/return".format( id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def return_inbound_transfer_async( self, id: str, params: "InboundTransferService.ReturnInboundTransferParams" = {}, options: RequestOptions = {}, ) -> InboundTransfer: """ Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a ReceivedDebit. The InboundTransfer must already be in the succeeded state. """ return cast( InboundTransfer, await self._request_async( "post", "/v1/test_helpers/treasury/inbound_transfers/{id}/return".format( id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def succeed( self, id: str, params: "InboundTransferService.SucceedParams" = {}, options: RequestOptions = {}, ) -> InboundTransfer: """ Transitions a test mode created InboundTransfer to the succeeded status. The InboundTransfer must already be in the processing state. """ return cast( InboundTransfer, self._request( "post", "/v1/test_helpers/treasury/inbound_transfers/{id}/succeed".format( id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def succeed_async( self, id: str, params: "InboundTransferService.SucceedParams" = {}, options: RequestOptions = {}, ) -> InboundTransfer: """ Transitions a test mode created InboundTransfer to the succeeded status. The InboundTransfer must already be in the processing state. """ return cast( InboundTransfer, await self._request_async( "post", "/v1/test_helpers/treasury/inbound_transfers/{id}/succeed".format( id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/test_helpers/treasury/_outbound_payment_service.py0000644000175100001770000002156614637354563026250 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.treasury._outbound_payment import OutboundPayment from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict class OutboundPaymentService(StripeService): class FailParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class PostParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ReturnOutboundPaymentParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ returned_details: NotRequired[ "OutboundPaymentService.ReturnOutboundPaymentParamsReturnedDetails" ] """ Optional hash to set the return code. """ class ReturnOutboundPaymentParamsReturnedDetails(TypedDict): code: NotRequired[ Literal[ "account_closed", "account_frozen", "bank_account_restricted", "bank_ownership_changed", "declined", "incorrect_account_holder_name", "invalid_account_number", "invalid_currency", "no_account", "other", ] ] """ The return code to be set on the OutboundPayment object. """ class UpdateParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ tracking_details: "OutboundPaymentService.UpdateParamsTrackingDetails" """ Details about network-specific tracking information. """ class UpdateParamsTrackingDetails(TypedDict): ach: NotRequired[ "OutboundPaymentService.UpdateParamsTrackingDetailsAch" ] """ ACH network tracking details. """ type: Literal["ach", "us_domestic_wire"] """ The US bank account network used to send funds. """ us_domestic_wire: NotRequired[ "OutboundPaymentService.UpdateParamsTrackingDetailsUsDomesticWire" ] """ US domestic wire network tracking details. """ class UpdateParamsTrackingDetailsAch(TypedDict): trace_id: str """ ACH trace ID for funds sent over the `ach` network. """ class UpdateParamsTrackingDetailsUsDomesticWire(TypedDict): imad: NotRequired[str] """ IMAD for funds sent over the `us_domestic_wire` network. """ omad: NotRequired[str] """ OMAD for funds sent over the `us_domestic_wire` network. """ def update( self, id: str, params: "OutboundPaymentService.UpdateParams", options: RequestOptions = {}, ) -> OutboundPayment: """ Updates a test mode created OutboundPayment with tracking details. The OutboundPayment must not be cancelable, and cannot be in the canceled or failed states. """ return cast( OutboundPayment, self._request( "post", "/v1/test_helpers/treasury/outbound_payments/{id}".format( id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, id: str, params: "OutboundPaymentService.UpdateParams", options: RequestOptions = {}, ) -> OutboundPayment: """ Updates a test mode created OutboundPayment with tracking details. The OutboundPayment must not be cancelable, and cannot be in the canceled or failed states. """ return cast( OutboundPayment, await self._request_async( "post", "/v1/test_helpers/treasury/outbound_payments/{id}".format( id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def fail( self, id: str, params: "OutboundPaymentService.FailParams" = {}, options: RequestOptions = {}, ) -> OutboundPayment: """ Transitions a test mode created OutboundPayment to the failed status. The OutboundPayment must already be in the processing state. """ return cast( OutboundPayment, self._request( "post", "/v1/test_helpers/treasury/outbound_payments/{id}/fail".format( id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def fail_async( self, id: str, params: "OutboundPaymentService.FailParams" = {}, options: RequestOptions = {}, ) -> OutboundPayment: """ Transitions a test mode created OutboundPayment to the failed status. The OutboundPayment must already be in the processing state. """ return cast( OutboundPayment, await self._request_async( "post", "/v1/test_helpers/treasury/outbound_payments/{id}/fail".format( id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def post( self, id: str, params: "OutboundPaymentService.PostParams" = {}, options: RequestOptions = {}, ) -> OutboundPayment: """ Transitions a test mode created OutboundPayment to the posted status. The OutboundPayment must already be in the processing state. """ return cast( OutboundPayment, self._request( "post", "/v1/test_helpers/treasury/outbound_payments/{id}/post".format( id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def post_async( self, id: str, params: "OutboundPaymentService.PostParams" = {}, options: RequestOptions = {}, ) -> OutboundPayment: """ Transitions a test mode created OutboundPayment to the posted status. The OutboundPayment must already be in the processing state. """ return cast( OutboundPayment, await self._request_async( "post", "/v1/test_helpers/treasury/outbound_payments/{id}/post".format( id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def return_outbound_payment( self, id: str, params: "OutboundPaymentService.ReturnOutboundPaymentParams" = {}, options: RequestOptions = {}, ) -> OutboundPayment: """ Transitions a test mode created OutboundPayment to the returned status. The OutboundPayment must already be in the processing state. """ return cast( OutboundPayment, self._request( "post", "/v1/test_helpers/treasury/outbound_payments/{id}/return".format( id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def return_outbound_payment_async( self, id: str, params: "OutboundPaymentService.ReturnOutboundPaymentParams" = {}, options: RequestOptions = {}, ) -> OutboundPayment: """ Transitions a test mode created OutboundPayment to the returned status. The OutboundPayment must already be in the processing state. """ return cast( OutboundPayment, await self._request_async( "post", "/v1/test_helpers/treasury/outbound_payments/{id}/return".format( id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/test_helpers/treasury/_outbound_transfer_service.py0000644000175100001770000002256714637354563026421 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.treasury._outbound_transfer import OutboundTransfer from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict class OutboundTransferService(StripeService): class FailParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class PostParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ReturnOutboundTransferParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ returned_details: NotRequired[ "OutboundTransferService.ReturnOutboundTransferParamsReturnedDetails" ] """ Details about a returned OutboundTransfer. """ class ReturnOutboundTransferParamsReturnedDetails(TypedDict): code: NotRequired[ Literal[ "account_closed", "account_frozen", "bank_account_restricted", "bank_ownership_changed", "declined", "incorrect_account_holder_name", "invalid_account_number", "invalid_currency", "no_account", "other", ] ] """ Reason for the return. """ class UpdateParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ tracking_details: "OutboundTransferService.UpdateParamsTrackingDetails" """ Details about network-specific tracking information. """ class UpdateParamsTrackingDetails(TypedDict): ach: NotRequired[ "OutboundTransferService.UpdateParamsTrackingDetailsAch" ] """ ACH network tracking details. """ type: Literal["ach", "us_domestic_wire"] """ The US bank account network used to send funds. """ us_domestic_wire: NotRequired[ "OutboundTransferService.UpdateParamsTrackingDetailsUsDomesticWire" ] """ US domestic wire network tracking details. """ class UpdateParamsTrackingDetailsAch(TypedDict): trace_id: str """ ACH trace ID for funds sent over the `ach` network. """ class UpdateParamsTrackingDetailsUsDomesticWire(TypedDict): imad: NotRequired[str] """ IMAD for funds sent over the `us_domestic_wire` network. """ omad: NotRequired[str] """ OMAD for funds sent over the `us_domestic_wire` network. """ def update( self, outbound_transfer: str, params: "OutboundTransferService.UpdateParams", options: RequestOptions = {}, ) -> OutboundTransfer: """ Updates a test mode created OutboundTransfer with tracking details. The OutboundTransfer must not be cancelable, and cannot be in the canceled or failed states. """ return cast( OutboundTransfer, self._request( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}".format( outbound_transfer=sanitize_id(outbound_transfer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, outbound_transfer: str, params: "OutboundTransferService.UpdateParams", options: RequestOptions = {}, ) -> OutboundTransfer: """ Updates a test mode created OutboundTransfer with tracking details. The OutboundTransfer must not be cancelable, and cannot be in the canceled or failed states. """ return cast( OutboundTransfer, await self._request_async( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}".format( outbound_transfer=sanitize_id(outbound_transfer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def fail( self, outbound_transfer: str, params: "OutboundTransferService.FailParams" = {}, options: RequestOptions = {}, ) -> OutboundTransfer: """ Transitions a test mode created OutboundTransfer to the failed status. The OutboundTransfer must already be in the processing state. """ return cast( OutboundTransfer, self._request( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/fail".format( outbound_transfer=sanitize_id(outbound_transfer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def fail_async( self, outbound_transfer: str, params: "OutboundTransferService.FailParams" = {}, options: RequestOptions = {}, ) -> OutboundTransfer: """ Transitions a test mode created OutboundTransfer to the failed status. The OutboundTransfer must already be in the processing state. """ return cast( OutboundTransfer, await self._request_async( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/fail".format( outbound_transfer=sanitize_id(outbound_transfer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def post( self, outbound_transfer: str, params: "OutboundTransferService.PostParams" = {}, options: RequestOptions = {}, ) -> OutboundTransfer: """ Transitions a test mode created OutboundTransfer to the posted status. The OutboundTransfer must already be in the processing state. """ return cast( OutboundTransfer, self._request( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/post".format( outbound_transfer=sanitize_id(outbound_transfer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def post_async( self, outbound_transfer: str, params: "OutboundTransferService.PostParams" = {}, options: RequestOptions = {}, ) -> OutboundTransfer: """ Transitions a test mode created OutboundTransfer to the posted status. The OutboundTransfer must already be in the processing state. """ return cast( OutboundTransfer, await self._request_async( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/post".format( outbound_transfer=sanitize_id(outbound_transfer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def return_outbound_transfer( self, outbound_transfer: str, params: "OutboundTransferService.ReturnOutboundTransferParams" = {}, options: RequestOptions = {}, ) -> OutboundTransfer: """ Transitions a test mode created OutboundTransfer to the returned status. The OutboundTransfer must already be in the processing state. """ return cast( OutboundTransfer, self._request( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/return".format( outbound_transfer=sanitize_id(outbound_transfer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def return_outbound_transfer_async( self, outbound_transfer: str, params: "OutboundTransferService.ReturnOutboundTransferParams" = {}, options: RequestOptions = {}, ) -> OutboundTransfer: """ Transitions a test mode created OutboundTransfer to the returned status. The OutboundTransfer must already be in the processing state. """ return cast( OutboundTransfer, await self._request_async( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/return".format( outbound_transfer=sanitize_id(outbound_transfer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/test_helpers/treasury/_received_credit_service.py0000644000175100001770000000727114637354563025771 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe.treasury._received_credit import ReceivedCredit from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict class ReceivedCreditService(StripeService): class CreateParams(TypedDict): amount: int """ Amount (in cents) to be transferred. """ 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 string attached to the object. Often useful for displaying to users. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ financial_account: str """ The FinancialAccount to send funds to. """ initiating_payment_method_details: NotRequired[ "ReceivedCreditService.CreateParamsInitiatingPaymentMethodDetails" ] """ Initiating payment method details for the object. """ network: Literal["ach", "us_domestic_wire"] """ Specifies the network rails to be used. If not set, will default to the PaymentMethod's preferred network. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. """ class CreateParamsInitiatingPaymentMethodDetails(TypedDict): type: Literal["us_bank_account"] """ The source type. """ us_bank_account: NotRequired[ "ReceivedCreditService.CreateParamsInitiatingPaymentMethodDetailsUsBankAccount" ] """ Optional fields for `us_bank_account`. """ class CreateParamsInitiatingPaymentMethodDetailsUsBankAccount(TypedDict): account_holder_name: NotRequired[str] """ The bank account holder's name. """ account_number: NotRequired[str] """ The bank account number. """ routing_number: NotRequired[str] """ The bank account's routing number. """ def create( self, params: "ReceivedCreditService.CreateParams", options: RequestOptions = {}, ) -> ReceivedCredit: """ Use this endpoint to simulate a test mode ReceivedCredit initiated by a third party. In live mode, you can't directly create ReceivedCredits initiated by third parties. """ return cast( ReceivedCredit, self._request( "post", "/v1/test_helpers/treasury/received_credits", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "ReceivedCreditService.CreateParams", options: RequestOptions = {}, ) -> ReceivedCredit: """ Use this endpoint to simulate a test mode ReceivedCredit initiated by a third party. In live mode, you can't directly create ReceivedCredits initiated by third parties. """ return cast( ReceivedCredit, await self._request_async( "post", "/v1/test_helpers/treasury/received_credits", api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/test_helpers/treasury/_received_debit_service.py0000644000175100001770000000722614637354563025606 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe.treasury._received_debit import ReceivedDebit from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict class ReceivedDebitService(StripeService): class CreateParams(TypedDict): amount: int """ Amount (in cents) to be transferred. """ 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 string attached to the object. Often useful for displaying to users. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ financial_account: str """ The FinancialAccount to pull funds from. """ initiating_payment_method_details: NotRequired[ "ReceivedDebitService.CreateParamsInitiatingPaymentMethodDetails" ] """ Initiating payment method details for the object. """ network: Literal["ach"] """ Specifies the network rails to be used. If not set, will default to the PaymentMethod's preferred network. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. """ class CreateParamsInitiatingPaymentMethodDetails(TypedDict): type: Literal["us_bank_account"] """ The source type. """ us_bank_account: NotRequired[ "ReceivedDebitService.CreateParamsInitiatingPaymentMethodDetailsUsBankAccount" ] """ Optional fields for `us_bank_account`. """ class CreateParamsInitiatingPaymentMethodDetailsUsBankAccount(TypedDict): account_holder_name: NotRequired[str] """ The bank account holder's name. """ account_number: NotRequired[str] """ The bank account number. """ routing_number: NotRequired[str] """ The bank account's routing number. """ def create( self, params: "ReceivedDebitService.CreateParams", options: RequestOptions = {}, ) -> ReceivedDebit: """ Use this endpoint to simulate a test mode ReceivedDebit initiated by a third party. In live mode, you can't directly create ReceivedDebits initiated by third parties. """ return cast( ReceivedDebit, self._request( "post", "/v1/test_helpers/treasury/received_debits", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "ReceivedDebitService.CreateParams", options: RequestOptions = {}, ) -> ReceivedDebit: """ Use this endpoint to simulate a test mode ReceivedDebit initiated by a third party. In live mode, you can't directly create ReceivedDebits initiated by third parties. """ return cast( ReceivedDebit, await self._request_async( "post", "/v1/test_helpers/treasury/received_debits", api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5569406 stripe-10.1.0/stripe/treasury/0000755000175100001770000000000014637354616015707 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/treasury/__init__.py0000644000175100001770000000431414637354563020023 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe.treasury._credit_reversal import CreditReversal as CreditReversal from stripe.treasury._credit_reversal_service import ( CreditReversalService as CreditReversalService, ) from stripe.treasury._debit_reversal import DebitReversal as DebitReversal from stripe.treasury._debit_reversal_service import ( DebitReversalService as DebitReversalService, ) from stripe.treasury._financial_account import ( FinancialAccount as FinancialAccount, ) from stripe.treasury._financial_account_features import ( FinancialAccountFeatures as FinancialAccountFeatures, ) from stripe.treasury._financial_account_features_service import ( FinancialAccountFeaturesService as FinancialAccountFeaturesService, ) from stripe.treasury._financial_account_service import ( FinancialAccountService as FinancialAccountService, ) from stripe.treasury._inbound_transfer import ( InboundTransfer as InboundTransfer, ) from stripe.treasury._inbound_transfer_service import ( InboundTransferService as InboundTransferService, ) from stripe.treasury._outbound_payment import ( OutboundPayment as OutboundPayment, ) from stripe.treasury._outbound_payment_service import ( OutboundPaymentService as OutboundPaymentService, ) from stripe.treasury._outbound_transfer import ( OutboundTransfer as OutboundTransfer, ) from stripe.treasury._outbound_transfer_service import ( OutboundTransferService as OutboundTransferService, ) from stripe.treasury._received_credit import ReceivedCredit as ReceivedCredit from stripe.treasury._received_credit_service import ( ReceivedCreditService as ReceivedCreditService, ) from stripe.treasury._received_debit import ReceivedDebit as ReceivedDebit from stripe.treasury._received_debit_service import ( ReceivedDebitService as ReceivedDebitService, ) from stripe.treasury._transaction import Transaction as Transaction from stripe.treasury._transaction_entry import ( TransactionEntry as TransactionEntry, ) from stripe.treasury._transaction_entry_service import ( TransactionEntryService as TransactionEntryService, ) from stripe.treasury._transaction_service import ( TransactionService as TransactionService, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/treasury/_credit_reversal.py0000644000175100001770000002004114637354563021573 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from typing import ClassVar, Dict, List, Optional, cast from typing_extensions import Literal, NotRequired, Unpack, TYPE_CHECKING if TYPE_CHECKING: from stripe.treasury._transaction import Transaction class CreditReversal( CreateableAPIResource["CreditReversal"], ListableAPIResource["CreditReversal"], ): """ You can reverse some [ReceivedCredits](https://stripe.com/docs/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"]] = ( "treasury.credit_reversal" ) class StatusTransitions(StripeObject): posted_at: Optional[int] """ Timestamp describing when the CreditReversal changed status to `posted` """ class CreateParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ received_credit: str """ The ReceivedCredit to reverse. """ class ListParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ financial_account: str """ Returns objects associated with this FinancialAccount. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ received_credit: NotRequired[str] """ Only return CreditReversals for the ReceivedCredit ID. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[Literal["canceled", "posted", "processing"]] """ Only return CreditReversals for a given status. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ amount: int """ Amount (in cents) transferred. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ 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). """ financial_account: str """ The FinancialAccount to reverse funds from. """ hosted_regulatory_receipt_url: Optional[str] """ A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. """ id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ metadata: Dict[str, str] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ network: Literal["ach", "stripe"] """ The rails used to reverse the funds. """ object: Literal["treasury.credit_reversal"] """ String representing the object's type. Objects of the same type share the same value. """ received_credit: str """ The ReceivedCredit being reversed. """ status: Literal["canceled", "posted", "processing"] """ Status of the CreditReversal """ status_transitions: StatusTransitions transaction: Optional[ExpandableField["Transaction"]] """ The Transaction associated with this object. """ @classmethod def create( cls, **params: Unpack["CreditReversal.CreateParams"] ) -> "CreditReversal": """ Reverses a ReceivedCredit and creates a CreditReversal object. """ return cast( "CreditReversal", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["CreditReversal.CreateParams"] ) -> "CreditReversal": """ Reverses a ReceivedCredit and creates a CreditReversal object. """ return cast( "CreditReversal", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def list( cls, **params: Unpack["CreditReversal.ListParams"] ) -> ListObject["CreditReversal"]: """ Returns a list of CreditReversals. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["CreditReversal.ListParams"] ) -> ListObject["CreditReversal"]: """ Returns a list of CreditReversals. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def retrieve( cls, id: str, **params: Unpack["CreditReversal.RetrieveParams"] ) -> "CreditReversal": """ Retrieves the details of an existing CreditReversal by passing the unique CreditReversal ID from either the CreditReversal creation request or CreditReversal list """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["CreditReversal.RetrieveParams"] ) -> "CreditReversal": """ Retrieves the details of an existing CreditReversal by passing the unique CreditReversal ID from either the CreditReversal creation request or CreditReversal list """ instance = cls(id, **params) await instance.refresh_async() return instance _inner_class_types = {"status_transitions": StatusTransitions} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/treasury/_credit_reversal_service.py0000644000175100001770000001466314637354563023330 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.treasury._credit_reversal import CreditReversal from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class CreditReversalService(StripeService): class CreateParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ received_credit: str """ The ReceivedCredit to reverse. """ class ListParams(TypedDict): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ financial_account: str """ Returns objects associated with this FinancialAccount. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ received_credit: NotRequired[str] """ Only return CreditReversals for the ReceivedCredit ID. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[Literal["canceled", "posted", "processing"]] """ Only return CreditReversals for a given status. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def list( self, params: "CreditReversalService.ListParams", options: RequestOptions = {}, ) -> ListObject[CreditReversal]: """ Returns a list of CreditReversals. """ return cast( ListObject[CreditReversal], self._request( "get", "/v1/treasury/credit_reversals", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "CreditReversalService.ListParams", options: RequestOptions = {}, ) -> ListObject[CreditReversal]: """ Returns a list of CreditReversals. """ return cast( ListObject[CreditReversal], await self._request_async( "get", "/v1/treasury/credit_reversals", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "CreditReversalService.CreateParams", options: RequestOptions = {}, ) -> CreditReversal: """ Reverses a ReceivedCredit and creates a CreditReversal object. """ return cast( CreditReversal, self._request( "post", "/v1/treasury/credit_reversals", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "CreditReversalService.CreateParams", options: RequestOptions = {}, ) -> CreditReversal: """ Reverses a ReceivedCredit and creates a CreditReversal object. """ return cast( CreditReversal, await self._request_async( "post", "/v1/treasury/credit_reversals", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, credit_reversal: str, params: "CreditReversalService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> CreditReversal: """ Retrieves the details of an existing CreditReversal by passing the unique CreditReversal ID from either the CreditReversal creation request or CreditReversal list """ return cast( CreditReversal, self._request( "get", "/v1/treasury/credit_reversals/{credit_reversal}".format( credit_reversal=sanitize_id(credit_reversal), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, credit_reversal: str, params: "CreditReversalService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> CreditReversal: """ Retrieves the details of an existing CreditReversal by passing the unique CreditReversal ID from either the CreditReversal creation request or CreditReversal list """ return cast( CreditReversal, await self._request_async( "get", "/v1/treasury/credit_reversals/{credit_reversal}".format( credit_reversal=sanitize_id(credit_reversal), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/treasury/_debit_reversal.py0000644000175100001770000002033714637354563021420 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from typing import ClassVar, Dict, List, Optional, cast from typing_extensions import Literal, NotRequired, Unpack, TYPE_CHECKING if TYPE_CHECKING: from stripe.treasury._transaction import Transaction class DebitReversal( CreateableAPIResource["DebitReversal"], ListableAPIResource["DebitReversal"], ): """ You can reverse some [ReceivedDebits](https://stripe.com/docs/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"]] = ( "treasury.debit_reversal" ) class LinkedFlows(StripeObject): issuing_dispute: Optional[str] """ Set if there is an Issuing dispute associated with the DebitReversal. """ class StatusTransitions(StripeObject): completed_at: Optional[int] """ Timestamp describing when the DebitReversal changed status to `completed`. """ class CreateParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ received_debit: str """ The ReceivedDebit to reverse. """ class ListParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ financial_account: str """ Returns objects associated with this FinancialAccount. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ received_debit: NotRequired[str] """ Only return DebitReversals for the ReceivedDebit ID. """ resolution: NotRequired[Literal["lost", "won"]] """ Only return DebitReversals for a given resolution. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[Literal["canceled", "completed", "processing"]] """ Only return DebitReversals for a given status. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ amount: int """ Amount (in cents) transferred. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ 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). """ financial_account: Optional[str] """ The FinancialAccount to reverse funds from. """ hosted_regulatory_receipt_url: Optional[str] """ A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. """ id: str """ Unique identifier for the object. """ linked_flows: Optional[LinkedFlows] """ Other flows linked to a DebitReversal. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ metadata: Dict[str, str] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ network: Literal["ach", "card"] """ The rails used to reverse the funds. """ object: Literal["treasury.debit_reversal"] """ String representing the object's type. Objects of the same type share the same value. """ received_debit: str """ The ReceivedDebit being reversed. """ status: Literal["failed", "processing", "succeeded"] """ Status of the DebitReversal """ status_transitions: StatusTransitions transaction: Optional[ExpandableField["Transaction"]] """ The Transaction associated with this object. """ @classmethod def create( cls, **params: Unpack["DebitReversal.CreateParams"] ) -> "DebitReversal": """ Reverses a ReceivedDebit and creates a DebitReversal object. """ return cast( "DebitReversal", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["DebitReversal.CreateParams"] ) -> "DebitReversal": """ Reverses a ReceivedDebit and creates a DebitReversal object. """ return cast( "DebitReversal", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def list( cls, **params: Unpack["DebitReversal.ListParams"] ) -> ListObject["DebitReversal"]: """ Returns a list of DebitReversals. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["DebitReversal.ListParams"] ) -> ListObject["DebitReversal"]: """ Returns a list of DebitReversals. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def retrieve( cls, id: str, **params: Unpack["DebitReversal.RetrieveParams"] ) -> "DebitReversal": """ Retrieves a DebitReversal object. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["DebitReversal.RetrieveParams"] ) -> "DebitReversal": """ Retrieves a DebitReversal object. """ instance = cls(id, **params) await instance.refresh_async() return instance _inner_class_types = { "linked_flows": LinkedFlows, "status_transitions": StatusTransitions, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/treasury/_debit_reversal_service.py0000644000175100001770000001442014637354563023134 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.treasury._debit_reversal import DebitReversal from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class DebitReversalService(StripeService): class CreateParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ received_debit: str """ The ReceivedDebit to reverse. """ class ListParams(TypedDict): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ financial_account: str """ Returns objects associated with this FinancialAccount. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ received_debit: NotRequired[str] """ Only return DebitReversals for the ReceivedDebit ID. """ resolution: NotRequired[Literal["lost", "won"]] """ Only return DebitReversals for a given resolution. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[Literal["canceled", "completed", "processing"]] """ Only return DebitReversals for a given status. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def list( self, params: "DebitReversalService.ListParams", options: RequestOptions = {}, ) -> ListObject[DebitReversal]: """ Returns a list of DebitReversals. """ return cast( ListObject[DebitReversal], self._request( "get", "/v1/treasury/debit_reversals", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "DebitReversalService.ListParams", options: RequestOptions = {}, ) -> ListObject[DebitReversal]: """ Returns a list of DebitReversals. """ return cast( ListObject[DebitReversal], await self._request_async( "get", "/v1/treasury/debit_reversals", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "DebitReversalService.CreateParams", options: RequestOptions = {}, ) -> DebitReversal: """ Reverses a ReceivedDebit and creates a DebitReversal object. """ return cast( DebitReversal, self._request( "post", "/v1/treasury/debit_reversals", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "DebitReversalService.CreateParams", options: RequestOptions = {}, ) -> DebitReversal: """ Reverses a ReceivedDebit and creates a DebitReversal object. """ return cast( DebitReversal, await self._request_async( "post", "/v1/treasury/debit_reversals", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, debit_reversal: str, params: "DebitReversalService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> DebitReversal: """ Retrieves a DebitReversal object. """ return cast( DebitReversal, self._request( "get", "/v1/treasury/debit_reversals/{debit_reversal}".format( debit_reversal=sanitize_id(debit_reversal), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, debit_reversal: str, params: "DebitReversalService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> DebitReversal: """ Retrieves a DebitReversal object. """ return cast( DebitReversal, await self._request_async( "get", "/v1/treasury/debit_reversals/{debit_reversal}".format( debit_reversal=sanitize_id(debit_reversal), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/treasury/_financial_account.py0000644000175100001770000011252214637354563022064 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._updateable_api_resource import UpdateableAPIResource from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe.treasury._financial_account_features import ( FinancialAccountFeatures, ) class FinancialAccount( CreateableAPIResource["FinancialAccount"], ListableAPIResource["FinancialAccount"], UpdateableAPIResource["FinancialAccount"], ): """ Stripe Treasury provides users with a container for money called a FinancialAccount that is separate from their Payments balance. FinancialAccounts serve as the source and destination of Treasury's money movement APIs. """ OBJECT_NAME: ClassVar[Literal["treasury.financial_account"]] = ( "treasury.financial_account" ) class Balance(StripeObject): cash: Dict[str, int] """ Funds the user can spend right now. """ inbound_pending: Dict[str, int] """ Funds not spendable yet, but will become available at a later time. """ outbound_pending: Dict[str, int] """ Funds in the account, but not spendable because they are being held for pending outbound flows. """ class FinancialAddress(StripeObject): class Aba(StripeObject): account_holder_name: str """ The name of the person or business that owns the bank account. """ account_number: Optional[str] """ The account number. """ account_number_last4: str """ The last four characters of the account number. """ bank_name: str """ Name of the bank. """ routing_number: str """ Routing number for the account. """ aba: Optional[Aba] """ ABA Records contain U.S. bank account details per the ABA format. """ supported_networks: Optional[List[Literal["ach", "us_domestic_wire"]]] """ The list of networks that the address supports """ type: Literal["aba"] """ The type of financial address """ _inner_class_types = {"aba": Aba} class PlatformRestrictions(StripeObject): inbound_flows: Optional[Literal["restricted", "unrestricted"]] """ Restricts all inbound money movement. """ outbound_flows: Optional[Literal["restricted", "unrestricted"]] """ Restricts all outbound money movement. """ class StatusDetails(StripeObject): class Closed(StripeObject): reasons: List[ Literal["account_rejected", "closed_by_platform", "other"] ] """ The array that contains reasons for a FinancialAccount closure. """ closed: Optional[Closed] """ Details related to the closure of this FinancialAccount """ _inner_class_types = {"closed": Closed} class CreateParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ features: NotRequired["FinancialAccount.CreateParamsFeatures"] """ Encodes whether a FinancialAccount has access to a particular feature. Stripe or the platform can control features via the requested field. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ platform_restrictions: NotRequired[ "FinancialAccount.CreateParamsPlatformRestrictions" ] """ The set of functionalities that the platform can restrict on the FinancialAccount. """ supported_currencies: List[str] """ The currencies the FinancialAccount can hold a balance in. """ class CreateParamsFeatures(TypedDict): card_issuing: NotRequired[ "FinancialAccount.CreateParamsFeaturesCardIssuing" ] """ Encodes the FinancialAccount's ability to be used with the Issuing product, including attaching cards to and drawing funds from the FinancialAccount. """ deposit_insurance: NotRequired[ "FinancialAccount.CreateParamsFeaturesDepositInsurance" ] """ Represents whether this FinancialAccount is eligible for deposit insurance. Various factors determine the insurance amount. """ financial_addresses: NotRequired[ "FinancialAccount.CreateParamsFeaturesFinancialAddresses" ] """ Contains Features that add FinancialAddresses to the FinancialAccount. """ inbound_transfers: NotRequired[ "FinancialAccount.CreateParamsFeaturesInboundTransfers" ] """ Contains settings related to adding funds to a FinancialAccount from another Account with the same owner. """ intra_stripe_flows: NotRequired[ "FinancialAccount.CreateParamsFeaturesIntraStripeFlows" ] """ Represents the ability for the FinancialAccount to send money to, or receive money from other FinancialAccounts (for example, via OutboundPayment). """ outbound_payments: NotRequired[ "FinancialAccount.CreateParamsFeaturesOutboundPayments" ] """ Includes Features related to initiating money movement out of the FinancialAccount to someone else's bucket of money. """ outbound_transfers: NotRequired[ "FinancialAccount.CreateParamsFeaturesOutboundTransfers" ] """ Contains a Feature and settings related to moving money out of the FinancialAccount into another Account with the same owner. """ class CreateParamsFeaturesCardIssuing(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class CreateParamsFeaturesDepositInsurance(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class CreateParamsFeaturesFinancialAddresses(TypedDict): aba: NotRequired[ "FinancialAccount.CreateParamsFeaturesFinancialAddressesAba" ] """ Adds an ABA FinancialAddress to the FinancialAccount. """ class CreateParamsFeaturesFinancialAddressesAba(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class CreateParamsFeaturesInboundTransfers(TypedDict): ach: NotRequired[ "FinancialAccount.CreateParamsFeaturesInboundTransfersAch" ] """ Enables ACH Debits via the InboundTransfers API. """ class CreateParamsFeaturesInboundTransfersAch(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class CreateParamsFeaturesIntraStripeFlows(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class CreateParamsFeaturesOutboundPayments(TypedDict): ach: NotRequired[ "FinancialAccount.CreateParamsFeaturesOutboundPaymentsAch" ] """ Enables ACH transfers via the OutboundPayments API. """ us_domestic_wire: NotRequired[ "FinancialAccount.CreateParamsFeaturesOutboundPaymentsUsDomesticWire" ] """ Enables US domestic wire transfers via the OutboundPayments API. """ class CreateParamsFeaturesOutboundPaymentsAch(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class CreateParamsFeaturesOutboundPaymentsUsDomesticWire(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class CreateParamsFeaturesOutboundTransfers(TypedDict): ach: NotRequired[ "FinancialAccount.CreateParamsFeaturesOutboundTransfersAch" ] """ Enables ACH transfers via the OutboundTransfers API. """ us_domestic_wire: NotRequired[ "FinancialAccount.CreateParamsFeaturesOutboundTransfersUsDomesticWire" ] """ Enables US domestic wire transfers via the OutboundTransfers API. """ class CreateParamsFeaturesOutboundTransfersAch(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class CreateParamsFeaturesOutboundTransfersUsDomesticWire(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class CreateParamsPlatformRestrictions(TypedDict): inbound_flows: NotRequired[Literal["restricted", "unrestricted"]] """ Restricts all inbound money movement. """ outbound_flows: NotRequired[Literal["restricted", "unrestricted"]] """ Restricts all outbound money movement. """ class ListParams(RequestOptions): created: NotRequired["FinancialAccount.ListParamsCreated|int"] """ Only return FinancialAccounts that were created during the given date interval. """ ending_before: NotRequired[str] """ An object ID cursor for use in pagination. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit ranging from 1 to 100 (defaults to 10). """ starting_after: NotRequired[str] """ An object ID cursor for use in pagination. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ModifyParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ features: NotRequired["FinancialAccount.ModifyParamsFeatures"] """ Encodes whether a FinancialAccount has access to a particular feature, with a status enum and associated `status_details`. Stripe or the platform may control features via the requested field. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ platform_restrictions: NotRequired[ "FinancialAccount.ModifyParamsPlatformRestrictions" ] """ The set of functionalities that the platform can restrict on the FinancialAccount. """ class ModifyParamsFeatures(TypedDict): card_issuing: NotRequired[ "FinancialAccount.ModifyParamsFeaturesCardIssuing" ] """ Encodes the FinancialAccount's ability to be used with the Issuing product, including attaching cards to and drawing funds from the FinancialAccount. """ deposit_insurance: NotRequired[ "FinancialAccount.ModifyParamsFeaturesDepositInsurance" ] """ Represents whether this FinancialAccount is eligible for deposit insurance. Various factors determine the insurance amount. """ financial_addresses: NotRequired[ "FinancialAccount.ModifyParamsFeaturesFinancialAddresses" ] """ Contains Features that add FinancialAddresses to the FinancialAccount. """ inbound_transfers: NotRequired[ "FinancialAccount.ModifyParamsFeaturesInboundTransfers" ] """ Contains settings related to adding funds to a FinancialAccount from another Account with the same owner. """ intra_stripe_flows: NotRequired[ "FinancialAccount.ModifyParamsFeaturesIntraStripeFlows" ] """ Represents the ability for the FinancialAccount to send money to, or receive money from other FinancialAccounts (for example, via OutboundPayment). """ outbound_payments: NotRequired[ "FinancialAccount.ModifyParamsFeaturesOutboundPayments" ] """ Includes Features related to initiating money movement out of the FinancialAccount to someone else's bucket of money. """ outbound_transfers: NotRequired[ "FinancialAccount.ModifyParamsFeaturesOutboundTransfers" ] """ Contains a Feature and settings related to moving money out of the FinancialAccount into another Account with the same owner. """ class ModifyParamsFeaturesCardIssuing(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class ModifyParamsFeaturesDepositInsurance(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class ModifyParamsFeaturesFinancialAddresses(TypedDict): aba: NotRequired[ "FinancialAccount.ModifyParamsFeaturesFinancialAddressesAba" ] """ Adds an ABA FinancialAddress to the FinancialAccount. """ class ModifyParamsFeaturesFinancialAddressesAba(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class ModifyParamsFeaturesInboundTransfers(TypedDict): ach: NotRequired[ "FinancialAccount.ModifyParamsFeaturesInboundTransfersAch" ] """ Enables ACH Debits via the InboundTransfers API. """ class ModifyParamsFeaturesInboundTransfersAch(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class ModifyParamsFeaturesIntraStripeFlows(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class ModifyParamsFeaturesOutboundPayments(TypedDict): ach: NotRequired[ "FinancialAccount.ModifyParamsFeaturesOutboundPaymentsAch" ] """ Enables ACH transfers via the OutboundPayments API. """ us_domestic_wire: NotRequired[ "FinancialAccount.ModifyParamsFeaturesOutboundPaymentsUsDomesticWire" ] """ Enables US domestic wire transfers via the OutboundPayments API. """ class ModifyParamsFeaturesOutboundPaymentsAch(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class ModifyParamsFeaturesOutboundPaymentsUsDomesticWire(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class ModifyParamsFeaturesOutboundTransfers(TypedDict): ach: NotRequired[ "FinancialAccount.ModifyParamsFeaturesOutboundTransfersAch" ] """ Enables ACH transfers via the OutboundTransfers API. """ us_domestic_wire: NotRequired[ "FinancialAccount.ModifyParamsFeaturesOutboundTransfersUsDomesticWire" ] """ Enables US domestic wire transfers via the OutboundTransfers API. """ class ModifyParamsFeaturesOutboundTransfersAch(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class ModifyParamsFeaturesOutboundTransfersUsDomesticWire(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class ModifyParamsPlatformRestrictions(TypedDict): inbound_flows: NotRequired[Literal["restricted", "unrestricted"]] """ Restricts all inbound money movement. """ outbound_flows: NotRequired[Literal["restricted", "unrestricted"]] """ Restricts all outbound money movement. """ class RetrieveFeaturesParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateFeaturesParams(RequestOptions): card_issuing: NotRequired[ "FinancialAccount.UpdateFeaturesParamsCardIssuing" ] """ Encodes the FinancialAccount's ability to be used with the Issuing product, including attaching cards to and drawing funds from the FinancialAccount. """ deposit_insurance: NotRequired[ "FinancialAccount.UpdateFeaturesParamsDepositInsurance" ] """ Represents whether this FinancialAccount is eligible for deposit insurance. Various factors determine the insurance amount. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ financial_addresses: NotRequired[ "FinancialAccount.UpdateFeaturesParamsFinancialAddresses" ] """ Contains Features that add FinancialAddresses to the FinancialAccount. """ inbound_transfers: NotRequired[ "FinancialAccount.UpdateFeaturesParamsInboundTransfers" ] """ Contains settings related to adding funds to a FinancialAccount from another Account with the same owner. """ intra_stripe_flows: NotRequired[ "FinancialAccount.UpdateFeaturesParamsIntraStripeFlows" ] """ Represents the ability for the FinancialAccount to send money to, or receive money from other FinancialAccounts (for example, via OutboundPayment). """ outbound_payments: NotRequired[ "FinancialAccount.UpdateFeaturesParamsOutboundPayments" ] """ Includes Features related to initiating money movement out of the FinancialAccount to someone else's bucket of money. """ outbound_transfers: NotRequired[ "FinancialAccount.UpdateFeaturesParamsOutboundTransfers" ] """ Contains a Feature and settings related to moving money out of the FinancialAccount into another Account with the same owner. """ class UpdateFeaturesParamsCardIssuing(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class UpdateFeaturesParamsDepositInsurance(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class UpdateFeaturesParamsFinancialAddresses(TypedDict): aba: NotRequired[ "FinancialAccount.UpdateFeaturesParamsFinancialAddressesAba" ] """ Adds an ABA FinancialAddress to the FinancialAccount. """ class UpdateFeaturesParamsFinancialAddressesAba(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class UpdateFeaturesParamsInboundTransfers(TypedDict): ach: NotRequired[ "FinancialAccount.UpdateFeaturesParamsInboundTransfersAch" ] """ Enables ACH Debits via the InboundTransfers API. """ class UpdateFeaturesParamsInboundTransfersAch(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class UpdateFeaturesParamsIntraStripeFlows(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class UpdateFeaturesParamsOutboundPayments(TypedDict): ach: NotRequired[ "FinancialAccount.UpdateFeaturesParamsOutboundPaymentsAch" ] """ Enables ACH transfers via the OutboundPayments API. """ us_domestic_wire: NotRequired[ "FinancialAccount.UpdateFeaturesParamsOutboundPaymentsUsDomesticWire" ] """ Enables US domestic wire transfers via the OutboundPayments API. """ class UpdateFeaturesParamsOutboundPaymentsAch(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class UpdateFeaturesParamsOutboundPaymentsUsDomesticWire(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class UpdateFeaturesParamsOutboundTransfers(TypedDict): ach: NotRequired[ "FinancialAccount.UpdateFeaturesParamsOutboundTransfersAch" ] """ Enables ACH transfers via the OutboundTransfers API. """ us_domestic_wire: NotRequired[ "FinancialAccount.UpdateFeaturesParamsOutboundTransfersUsDomesticWire" ] """ Enables US domestic wire transfers via the OutboundTransfers API. """ class UpdateFeaturesParamsOutboundTransfersAch(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class UpdateFeaturesParamsOutboundTransfersUsDomesticWire(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ active_features: Optional[ List[ Literal[ "card_issuing", "deposit_insurance", "financial_addresses.aba", "inbound_transfers.ach", "intra_stripe_flows", "outbound_payments.ach", "outbound_payments.us_domestic_wire", "outbound_transfers.ach", "outbound_transfers.us_domestic_wire", "remote_deposit_capture", ] ] ] """ The array of paths to active Features in the Features hash. """ balance: Balance """ Balance information for the FinancialAccount """ country: str """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ features: Optional["FinancialAccountFeatures"] """ Encodes whether a FinancialAccount has access to a particular Feature, with a `status` enum and associated `status_details`. Stripe or the platform can control Features via the requested field. """ financial_addresses: List[FinancialAddress] """ The set of credentials that resolve to a FinancialAccount. """ id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ metadata: Optional[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ object: Literal["treasury.financial_account"] """ String representing the object's type. Objects of the same type share the same value. """ pending_features: Optional[ List[ Literal[ "card_issuing", "deposit_insurance", "financial_addresses.aba", "inbound_transfers.ach", "intra_stripe_flows", "outbound_payments.ach", "outbound_payments.us_domestic_wire", "outbound_transfers.ach", "outbound_transfers.us_domestic_wire", "remote_deposit_capture", ] ] ] """ The array of paths to pending Features in the Features hash. """ platform_restrictions: Optional[PlatformRestrictions] """ The set of functionalities that the platform can restrict on the FinancialAccount. """ restricted_features: Optional[ List[ Literal[ "card_issuing", "deposit_insurance", "financial_addresses.aba", "inbound_transfers.ach", "intra_stripe_flows", "outbound_payments.ach", "outbound_payments.us_domestic_wire", "outbound_transfers.ach", "outbound_transfers.us_domestic_wire", "remote_deposit_capture", ] ] ] """ The array of paths to restricted Features in the Features hash. """ status: Literal["closed", "open"] """ The enum specifying what state the account is in. """ status_details: StatusDetails supported_currencies: List[str] """ The currencies the FinancialAccount can hold a balance in. Three-letter [ISO currency code](https://www.iso.org/iso-4217-currency-codes.html), in lowercase. """ @classmethod def create( cls, **params: Unpack["FinancialAccount.CreateParams"] ) -> "FinancialAccount": """ Creates a new FinancialAccount. For now, each connected account can only have one FinancialAccount. """ return cast( "FinancialAccount", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["FinancialAccount.CreateParams"] ) -> "FinancialAccount": """ Creates a new FinancialAccount. For now, each connected account can only have one FinancialAccount. """ return cast( "FinancialAccount", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def list( cls, **params: Unpack["FinancialAccount.ListParams"] ) -> ListObject["FinancialAccount"]: """ Returns a list of FinancialAccounts. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["FinancialAccount.ListParams"] ) -> ListObject["FinancialAccount"]: """ Returns a list of FinancialAccounts. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def modify( cls, id: str, **params: Unpack["FinancialAccount.ModifyParams"] ) -> "FinancialAccount": """ Updates the details of a FinancialAccount. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "FinancialAccount", cls._static_request( "post", url, params=params, ), ) @classmethod async def modify_async( cls, id: str, **params: Unpack["FinancialAccount.ModifyParams"] ) -> "FinancialAccount": """ Updates the details of a FinancialAccount. """ url = "%s/%s" % (cls.class_url(), sanitize_id(id)) return cast( "FinancialAccount", await cls._static_request_async( "post", url, params=params, ), ) @classmethod def retrieve( cls, id: str, **params: Unpack["FinancialAccount.RetrieveParams"] ) -> "FinancialAccount": """ Retrieves the details of a FinancialAccount. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["FinancialAccount.RetrieveParams"] ) -> "FinancialAccount": """ Retrieves the details of a FinancialAccount. """ instance = cls(id, **params) await instance.refresh_async() return instance @classmethod def _cls_retrieve_features( cls, financial_account: str, **params: Unpack["FinancialAccount.RetrieveFeaturesParams"], ) -> "FinancialAccountFeatures": """ Retrieves Features information associated with the FinancialAccount. """ return cast( "FinancialAccountFeatures", cls._static_request( "get", "/v1/treasury/financial_accounts/{financial_account}/features".format( financial_account=sanitize_id(financial_account) ), params=params, ), ) @overload @staticmethod def retrieve_features( financial_account: str, **params: Unpack["FinancialAccount.RetrieveFeaturesParams"], ) -> "FinancialAccountFeatures": """ Retrieves Features information associated with the FinancialAccount. """ ... @overload def retrieve_features( self, **params: Unpack["FinancialAccount.RetrieveFeaturesParams"] ) -> "FinancialAccountFeatures": """ Retrieves Features information associated with the FinancialAccount. """ ... @class_method_variant("_cls_retrieve_features") def retrieve_features( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["FinancialAccount.RetrieveFeaturesParams"] ) -> "FinancialAccountFeatures": """ Retrieves Features information associated with the FinancialAccount. """ return cast( "FinancialAccountFeatures", self._request( "get", "/v1/treasury/financial_accounts/{financial_account}/features".format( financial_account=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_retrieve_features_async( cls, financial_account: str, **params: Unpack["FinancialAccount.RetrieveFeaturesParams"], ) -> "FinancialAccountFeatures": """ Retrieves Features information associated with the FinancialAccount. """ return cast( "FinancialAccountFeatures", await cls._static_request_async( "get", "/v1/treasury/financial_accounts/{financial_account}/features".format( financial_account=sanitize_id(financial_account) ), params=params, ), ) @overload @staticmethod async def retrieve_features_async( financial_account: str, **params: Unpack["FinancialAccount.RetrieveFeaturesParams"], ) -> "FinancialAccountFeatures": """ Retrieves Features information associated with the FinancialAccount. """ ... @overload async def retrieve_features_async( self, **params: Unpack["FinancialAccount.RetrieveFeaturesParams"] ) -> "FinancialAccountFeatures": """ Retrieves Features information associated with the FinancialAccount. """ ... @class_method_variant("_cls_retrieve_features_async") async def retrieve_features_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["FinancialAccount.RetrieveFeaturesParams"] ) -> "FinancialAccountFeatures": """ Retrieves Features information associated with the FinancialAccount. """ return cast( "FinancialAccountFeatures", await self._request_async( "get", "/v1/treasury/financial_accounts/{financial_account}/features".format( financial_account=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def _cls_update_features( cls, financial_account: str, **params: Unpack["FinancialAccount.UpdateFeaturesParams"], ) -> "FinancialAccountFeatures": """ Updates the Features associated with a FinancialAccount. """ return cast( "FinancialAccountFeatures", cls._static_request( "post", "/v1/treasury/financial_accounts/{financial_account}/features".format( financial_account=sanitize_id(financial_account) ), params=params, ), ) @overload @staticmethod def update_features( financial_account: str, **params: Unpack["FinancialAccount.UpdateFeaturesParams"], ) -> "FinancialAccountFeatures": """ Updates the Features associated with a FinancialAccount. """ ... @overload def update_features( self, **params: Unpack["FinancialAccount.UpdateFeaturesParams"] ) -> "FinancialAccountFeatures": """ Updates the Features associated with a FinancialAccount. """ ... @class_method_variant("_cls_update_features") def update_features( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["FinancialAccount.UpdateFeaturesParams"] ) -> "FinancialAccountFeatures": """ Updates the Features associated with a FinancialAccount. """ return cast( "FinancialAccountFeatures", self._request( "post", "/v1/treasury/financial_accounts/{financial_account}/features".format( financial_account=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_update_features_async( cls, financial_account: str, **params: Unpack["FinancialAccount.UpdateFeaturesParams"], ) -> "FinancialAccountFeatures": """ Updates the Features associated with a FinancialAccount. """ return cast( "FinancialAccountFeatures", await cls._static_request_async( "post", "/v1/treasury/financial_accounts/{financial_account}/features".format( financial_account=sanitize_id(financial_account) ), params=params, ), ) @overload @staticmethod async def update_features_async( financial_account: str, **params: Unpack["FinancialAccount.UpdateFeaturesParams"], ) -> "FinancialAccountFeatures": """ Updates the Features associated with a FinancialAccount. """ ... @overload async def update_features_async( self, **params: Unpack["FinancialAccount.UpdateFeaturesParams"] ) -> "FinancialAccountFeatures": """ Updates the Features associated with a FinancialAccount. """ ... @class_method_variant("_cls_update_features_async") async def update_features_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["FinancialAccount.UpdateFeaturesParams"] ) -> "FinancialAccountFeatures": """ Updates the Features associated with a FinancialAccount. """ return cast( "FinancialAccountFeatures", await self._request_async( "post", "/v1/treasury/financial_accounts/{financial_account}/features".format( financial_account=sanitize_id(self.get("id")) ), params=params, ), ) _inner_class_types = { "balance": Balance, "financial_addresses": FinancialAddress, "platform_restrictions": PlatformRestrictions, "status_details": StatusDetails, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/treasury/_financial_account_features.py0000644000175100001770000004434314637354563023767 0ustar00runnerdocker# -*- 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 FinancialAccountFeatures(StripeObject): """ Encodes whether a FinancialAccount has access to a particular Feature, with a `status` enum and associated `status_details`. Stripe or the platform can control Features via the requested field. """ OBJECT_NAME: ClassVar[Literal["treasury.financial_account_features"]] = ( "treasury.financial_account_features" ) class CardIssuing(StripeObject): class StatusDetail(StripeObject): code: Literal[ "activating", "capability_not_requested", "financial_account_closed", "rejected_other", "rejected_unsupported_business", "requirements_past_due", "requirements_pending_verification", "restricted_by_platform", "restricted_other", ] """ Represents the reason why the status is `pending` or `restricted`. """ resolution: Optional[ Literal[ "contact_stripe", "provide_information", "remove_restriction", ] ] """ Represents what the user should do, if anything, to activate the Feature. """ restriction: Optional[Literal["inbound_flows", "outbound_flows"]] """ The `platform_restrictions` that are restricting this Feature. """ requested: bool """ Whether the FinancialAccount should have the Feature. """ status: Literal["active", "pending", "restricted"] """ Whether the Feature is operational. """ status_details: List[StatusDetail] """ Additional details; includes at least one entry when the status is not `active`. """ _inner_class_types = {"status_details": StatusDetail} class DepositInsurance(StripeObject): class StatusDetail(StripeObject): code: Literal[ "activating", "capability_not_requested", "financial_account_closed", "rejected_other", "rejected_unsupported_business", "requirements_past_due", "requirements_pending_verification", "restricted_by_platform", "restricted_other", ] """ Represents the reason why the status is `pending` or `restricted`. """ resolution: Optional[ Literal[ "contact_stripe", "provide_information", "remove_restriction", ] ] """ Represents what the user should do, if anything, to activate the Feature. """ restriction: Optional[Literal["inbound_flows", "outbound_flows"]] """ The `platform_restrictions` that are restricting this Feature. """ requested: bool """ Whether the FinancialAccount should have the Feature. """ status: Literal["active", "pending", "restricted"] """ Whether the Feature is operational. """ status_details: List[StatusDetail] """ Additional details; includes at least one entry when the status is not `active`. """ _inner_class_types = {"status_details": StatusDetail} class FinancialAddresses(StripeObject): class Aba(StripeObject): class StatusDetail(StripeObject): code: Literal[ "activating", "capability_not_requested", "financial_account_closed", "rejected_other", "rejected_unsupported_business", "requirements_past_due", "requirements_pending_verification", "restricted_by_platform", "restricted_other", ] """ Represents the reason why the status is `pending` or `restricted`. """ resolution: Optional[ Literal[ "contact_stripe", "provide_information", "remove_restriction", ] ] """ Represents what the user should do, if anything, to activate the Feature. """ restriction: Optional[ Literal["inbound_flows", "outbound_flows"] ] """ The `platform_restrictions` that are restricting this Feature. """ requested: bool """ Whether the FinancialAccount should have the Feature. """ status: Literal["active", "pending", "restricted"] """ Whether the Feature is operational. """ status_details: List[StatusDetail] """ Additional details; includes at least one entry when the status is not `active`. """ _inner_class_types = {"status_details": StatusDetail} aba: Optional[Aba] """ Toggle settings for enabling/disabling the ABA address feature """ _inner_class_types = {"aba": Aba} class InboundTransfers(StripeObject): class Ach(StripeObject): class StatusDetail(StripeObject): code: Literal[ "activating", "capability_not_requested", "financial_account_closed", "rejected_other", "rejected_unsupported_business", "requirements_past_due", "requirements_pending_verification", "restricted_by_platform", "restricted_other", ] """ Represents the reason why the status is `pending` or `restricted`. """ resolution: Optional[ Literal[ "contact_stripe", "provide_information", "remove_restriction", ] ] """ Represents what the user should do, if anything, to activate the Feature. """ restriction: Optional[ Literal["inbound_flows", "outbound_flows"] ] """ The `platform_restrictions` that are restricting this Feature. """ requested: bool """ Whether the FinancialAccount should have the Feature. """ status: Literal["active", "pending", "restricted"] """ Whether the Feature is operational. """ status_details: List[StatusDetail] """ Additional details; includes at least one entry when the status is not `active`. """ _inner_class_types = {"status_details": StatusDetail} ach: Optional[Ach] """ Toggle settings for enabling/disabling an ACH specific feature """ _inner_class_types = {"ach": Ach} class IntraStripeFlows(StripeObject): class StatusDetail(StripeObject): code: Literal[ "activating", "capability_not_requested", "financial_account_closed", "rejected_other", "rejected_unsupported_business", "requirements_past_due", "requirements_pending_verification", "restricted_by_platform", "restricted_other", ] """ Represents the reason why the status is `pending` or `restricted`. """ resolution: Optional[ Literal[ "contact_stripe", "provide_information", "remove_restriction", ] ] """ Represents what the user should do, if anything, to activate the Feature. """ restriction: Optional[Literal["inbound_flows", "outbound_flows"]] """ The `platform_restrictions` that are restricting this Feature. """ requested: bool """ Whether the FinancialAccount should have the Feature. """ status: Literal["active", "pending", "restricted"] """ Whether the Feature is operational. """ status_details: List[StatusDetail] """ Additional details; includes at least one entry when the status is not `active`. """ _inner_class_types = {"status_details": StatusDetail} class OutboundPayments(StripeObject): class Ach(StripeObject): class StatusDetail(StripeObject): code: Literal[ "activating", "capability_not_requested", "financial_account_closed", "rejected_other", "rejected_unsupported_business", "requirements_past_due", "requirements_pending_verification", "restricted_by_platform", "restricted_other", ] """ Represents the reason why the status is `pending` or `restricted`. """ resolution: Optional[ Literal[ "contact_stripe", "provide_information", "remove_restriction", ] ] """ Represents what the user should do, if anything, to activate the Feature. """ restriction: Optional[ Literal["inbound_flows", "outbound_flows"] ] """ The `platform_restrictions` that are restricting this Feature. """ requested: bool """ Whether the FinancialAccount should have the Feature. """ status: Literal["active", "pending", "restricted"] """ Whether the Feature is operational. """ status_details: List[StatusDetail] """ Additional details; includes at least one entry when the status is not `active`. """ _inner_class_types = {"status_details": StatusDetail} class UsDomesticWire(StripeObject): class StatusDetail(StripeObject): code: Literal[ "activating", "capability_not_requested", "financial_account_closed", "rejected_other", "rejected_unsupported_business", "requirements_past_due", "requirements_pending_verification", "restricted_by_platform", "restricted_other", ] """ Represents the reason why the status is `pending` or `restricted`. """ resolution: Optional[ Literal[ "contact_stripe", "provide_information", "remove_restriction", ] ] """ Represents what the user should do, if anything, to activate the Feature. """ restriction: Optional[ Literal["inbound_flows", "outbound_flows"] ] """ The `platform_restrictions` that are restricting this Feature. """ requested: bool """ Whether the FinancialAccount should have the Feature. """ status: Literal["active", "pending", "restricted"] """ Whether the Feature is operational. """ status_details: List[StatusDetail] """ Additional details; includes at least one entry when the status is not `active`. """ _inner_class_types = {"status_details": StatusDetail} ach: Optional[Ach] """ Toggle settings for enabling/disabling an ACH specific feature """ us_domestic_wire: Optional[UsDomesticWire] """ Toggle settings for enabling/disabling a feature """ _inner_class_types = {"ach": Ach, "us_domestic_wire": UsDomesticWire} class OutboundTransfers(StripeObject): class Ach(StripeObject): class StatusDetail(StripeObject): code: Literal[ "activating", "capability_not_requested", "financial_account_closed", "rejected_other", "rejected_unsupported_business", "requirements_past_due", "requirements_pending_verification", "restricted_by_platform", "restricted_other", ] """ Represents the reason why the status is `pending` or `restricted`. """ resolution: Optional[ Literal[ "contact_stripe", "provide_information", "remove_restriction", ] ] """ Represents what the user should do, if anything, to activate the Feature. """ restriction: Optional[ Literal["inbound_flows", "outbound_flows"] ] """ The `platform_restrictions` that are restricting this Feature. """ requested: bool """ Whether the FinancialAccount should have the Feature. """ status: Literal["active", "pending", "restricted"] """ Whether the Feature is operational. """ status_details: List[StatusDetail] """ Additional details; includes at least one entry when the status is not `active`. """ _inner_class_types = {"status_details": StatusDetail} class UsDomesticWire(StripeObject): class StatusDetail(StripeObject): code: Literal[ "activating", "capability_not_requested", "financial_account_closed", "rejected_other", "rejected_unsupported_business", "requirements_past_due", "requirements_pending_verification", "restricted_by_platform", "restricted_other", ] """ Represents the reason why the status is `pending` or `restricted`. """ resolution: Optional[ Literal[ "contact_stripe", "provide_information", "remove_restriction", ] ] """ Represents what the user should do, if anything, to activate the Feature. """ restriction: Optional[ Literal["inbound_flows", "outbound_flows"] ] """ The `platform_restrictions` that are restricting this Feature. """ requested: bool """ Whether the FinancialAccount should have the Feature. """ status: Literal["active", "pending", "restricted"] """ Whether the Feature is operational. """ status_details: List[StatusDetail] """ Additional details; includes at least one entry when the status is not `active`. """ _inner_class_types = {"status_details": StatusDetail} ach: Optional[Ach] """ Toggle settings for enabling/disabling an ACH specific feature """ us_domestic_wire: Optional[UsDomesticWire] """ Toggle settings for enabling/disabling a feature """ _inner_class_types = {"ach": Ach, "us_domestic_wire": UsDomesticWire} card_issuing: Optional[CardIssuing] """ Toggle settings for enabling/disabling a feature """ deposit_insurance: Optional[DepositInsurance] """ Toggle settings for enabling/disabling a feature """ financial_addresses: Optional[FinancialAddresses] """ Settings related to Financial Addresses features on a Financial Account """ inbound_transfers: Optional[InboundTransfers] """ InboundTransfers contains inbound transfers features for a FinancialAccount. """ intra_stripe_flows: Optional[IntraStripeFlows] """ Toggle settings for enabling/disabling a feature """ object: Literal["treasury.financial_account_features"] """ String representing the object's type. Objects of the same type share the same value. """ outbound_payments: Optional[OutboundPayments] """ Settings related to Outbound Payments features on a Financial Account """ outbound_transfers: Optional[OutboundTransfers] """ OutboundTransfers contains outbound transfers features for a FinancialAccount. """ _inner_class_types = { "card_issuing": CardIssuing, "deposit_insurance": DepositInsurance, "financial_addresses": FinancialAddresses, "inbound_transfers": InboundTransfers, "intra_stripe_flows": IntraStripeFlows, "outbound_payments": OutboundPayments, "outbound_transfers": OutboundTransfers, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/treasury/_financial_account_features_service.py0000644000175100001770000002077214637354563025507 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.treasury._financial_account_features import ( FinancialAccountFeatures, ) from typing import List, cast from typing_extensions import NotRequired, TypedDict class FinancialAccountFeaturesService(StripeService): class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): card_issuing: NotRequired[ "FinancialAccountFeaturesService.UpdateParamsCardIssuing" ] """ Encodes the FinancialAccount's ability to be used with the Issuing product, including attaching cards to and drawing funds from the FinancialAccount. """ deposit_insurance: NotRequired[ "FinancialAccountFeaturesService.UpdateParamsDepositInsurance" ] """ Represents whether this FinancialAccount is eligible for deposit insurance. Various factors determine the insurance amount. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ financial_addresses: NotRequired[ "FinancialAccountFeaturesService.UpdateParamsFinancialAddresses" ] """ Contains Features that add FinancialAddresses to the FinancialAccount. """ inbound_transfers: NotRequired[ "FinancialAccountFeaturesService.UpdateParamsInboundTransfers" ] """ Contains settings related to adding funds to a FinancialAccount from another Account with the same owner. """ intra_stripe_flows: NotRequired[ "FinancialAccountFeaturesService.UpdateParamsIntraStripeFlows" ] """ Represents the ability for the FinancialAccount to send money to, or receive money from other FinancialAccounts (for example, via OutboundPayment). """ outbound_payments: NotRequired[ "FinancialAccountFeaturesService.UpdateParamsOutboundPayments" ] """ Includes Features related to initiating money movement out of the FinancialAccount to someone else's bucket of money. """ outbound_transfers: NotRequired[ "FinancialAccountFeaturesService.UpdateParamsOutboundTransfers" ] """ Contains a Feature and settings related to moving money out of the FinancialAccount into another Account with the same owner. """ class UpdateParamsCardIssuing(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class UpdateParamsDepositInsurance(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class UpdateParamsFinancialAddresses(TypedDict): aba: NotRequired[ "FinancialAccountFeaturesService.UpdateParamsFinancialAddressesAba" ] """ Adds an ABA FinancialAddress to the FinancialAccount. """ class UpdateParamsFinancialAddressesAba(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class UpdateParamsInboundTransfers(TypedDict): ach: NotRequired[ "FinancialAccountFeaturesService.UpdateParamsInboundTransfersAch" ] """ Enables ACH Debits via the InboundTransfers API. """ class UpdateParamsInboundTransfersAch(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class UpdateParamsIntraStripeFlows(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class UpdateParamsOutboundPayments(TypedDict): ach: NotRequired[ "FinancialAccountFeaturesService.UpdateParamsOutboundPaymentsAch" ] """ Enables ACH transfers via the OutboundPayments API. """ us_domestic_wire: NotRequired[ "FinancialAccountFeaturesService.UpdateParamsOutboundPaymentsUsDomesticWire" ] """ Enables US domestic wire transfers via the OutboundPayments API. """ class UpdateParamsOutboundPaymentsAch(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class UpdateParamsOutboundPaymentsUsDomesticWire(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class UpdateParamsOutboundTransfers(TypedDict): ach: NotRequired[ "FinancialAccountFeaturesService.UpdateParamsOutboundTransfersAch" ] """ Enables ACH transfers via the OutboundTransfers API. """ us_domestic_wire: NotRequired[ "FinancialAccountFeaturesService.UpdateParamsOutboundTransfersUsDomesticWire" ] """ Enables US domestic wire transfers via the OutboundTransfers API. """ class UpdateParamsOutboundTransfersAch(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class UpdateParamsOutboundTransfersUsDomesticWire(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ def update( self, financial_account: str, params: "FinancialAccountFeaturesService.UpdateParams" = {}, options: RequestOptions = {}, ) -> FinancialAccountFeatures: """ Updates the Features associated with a FinancialAccount. """ return cast( FinancialAccountFeatures, self._request( "post", "/v1/treasury/financial_accounts/{financial_account}/features".format( financial_account=sanitize_id(financial_account), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, financial_account: str, params: "FinancialAccountFeaturesService.UpdateParams" = {}, options: RequestOptions = {}, ) -> FinancialAccountFeatures: """ Updates the Features associated with a FinancialAccount. """ return cast( FinancialAccountFeatures, await self._request_async( "post", "/v1/treasury/financial_accounts/{financial_account}/features".format( financial_account=sanitize_id(financial_account), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, financial_account: str, params: "FinancialAccountFeaturesService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> FinancialAccountFeatures: """ Retrieves Features information associated with the FinancialAccount. """ return cast( FinancialAccountFeatures, self._request( "get", "/v1/treasury/financial_accounts/{financial_account}/features".format( financial_account=sanitize_id(financial_account), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, financial_account: str, params: "FinancialAccountFeaturesService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> FinancialAccountFeatures: """ Retrieves Features information associated with the FinancialAccount. """ return cast( FinancialAccountFeatures, await self._request_async( "get", "/v1/treasury/financial_accounts/{financial_account}/features".format( financial_account=sanitize_id(financial_account), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/treasury/_financial_account_service.py0000644000175100001770000004745714637354563023622 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.treasury._financial_account import FinancialAccount from stripe.treasury._financial_account_features_service import ( FinancialAccountFeaturesService, ) from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class FinancialAccountService(StripeService): def __init__(self, requestor): super().__init__(requestor) self.features = FinancialAccountFeaturesService(self._requestor) class CreateParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ features: NotRequired["FinancialAccountService.CreateParamsFeatures"] """ Encodes whether a FinancialAccount has access to a particular feature. Stripe or the platform can control features via the requested field. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ platform_restrictions: NotRequired[ "FinancialAccountService.CreateParamsPlatformRestrictions" ] """ The set of functionalities that the platform can restrict on the FinancialAccount. """ supported_currencies: List[str] """ The currencies the FinancialAccount can hold a balance in. """ class CreateParamsFeatures(TypedDict): card_issuing: NotRequired[ "FinancialAccountService.CreateParamsFeaturesCardIssuing" ] """ Encodes the FinancialAccount's ability to be used with the Issuing product, including attaching cards to and drawing funds from the FinancialAccount. """ deposit_insurance: NotRequired[ "FinancialAccountService.CreateParamsFeaturesDepositInsurance" ] """ Represents whether this FinancialAccount is eligible for deposit insurance. Various factors determine the insurance amount. """ financial_addresses: NotRequired[ "FinancialAccountService.CreateParamsFeaturesFinancialAddresses" ] """ Contains Features that add FinancialAddresses to the FinancialAccount. """ inbound_transfers: NotRequired[ "FinancialAccountService.CreateParamsFeaturesInboundTransfers" ] """ Contains settings related to adding funds to a FinancialAccount from another Account with the same owner. """ intra_stripe_flows: NotRequired[ "FinancialAccountService.CreateParamsFeaturesIntraStripeFlows" ] """ Represents the ability for the FinancialAccount to send money to, or receive money from other FinancialAccounts (for example, via OutboundPayment). """ outbound_payments: NotRequired[ "FinancialAccountService.CreateParamsFeaturesOutboundPayments" ] """ Includes Features related to initiating money movement out of the FinancialAccount to someone else's bucket of money. """ outbound_transfers: NotRequired[ "FinancialAccountService.CreateParamsFeaturesOutboundTransfers" ] """ Contains a Feature and settings related to moving money out of the FinancialAccount into another Account with the same owner. """ class CreateParamsFeaturesCardIssuing(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class CreateParamsFeaturesDepositInsurance(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class CreateParamsFeaturesFinancialAddresses(TypedDict): aba: NotRequired[ "FinancialAccountService.CreateParamsFeaturesFinancialAddressesAba" ] """ Adds an ABA FinancialAddress to the FinancialAccount. """ class CreateParamsFeaturesFinancialAddressesAba(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class CreateParamsFeaturesInboundTransfers(TypedDict): ach: NotRequired[ "FinancialAccountService.CreateParamsFeaturesInboundTransfersAch" ] """ Enables ACH Debits via the InboundTransfers API. """ class CreateParamsFeaturesInboundTransfersAch(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class CreateParamsFeaturesIntraStripeFlows(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class CreateParamsFeaturesOutboundPayments(TypedDict): ach: NotRequired[ "FinancialAccountService.CreateParamsFeaturesOutboundPaymentsAch" ] """ Enables ACH transfers via the OutboundPayments API. """ us_domestic_wire: NotRequired[ "FinancialAccountService.CreateParamsFeaturesOutboundPaymentsUsDomesticWire" ] """ Enables US domestic wire transfers via the OutboundPayments API. """ class CreateParamsFeaturesOutboundPaymentsAch(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class CreateParamsFeaturesOutboundPaymentsUsDomesticWire(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class CreateParamsFeaturesOutboundTransfers(TypedDict): ach: NotRequired[ "FinancialAccountService.CreateParamsFeaturesOutboundTransfersAch" ] """ Enables ACH transfers via the OutboundTransfers API. """ us_domestic_wire: NotRequired[ "FinancialAccountService.CreateParamsFeaturesOutboundTransfersUsDomesticWire" ] """ Enables US domestic wire transfers via the OutboundTransfers API. """ class CreateParamsFeaturesOutboundTransfersAch(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class CreateParamsFeaturesOutboundTransfersUsDomesticWire(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class CreateParamsPlatformRestrictions(TypedDict): inbound_flows: NotRequired[Literal["restricted", "unrestricted"]] """ Restricts all inbound money movement. """ outbound_flows: NotRequired[Literal["restricted", "unrestricted"]] """ Restricts all outbound money movement. """ class ListParams(TypedDict): created: NotRequired["FinancialAccountService.ListParamsCreated|int"] """ Only return FinancialAccounts that were created during the given date interval. """ ending_before: NotRequired[str] """ An object ID cursor for use in pagination. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ limit: NotRequired[int] """ A limit ranging from 1 to 100 (defaults to 10). """ starting_after: NotRequired[str] """ An object ID cursor for use in pagination. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class UpdateParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ features: NotRequired["FinancialAccountService.UpdateParamsFeatures"] """ Encodes whether a FinancialAccount has access to a particular feature, with a status enum and associated `status_details`. Stripe or the platform may control features via the requested field. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ platform_restrictions: NotRequired[ "FinancialAccountService.UpdateParamsPlatformRestrictions" ] """ The set of functionalities that the platform can restrict on the FinancialAccount. """ class UpdateParamsFeatures(TypedDict): card_issuing: NotRequired[ "FinancialAccountService.UpdateParamsFeaturesCardIssuing" ] """ Encodes the FinancialAccount's ability to be used with the Issuing product, including attaching cards to and drawing funds from the FinancialAccount. """ deposit_insurance: NotRequired[ "FinancialAccountService.UpdateParamsFeaturesDepositInsurance" ] """ Represents whether this FinancialAccount is eligible for deposit insurance. Various factors determine the insurance amount. """ financial_addresses: NotRequired[ "FinancialAccountService.UpdateParamsFeaturesFinancialAddresses" ] """ Contains Features that add FinancialAddresses to the FinancialAccount. """ inbound_transfers: NotRequired[ "FinancialAccountService.UpdateParamsFeaturesInboundTransfers" ] """ Contains settings related to adding funds to a FinancialAccount from another Account with the same owner. """ intra_stripe_flows: NotRequired[ "FinancialAccountService.UpdateParamsFeaturesIntraStripeFlows" ] """ Represents the ability for the FinancialAccount to send money to, or receive money from other FinancialAccounts (for example, via OutboundPayment). """ outbound_payments: NotRequired[ "FinancialAccountService.UpdateParamsFeaturesOutboundPayments" ] """ Includes Features related to initiating money movement out of the FinancialAccount to someone else's bucket of money. """ outbound_transfers: NotRequired[ "FinancialAccountService.UpdateParamsFeaturesOutboundTransfers" ] """ Contains a Feature and settings related to moving money out of the FinancialAccount into another Account with the same owner. """ class UpdateParamsFeaturesCardIssuing(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class UpdateParamsFeaturesDepositInsurance(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class UpdateParamsFeaturesFinancialAddresses(TypedDict): aba: NotRequired[ "FinancialAccountService.UpdateParamsFeaturesFinancialAddressesAba" ] """ Adds an ABA FinancialAddress to the FinancialAccount. """ class UpdateParamsFeaturesFinancialAddressesAba(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class UpdateParamsFeaturesInboundTransfers(TypedDict): ach: NotRequired[ "FinancialAccountService.UpdateParamsFeaturesInboundTransfersAch" ] """ Enables ACH Debits via the InboundTransfers API. """ class UpdateParamsFeaturesInboundTransfersAch(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class UpdateParamsFeaturesIntraStripeFlows(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class UpdateParamsFeaturesOutboundPayments(TypedDict): ach: NotRequired[ "FinancialAccountService.UpdateParamsFeaturesOutboundPaymentsAch" ] """ Enables ACH transfers via the OutboundPayments API. """ us_domestic_wire: NotRequired[ "FinancialAccountService.UpdateParamsFeaturesOutboundPaymentsUsDomesticWire" ] """ Enables US domestic wire transfers via the OutboundPayments API. """ class UpdateParamsFeaturesOutboundPaymentsAch(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class UpdateParamsFeaturesOutboundPaymentsUsDomesticWire(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class UpdateParamsFeaturesOutboundTransfers(TypedDict): ach: NotRequired[ "FinancialAccountService.UpdateParamsFeaturesOutboundTransfersAch" ] """ Enables ACH transfers via the OutboundTransfers API. """ us_domestic_wire: NotRequired[ "FinancialAccountService.UpdateParamsFeaturesOutboundTransfersUsDomesticWire" ] """ Enables US domestic wire transfers via the OutboundTransfers API. """ class UpdateParamsFeaturesOutboundTransfersAch(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class UpdateParamsFeaturesOutboundTransfersUsDomesticWire(TypedDict): requested: bool """ Whether the FinancialAccount should have the Feature. """ class UpdateParamsPlatformRestrictions(TypedDict): inbound_flows: NotRequired[Literal["restricted", "unrestricted"]] """ Restricts all inbound money movement. """ outbound_flows: NotRequired[Literal["restricted", "unrestricted"]] """ Restricts all outbound money movement. """ def list( self, params: "FinancialAccountService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[FinancialAccount]: """ Returns a list of FinancialAccounts. """ return cast( ListObject[FinancialAccount], self._request( "get", "/v1/treasury/financial_accounts", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "FinancialAccountService.ListParams" = {}, options: RequestOptions = {}, ) -> ListObject[FinancialAccount]: """ Returns a list of FinancialAccounts. """ return cast( ListObject[FinancialAccount], await self._request_async( "get", "/v1/treasury/financial_accounts", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "FinancialAccountService.CreateParams", options: RequestOptions = {}, ) -> FinancialAccount: """ Creates a new FinancialAccount. For now, each connected account can only have one FinancialAccount. """ return cast( FinancialAccount, self._request( "post", "/v1/treasury/financial_accounts", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "FinancialAccountService.CreateParams", options: RequestOptions = {}, ) -> FinancialAccount: """ Creates a new FinancialAccount. For now, each connected account can only have one FinancialAccount. """ return cast( FinancialAccount, await self._request_async( "post", "/v1/treasury/financial_accounts", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, financial_account: str, params: "FinancialAccountService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> FinancialAccount: """ Retrieves the details of a FinancialAccount. """ return cast( FinancialAccount, self._request( "get", "/v1/treasury/financial_accounts/{financial_account}".format( financial_account=sanitize_id(financial_account), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, financial_account: str, params: "FinancialAccountService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> FinancialAccount: """ Retrieves the details of a FinancialAccount. """ return cast( FinancialAccount, await self._request_async( "get", "/v1/treasury/financial_accounts/{financial_account}".format( financial_account=sanitize_id(financial_account), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def update( self, financial_account: str, params: "FinancialAccountService.UpdateParams" = {}, options: RequestOptions = {}, ) -> FinancialAccount: """ Updates the details of a FinancialAccount. """ return cast( FinancialAccount, self._request( "post", "/v1/treasury/financial_accounts/{financial_account}".format( financial_account=sanitize_id(financial_account), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def update_async( self, financial_account: str, params: "FinancialAccountService.UpdateParams" = {}, options: RequestOptions = {}, ) -> FinancialAccount: """ Updates the details of a FinancialAccount. """ return cast( FinancialAccount, await self._request_async( "post", "/v1/treasury/financial_accounts/{financial_account}".format( financial_account=sanitize_id(financial_account), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/treasury/_inbound_transfer.py0000644000175100001770000010054314637354563021766 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._test_helpers import APIResourceTestHelpers from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, NotRequired, Type, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._mandate import Mandate from stripe.treasury._transaction import Transaction class InboundTransfer( CreateableAPIResource["InboundTransfer"], ListableAPIResource["InboundTransfer"], ): """ Use [InboundTransfers](https://stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) to add funds to your [FinancialAccount](https://stripe.com/docs/api#financial_accounts) via a PaymentMethod that is owned by you. The funds will be transferred via an ACH debit. """ OBJECT_NAME: ClassVar[Literal["treasury.inbound_transfer"]] = ( "treasury.inbound_transfer" ) class FailureDetails(StripeObject): code: Literal[ "account_closed", "account_frozen", "bank_account_restricted", "bank_ownership_changed", "debit_not_authorized", "incorrect_account_holder_address", "incorrect_account_holder_name", "incorrect_account_holder_tax_id", "insufficient_funds", "invalid_account_number", "invalid_currency", "no_account", "other", ] """ Reason for the failure. """ class LinkedFlows(StripeObject): received_debit: Optional[str] """ If funds for this flow were returned after the flow went to the `succeeded` state, this field contains a reference to the ReceivedDebit return. """ class OriginPaymentMethodDetails(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 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State, county, province, or region. """ address: Address email: Optional[str] """ Email address. """ name: Optional[str] """ Full name. """ _inner_class_types = {"address": Address} class UsBankAccount(StripeObject): account_holder_type: Optional[Literal["company", "individual"]] """ Account holder type: individual or company. """ account_type: Optional[Literal["checking", "savings"]] """ Account type: checkings or savings. Defaults to checking if omitted. """ bank_name: Optional[str] """ Name of the bank associated with the bank account. """ fingerprint: Optional[str] """ Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. """ last4: Optional[str] """ Last four digits of the bank account number. """ mandate: Optional[ExpandableField["Mandate"]] """ ID of the mandate used to make this payment. """ network: Literal["ach"] """ The network rails used. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. """ routing_number: Optional[str] """ Routing number of the bank account. """ billing_details: BillingDetails type: Literal["us_bank_account"] """ The type of the payment method used in the InboundTransfer. """ us_bank_account: Optional[UsBankAccount] _inner_class_types = { "billing_details": BillingDetails, "us_bank_account": UsBankAccount, } class StatusTransitions(StripeObject): canceled_at: Optional[int] """ Timestamp describing when an InboundTransfer changed status to `canceled`. """ failed_at: Optional[int] """ Timestamp describing when an InboundTransfer changed status to `failed`. """ succeeded_at: Optional[int] """ Timestamp describing when an InboundTransfer changed status to `succeeded`. """ class CancelParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CreateParams(RequestOptions): amount: int """ Amount (in cents) to be transferred. """ 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 string attached to the object. Often useful for displaying to users. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ financial_account: str """ The FinancialAccount to send funds to. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ origin_payment_method: str """ The origin payment method to be debited for the InboundTransfer. """ statement_descriptor: NotRequired[str] """ The complete description that appears on your customers' statements. Maximum 10 characters. """ class FailParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ failure_details: NotRequired[ "InboundTransfer.FailParamsFailureDetails" ] """ Details about a failed InboundTransfer. """ class FailParamsFailureDetails(TypedDict): code: NotRequired[ Literal[ "account_closed", "account_frozen", "bank_account_restricted", "bank_ownership_changed", "debit_not_authorized", "incorrect_account_holder_address", "incorrect_account_holder_name", "incorrect_account_holder_tax_id", "insufficient_funds", "invalid_account_number", "invalid_currency", "no_account", "other", ] ] """ Reason for the failure. """ class ListParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ financial_account: str """ Returns objects associated with this FinancialAccount. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ Literal["canceled", "failed", "processing", "succeeded"] ] """ Only return InboundTransfers that have the given status: `processing`, `succeeded`, `failed` or `canceled`. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ReturnInboundTransferParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class SucceedParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ amount: int """ Amount (in cents) transferred. """ cancelable: bool """ Returns `true` if the InboundTransfer is able to be canceled. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ 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. """ failure_details: Optional[FailureDetails] """ Details about this InboundTransfer's failure. Only set when status is `failed`. """ financial_account: str """ The FinancialAccount that received the funds. """ hosted_regulatory_receipt_url: Optional[str] """ A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. """ id: str """ Unique identifier for the object. """ linked_flows: LinkedFlows livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ metadata: Dict[str, str] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ object: Literal["treasury.inbound_transfer"] """ String representing the object's type. Objects of the same type share the same value. """ origin_payment_method: str """ The origin payment method to be debited for an InboundTransfer. """ origin_payment_method_details: Optional[OriginPaymentMethodDetails] """ Details about the PaymentMethod for an InboundTransfer. """ returned: Optional[bool] """ Returns `true` if the funds for an InboundTransfer were returned after the InboundTransfer went to the `succeeded` state. """ statement_descriptor: str """ Statement descriptor shown when funds are debited from the source. Not all payment networks support `statement_descriptor`. """ status: Literal["canceled", "failed", "processing", "succeeded"] """ Status of the InboundTransfer: `processing`, `succeeded`, `failed`, and `canceled`. An InboundTransfer is `processing` if it is created and pending. The status changes to `succeeded` once the funds have been "confirmed" and a `transaction` is created and posted. The status changes to `failed` if the transfer fails. """ status_transitions: StatusTransitions transaction: Optional[ExpandableField["Transaction"]] """ The Transaction associated with this object. """ @classmethod def _cls_cancel( cls, inbound_transfer: str, **params: Unpack["InboundTransfer.CancelParams"], ) -> "InboundTransfer": """ Cancels an InboundTransfer. """ return cast( "InboundTransfer", cls._static_request( "post", "/v1/treasury/inbound_transfers/{inbound_transfer}/cancel".format( inbound_transfer=sanitize_id(inbound_transfer) ), params=params, ), ) @overload @staticmethod def cancel( inbound_transfer: str, **params: Unpack["InboundTransfer.CancelParams"] ) -> "InboundTransfer": """ Cancels an InboundTransfer. """ ... @overload def cancel( self, **params: Unpack["InboundTransfer.CancelParams"] ) -> "InboundTransfer": """ Cancels an InboundTransfer. """ ... @class_method_variant("_cls_cancel") def cancel( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["InboundTransfer.CancelParams"] ) -> "InboundTransfer": """ Cancels an InboundTransfer. """ return cast( "InboundTransfer", self._request( "post", "/v1/treasury/inbound_transfers/{inbound_transfer}/cancel".format( inbound_transfer=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_cancel_async( cls, inbound_transfer: str, **params: Unpack["InboundTransfer.CancelParams"], ) -> "InboundTransfer": """ Cancels an InboundTransfer. """ return cast( "InboundTransfer", await cls._static_request_async( "post", "/v1/treasury/inbound_transfers/{inbound_transfer}/cancel".format( inbound_transfer=sanitize_id(inbound_transfer) ), params=params, ), ) @overload @staticmethod async def cancel_async( inbound_transfer: str, **params: Unpack["InboundTransfer.CancelParams"] ) -> "InboundTransfer": """ Cancels an InboundTransfer. """ ... @overload async def cancel_async( self, **params: Unpack["InboundTransfer.CancelParams"] ) -> "InboundTransfer": """ Cancels an InboundTransfer. """ ... @class_method_variant("_cls_cancel_async") async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["InboundTransfer.CancelParams"] ) -> "InboundTransfer": """ Cancels an InboundTransfer. """ return cast( "InboundTransfer", await self._request_async( "post", "/v1/treasury/inbound_transfers/{inbound_transfer}/cancel".format( inbound_transfer=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def create( cls, **params: Unpack["InboundTransfer.CreateParams"] ) -> "InboundTransfer": """ Creates an InboundTransfer. """ return cast( "InboundTransfer", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["InboundTransfer.CreateParams"] ) -> "InboundTransfer": """ Creates an InboundTransfer. """ return cast( "InboundTransfer", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def list( cls, **params: Unpack["InboundTransfer.ListParams"] ) -> ListObject["InboundTransfer"]: """ Returns a list of InboundTransfers sent from the specified FinancialAccount. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["InboundTransfer.ListParams"] ) -> ListObject["InboundTransfer"]: """ Returns a list of InboundTransfers sent from the specified FinancialAccount. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def retrieve( cls, id: str, **params: Unpack["InboundTransfer.RetrieveParams"] ) -> "InboundTransfer": """ Retrieves the details of an existing InboundTransfer. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["InboundTransfer.RetrieveParams"] ) -> "InboundTransfer": """ Retrieves the details of an existing InboundTransfer. """ instance = cls(id, **params) await instance.refresh_async() return instance class TestHelpers(APIResourceTestHelpers["InboundTransfer"]): _resource_cls: Type["InboundTransfer"] @classmethod def _cls_fail( cls, id: str, **params: Unpack["InboundTransfer.FailParams"] ) -> "InboundTransfer": """ Transitions a test mode created InboundTransfer to the failed status. The InboundTransfer must already be in the processing state. """ return cast( "InboundTransfer", cls._static_request( "post", "/v1/test_helpers/treasury/inbound_transfers/{id}/fail".format( id=sanitize_id(id) ), params=params, ), ) @overload @staticmethod def fail( id: str, **params: Unpack["InboundTransfer.FailParams"] ) -> "InboundTransfer": """ Transitions a test mode created InboundTransfer to the failed status. The InboundTransfer must already be in the processing state. """ ... @overload def fail( self, **params: Unpack["InboundTransfer.FailParams"] ) -> "InboundTransfer": """ Transitions a test mode created InboundTransfer to the failed status. The InboundTransfer must already be in the processing state. """ ... @class_method_variant("_cls_fail") def fail( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["InboundTransfer.FailParams"] ) -> "InboundTransfer": """ Transitions a test mode created InboundTransfer to the failed status. The InboundTransfer must already be in the processing state. """ return cast( "InboundTransfer", self.resource._request( "post", "/v1/test_helpers/treasury/inbound_transfers/{id}/fail".format( id=sanitize_id(self.resource.get("id")) ), params=params, ), ) @classmethod async def _cls_fail_async( cls, id: str, **params: Unpack["InboundTransfer.FailParams"] ) -> "InboundTransfer": """ Transitions a test mode created InboundTransfer to the failed status. The InboundTransfer must already be in the processing state. """ return cast( "InboundTransfer", await cls._static_request_async( "post", "/v1/test_helpers/treasury/inbound_transfers/{id}/fail".format( id=sanitize_id(id) ), params=params, ), ) @overload @staticmethod async def fail_async( id: str, **params: Unpack["InboundTransfer.FailParams"] ) -> "InboundTransfer": """ Transitions a test mode created InboundTransfer to the failed status. The InboundTransfer must already be in the processing state. """ ... @overload async def fail_async( self, **params: Unpack["InboundTransfer.FailParams"] ) -> "InboundTransfer": """ Transitions a test mode created InboundTransfer to the failed status. The InboundTransfer must already be in the processing state. """ ... @class_method_variant("_cls_fail_async") async def fail_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["InboundTransfer.FailParams"] ) -> "InboundTransfer": """ Transitions a test mode created InboundTransfer to the failed status. The InboundTransfer must already be in the processing state. """ return cast( "InboundTransfer", await self.resource._request_async( "post", "/v1/test_helpers/treasury/inbound_transfers/{id}/fail".format( id=sanitize_id(self.resource.get("id")) ), params=params, ), ) @classmethod def _cls_return_inbound_transfer( cls, id: str, **params: Unpack["InboundTransfer.ReturnInboundTransferParams"], ) -> "InboundTransfer": """ Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a ReceivedDebit. The InboundTransfer must already be in the succeeded state. """ return cast( "InboundTransfer", cls._static_request( "post", "/v1/test_helpers/treasury/inbound_transfers/{id}/return".format( id=sanitize_id(id) ), params=params, ), ) @overload @staticmethod def return_inbound_transfer( id: str, **params: Unpack["InboundTransfer.ReturnInboundTransferParams"], ) -> "InboundTransfer": """ Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a ReceivedDebit. The InboundTransfer must already be in the succeeded state. """ ... @overload def return_inbound_transfer( self, **params: Unpack["InboundTransfer.ReturnInboundTransferParams"], ) -> "InboundTransfer": """ Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a ReceivedDebit. The InboundTransfer must already be in the succeeded state. """ ... @class_method_variant("_cls_return_inbound_transfer") def return_inbound_transfer( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["InboundTransfer.ReturnInboundTransferParams"], ) -> "InboundTransfer": """ Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a ReceivedDebit. The InboundTransfer must already be in the succeeded state. """ return cast( "InboundTransfer", self.resource._request( "post", "/v1/test_helpers/treasury/inbound_transfers/{id}/return".format( id=sanitize_id(self.resource.get("id")) ), params=params, ), ) @classmethod async def _cls_return_inbound_transfer_async( cls, id: str, **params: Unpack["InboundTransfer.ReturnInboundTransferParams"], ) -> "InboundTransfer": """ Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a ReceivedDebit. The InboundTransfer must already be in the succeeded state. """ return cast( "InboundTransfer", await cls._static_request_async( "post", "/v1/test_helpers/treasury/inbound_transfers/{id}/return".format( id=sanitize_id(id) ), params=params, ), ) @overload @staticmethod async def return_inbound_transfer_async( id: str, **params: Unpack["InboundTransfer.ReturnInboundTransferParams"], ) -> "InboundTransfer": """ Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a ReceivedDebit. The InboundTransfer must already be in the succeeded state. """ ... @overload async def return_inbound_transfer_async( self, **params: Unpack["InboundTransfer.ReturnInboundTransferParams"], ) -> "InboundTransfer": """ Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a ReceivedDebit. The InboundTransfer must already be in the succeeded state. """ ... @class_method_variant("_cls_return_inbound_transfer_async") async def return_inbound_transfer_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["InboundTransfer.ReturnInboundTransferParams"], ) -> "InboundTransfer": """ Marks the test mode InboundTransfer object as returned and links the InboundTransfer to a ReceivedDebit. The InboundTransfer must already be in the succeeded state. """ return cast( "InboundTransfer", await self.resource._request_async( "post", "/v1/test_helpers/treasury/inbound_transfers/{id}/return".format( id=sanitize_id(self.resource.get("id")) ), params=params, ), ) @classmethod def _cls_succeed( cls, id: str, **params: Unpack["InboundTransfer.SucceedParams"] ) -> "InboundTransfer": """ Transitions a test mode created InboundTransfer to the succeeded status. The InboundTransfer must already be in the processing state. """ return cast( "InboundTransfer", cls._static_request( "post", "/v1/test_helpers/treasury/inbound_transfers/{id}/succeed".format( id=sanitize_id(id) ), params=params, ), ) @overload @staticmethod def succeed( id: str, **params: Unpack["InboundTransfer.SucceedParams"] ) -> "InboundTransfer": """ Transitions a test mode created InboundTransfer to the succeeded status. The InboundTransfer must already be in the processing state. """ ... @overload def succeed( self, **params: Unpack["InboundTransfer.SucceedParams"] ) -> "InboundTransfer": """ Transitions a test mode created InboundTransfer to the succeeded status. The InboundTransfer must already be in the processing state. """ ... @class_method_variant("_cls_succeed") def succeed( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["InboundTransfer.SucceedParams"] ) -> "InboundTransfer": """ Transitions a test mode created InboundTransfer to the succeeded status. The InboundTransfer must already be in the processing state. """ return cast( "InboundTransfer", self.resource._request( "post", "/v1/test_helpers/treasury/inbound_transfers/{id}/succeed".format( id=sanitize_id(self.resource.get("id")) ), params=params, ), ) @classmethod async def _cls_succeed_async( cls, id: str, **params: Unpack["InboundTransfer.SucceedParams"] ) -> "InboundTransfer": """ Transitions a test mode created InboundTransfer to the succeeded status. The InboundTransfer must already be in the processing state. """ return cast( "InboundTransfer", await cls._static_request_async( "post", "/v1/test_helpers/treasury/inbound_transfers/{id}/succeed".format( id=sanitize_id(id) ), params=params, ), ) @overload @staticmethod async def succeed_async( id: str, **params: Unpack["InboundTransfer.SucceedParams"] ) -> "InboundTransfer": """ Transitions a test mode created InboundTransfer to the succeeded status. The InboundTransfer must already be in the processing state. """ ... @overload async def succeed_async( self, **params: Unpack["InboundTransfer.SucceedParams"] ) -> "InboundTransfer": """ Transitions a test mode created InboundTransfer to the succeeded status. The InboundTransfer must already be in the processing state. """ ... @class_method_variant("_cls_succeed_async") async def succeed_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["InboundTransfer.SucceedParams"] ) -> "InboundTransfer": """ Transitions a test mode created InboundTransfer to the succeeded status. The InboundTransfer must already be in the processing state. """ return cast( "InboundTransfer", await self.resource._request_async( "post", "/v1/test_helpers/treasury/inbound_transfers/{id}/succeed".format( id=sanitize_id(self.resource.get("id")) ), params=params, ), ) @property def test_helpers(self): return self.TestHelpers(self) _inner_class_types = { "failure_details": FailureDetails, "linked_flows": LinkedFlows, "origin_payment_method_details": OriginPaymentMethodDetails, "status_transitions": StatusTransitions, } InboundTransfer.TestHelpers._resource_cls = InboundTransfer ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/treasury/_inbound_transfer_service.py0000644000175100001770000002057614637354563023515 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.treasury._inbound_transfer import InboundTransfer from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class InboundTransferService(StripeService): class CancelParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CreateParams(TypedDict): amount: int """ Amount (in cents) to be transferred. """ 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 string attached to the object. Often useful for displaying to users. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ financial_account: str """ The FinancialAccount to send funds to. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ origin_payment_method: str """ The origin payment method to be debited for the InboundTransfer. """ statement_descriptor: NotRequired[str] """ The complete description that appears on your customers' statements. Maximum 10 characters. """ class ListParams(TypedDict): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ financial_account: str """ Returns objects associated with this FinancialAccount. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ Literal["canceled", "failed", "processing", "succeeded"] ] """ Only return InboundTransfers that have the given status: `processing`, `succeeded`, `failed` or `canceled`. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def list( self, params: "InboundTransferService.ListParams", options: RequestOptions = {}, ) -> ListObject[InboundTransfer]: """ Returns a list of InboundTransfers sent from the specified FinancialAccount. """ return cast( ListObject[InboundTransfer], self._request( "get", "/v1/treasury/inbound_transfers", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "InboundTransferService.ListParams", options: RequestOptions = {}, ) -> ListObject[InboundTransfer]: """ Returns a list of InboundTransfers sent from the specified FinancialAccount. """ return cast( ListObject[InboundTransfer], await self._request_async( "get", "/v1/treasury/inbound_transfers", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "InboundTransferService.CreateParams", options: RequestOptions = {}, ) -> InboundTransfer: """ Creates an InboundTransfer. """ return cast( InboundTransfer, self._request( "post", "/v1/treasury/inbound_transfers", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "InboundTransferService.CreateParams", options: RequestOptions = {}, ) -> InboundTransfer: """ Creates an InboundTransfer. """ return cast( InboundTransfer, await self._request_async( "post", "/v1/treasury/inbound_transfers", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, id: str, params: "InboundTransferService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> InboundTransfer: """ Retrieves the details of an existing InboundTransfer. """ return cast( InboundTransfer, self._request( "get", "/v1/treasury/inbound_transfers/{id}".format( id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, id: str, params: "InboundTransferService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> InboundTransfer: """ Retrieves the details of an existing InboundTransfer. """ return cast( InboundTransfer, await self._request_async( "get", "/v1/treasury/inbound_transfers/{id}".format( id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def cancel( self, inbound_transfer: str, params: "InboundTransferService.CancelParams" = {}, options: RequestOptions = {}, ) -> InboundTransfer: """ Cancels an InboundTransfer. """ return cast( InboundTransfer, self._request( "post", "/v1/treasury/inbound_transfers/{inbound_transfer}/cancel".format( inbound_transfer=sanitize_id(inbound_transfer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def cancel_async( self, inbound_transfer: str, params: "InboundTransferService.CancelParams" = {}, options: RequestOptions = {}, ) -> InboundTransfer: """ Cancels an InboundTransfer. """ return cast( InboundTransfer, await self._request_async( "post", "/v1/treasury/inbound_transfers/{inbound_transfer}/cancel".format( inbound_transfer=sanitize_id(inbound_transfer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/treasury/_outbound_payment.py0000644000175100001770000013463214637354563022026 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._test_helpers import APIResourceTestHelpers from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, NotRequired, Type, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._mandate import Mandate from stripe.treasury._transaction import Transaction class OutboundPayment( CreateableAPIResource["OutboundPayment"], ListableAPIResource["OutboundPayment"], ): """ Use OutboundPayments to send funds to another party's external bank account or [FinancialAccount](https://stripe.com/docs/api#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://stripe.com/docs/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. """ OBJECT_NAME: ClassVar[Literal["treasury.outbound_payment"]] = ( "treasury.outbound_payment" ) class DestinationPaymentMethodDetails(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 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State, county, province, or region. """ address: Address email: Optional[str] """ Email address. """ name: Optional[str] """ Full name. """ _inner_class_types = {"address": Address} class FinancialAccount(StripeObject): id: str """ Token of the FinancialAccount. """ network: Literal["stripe"] """ The rails used to send funds. """ class UsBankAccount(StripeObject): account_holder_type: Optional[Literal["company", "individual"]] """ Account holder type: individual or company. """ account_type: Optional[Literal["checking", "savings"]] """ Account type: checkings or savings. Defaults to checking if omitted. """ bank_name: Optional[str] """ Name of the bank associated with the bank account. """ fingerprint: Optional[str] """ Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. """ last4: Optional[str] """ Last four digits of the bank account number. """ mandate: Optional[ExpandableField["Mandate"]] """ ID of the mandate used to make this payment. """ network: Literal["ach", "us_domestic_wire"] """ The network rails used. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. """ routing_number: Optional[str] """ Routing number of the bank account. """ billing_details: BillingDetails financial_account: Optional[FinancialAccount] type: Literal["financial_account", "us_bank_account"] """ The type of the payment method used in the OutboundPayment. """ us_bank_account: Optional[UsBankAccount] _inner_class_types = { "billing_details": BillingDetails, "financial_account": FinancialAccount, "us_bank_account": UsBankAccount, } class EndUserDetails(StripeObject): ip_address: Optional[str] """ IP address of the user initiating the OutboundPayment. Set if `present` is set to `true`. IP address collection is required for risk and compliance reasons. This will be used to help determine if the OutboundPayment is authorized or should be blocked. """ present: bool """ `true` if the OutboundPayment creation request is being made on behalf of an end user by a platform. Otherwise, `false`. """ class ReturnedDetails(StripeObject): code: Literal[ "account_closed", "account_frozen", "bank_account_restricted", "bank_ownership_changed", "declined", "incorrect_account_holder_name", "invalid_account_number", "invalid_currency", "no_account", "other", ] """ Reason for the return. """ transaction: ExpandableField["Transaction"] """ The Transaction associated with this object. """ class StatusTransitions(StripeObject): canceled_at: Optional[int] """ Timestamp describing when an OutboundPayment changed status to `canceled`. """ failed_at: Optional[int] """ Timestamp describing when an OutboundPayment changed status to `failed`. """ posted_at: Optional[int] """ Timestamp describing when an OutboundPayment changed status to `posted`. """ returned_at: Optional[int] """ Timestamp describing when an OutboundPayment changed status to `returned`. """ class TrackingDetails(StripeObject): class Ach(StripeObject): trace_id: str """ ACH trace ID of the OutboundPayment for payments sent over the `ach` network. """ class UsDomesticWire(StripeObject): imad: str """ IMAD of the OutboundPayment for payments sent over the `us_domestic_wire` network. """ omad: Optional[str] """ OMAD of the OutboundPayment for payments sent over the `us_domestic_wire` network. """ ach: Optional[Ach] type: Literal["ach", "us_domestic_wire"] """ The US bank account network used to send funds. """ us_domestic_wire: Optional[UsDomesticWire] _inner_class_types = {"ach": Ach, "us_domestic_wire": UsDomesticWire} class CancelParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CreateParams(RequestOptions): amount: int """ Amount (in cents) to be transferred. """ 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). """ customer: NotRequired[str] """ ID of the customer to whom the OutboundPayment is sent. Must match the Customer attached to the `destination_payment_method` passed in. """ description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ destination_payment_method: NotRequired[str] """ The PaymentMethod to use as the payment instrument for the OutboundPayment. Exclusive with `destination_payment_method_data`. """ destination_payment_method_data: NotRequired[ "OutboundPayment.CreateParamsDestinationPaymentMethodData" ] """ Hash used to generate the PaymentMethod to be used for this OutboundPayment. Exclusive with `destination_payment_method`. """ destination_payment_method_options: NotRequired[ "OutboundPayment.CreateParamsDestinationPaymentMethodOptions" ] """ Payment method-specific configuration for this OutboundPayment. """ end_user_details: NotRequired[ "OutboundPayment.CreateParamsEndUserDetails" ] """ End user details. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ financial_account: str """ The FinancialAccount to pull funds from. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ statement_descriptor: NotRequired[str] """ The description that appears on the receiving end for this OutboundPayment (for example, bank statement for external bank transfer). Maximum 10 characters for `ach` payments, 140 characters for `us_domestic_wire` payments, or 500 characters for `stripe` network transfers. The default value is "payment". """ class CreateParamsDestinationPaymentMethodData(TypedDict): billing_details: NotRequired[ "OutboundPayment.CreateParamsDestinationPaymentMethodDataBillingDetails" ] """ Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. """ financial_account: NotRequired[str] """ Required if type is set to `financial_account`. The FinancialAccount ID to send funds to. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ type: Literal["financial_account", "us_bank_account"] """ The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. """ us_bank_account: NotRequired[ "OutboundPayment.CreateParamsDestinationPaymentMethodDataUsBankAccount" ] """ Required hash if type is set to `us_bank_account`. """ class CreateParamsDestinationPaymentMethodDataBillingDetails(TypedDict): address: NotRequired[ "Literal['']|OutboundPayment.CreateParamsDestinationPaymentMethodDataBillingDetailsAddress" ] """ Billing address. """ email: NotRequired["Literal['']|str"] """ Email address. """ name: NotRequired["Literal['']|str"] """ Full name. """ phone: NotRequired["Literal['']|str"] """ Billing phone number (including extension). """ class CreateParamsDestinationPaymentMethodDataBillingDetailsAddress( TypedDict, ): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsDestinationPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type: individual or company. """ account_number: NotRequired[str] """ Account number of the bank account. """ account_type: NotRequired[Literal["checking", "savings"]] """ Account type: checkings or savings. Defaults to checking if omitted. """ financial_connections_account: NotRequired[str] """ The ID of a Financial Connections Account to use as a payment method. """ routing_number: NotRequired[str] """ Routing number of the bank account. """ class CreateParamsDestinationPaymentMethodOptions(TypedDict): us_bank_account: NotRequired[ "Literal['']|OutboundPayment.CreateParamsDestinationPaymentMethodOptionsUsBankAccount" ] """ Optional fields for `us_bank_account`. """ class CreateParamsDestinationPaymentMethodOptionsUsBankAccount(TypedDict): network: NotRequired[Literal["ach", "us_domestic_wire"]] """ Specifies the network rails to be used. If not set, will default to the PaymentMethod's preferred network. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. """ class CreateParamsEndUserDetails(TypedDict): ip_address: NotRequired[str] """ IP address of the user initiating the OutboundPayment. Must be supplied if `present` is set to `true`. """ present: bool """ `True` if the OutboundPayment creation request is being made on behalf of an end user by a platform. Otherwise, `false`. """ class FailParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ListParams(RequestOptions): created: NotRequired["OutboundPayment.ListParamsCreated|int"] """ Only return OutboundPayments that were created during the given date interval. """ customer: NotRequired[str] """ Only return OutboundPayments sent to this customer. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ financial_account: str """ Returns objects associated with this FinancialAccount. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ Literal["canceled", "failed", "posted", "processing", "returned"] ] """ Only return OutboundPayments that have the given status: `processing`, `failed`, `posted`, `returned`, or `canceled`. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class PostParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ReturnOutboundPaymentParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ returned_details: NotRequired[ "OutboundPayment.ReturnOutboundPaymentParamsReturnedDetails" ] """ Optional hash to set the return code. """ class ReturnOutboundPaymentParamsReturnedDetails(TypedDict): code: NotRequired[ Literal[ "account_closed", "account_frozen", "bank_account_restricted", "bank_ownership_changed", "declined", "incorrect_account_holder_name", "invalid_account_number", "invalid_currency", "no_account", "other", ] ] """ The return code to be set on the OutboundPayment object. """ class UpdateParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ tracking_details: "OutboundPayment.UpdateParamsTrackingDetails" """ Details about network-specific tracking information. """ class UpdateParamsTrackingDetails(TypedDict): ach: NotRequired["OutboundPayment.UpdateParamsTrackingDetailsAch"] """ ACH network tracking details. """ type: Literal["ach", "us_domestic_wire"] """ The US bank account network used to send funds. """ us_domestic_wire: NotRequired[ "OutboundPayment.UpdateParamsTrackingDetailsUsDomesticWire" ] """ US domestic wire network tracking details. """ class UpdateParamsTrackingDetailsAch(TypedDict): trace_id: str """ ACH trace ID for funds sent over the `ach` network. """ class UpdateParamsTrackingDetailsUsDomesticWire(TypedDict): imad: NotRequired[str] """ IMAD for funds sent over the `us_domestic_wire` network. """ omad: NotRequired[str] """ OMAD for funds sent over the `us_domestic_wire` network. """ amount: int """ Amount (in cents) transferred. """ cancelable: bool """ Returns `true` if the object can be canceled, and `false` otherwise. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ 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). """ customer: Optional[str] """ ID of the [customer](https://stripe.com/docs/api/customers) to whom an OutboundPayment is sent. """ description: Optional[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ destination_payment_method: Optional[str] """ The PaymentMethod via which an OutboundPayment is sent. This field can be empty if the OutboundPayment was created using `destination_payment_method_data`. """ destination_payment_method_details: Optional[ DestinationPaymentMethodDetails ] """ Details about the PaymentMethod for an OutboundPayment. """ end_user_details: Optional[EndUserDetails] """ Details about the end user. """ expected_arrival_date: int """ The date when funds are expected to arrive in the destination account. """ financial_account: str """ The FinancialAccount that funds were pulled from. """ hosted_regulatory_receipt_url: Optional[str] """ A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. """ id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ metadata: Dict[str, str] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ object: Literal["treasury.outbound_payment"] """ String representing the object's type. Objects of the same type share the same value. """ returned_details: Optional[ReturnedDetails] """ Details about a returned OutboundPayment. Only set when the status is `returned`. """ statement_descriptor: str """ The description that appears on the receiving end for an OutboundPayment (for example, bank statement for external bank transfer). """ status: Literal["canceled", "failed", "posted", "processing", "returned"] """ Current status of the OutboundPayment: `processing`, `failed`, `posted`, `returned`, `canceled`. An OutboundPayment is `processing` if it has been created and is pending. The status changes to `posted` once the OutboundPayment has been "confirmed" and funds have left the account, or to `failed` or `canceled`. If an OutboundPayment fails to arrive at its destination, its status will change to `returned`. """ status_transitions: StatusTransitions tracking_details: Optional[TrackingDetails] """ Details about network-specific tracking information if available. """ transaction: ExpandableField["Transaction"] """ The Transaction associated with this object. """ @classmethod def _cls_cancel( cls, id: str, **params: Unpack["OutboundPayment.CancelParams"] ) -> "OutboundPayment": """ Cancel an OutboundPayment. """ return cast( "OutboundPayment", cls._static_request( "post", "/v1/treasury/outbound_payments/{id}/cancel".format( id=sanitize_id(id) ), params=params, ), ) @overload @staticmethod def cancel( id: str, **params: Unpack["OutboundPayment.CancelParams"] ) -> "OutboundPayment": """ Cancel an OutboundPayment. """ ... @overload def cancel( self, **params: Unpack["OutboundPayment.CancelParams"] ) -> "OutboundPayment": """ Cancel an OutboundPayment. """ ... @class_method_variant("_cls_cancel") def cancel( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["OutboundPayment.CancelParams"] ) -> "OutboundPayment": """ Cancel an OutboundPayment. """ return cast( "OutboundPayment", self._request( "post", "/v1/treasury/outbound_payments/{id}/cancel".format( id=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_cancel_async( cls, id: str, **params: Unpack["OutboundPayment.CancelParams"] ) -> "OutboundPayment": """ Cancel an OutboundPayment. """ return cast( "OutboundPayment", await cls._static_request_async( "post", "/v1/treasury/outbound_payments/{id}/cancel".format( id=sanitize_id(id) ), params=params, ), ) @overload @staticmethod async def cancel_async( id: str, **params: Unpack["OutboundPayment.CancelParams"] ) -> "OutboundPayment": """ Cancel an OutboundPayment. """ ... @overload async def cancel_async( self, **params: Unpack["OutboundPayment.CancelParams"] ) -> "OutboundPayment": """ Cancel an OutboundPayment. """ ... @class_method_variant("_cls_cancel_async") async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["OutboundPayment.CancelParams"] ) -> "OutboundPayment": """ Cancel an OutboundPayment. """ return cast( "OutboundPayment", await self._request_async( "post", "/v1/treasury/outbound_payments/{id}/cancel".format( id=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def create( cls, **params: Unpack["OutboundPayment.CreateParams"] ) -> "OutboundPayment": """ Creates an OutboundPayment. """ return cast( "OutboundPayment", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["OutboundPayment.CreateParams"] ) -> "OutboundPayment": """ Creates an OutboundPayment. """ return cast( "OutboundPayment", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def list( cls, **params: Unpack["OutboundPayment.ListParams"] ) -> ListObject["OutboundPayment"]: """ Returns a list of OutboundPayments sent from the specified FinancialAccount. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["OutboundPayment.ListParams"] ) -> ListObject["OutboundPayment"]: """ Returns a list of OutboundPayments sent from the specified FinancialAccount. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def retrieve( cls, id: str, **params: Unpack["OutboundPayment.RetrieveParams"] ) -> "OutboundPayment": """ Retrieves the details of an existing OutboundPayment by passing the unique OutboundPayment ID from either the OutboundPayment creation request or OutboundPayment list. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["OutboundPayment.RetrieveParams"] ) -> "OutboundPayment": """ Retrieves the details of an existing OutboundPayment by passing the unique OutboundPayment ID from either the OutboundPayment creation request or OutboundPayment list. """ instance = cls(id, **params) await instance.refresh_async() return instance class TestHelpers(APIResourceTestHelpers["OutboundPayment"]): _resource_cls: Type["OutboundPayment"] @classmethod def _cls_fail( cls, id: str, **params: Unpack["OutboundPayment.FailParams"] ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the failed status. The OutboundPayment must already be in the processing state. """ return cast( "OutboundPayment", cls._static_request( "post", "/v1/test_helpers/treasury/outbound_payments/{id}/fail".format( id=sanitize_id(id) ), params=params, ), ) @overload @staticmethod def fail( id: str, **params: Unpack["OutboundPayment.FailParams"] ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the failed status. The OutboundPayment must already be in the processing state. """ ... @overload def fail( self, **params: Unpack["OutboundPayment.FailParams"] ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the failed status. The OutboundPayment must already be in the processing state. """ ... @class_method_variant("_cls_fail") def fail( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["OutboundPayment.FailParams"] ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the failed status. The OutboundPayment must already be in the processing state. """ return cast( "OutboundPayment", self.resource._request( "post", "/v1/test_helpers/treasury/outbound_payments/{id}/fail".format( id=sanitize_id(self.resource.get("id")) ), params=params, ), ) @classmethod async def _cls_fail_async( cls, id: str, **params: Unpack["OutboundPayment.FailParams"] ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the failed status. The OutboundPayment must already be in the processing state. """ return cast( "OutboundPayment", await cls._static_request_async( "post", "/v1/test_helpers/treasury/outbound_payments/{id}/fail".format( id=sanitize_id(id) ), params=params, ), ) @overload @staticmethod async def fail_async( id: str, **params: Unpack["OutboundPayment.FailParams"] ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the failed status. The OutboundPayment must already be in the processing state. """ ... @overload async def fail_async( self, **params: Unpack["OutboundPayment.FailParams"] ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the failed status. The OutboundPayment must already be in the processing state. """ ... @class_method_variant("_cls_fail_async") async def fail_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["OutboundPayment.FailParams"] ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the failed status. The OutboundPayment must already be in the processing state. """ return cast( "OutboundPayment", await self.resource._request_async( "post", "/v1/test_helpers/treasury/outbound_payments/{id}/fail".format( id=sanitize_id(self.resource.get("id")) ), params=params, ), ) @classmethod def _cls_post( cls, id: str, **params: Unpack["OutboundPayment.PostParams"] ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the posted status. The OutboundPayment must already be in the processing state. """ return cast( "OutboundPayment", cls._static_request( "post", "/v1/test_helpers/treasury/outbound_payments/{id}/post".format( id=sanitize_id(id) ), params=params, ), ) @overload @staticmethod def post( id: str, **params: Unpack["OutboundPayment.PostParams"] ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the posted status. The OutboundPayment must already be in the processing state. """ ... @overload def post( self, **params: Unpack["OutboundPayment.PostParams"] ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the posted status. The OutboundPayment must already be in the processing state. """ ... @class_method_variant("_cls_post") def post( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["OutboundPayment.PostParams"] ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the posted status. The OutboundPayment must already be in the processing state. """ return cast( "OutboundPayment", self.resource._request( "post", "/v1/test_helpers/treasury/outbound_payments/{id}/post".format( id=sanitize_id(self.resource.get("id")) ), params=params, ), ) @classmethod async def _cls_post_async( cls, id: str, **params: Unpack["OutboundPayment.PostParams"] ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the posted status. The OutboundPayment must already be in the processing state. """ return cast( "OutboundPayment", await cls._static_request_async( "post", "/v1/test_helpers/treasury/outbound_payments/{id}/post".format( id=sanitize_id(id) ), params=params, ), ) @overload @staticmethod async def post_async( id: str, **params: Unpack["OutboundPayment.PostParams"] ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the posted status. The OutboundPayment must already be in the processing state. """ ... @overload async def post_async( self, **params: Unpack["OutboundPayment.PostParams"] ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the posted status. The OutboundPayment must already be in the processing state. """ ... @class_method_variant("_cls_post_async") async def post_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["OutboundPayment.PostParams"] ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the posted status. The OutboundPayment must already be in the processing state. """ return cast( "OutboundPayment", await self.resource._request_async( "post", "/v1/test_helpers/treasury/outbound_payments/{id}/post".format( id=sanitize_id(self.resource.get("id")) ), params=params, ), ) @classmethod def _cls_return_outbound_payment( cls, id: str, **params: Unpack["OutboundPayment.ReturnOutboundPaymentParams"], ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the returned status. The OutboundPayment must already be in the processing state. """ return cast( "OutboundPayment", cls._static_request( "post", "/v1/test_helpers/treasury/outbound_payments/{id}/return".format( id=sanitize_id(id) ), params=params, ), ) @overload @staticmethod def return_outbound_payment( id: str, **params: Unpack["OutboundPayment.ReturnOutboundPaymentParams"], ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the returned status. The OutboundPayment must already be in the processing state. """ ... @overload def return_outbound_payment( self, **params: Unpack["OutboundPayment.ReturnOutboundPaymentParams"], ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the returned status. The OutboundPayment must already be in the processing state. """ ... @class_method_variant("_cls_return_outbound_payment") def return_outbound_payment( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["OutboundPayment.ReturnOutboundPaymentParams"], ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the returned status. The OutboundPayment must already be in the processing state. """ return cast( "OutboundPayment", self.resource._request( "post", "/v1/test_helpers/treasury/outbound_payments/{id}/return".format( id=sanitize_id(self.resource.get("id")) ), params=params, ), ) @classmethod async def _cls_return_outbound_payment_async( cls, id: str, **params: Unpack["OutboundPayment.ReturnOutboundPaymentParams"], ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the returned status. The OutboundPayment must already be in the processing state. """ return cast( "OutboundPayment", await cls._static_request_async( "post", "/v1/test_helpers/treasury/outbound_payments/{id}/return".format( id=sanitize_id(id) ), params=params, ), ) @overload @staticmethod async def return_outbound_payment_async( id: str, **params: Unpack["OutboundPayment.ReturnOutboundPaymentParams"], ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the returned status. The OutboundPayment must already be in the processing state. """ ... @overload async def return_outbound_payment_async( self, **params: Unpack["OutboundPayment.ReturnOutboundPaymentParams"], ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the returned status. The OutboundPayment must already be in the processing state. """ ... @class_method_variant("_cls_return_outbound_payment_async") async def return_outbound_payment_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["OutboundPayment.ReturnOutboundPaymentParams"], ) -> "OutboundPayment": """ Transitions a test mode created OutboundPayment to the returned status. The OutboundPayment must already be in the processing state. """ return cast( "OutboundPayment", await self.resource._request_async( "post", "/v1/test_helpers/treasury/outbound_payments/{id}/return".format( id=sanitize_id(self.resource.get("id")) ), params=params, ), ) @classmethod def _cls_update( cls, id: str, **params: Unpack["OutboundPayment.UpdateParams"] ) -> "OutboundPayment": """ Updates a test mode created OutboundPayment with tracking details. The OutboundPayment must not be cancelable, and cannot be in the canceled or failed states. """ return cast( "OutboundPayment", cls._static_request( "post", "/v1/test_helpers/treasury/outbound_payments/{id}".format( id=sanitize_id(id) ), params=params, ), ) @overload @staticmethod def update( id: str, **params: Unpack["OutboundPayment.UpdateParams"] ) -> "OutboundPayment": """ Updates a test mode created OutboundPayment with tracking details. The OutboundPayment must not be cancelable, and cannot be in the canceled or failed states. """ ... @overload def update( self, **params: Unpack["OutboundPayment.UpdateParams"] ) -> "OutboundPayment": """ Updates a test mode created OutboundPayment with tracking details. The OutboundPayment must not be cancelable, and cannot be in the canceled or failed states. """ ... @class_method_variant("_cls_update") def update( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["OutboundPayment.UpdateParams"] ) -> "OutboundPayment": """ Updates a test mode created OutboundPayment with tracking details. The OutboundPayment must not be cancelable, and cannot be in the canceled or failed states. """ return cast( "OutboundPayment", self.resource._request( "post", "/v1/test_helpers/treasury/outbound_payments/{id}".format( id=sanitize_id(self.resource.get("id")) ), params=params, ), ) @classmethod async def _cls_update_async( cls, id: str, **params: Unpack["OutboundPayment.UpdateParams"] ) -> "OutboundPayment": """ Updates a test mode created OutboundPayment with tracking details. The OutboundPayment must not be cancelable, and cannot be in the canceled or failed states. """ return cast( "OutboundPayment", await cls._static_request_async( "post", "/v1/test_helpers/treasury/outbound_payments/{id}".format( id=sanitize_id(id) ), params=params, ), ) @overload @staticmethod async def update_async( id: str, **params: Unpack["OutboundPayment.UpdateParams"] ) -> "OutboundPayment": """ Updates a test mode created OutboundPayment with tracking details. The OutboundPayment must not be cancelable, and cannot be in the canceled or failed states. """ ... @overload async def update_async( self, **params: Unpack["OutboundPayment.UpdateParams"] ) -> "OutboundPayment": """ Updates a test mode created OutboundPayment with tracking details. The OutboundPayment must not be cancelable, and cannot be in the canceled or failed states. """ ... @class_method_variant("_cls_update_async") async def update_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["OutboundPayment.UpdateParams"] ) -> "OutboundPayment": """ Updates a test mode created OutboundPayment with tracking details. The OutboundPayment must not be cancelable, and cannot be in the canceled or failed states. """ return cast( "OutboundPayment", await self.resource._request_async( "post", "/v1/test_helpers/treasury/outbound_payments/{id}".format( id=sanitize_id(self.resource.get("id")) ), params=params, ), ) @property def test_helpers(self): return self.TestHelpers(self) _inner_class_types = { "destination_payment_method_details": DestinationPaymentMethodDetails, "end_user_details": EndUserDetails, "returned_details": ReturnedDetails, "status_transitions": StatusTransitions, "tracking_details": TrackingDetails, } OutboundPayment.TestHelpers._resource_cls = OutboundPayment ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/treasury/_outbound_payment_service.py0000644000175100001770000003577014637354563023551 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.treasury._outbound_payment import OutboundPayment from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class OutboundPaymentService(StripeService): class CancelParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CreateParams(TypedDict): amount: int """ Amount (in cents) to be transferred. """ 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). """ customer: NotRequired[str] """ ID of the customer to whom the OutboundPayment is sent. Must match the Customer attached to the `destination_payment_method` passed in. """ description: NotRequired[str] """ An arbitrary string attached to the object. Often useful for displaying to users. """ destination_payment_method: NotRequired[str] """ The PaymentMethod to use as the payment instrument for the OutboundPayment. Exclusive with `destination_payment_method_data`. """ destination_payment_method_data: NotRequired[ "OutboundPaymentService.CreateParamsDestinationPaymentMethodData" ] """ Hash used to generate the PaymentMethod to be used for this OutboundPayment. Exclusive with `destination_payment_method`. """ destination_payment_method_options: NotRequired[ "OutboundPaymentService.CreateParamsDestinationPaymentMethodOptions" ] """ Payment method-specific configuration for this OutboundPayment. """ end_user_details: NotRequired[ "OutboundPaymentService.CreateParamsEndUserDetails" ] """ End user details. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ financial_account: str """ The FinancialAccount to pull funds from. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ statement_descriptor: NotRequired[str] """ The description that appears on the receiving end for this OutboundPayment (for example, bank statement for external bank transfer). Maximum 10 characters for `ach` payments, 140 characters for `us_domestic_wire` payments, or 500 characters for `stripe` network transfers. The default value is "payment". """ class CreateParamsDestinationPaymentMethodData(TypedDict): billing_details: NotRequired[ "OutboundPaymentService.CreateParamsDestinationPaymentMethodDataBillingDetails" ] """ Billing information associated with the PaymentMethod that may be used or required by particular types of payment methods. """ financial_account: NotRequired[str] """ Required if type is set to `financial_account`. The FinancialAccount ID to send funds to. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ type: Literal["financial_account", "us_bank_account"] """ The type of the PaymentMethod. An additional hash is included on the PaymentMethod with a name matching this value. It contains additional information specific to the PaymentMethod type. """ us_bank_account: NotRequired[ "OutboundPaymentService.CreateParamsDestinationPaymentMethodDataUsBankAccount" ] """ Required hash if type is set to `us_bank_account`. """ class CreateParamsDestinationPaymentMethodDataBillingDetails(TypedDict): address: NotRequired[ "Literal['']|OutboundPaymentService.CreateParamsDestinationPaymentMethodDataBillingDetailsAddress" ] """ Billing address. """ email: NotRequired["Literal['']|str"] """ Email address. """ name: NotRequired["Literal['']|str"] """ Full name. """ phone: NotRequired["Literal['']|str"] """ Billing phone number (including extension). """ class CreateParamsDestinationPaymentMethodDataBillingDetailsAddress( TypedDict, ): city: NotRequired[str] """ City, district, suburb, town, or village. """ country: NotRequired[str] """ Two-letter country code ([ISO 3166-1 alpha-2](https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2)). """ line1: NotRequired[str] """ Address line 1 (e.g., street, PO Box, or company name). """ line2: NotRequired[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: NotRequired[str] """ ZIP or postal code. """ state: NotRequired[str] """ State, county, province, or region. """ class CreateParamsDestinationPaymentMethodDataUsBankAccount(TypedDict): account_holder_type: NotRequired[Literal["company", "individual"]] """ Account holder type: individual or company. """ account_number: NotRequired[str] """ Account number of the bank account. """ account_type: NotRequired[Literal["checking", "savings"]] """ Account type: checkings or savings. Defaults to checking if omitted. """ financial_connections_account: NotRequired[str] """ The ID of a Financial Connections Account to use as a payment method. """ routing_number: NotRequired[str] """ Routing number of the bank account. """ class CreateParamsDestinationPaymentMethodOptions(TypedDict): us_bank_account: NotRequired[ "Literal['']|OutboundPaymentService.CreateParamsDestinationPaymentMethodOptionsUsBankAccount" ] """ Optional fields for `us_bank_account`. """ class CreateParamsDestinationPaymentMethodOptionsUsBankAccount(TypedDict): network: NotRequired[Literal["ach", "us_domestic_wire"]] """ Specifies the network rails to be used. If not set, will default to the PaymentMethod's preferred network. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. """ class CreateParamsEndUserDetails(TypedDict): ip_address: NotRequired[str] """ IP address of the user initiating the OutboundPayment. Must be supplied if `present` is set to `true`. """ present: bool """ `True` if the OutboundPayment creation request is being made on behalf of an end user by a platform. Otherwise, `false`. """ class ListParams(TypedDict): created: NotRequired["OutboundPaymentService.ListParamsCreated|int"] """ Only return OutboundPayments that were created during the given date interval. """ customer: NotRequired[str] """ Only return OutboundPayments sent to this customer. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ financial_account: str """ Returns objects associated with this FinancialAccount. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ Literal["canceled", "failed", "posted", "processing", "returned"] ] """ Only return OutboundPayments that have the given status: `processing`, `failed`, `posted`, `returned`, or `canceled`. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def list( self, params: "OutboundPaymentService.ListParams", options: RequestOptions = {}, ) -> ListObject[OutboundPayment]: """ Returns a list of OutboundPayments sent from the specified FinancialAccount. """ return cast( ListObject[OutboundPayment], self._request( "get", "/v1/treasury/outbound_payments", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "OutboundPaymentService.ListParams", options: RequestOptions = {}, ) -> ListObject[OutboundPayment]: """ Returns a list of OutboundPayments sent from the specified FinancialAccount. """ return cast( ListObject[OutboundPayment], await self._request_async( "get", "/v1/treasury/outbound_payments", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "OutboundPaymentService.CreateParams", options: RequestOptions = {}, ) -> OutboundPayment: """ Creates an OutboundPayment. """ return cast( OutboundPayment, self._request( "post", "/v1/treasury/outbound_payments", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "OutboundPaymentService.CreateParams", options: RequestOptions = {}, ) -> OutboundPayment: """ Creates an OutboundPayment. """ return cast( OutboundPayment, await self._request_async( "post", "/v1/treasury/outbound_payments", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, id: str, params: "OutboundPaymentService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> OutboundPayment: """ Retrieves the details of an existing OutboundPayment by passing the unique OutboundPayment ID from either the OutboundPayment creation request or OutboundPayment list. """ return cast( OutboundPayment, self._request( "get", "/v1/treasury/outbound_payments/{id}".format( id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, id: str, params: "OutboundPaymentService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> OutboundPayment: """ Retrieves the details of an existing OutboundPayment by passing the unique OutboundPayment ID from either the OutboundPayment creation request or OutboundPayment list. """ return cast( OutboundPayment, await self._request_async( "get", "/v1/treasury/outbound_payments/{id}".format( id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def cancel( self, id: str, params: "OutboundPaymentService.CancelParams" = {}, options: RequestOptions = {}, ) -> OutboundPayment: """ Cancel an OutboundPayment. """ return cast( OutboundPayment, self._request( "post", "/v1/treasury/outbound_payments/{id}/cancel".format( id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def cancel_async( self, id: str, params: "OutboundPaymentService.CancelParams" = {}, options: RequestOptions = {}, ) -> OutboundPayment: """ Cancel an OutboundPayment. """ return cast( OutboundPayment, await self._request_async( "post", "/v1/treasury/outbound_payments/{id}/cancel".format( id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/treasury/_outbound_transfer.py0000644000175100001770000012322514637354563022171 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._createable_api_resource import CreateableAPIResource from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._test_helpers import APIResourceTestHelpers from stripe._util import class_method_variant, sanitize_id from typing import ClassVar, Dict, List, Optional, cast, overload from typing_extensions import ( Literal, NotRequired, Type, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._mandate import Mandate from stripe.treasury._transaction import Transaction class OutboundTransfer( CreateableAPIResource["OutboundTransfer"], ListableAPIResource["OutboundTransfer"], ): """ Use OutboundTransfers to transfer funds from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](https://stripe.com/docs/api#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account. Simulate OutboundTransfer state changes with the `/v1/test_helpers/treasury/outbound_transfers` endpoints. These methods can only be called on test mode objects. """ OBJECT_NAME: ClassVar[Literal["treasury.outbound_transfer"]] = ( "treasury.outbound_transfer" ) class DestinationPaymentMethodDetails(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 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State, county, province, or region. """ address: Address email: Optional[str] """ Email address. """ name: Optional[str] """ Full name. """ _inner_class_types = {"address": Address} class UsBankAccount(StripeObject): account_holder_type: Optional[Literal["company", "individual"]] """ Account holder type: individual or company. """ account_type: Optional[Literal["checking", "savings"]] """ Account type: checkings or savings. Defaults to checking if omitted. """ bank_name: Optional[str] """ Name of the bank associated with the bank account. """ fingerprint: Optional[str] """ Uniquely identifies this particular bank account. You can use this attribute to check whether two bank accounts are the same. """ last4: Optional[str] """ Last four digits of the bank account number. """ mandate: Optional[ExpandableField["Mandate"]] """ ID of the mandate used to make this payment. """ network: Literal["ach", "us_domestic_wire"] """ The network rails used. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. """ routing_number: Optional[str] """ Routing number of the bank account. """ billing_details: BillingDetails type: Literal["us_bank_account"] """ The type of the payment method used in the OutboundTransfer. """ us_bank_account: Optional[UsBankAccount] _inner_class_types = { "billing_details": BillingDetails, "us_bank_account": UsBankAccount, } class ReturnedDetails(StripeObject): code: Literal[ "account_closed", "account_frozen", "bank_account_restricted", "bank_ownership_changed", "declined", "incorrect_account_holder_name", "invalid_account_number", "invalid_currency", "no_account", "other", ] """ Reason for the return. """ transaction: ExpandableField["Transaction"] """ The Transaction associated with this object. """ class StatusTransitions(StripeObject): canceled_at: Optional[int] """ Timestamp describing when an OutboundTransfer changed status to `canceled` """ failed_at: Optional[int] """ Timestamp describing when an OutboundTransfer changed status to `failed` """ posted_at: Optional[int] """ Timestamp describing when an OutboundTransfer changed status to `posted` """ returned_at: Optional[int] """ Timestamp describing when an OutboundTransfer changed status to `returned` """ class TrackingDetails(StripeObject): class Ach(StripeObject): trace_id: str """ ACH trace ID of the OutboundTransfer for transfers sent over the `ach` network. """ class UsDomesticWire(StripeObject): imad: str """ IMAD of the OutboundTransfer for transfers sent over the `us_domestic_wire` network. """ omad: Optional[str] """ OMAD of the OutboundTransfer for transfers sent over the `us_domestic_wire` network. """ ach: Optional[Ach] type: Literal["ach", "us_domestic_wire"] """ The US bank account network used to send funds. """ us_domestic_wire: Optional[UsDomesticWire] _inner_class_types = {"ach": Ach, "us_domestic_wire": UsDomesticWire} class CancelParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CreateParams(RequestOptions): amount: int """ Amount (in cents) to be transferred. """ 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 string attached to the object. Often useful for displaying to users. """ destination_payment_method: NotRequired[str] """ The PaymentMethod to use as the payment instrument for the OutboundTransfer. """ destination_payment_method_options: NotRequired[ "OutboundTransfer.CreateParamsDestinationPaymentMethodOptions" ] """ Hash describing payment method configuration details. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ financial_account: str """ The FinancialAccount to pull funds from. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ statement_descriptor: NotRequired[str] """ Statement descriptor to be shown on the receiving end of an OutboundTransfer. Maximum 10 characters for `ach` transfers or 140 characters for `us_domestic_wire` transfers. The default value is "transfer". """ class CreateParamsDestinationPaymentMethodOptions(TypedDict): us_bank_account: NotRequired[ "Literal['']|OutboundTransfer.CreateParamsDestinationPaymentMethodOptionsUsBankAccount" ] """ Optional fields for `us_bank_account`. """ class CreateParamsDestinationPaymentMethodOptionsUsBankAccount(TypedDict): network: NotRequired[Literal["ach", "us_domestic_wire"]] """ Specifies the network rails to be used. If not set, will default to the PaymentMethod's preferred network. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. """ class FailParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ListParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ financial_account: str """ Returns objects associated with this FinancialAccount. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ Literal["canceled", "failed", "posted", "processing", "returned"] ] """ Only return OutboundTransfers that have the given status: `processing`, `canceled`, `failed`, `posted`, or `returned`. """ class PostParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class ReturnOutboundTransferParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ returned_details: NotRequired[ "OutboundTransfer.ReturnOutboundTransferParamsReturnedDetails" ] """ Details about a returned OutboundTransfer. """ class ReturnOutboundTransferParamsReturnedDetails(TypedDict): code: NotRequired[ Literal[ "account_closed", "account_frozen", "bank_account_restricted", "bank_ownership_changed", "declined", "incorrect_account_holder_name", "invalid_account_number", "invalid_currency", "no_account", "other", ] ] """ Reason for the return. """ class UpdateParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ tracking_details: "OutboundTransfer.UpdateParamsTrackingDetails" """ Details about network-specific tracking information. """ class UpdateParamsTrackingDetails(TypedDict): ach: NotRequired["OutboundTransfer.UpdateParamsTrackingDetailsAch"] """ ACH network tracking details. """ type: Literal["ach", "us_domestic_wire"] """ The US bank account network used to send funds. """ us_domestic_wire: NotRequired[ "OutboundTransfer.UpdateParamsTrackingDetailsUsDomesticWire" ] """ US domestic wire network tracking details. """ class UpdateParamsTrackingDetailsAch(TypedDict): trace_id: str """ ACH trace ID for funds sent over the `ach` network. """ class UpdateParamsTrackingDetailsUsDomesticWire(TypedDict): imad: NotRequired[str] """ IMAD for funds sent over the `us_domestic_wire` network. """ omad: NotRequired[str] """ OMAD for funds sent over the `us_domestic_wire` network. """ amount: int """ Amount (in cents) transferred. """ cancelable: bool """ Returns `true` if the object can be canceled, and `false` otherwise. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ 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. """ destination_payment_method: Optional[str] """ The PaymentMethod used as the payment instrument for an OutboundTransfer. """ destination_payment_method_details: DestinationPaymentMethodDetails expected_arrival_date: int """ The date when funds are expected to arrive in the destination account. """ financial_account: str """ The FinancialAccount that funds were pulled from. """ hosted_regulatory_receipt_url: Optional[str] """ A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. """ id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ metadata: Dict[str, str] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. """ object: Literal["treasury.outbound_transfer"] """ String representing the object's type. Objects of the same type share the same value. """ returned_details: Optional[ReturnedDetails] """ Details about a returned OutboundTransfer. Only set when the status is `returned`. """ statement_descriptor: str """ Information about the OutboundTransfer to be sent to the recipient account. """ status: Literal["canceled", "failed", "posted", "processing", "returned"] """ Current status of the OutboundTransfer: `processing`, `failed`, `canceled`, `posted`, `returned`. An OutboundTransfer is `processing` if it has been created and is pending. The status changes to `posted` once the OutboundTransfer has been "confirmed" and funds have left the account, or to `failed` or `canceled`. If an OutboundTransfer fails to arrive at its destination, its status will change to `returned`. """ status_transitions: StatusTransitions tracking_details: Optional[TrackingDetails] """ Details about network-specific tracking information if available. """ transaction: ExpandableField["Transaction"] """ The Transaction associated with this object. """ @classmethod def _cls_cancel( cls, outbound_transfer: str, **params: Unpack["OutboundTransfer.CancelParams"], ) -> "OutboundTransfer": """ An OutboundTransfer can be canceled if the funds have not yet been paid out. """ return cast( "OutboundTransfer", cls._static_request( "post", "/v1/treasury/outbound_transfers/{outbound_transfer}/cancel".format( outbound_transfer=sanitize_id(outbound_transfer) ), params=params, ), ) @overload @staticmethod def cancel( outbound_transfer: str, **params: Unpack["OutboundTransfer.CancelParams"], ) -> "OutboundTransfer": """ An OutboundTransfer can be canceled if the funds have not yet been paid out. """ ... @overload def cancel( self, **params: Unpack["OutboundTransfer.CancelParams"] ) -> "OutboundTransfer": """ An OutboundTransfer can be canceled if the funds have not yet been paid out. """ ... @class_method_variant("_cls_cancel") def cancel( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["OutboundTransfer.CancelParams"] ) -> "OutboundTransfer": """ An OutboundTransfer can be canceled if the funds have not yet been paid out. """ return cast( "OutboundTransfer", self._request( "post", "/v1/treasury/outbound_transfers/{outbound_transfer}/cancel".format( outbound_transfer=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod async def _cls_cancel_async( cls, outbound_transfer: str, **params: Unpack["OutboundTransfer.CancelParams"], ) -> "OutboundTransfer": """ An OutboundTransfer can be canceled if the funds have not yet been paid out. """ return cast( "OutboundTransfer", await cls._static_request_async( "post", "/v1/treasury/outbound_transfers/{outbound_transfer}/cancel".format( outbound_transfer=sanitize_id(outbound_transfer) ), params=params, ), ) @overload @staticmethod async def cancel_async( outbound_transfer: str, **params: Unpack["OutboundTransfer.CancelParams"], ) -> "OutboundTransfer": """ An OutboundTransfer can be canceled if the funds have not yet been paid out. """ ... @overload async def cancel_async( self, **params: Unpack["OutboundTransfer.CancelParams"] ) -> "OutboundTransfer": """ An OutboundTransfer can be canceled if the funds have not yet been paid out. """ ... @class_method_variant("_cls_cancel_async") async def cancel_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["OutboundTransfer.CancelParams"] ) -> "OutboundTransfer": """ An OutboundTransfer can be canceled if the funds have not yet been paid out. """ return cast( "OutboundTransfer", await self._request_async( "post", "/v1/treasury/outbound_transfers/{outbound_transfer}/cancel".format( outbound_transfer=sanitize_id(self.get("id")) ), params=params, ), ) @classmethod def create( cls, **params: Unpack["OutboundTransfer.CreateParams"] ) -> "OutboundTransfer": """ Creates an OutboundTransfer. """ return cast( "OutboundTransfer", cls._static_request( "post", cls.class_url(), params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["OutboundTransfer.CreateParams"] ) -> "OutboundTransfer": """ Creates an OutboundTransfer. """ return cast( "OutboundTransfer", await cls._static_request_async( "post", cls.class_url(), params=params, ), ) @classmethod def list( cls, **params: Unpack["OutboundTransfer.ListParams"] ) -> ListObject["OutboundTransfer"]: """ Returns a list of OutboundTransfers sent from the specified FinancialAccount. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["OutboundTransfer.ListParams"] ) -> ListObject["OutboundTransfer"]: """ Returns a list of OutboundTransfers sent from the specified FinancialAccount. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def retrieve( cls, id: str, **params: Unpack["OutboundTransfer.RetrieveParams"] ) -> "OutboundTransfer": """ Retrieves the details of an existing OutboundTransfer by passing the unique OutboundTransfer ID from either the OutboundTransfer creation request or OutboundTransfer list. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["OutboundTransfer.RetrieveParams"] ) -> "OutboundTransfer": """ Retrieves the details of an existing OutboundTransfer by passing the unique OutboundTransfer ID from either the OutboundTransfer creation request or OutboundTransfer list. """ instance = cls(id, **params) await instance.refresh_async() return instance class TestHelpers(APIResourceTestHelpers["OutboundTransfer"]): _resource_cls: Type["OutboundTransfer"] @classmethod def _cls_fail( cls, outbound_transfer: str, **params: Unpack["OutboundTransfer.FailParams"], ) -> "OutboundTransfer": """ Transitions a test mode created OutboundTransfer to the failed status. The OutboundTransfer must already be in the processing state. """ return cast( "OutboundTransfer", cls._static_request( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/fail".format( outbound_transfer=sanitize_id(outbound_transfer) ), params=params, ), ) @overload @staticmethod def fail( outbound_transfer: str, **params: Unpack["OutboundTransfer.FailParams"], ) -> "OutboundTransfer": """ Transitions a test mode created OutboundTransfer to the failed status. The OutboundTransfer must already be in the processing state. """ ... @overload def fail( self, **params: Unpack["OutboundTransfer.FailParams"] ) -> "OutboundTransfer": """ Transitions a test mode created OutboundTransfer to the failed status. The OutboundTransfer must already be in the processing state. """ ... @class_method_variant("_cls_fail") def fail( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["OutboundTransfer.FailParams"] ) -> "OutboundTransfer": """ Transitions a test mode created OutboundTransfer to the failed status. The OutboundTransfer must already be in the processing state. """ return cast( "OutboundTransfer", self.resource._request( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/fail".format( outbound_transfer=sanitize_id(self.resource.get("id")) ), params=params, ), ) @classmethod async def _cls_fail_async( cls, outbound_transfer: str, **params: Unpack["OutboundTransfer.FailParams"], ) -> "OutboundTransfer": """ Transitions a test mode created OutboundTransfer to the failed status. The OutboundTransfer must already be in the processing state. """ return cast( "OutboundTransfer", await cls._static_request_async( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/fail".format( outbound_transfer=sanitize_id(outbound_transfer) ), params=params, ), ) @overload @staticmethod async def fail_async( outbound_transfer: str, **params: Unpack["OutboundTransfer.FailParams"], ) -> "OutboundTransfer": """ Transitions a test mode created OutboundTransfer to the failed status. The OutboundTransfer must already be in the processing state. """ ... @overload async def fail_async( self, **params: Unpack["OutboundTransfer.FailParams"] ) -> "OutboundTransfer": """ Transitions a test mode created OutboundTransfer to the failed status. The OutboundTransfer must already be in the processing state. """ ... @class_method_variant("_cls_fail_async") async def fail_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["OutboundTransfer.FailParams"] ) -> "OutboundTransfer": """ Transitions a test mode created OutboundTransfer to the failed status. The OutboundTransfer must already be in the processing state. """ return cast( "OutboundTransfer", await self.resource._request_async( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/fail".format( outbound_transfer=sanitize_id(self.resource.get("id")) ), params=params, ), ) @classmethod def _cls_post( cls, outbound_transfer: str, **params: Unpack["OutboundTransfer.PostParams"], ) -> "OutboundTransfer": """ Transitions a test mode created OutboundTransfer to the posted status. The OutboundTransfer must already be in the processing state. """ return cast( "OutboundTransfer", cls._static_request( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/post".format( outbound_transfer=sanitize_id(outbound_transfer) ), params=params, ), ) @overload @staticmethod def post( outbound_transfer: str, **params: Unpack["OutboundTransfer.PostParams"], ) -> "OutboundTransfer": """ Transitions a test mode created OutboundTransfer to the posted status. The OutboundTransfer must already be in the processing state. """ ... @overload def post( self, **params: Unpack["OutboundTransfer.PostParams"] ) -> "OutboundTransfer": """ Transitions a test mode created OutboundTransfer to the posted status. The OutboundTransfer must already be in the processing state. """ ... @class_method_variant("_cls_post") def post( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["OutboundTransfer.PostParams"] ) -> "OutboundTransfer": """ Transitions a test mode created OutboundTransfer to the posted status. The OutboundTransfer must already be in the processing state. """ return cast( "OutboundTransfer", self.resource._request( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/post".format( outbound_transfer=sanitize_id(self.resource.get("id")) ), params=params, ), ) @classmethod async def _cls_post_async( cls, outbound_transfer: str, **params: Unpack["OutboundTransfer.PostParams"], ) -> "OutboundTransfer": """ Transitions a test mode created OutboundTransfer to the posted status. The OutboundTransfer must already be in the processing state. """ return cast( "OutboundTransfer", await cls._static_request_async( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/post".format( outbound_transfer=sanitize_id(outbound_transfer) ), params=params, ), ) @overload @staticmethod async def post_async( outbound_transfer: str, **params: Unpack["OutboundTransfer.PostParams"], ) -> "OutboundTransfer": """ Transitions a test mode created OutboundTransfer to the posted status. The OutboundTransfer must already be in the processing state. """ ... @overload async def post_async( self, **params: Unpack["OutboundTransfer.PostParams"] ) -> "OutboundTransfer": """ Transitions a test mode created OutboundTransfer to the posted status. The OutboundTransfer must already be in the processing state. """ ... @class_method_variant("_cls_post_async") async def post_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["OutboundTransfer.PostParams"] ) -> "OutboundTransfer": """ Transitions a test mode created OutboundTransfer to the posted status. The OutboundTransfer must already be in the processing state. """ return cast( "OutboundTransfer", await self.resource._request_async( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/post".format( outbound_transfer=sanitize_id(self.resource.get("id")) ), params=params, ), ) @classmethod def _cls_return_outbound_transfer( cls, outbound_transfer: str, **params: Unpack["OutboundTransfer.ReturnOutboundTransferParams"], ) -> "OutboundTransfer": """ Transitions a test mode created OutboundTransfer to the returned status. The OutboundTransfer must already be in the processing state. """ return cast( "OutboundTransfer", cls._static_request( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/return".format( outbound_transfer=sanitize_id(outbound_transfer) ), params=params, ), ) @overload @staticmethod def return_outbound_transfer( outbound_transfer: str, **params: Unpack["OutboundTransfer.ReturnOutboundTransferParams"], ) -> "OutboundTransfer": """ Transitions a test mode created OutboundTransfer to the returned status. The OutboundTransfer must already be in the processing state. """ ... @overload def return_outbound_transfer( self, **params: Unpack["OutboundTransfer.ReturnOutboundTransferParams"], ) -> "OutboundTransfer": """ Transitions a test mode created OutboundTransfer to the returned status. The OutboundTransfer must already be in the processing state. """ ... @class_method_variant("_cls_return_outbound_transfer") def return_outbound_transfer( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["OutboundTransfer.ReturnOutboundTransferParams"], ) -> "OutboundTransfer": """ Transitions a test mode created OutboundTransfer to the returned status. The OutboundTransfer must already be in the processing state. """ return cast( "OutboundTransfer", self.resource._request( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/return".format( outbound_transfer=sanitize_id(self.resource.get("id")) ), params=params, ), ) @classmethod async def _cls_return_outbound_transfer_async( cls, outbound_transfer: str, **params: Unpack["OutboundTransfer.ReturnOutboundTransferParams"], ) -> "OutboundTransfer": """ Transitions a test mode created OutboundTransfer to the returned status. The OutboundTransfer must already be in the processing state. """ return cast( "OutboundTransfer", await cls._static_request_async( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/return".format( outbound_transfer=sanitize_id(outbound_transfer) ), params=params, ), ) @overload @staticmethod async def return_outbound_transfer_async( outbound_transfer: str, **params: Unpack["OutboundTransfer.ReturnOutboundTransferParams"], ) -> "OutboundTransfer": """ Transitions a test mode created OutboundTransfer to the returned status. The OutboundTransfer must already be in the processing state. """ ... @overload async def return_outbound_transfer_async( self, **params: Unpack["OutboundTransfer.ReturnOutboundTransferParams"], ) -> "OutboundTransfer": """ Transitions a test mode created OutboundTransfer to the returned status. The OutboundTransfer must already be in the processing state. """ ... @class_method_variant("_cls_return_outbound_transfer_async") async def return_outbound_transfer_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["OutboundTransfer.ReturnOutboundTransferParams"], ) -> "OutboundTransfer": """ Transitions a test mode created OutboundTransfer to the returned status. The OutboundTransfer must already be in the processing state. """ return cast( "OutboundTransfer", await self.resource._request_async( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}/return".format( outbound_transfer=sanitize_id(self.resource.get("id")) ), params=params, ), ) @classmethod def _cls_update( cls, outbound_transfer: str, **params: Unpack["OutboundTransfer.UpdateParams"], ) -> "OutboundTransfer": """ Updates a test mode created OutboundTransfer with tracking details. The OutboundTransfer must not be cancelable, and cannot be in the canceled or failed states. """ return cast( "OutboundTransfer", cls._static_request( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}".format( outbound_transfer=sanitize_id(outbound_transfer) ), params=params, ), ) @overload @staticmethod def update( outbound_transfer: str, **params: Unpack["OutboundTransfer.UpdateParams"], ) -> "OutboundTransfer": """ Updates a test mode created OutboundTransfer with tracking details. The OutboundTransfer must not be cancelable, and cannot be in the canceled or failed states. """ ... @overload def update( self, **params: Unpack["OutboundTransfer.UpdateParams"] ) -> "OutboundTransfer": """ Updates a test mode created OutboundTransfer with tracking details. The OutboundTransfer must not be cancelable, and cannot be in the canceled or failed states. """ ... @class_method_variant("_cls_update") def update( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["OutboundTransfer.UpdateParams"] ) -> "OutboundTransfer": """ Updates a test mode created OutboundTransfer with tracking details. The OutboundTransfer must not be cancelable, and cannot be in the canceled or failed states. """ return cast( "OutboundTransfer", self.resource._request( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}".format( outbound_transfer=sanitize_id(self.resource.get("id")) ), params=params, ), ) @classmethod async def _cls_update_async( cls, outbound_transfer: str, **params: Unpack["OutboundTransfer.UpdateParams"], ) -> "OutboundTransfer": """ Updates a test mode created OutboundTransfer with tracking details. The OutboundTransfer must not be cancelable, and cannot be in the canceled or failed states. """ return cast( "OutboundTransfer", await cls._static_request_async( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}".format( outbound_transfer=sanitize_id(outbound_transfer) ), params=params, ), ) @overload @staticmethod async def update_async( outbound_transfer: str, **params: Unpack["OutboundTransfer.UpdateParams"], ) -> "OutboundTransfer": """ Updates a test mode created OutboundTransfer with tracking details. The OutboundTransfer must not be cancelable, and cannot be in the canceled or failed states. """ ... @overload async def update_async( self, **params: Unpack["OutboundTransfer.UpdateParams"] ) -> "OutboundTransfer": """ Updates a test mode created OutboundTransfer with tracking details. The OutboundTransfer must not be cancelable, and cannot be in the canceled or failed states. """ ... @class_method_variant("_cls_update_async") async def update_async( # pyright: ignore[reportGeneralTypeIssues] self, **params: Unpack["OutboundTransfer.UpdateParams"] ) -> "OutboundTransfer": """ Updates a test mode created OutboundTransfer with tracking details. The OutboundTransfer must not be cancelable, and cannot be in the canceled or failed states. """ return cast( "OutboundTransfer", await self.resource._request_async( "post", "/v1/test_helpers/treasury/outbound_transfers/{outbound_transfer}".format( outbound_transfer=sanitize_id(self.resource.get("id")) ), params=params, ), ) @property def test_helpers(self): return self.TestHelpers(self) _inner_class_types = { "destination_payment_method_details": DestinationPaymentMethodDetails, "returned_details": ReturnedDetails, "status_transitions": StatusTransitions, "tracking_details": TrackingDetails, } OutboundTransfer.TestHelpers._resource_cls = OutboundTransfer ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/treasury/_outbound_transfer_service.py0000644000175100001770000002372214637354563023712 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.treasury._outbound_transfer import OutboundTransfer from typing import Dict, List, cast from typing_extensions import Literal, NotRequired, TypedDict class OutboundTransferService(StripeService): class CancelParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ class CreateParams(TypedDict): amount: int """ Amount (in cents) to be transferred. """ 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 string attached to the object. Often useful for displaying to users. """ destination_payment_method: NotRequired[str] """ The PaymentMethod to use as the payment instrument for the OutboundTransfer. """ destination_payment_method_options: NotRequired[ "OutboundTransferService.CreateParamsDestinationPaymentMethodOptions" ] """ Hash describing payment method configuration details. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ financial_account: str """ The FinancialAccount to pull funds from. """ metadata: NotRequired[Dict[str, str]] """ Set of [key-value pairs](https://stripe.com/docs/api/metadata) that you can attach to an object. This can be useful for storing additional information about the object in a structured format. Individual keys can be unset by posting an empty value to them. All keys can be unset by posting an empty value to `metadata`. """ statement_descriptor: NotRequired[str] """ Statement descriptor to be shown on the receiving end of an OutboundTransfer. Maximum 10 characters for `ach` transfers or 140 characters for `us_domestic_wire` transfers. The default value is "transfer". """ class CreateParamsDestinationPaymentMethodOptions(TypedDict): us_bank_account: NotRequired[ "Literal['']|OutboundTransferService.CreateParamsDestinationPaymentMethodOptionsUsBankAccount" ] """ Optional fields for `us_bank_account`. """ class CreateParamsDestinationPaymentMethodOptionsUsBankAccount(TypedDict): network: NotRequired[Literal["ach", "us_domestic_wire"]] """ Specifies the network rails to be used. If not set, will default to the PaymentMethod's preferred network. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. """ class ListParams(TypedDict): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ financial_account: str """ Returns objects associated with this FinancialAccount. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[ Literal["canceled", "failed", "posted", "processing", "returned"] ] """ Only return OutboundTransfers that have the given status: `processing`, `canceled`, `failed`, `posted`, or `returned`. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def list( self, params: "OutboundTransferService.ListParams", options: RequestOptions = {}, ) -> ListObject[OutboundTransfer]: """ Returns a list of OutboundTransfers sent from the specified FinancialAccount. """ return cast( ListObject[OutboundTransfer], self._request( "get", "/v1/treasury/outbound_transfers", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "OutboundTransferService.ListParams", options: RequestOptions = {}, ) -> ListObject[OutboundTransfer]: """ Returns a list of OutboundTransfers sent from the specified FinancialAccount. """ return cast( ListObject[OutboundTransfer], await self._request_async( "get", "/v1/treasury/outbound_transfers", api_mode="V1", base_address="api", params=params, options=options, ), ) def create( self, params: "OutboundTransferService.CreateParams", options: RequestOptions = {}, ) -> OutboundTransfer: """ Creates an OutboundTransfer. """ return cast( OutboundTransfer, self._request( "post", "/v1/treasury/outbound_transfers", api_mode="V1", base_address="api", params=params, options=options, ), ) async def create_async( self, params: "OutboundTransferService.CreateParams", options: RequestOptions = {}, ) -> OutboundTransfer: """ Creates an OutboundTransfer. """ return cast( OutboundTransfer, await self._request_async( "post", "/v1/treasury/outbound_transfers", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, outbound_transfer: str, params: "OutboundTransferService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> OutboundTransfer: """ Retrieves the details of an existing OutboundTransfer by passing the unique OutboundTransfer ID from either the OutboundTransfer creation request or OutboundTransfer list. """ return cast( OutboundTransfer, self._request( "get", "/v1/treasury/outbound_transfers/{outbound_transfer}".format( outbound_transfer=sanitize_id(outbound_transfer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, outbound_transfer: str, params: "OutboundTransferService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> OutboundTransfer: """ Retrieves the details of an existing OutboundTransfer by passing the unique OutboundTransfer ID from either the OutboundTransfer creation request or OutboundTransfer list. """ return cast( OutboundTransfer, await self._request_async( "get", "/v1/treasury/outbound_transfers/{outbound_transfer}".format( outbound_transfer=sanitize_id(outbound_transfer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) def cancel( self, outbound_transfer: str, params: "OutboundTransferService.CancelParams" = {}, options: RequestOptions = {}, ) -> OutboundTransfer: """ An OutboundTransfer can be canceled if the funds have not yet been paid out. """ return cast( OutboundTransfer, self._request( "post", "/v1/treasury/outbound_transfers/{outbound_transfer}/cancel".format( outbound_transfer=sanitize_id(outbound_transfer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def cancel_async( self, outbound_transfer: str, params: "OutboundTransferService.CancelParams" = {}, options: RequestOptions = {}, ) -> OutboundTransfer: """ An OutboundTransfer can be canceled if the funds have not yet been paid out. """ return cast( OutboundTransfer, await self._request_async( "post", "/v1/treasury/outbound_transfers/{outbound_transfer}/cancel".format( outbound_transfer=sanitize_id(outbound_transfer), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/treasury/_received_credit.py0000644000175100001770000004167514637354563021556 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._test_helpers import APIResourceTestHelpers from typing import ClassVar, List, Optional, cast from typing_extensions import ( Literal, NotRequired, Type, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe._payout import Payout from stripe.treasury._credit_reversal import CreditReversal from stripe.treasury._outbound_payment import OutboundPayment from stripe.treasury._transaction import Transaction class ReceivedCredit(ListableAPIResource["ReceivedCredit"]): """ ReceivedCredits represent funds sent to a [FinancialAccount](https://stripe.com/docs/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"]] = ( "treasury.received_credit" ) class InitiatingPaymentMethodDetails(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 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State, county, province, or region. """ address: Address email: Optional[str] """ Email address. """ name: Optional[str] """ Full name. """ _inner_class_types = {"address": Address} class FinancialAccount(StripeObject): id: str """ The FinancialAccount ID. """ network: Literal["stripe"] """ The rails the ReceivedCredit was sent over. A FinancialAccount can only send funds over `stripe`. """ class UsBankAccount(StripeObject): bank_name: Optional[str] """ Bank name. """ last4: Optional[str] """ The last four digits of the bank account number. """ routing_number: Optional[str] """ The routing number for the bank account. """ balance: Optional[Literal["payments"]] """ Set when `type` is `balance`. """ billing_details: BillingDetails financial_account: Optional[FinancialAccount] issuing_card: Optional[str] """ Set when `type` is `issuing_card`. This is an [Issuing Card](https://stripe.com/docs/api#issuing_cards) ID. """ type: Literal[ "balance", "financial_account", "issuing_card", "stripe", "us_bank_account", ] """ Polymorphic type matching the originating money movement's source. This can be an external account, a Stripe balance, or a FinancialAccount. """ us_bank_account: Optional[UsBankAccount] _inner_class_types = { "billing_details": BillingDetails, "financial_account": FinancialAccount, "us_bank_account": UsBankAccount, } class LinkedFlows(StripeObject): class SourceFlowDetails(StripeObject): credit_reversal: Optional["CreditReversal"] """ You can reverse some [ReceivedCredits](https://stripe.com/docs/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 to send funds to another party's external bank account or [FinancialAccount](https://stripe.com/docs/api#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://stripe.com/docs/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. """ payout: Optional["Payout"] """ A `Payout` object is created when you receive funds from Stripe, or when you initiate a payout to either a bank account or debit card of a [connected Stripe account](https://stripe.com/docs/connect/bank-debit-card-payouts). You can retrieve individual payouts, and list all payouts. Payouts are made on [varying schedules](https://stripe.com/docs/connect/manage-payout-schedule), depending on your country and industry. Related guide: [Receiving payouts](https://stripe.com/docs/payouts) """ type: Literal[ "credit_reversal", "other", "outbound_payment", "payout" ] """ The type of the source flow that originated the ReceivedCredit. """ credit_reversal: Optional[str] """ The CreditReversal created as a result of this ReceivedCredit being reversed. """ issuing_authorization: Optional[str] """ Set if the ReceivedCredit was created due to an [Issuing Authorization](https://stripe.com/docs/api#issuing_authorizations) object. """ issuing_transaction: Optional[str] """ Set if the ReceivedCredit is also viewable as an [Issuing transaction](https://stripe.com/docs/api#issuing_transactions) object. """ source_flow: Optional[str] """ ID of the source flow. Set if `network` is `stripe` and the source flow is visible to the user. Examples of source flows include OutboundPayments, payouts, or CreditReversals. """ source_flow_details: Optional[SourceFlowDetails] """ The expandable object of the source flow. """ source_flow_type: Optional[str] """ The type of flow that originated the ReceivedCredit (for example, `outbound_payment`). """ _inner_class_types = {"source_flow_details": SourceFlowDetails} class ReversalDetails(StripeObject): deadline: Optional[int] """ Time before which a ReceivedCredit can be reversed. """ restricted_reason: Optional[ Literal[ "already_reversed", "deadline_passed", "network_restricted", "other", "source_flow_restricted", ] ] """ Set if a ReceivedCredit cannot be reversed. """ class CreateParams(RequestOptions): amount: int """ Amount (in cents) to be transferred. """ 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 string attached to the object. Often useful for displaying to users. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ financial_account: str """ The FinancialAccount to send funds to. """ initiating_payment_method_details: NotRequired[ "ReceivedCredit.CreateParamsInitiatingPaymentMethodDetails" ] """ Initiating payment method details for the object. """ network: Literal["ach", "us_domestic_wire"] """ Specifies the network rails to be used. If not set, will default to the PaymentMethod's preferred network. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. """ class CreateParamsInitiatingPaymentMethodDetails(TypedDict): type: Literal["us_bank_account"] """ The source type. """ us_bank_account: NotRequired[ "ReceivedCredit.CreateParamsInitiatingPaymentMethodDetailsUsBankAccount" ] """ Optional fields for `us_bank_account`. """ class CreateParamsInitiatingPaymentMethodDetailsUsBankAccount(TypedDict): account_holder_name: NotRequired[str] """ The bank account holder's name. """ account_number: NotRequired[str] """ The bank account number. """ routing_number: NotRequired[str] """ The bank account's routing number. """ class ListParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ financial_account: str """ The FinancialAccount that received the funds. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ linked_flows: NotRequired["ReceivedCredit.ListParamsLinkedFlows"] """ Only return ReceivedCredits described by the flow. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[Literal["failed", "succeeded"]] """ Only return ReceivedCredits that have the given status: `succeeded` or `failed`. """ class ListParamsLinkedFlows(TypedDict): source_flow_type: Literal[ "credit_reversal", "other", "outbound_payment", "payout" ] """ The source flow type. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ amount: int """ Amount (in cents) transferred. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ 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: str """ An arbitrary string attached to the object. Often useful for displaying to users. """ failure_code: Optional[ Literal["account_closed", "account_frozen", "other"] ] """ Reason for the failure. A ReceivedCredit might fail because the receiving FinancialAccount is closed or frozen. """ financial_account: Optional[str] """ The FinancialAccount that received the funds. """ hosted_regulatory_receipt_url: Optional[str] """ A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. """ id: str """ Unique identifier for the object. """ initiating_payment_method_details: InitiatingPaymentMethodDetails linked_flows: LinkedFlows livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ network: Literal["ach", "card", "stripe", "us_domestic_wire"] """ The rails used to send the funds. """ object: Literal["treasury.received_credit"] """ String representing the object's type. Objects of the same type share the same value. """ reversal_details: Optional[ReversalDetails] """ Details describing when a ReceivedCredit may be reversed. """ status: Literal["failed", "succeeded"] """ Status of the ReceivedCredit. ReceivedCredits are created either `succeeded` (approved) or `failed` (declined). If a ReceivedCredit is declined, the failure reason can be found in the `failure_code` field. """ transaction: Optional[ExpandableField["Transaction"]] """ The Transaction associated with this object. """ @classmethod def list( cls, **params: Unpack["ReceivedCredit.ListParams"] ) -> ListObject["ReceivedCredit"]: """ Returns a list of ReceivedCredits. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["ReceivedCredit.ListParams"] ) -> ListObject["ReceivedCredit"]: """ Returns a list of ReceivedCredits. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def retrieve( cls, id: str, **params: Unpack["ReceivedCredit.RetrieveParams"] ) -> "ReceivedCredit": """ Retrieves the details of an existing ReceivedCredit by passing the unique ReceivedCredit ID from the ReceivedCredit list. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["ReceivedCredit.RetrieveParams"] ) -> "ReceivedCredit": """ Retrieves the details of an existing ReceivedCredit by passing the unique ReceivedCredit ID from the ReceivedCredit list. """ instance = cls(id, **params) await instance.refresh_async() return instance class TestHelpers(APIResourceTestHelpers["ReceivedCredit"]): _resource_cls: Type["ReceivedCredit"] @classmethod def create( cls, **params: Unpack["ReceivedCredit.CreateParams"] ) -> "ReceivedCredit": """ Use this endpoint to simulate a test mode ReceivedCredit initiated by a third party. In live mode, you can't directly create ReceivedCredits initiated by third parties. """ return cast( "ReceivedCredit", cls._static_request( "post", "/v1/test_helpers/treasury/received_credits", params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["ReceivedCredit.CreateParams"] ) -> "ReceivedCredit": """ Use this endpoint to simulate a test mode ReceivedCredit initiated by a third party. In live mode, you can't directly create ReceivedCredits initiated by third parties. """ return cast( "ReceivedCredit", await cls._static_request_async( "post", "/v1/test_helpers/treasury/received_credits", params=params, ), ) @property def test_helpers(self): return self.TestHelpers(self) _inner_class_types = { "initiating_payment_method_details": InitiatingPaymentMethodDetails, "linked_flows": LinkedFlows, "reversal_details": ReversalDetails, } ReceivedCredit.TestHelpers._resource_cls = ReceivedCredit ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/treasury/_received_credit_service.py0000644000175100001770000001143314637354563023263 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.treasury._received_credit import ReceivedCredit from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict class ReceivedCreditService(StripeService): class ListParams(TypedDict): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ financial_account: str """ The FinancialAccount that received the funds. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ linked_flows: NotRequired[ "ReceivedCreditService.ListParamsLinkedFlows" ] """ Only return ReceivedCredits described by the flow. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[Literal["failed", "succeeded"]] """ Only return ReceivedCredits that have the given status: `succeeded` or `failed`. """ class ListParamsLinkedFlows(TypedDict): source_flow_type: Literal[ "credit_reversal", "other", "outbound_payment", "payout" ] """ The source flow type. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def list( self, params: "ReceivedCreditService.ListParams", options: RequestOptions = {}, ) -> ListObject[ReceivedCredit]: """ Returns a list of ReceivedCredits. """ return cast( ListObject[ReceivedCredit], self._request( "get", "/v1/treasury/received_credits", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "ReceivedCreditService.ListParams", options: RequestOptions = {}, ) -> ListObject[ReceivedCredit]: """ Returns a list of ReceivedCredits. """ return cast( ListObject[ReceivedCredit], await self._request_async( "get", "/v1/treasury/received_credits", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, id: str, params: "ReceivedCreditService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> ReceivedCredit: """ Retrieves the details of an existing ReceivedCredit by passing the unique ReceivedCredit ID from the ReceivedCredit list. """ return cast( ReceivedCredit, self._request( "get", "/v1/treasury/received_credits/{id}".format( id=sanitize_id(id) ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, id: str, params: "ReceivedCreditService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> ReceivedCredit: """ Retrieves the details of an existing ReceivedCredit by passing the unique ReceivedCredit ID from the ReceivedCredit list. """ return cast( ReceivedCredit, await self._request_async( "get", "/v1/treasury/received_credits/{id}".format( id=sanitize_id(id) ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/treasury/_received_debit.py0000644000175100001770000003450214637354563021362 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from stripe._test_helpers import APIResourceTestHelpers from typing import ClassVar, List, Optional, cast from typing_extensions import ( Literal, NotRequired, Type, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe.treasury._transaction import Transaction class ReceivedDebit(ListableAPIResource["ReceivedDebit"]): """ ReceivedDebits represent funds pulled from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts). These are not initiated from the FinancialAccount. """ OBJECT_NAME: ClassVar[Literal["treasury.received_debit"]] = ( "treasury.received_debit" ) class InitiatingPaymentMethodDetails(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 (e.g., street, PO Box, or company name). """ line2: Optional[str] """ Address line 2 (e.g., apartment, suite, unit, or building). """ postal_code: Optional[str] """ ZIP or postal code. """ state: Optional[str] """ State, county, province, or region. """ address: Address email: Optional[str] """ Email address. """ name: Optional[str] """ Full name. """ _inner_class_types = {"address": Address} class FinancialAccount(StripeObject): id: str """ The FinancialAccount ID. """ network: Literal["stripe"] """ The rails the ReceivedCredit was sent over. A FinancialAccount can only send funds over `stripe`. """ class UsBankAccount(StripeObject): bank_name: Optional[str] """ Bank name. """ last4: Optional[str] """ The last four digits of the bank account number. """ routing_number: Optional[str] """ The routing number for the bank account. """ balance: Optional[Literal["payments"]] """ Set when `type` is `balance`. """ billing_details: BillingDetails financial_account: Optional[FinancialAccount] issuing_card: Optional[str] """ Set when `type` is `issuing_card`. This is an [Issuing Card](https://stripe.com/docs/api#issuing_cards) ID. """ type: Literal[ "balance", "financial_account", "issuing_card", "stripe", "us_bank_account", ] """ Polymorphic type matching the originating money movement's source. This can be an external account, a Stripe balance, or a FinancialAccount. """ us_bank_account: Optional[UsBankAccount] _inner_class_types = { "billing_details": BillingDetails, "financial_account": FinancialAccount, "us_bank_account": UsBankAccount, } class LinkedFlows(StripeObject): debit_reversal: Optional[str] """ The DebitReversal created as a result of this ReceivedDebit being reversed. """ inbound_transfer: Optional[str] """ Set if the ReceivedDebit is associated with an InboundTransfer's return of funds. """ issuing_authorization: Optional[str] """ Set if the ReceivedDebit was created due to an [Issuing Authorization](https://stripe.com/docs/api#issuing_authorizations) object. """ issuing_transaction: Optional[str] """ Set if the ReceivedDebit is also viewable as an [Issuing Dispute](https://stripe.com/docs/api#issuing_disputes) object. """ payout: Optional[str] """ Set if the ReceivedDebit was created due to a [Payout](https://stripe.com/docs/api#payouts) object. """ class ReversalDetails(StripeObject): deadline: Optional[int] """ Time before which a ReceivedDebit can be reversed. """ restricted_reason: Optional[ Literal[ "already_reversed", "deadline_passed", "network_restricted", "other", "source_flow_restricted", ] ] """ Set if a ReceivedDebit can't be reversed. """ class CreateParams(RequestOptions): amount: int """ Amount (in cents) to be transferred. """ 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 string attached to the object. Often useful for displaying to users. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ financial_account: str """ The FinancialAccount to pull funds from. """ initiating_payment_method_details: NotRequired[ "ReceivedDebit.CreateParamsInitiatingPaymentMethodDetails" ] """ Initiating payment method details for the object. """ network: Literal["ach"] """ Specifies the network rails to be used. If not set, will default to the PaymentMethod's preferred network. See the [docs](https://stripe.com/docs/treasury/money-movement/timelines) to learn more about money movement timelines for each network type. """ class CreateParamsInitiatingPaymentMethodDetails(TypedDict): type: Literal["us_bank_account"] """ The source type. """ us_bank_account: NotRequired[ "ReceivedDebit.CreateParamsInitiatingPaymentMethodDetailsUsBankAccount" ] """ Optional fields for `us_bank_account`. """ class CreateParamsInitiatingPaymentMethodDetailsUsBankAccount(TypedDict): account_holder_name: NotRequired[str] """ The bank account holder's name. """ account_number: NotRequired[str] """ The bank account number. """ routing_number: NotRequired[str] """ The bank account's routing number. """ class ListParams(RequestOptions): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ financial_account: str """ The FinancialAccount that funds were pulled from. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[Literal["failed", "succeeded"]] """ Only return ReceivedDebits that have the given status: `succeeded` or `failed`. """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ amount: int """ Amount (in cents) transferred. """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ 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: str """ An arbitrary string attached to the object. Often useful for displaying to users. """ failure_code: Optional[ Literal[ "account_closed", "account_frozen", "insufficient_funds", "other" ] ] """ Reason for the failure. A ReceivedDebit might fail because the FinancialAccount doesn't have sufficient funds, is closed, or is frozen. """ financial_account: Optional[str] """ The FinancialAccount that funds were pulled from. """ hosted_regulatory_receipt_url: Optional[str] """ A [hosted transaction receipt](https://stripe.com/docs/treasury/moving-money/regulatory-receipts) URL that is provided when money movement is considered regulated under Stripe's money transmission licenses. """ id: str """ Unique identifier for the object. """ initiating_payment_method_details: Optional[InitiatingPaymentMethodDetails] linked_flows: LinkedFlows livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ network: Literal["ach", "card", "stripe"] """ The network used for the ReceivedDebit. """ object: Literal["treasury.received_debit"] """ String representing the object's type. Objects of the same type share the same value. """ reversal_details: Optional[ReversalDetails] """ Details describing when a ReceivedDebit might be reversed. """ status: Literal["failed", "succeeded"] """ Status of the ReceivedDebit. ReceivedDebits are created with a status of either `succeeded` (approved) or `failed` (declined). The failure reason can be found under the `failure_code`. """ transaction: Optional[ExpandableField["Transaction"]] """ The Transaction associated with this object. """ @classmethod def list( cls, **params: Unpack["ReceivedDebit.ListParams"] ) -> ListObject["ReceivedDebit"]: """ Returns a list of ReceivedDebits. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["ReceivedDebit.ListParams"] ) -> ListObject["ReceivedDebit"]: """ Returns a list of ReceivedDebits. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def retrieve( cls, id: str, **params: Unpack["ReceivedDebit.RetrieveParams"] ) -> "ReceivedDebit": """ Retrieves the details of an existing ReceivedDebit by passing the unique ReceivedDebit ID from the ReceivedDebit list """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["ReceivedDebit.RetrieveParams"] ) -> "ReceivedDebit": """ Retrieves the details of an existing ReceivedDebit by passing the unique ReceivedDebit ID from the ReceivedDebit list """ instance = cls(id, **params) await instance.refresh_async() return instance class TestHelpers(APIResourceTestHelpers["ReceivedDebit"]): _resource_cls: Type["ReceivedDebit"] @classmethod def create( cls, **params: Unpack["ReceivedDebit.CreateParams"] ) -> "ReceivedDebit": """ Use this endpoint to simulate a test mode ReceivedDebit initiated by a third party. In live mode, you can't directly create ReceivedDebits initiated by third parties. """ return cast( "ReceivedDebit", cls._static_request( "post", "/v1/test_helpers/treasury/received_debits", params=params, ), ) @classmethod async def create_async( cls, **params: Unpack["ReceivedDebit.CreateParams"] ) -> "ReceivedDebit": """ Use this endpoint to simulate a test mode ReceivedDebit initiated by a third party. In live mode, you can't directly create ReceivedDebits initiated by third parties. """ return cast( "ReceivedDebit", await cls._static_request_async( "post", "/v1/test_helpers/treasury/received_debits", params=params, ), ) @property def test_helpers(self): return self.TestHelpers(self) _inner_class_types = { "initiating_payment_method_details": InitiatingPaymentMethodDetails, "linked_flows": LinkedFlows, "reversal_details": ReversalDetails, } ReceivedDebit.TestHelpers._resource_cls = ReceivedDebit ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/treasury/_received_debit_service.py0000644000175100001770000001044614637354563023103 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.treasury._received_debit import ReceivedDebit from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict class ReceivedDebitService(StripeService): class ListParams(TypedDict): ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ financial_account: str """ The FinancialAccount that funds were pulled from. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[Literal["failed", "succeeded"]] """ Only return ReceivedDebits that have the given status: `succeeded` or `failed`. """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def list( self, params: "ReceivedDebitService.ListParams", options: RequestOptions = {}, ) -> ListObject[ReceivedDebit]: """ Returns a list of ReceivedDebits. """ return cast( ListObject[ReceivedDebit], self._request( "get", "/v1/treasury/received_debits", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "ReceivedDebitService.ListParams", options: RequestOptions = {}, ) -> ListObject[ReceivedDebit]: """ Returns a list of ReceivedDebits. """ return cast( ListObject[ReceivedDebit], await self._request_async( "get", "/v1/treasury/received_debits", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, id: str, params: "ReceivedDebitService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> ReceivedDebit: """ Retrieves the details of an existing ReceivedDebit by passing the unique ReceivedDebit ID from the ReceivedDebit list """ return cast( ReceivedDebit, self._request( "get", "/v1/treasury/received_debits/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, id: str, params: "ReceivedDebitService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> ReceivedDebit: """ Retrieves the details of an existing ReceivedDebit by passing the unique ReceivedDebit ID from the ReceivedDebit list """ return cast( ReceivedDebit, await self._request_async( "get", "/v1/treasury/received_debits/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/treasury/_transaction.py0000644000175100001770000003114514637354563020752 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from typing import ClassVar, List, Optional from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe.issuing._authorization import Authorization from stripe.treasury._credit_reversal import CreditReversal from stripe.treasury._debit_reversal import DebitReversal from stripe.treasury._inbound_transfer import InboundTransfer from stripe.treasury._outbound_payment import OutboundPayment from stripe.treasury._outbound_transfer import OutboundTransfer from stripe.treasury._received_credit import ReceivedCredit from stripe.treasury._received_debit import ReceivedDebit from stripe.treasury._transaction_entry import TransactionEntry class Transaction(ListableAPIResource["Transaction"]): """ Transactions represent changes to a [FinancialAccount's](https://stripe.com/docs/api#financial_accounts) balance. """ OBJECT_NAME: ClassVar[Literal["treasury.transaction"]] = ( "treasury.transaction" ) class BalanceImpact(StripeObject): cash: int """ The change made to funds the user can spend right now. """ inbound_pending: int """ The change made to funds that are not spendable yet, but will become available at a later time. """ outbound_pending: int """ The change made to funds in the account, but not spendable because they are being held for pending outbound flows. """ class FlowDetails(StripeObject): credit_reversal: Optional["CreditReversal"] """ You can reverse some [ReceivedCredits](https://stripe.com/docs/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://stripe.com/docs/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://stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) to add funds to your [FinancialAccount](https://stripe.com/docs/api#financial_accounts) via a PaymentMethod that is owned by you. The funds will be transferred via an ACH debit. """ issuing_authorization: Optional["Authorization"] """ When an [issued card](https://stripe.com/docs/issuing) is used to make a purchase, an Issuing `Authorization` object is created. [Authorizations](https://stripe.com/docs/issuing/purchases/authorizations) must be approved for the purchase to be completed successfully. Related guide: [Issued card authorizations](https://stripe.com/docs/issuing/purchases/authorizations) """ outbound_payment: Optional["OutboundPayment"] """ Use OutboundPayments to send funds to another party's external bank account or [FinancialAccount](https://stripe.com/docs/api#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://stripe.com/docs/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. """ outbound_transfer: Optional["OutboundTransfer"] """ Use OutboundTransfers to transfer funds from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](https://stripe.com/docs/api#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account. Simulate OutboundTransfer state changes with the `/v1/test_helpers/treasury/outbound_transfers` endpoints. These methods can only be called on test mode objects. """ received_credit: Optional["ReceivedCredit"] """ ReceivedCredits represent funds sent to a [FinancialAccount](https://stripe.com/docs/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://stripe.com/docs/api#financial_accounts). These are not initiated from the FinancialAccount. """ type: Literal[ "credit_reversal", "debit_reversal", "inbound_transfer", "issuing_authorization", "other", "outbound_payment", "outbound_transfer", "received_credit", "received_debit", ] """ Type of the flow that created the Transaction. Set to the same value as `flow_type`. """ class StatusTransitions(StripeObject): posted_at: Optional[int] """ Timestamp describing when the Transaction changed status to `posted`. """ void_at: Optional[int] """ Timestamp describing when the Transaction changed status to `void`. """ class ListParams(RequestOptions): created: NotRequired["Transaction.ListParamsCreated|int"] """ Only return Transactions that were created during the given date interval. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ financial_account: str """ Returns objects associated with this FinancialAccount. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ order_by: NotRequired[Literal["created", "posted_at"]] """ The results are in reverse chronological order by `created` or `posted_at`. The default is `created`. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[Literal["open", "posted", "void"]] """ Only return Transactions that have the given status: `open`, `posted`, or `void`. """ status_transitions: NotRequired[ "Transaction.ListParamsStatusTransitions" ] """ A filter for the `status_transitions.posted_at` timestamp. When using this filter, `status=posted` and `order_by=posted_at` must also be specified. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsStatusTransitions(TypedDict): posted_at: NotRequired[ "Transaction.ListParamsStatusTransitionsPostedAt|int" ] """ Returns Transactions with `posted_at` within the specified range. """ class ListParamsStatusTransitionsPostedAt(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ amount: int """ Amount (in cents) transferred. """ balance_impact: BalanceImpact """ Change to a FinancialAccount's balance """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ 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: str """ An arbitrary string attached to the object. Often useful for displaying to users. """ entries: Optional[ListObject["TransactionEntry"]] """ A list of TransactionEntries that are part of this Transaction. This cannot be expanded in any list endpoints. """ financial_account: str """ The FinancialAccount associated with this object. """ flow: Optional[str] """ ID of the flow that created the Transaction. """ flow_details: Optional[FlowDetails] """ Details of the flow that created the Transaction. """ flow_type: Literal[ "credit_reversal", "debit_reversal", "inbound_transfer", "issuing_authorization", "other", "outbound_payment", "outbound_transfer", "received_credit", "received_debit", ] """ Type of the flow that created the Transaction. """ id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ object: Literal["treasury.transaction"] """ String representing the object's type. Objects of the same type share the same value. """ status: Literal["open", "posted", "void"] """ Status of the Transaction. """ status_transitions: StatusTransitions @classmethod def list( cls, **params: Unpack["Transaction.ListParams"] ) -> ListObject["Transaction"]: """ Retrieves a list of Transaction objects. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["Transaction.ListParams"] ) -> ListObject["Transaction"]: """ Retrieves a list of Transaction objects. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def retrieve( cls, id: str, **params: Unpack["Transaction.RetrieveParams"] ) -> "Transaction": """ Retrieves the details of an existing Transaction. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["Transaction.RetrieveParams"] ) -> "Transaction": """ Retrieves the details of an existing Transaction. """ instance = cls(id, **params) await instance.refresh_async() return instance _inner_class_types = { "balance_impact": BalanceImpact, "flow_details": FlowDetails, "status_transitions": StatusTransitions, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/treasury/_transaction_entry.py0000644000175100001770000003073014637354563022172 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._expandable_field import ExpandableField from stripe._list_object import ListObject from stripe._listable_api_resource import ListableAPIResource from stripe._request_options import RequestOptions from stripe._stripe_object import StripeObject from typing import ClassVar, List, Optional from typing_extensions import ( Literal, NotRequired, TypedDict, Unpack, TYPE_CHECKING, ) if TYPE_CHECKING: from stripe.issuing._authorization import Authorization from stripe.treasury._credit_reversal import CreditReversal from stripe.treasury._debit_reversal import DebitReversal from stripe.treasury._inbound_transfer import InboundTransfer from stripe.treasury._outbound_payment import OutboundPayment from stripe.treasury._outbound_transfer import OutboundTransfer from stripe.treasury._received_credit import ReceivedCredit from stripe.treasury._received_debit import ReceivedDebit from stripe.treasury._transaction import Transaction class TransactionEntry(ListableAPIResource["TransactionEntry"]): """ TransactionEntries represent individual units of money movements within a single [Transaction](https://stripe.com/docs/api#transactions). """ OBJECT_NAME: ClassVar[Literal["treasury.transaction_entry"]] = ( "treasury.transaction_entry" ) class BalanceImpact(StripeObject): cash: int """ The change made to funds the user can spend right now. """ inbound_pending: int """ The change made to funds that are not spendable yet, but will become available at a later time. """ outbound_pending: int """ The change made to funds in the account, but not spendable because they are being held for pending outbound flows. """ class FlowDetails(StripeObject): credit_reversal: Optional["CreditReversal"] """ You can reverse some [ReceivedCredits](https://stripe.com/docs/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://stripe.com/docs/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://stripe.com/docs/treasury/moving-money/financial-accounts/into/inbound-transfers) to add funds to your [FinancialAccount](https://stripe.com/docs/api#financial_accounts) via a PaymentMethod that is owned by you. The funds will be transferred via an ACH debit. """ issuing_authorization: Optional["Authorization"] """ When an [issued card](https://stripe.com/docs/issuing) is used to make a purchase, an Issuing `Authorization` object is created. [Authorizations](https://stripe.com/docs/issuing/purchases/authorizations) must be approved for the purchase to be completed successfully. Related guide: [Issued card authorizations](https://stripe.com/docs/issuing/purchases/authorizations) """ outbound_payment: Optional["OutboundPayment"] """ Use OutboundPayments to send funds to another party's external bank account or [FinancialAccount](https://stripe.com/docs/api#financial_accounts). To send money to an account belonging to the same user, use an [OutboundTransfer](https://stripe.com/docs/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. """ outbound_transfer: Optional["OutboundTransfer"] """ Use OutboundTransfers to transfer funds from a [FinancialAccount](https://stripe.com/docs/api#financial_accounts) to a PaymentMethod belonging to the same entity. To send funds to a different party, use [OutboundPayments](https://stripe.com/docs/api#outbound_payments) instead. You can send funds over ACH rails or through a domestic wire transfer to a user's own external bank account. Simulate OutboundTransfer state changes with the `/v1/test_helpers/treasury/outbound_transfers` endpoints. These methods can only be called on test mode objects. """ received_credit: Optional["ReceivedCredit"] """ ReceivedCredits represent funds sent to a [FinancialAccount](https://stripe.com/docs/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://stripe.com/docs/api#financial_accounts). These are not initiated from the FinancialAccount. """ type: Literal[ "credit_reversal", "debit_reversal", "inbound_transfer", "issuing_authorization", "other", "outbound_payment", "outbound_transfer", "received_credit", "received_debit", ] """ Type of the flow that created the Transaction. Set to the same value as `flow_type`. """ class ListParams(RequestOptions): created: NotRequired["TransactionEntry.ListParamsCreated|int"] """ Only return TransactionEntries that were created during the given date interval. """ effective_at: NotRequired["TransactionEntry.ListParamsEffectiveAt|int"] ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ financial_account: str """ Returns objects associated with this FinancialAccount. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ order_by: NotRequired[Literal["created", "effective_at"]] """ The results are in reverse chronological order by `created` or `effective_at`. The default is `created`. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ transaction: NotRequired[str] """ Only return TransactionEntries associated with this Transaction. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsEffectiveAt(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(RequestOptions): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ balance_impact: BalanceImpact """ Change to a FinancialAccount's balance """ created: int """ Time at which the object was created. Measured in seconds since the Unix epoch. """ 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). """ effective_at: int """ When the TransactionEntry will impact the FinancialAccount's balance. """ financial_account: str """ The FinancialAccount associated with this object. """ flow: Optional[str] """ Token of the flow associated with the TransactionEntry. """ flow_details: Optional[FlowDetails] """ Details of the flow associated with the TransactionEntry. """ flow_type: Literal[ "credit_reversal", "debit_reversal", "inbound_transfer", "issuing_authorization", "other", "outbound_payment", "outbound_transfer", "received_credit", "received_debit", ] """ Type of the flow associated with the TransactionEntry. """ id: str """ Unique identifier for the object. """ livemode: bool """ Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode. """ object: Literal["treasury.transaction_entry"] """ String representing the object's type. Objects of the same type share the same value. """ transaction: ExpandableField["Transaction"] """ The Transaction associated with this object. """ type: Literal[ "credit_reversal", "credit_reversal_posting", "debit_reversal", "inbound_transfer", "inbound_transfer_return", "issuing_authorization_hold", "issuing_authorization_release", "other", "outbound_payment", "outbound_payment_cancellation", "outbound_payment_failure", "outbound_payment_posting", "outbound_payment_return", "outbound_transfer", "outbound_transfer_cancellation", "outbound_transfer_failure", "outbound_transfer_posting", "outbound_transfer_return", "received_credit", "received_debit", ] """ The specific money movement that generated the TransactionEntry. """ @classmethod def list( cls, **params: Unpack["TransactionEntry.ListParams"] ) -> ListObject["TransactionEntry"]: """ Retrieves a list of TransactionEntry objects. """ result = cls._static_request( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod async def list_async( cls, **params: Unpack["TransactionEntry.ListParams"] ) -> ListObject["TransactionEntry"]: """ Retrieves a list of TransactionEntry objects. """ result = await cls._static_request_async( "get", cls.class_url(), params=params, ) if not isinstance(result, ListObject): raise TypeError( "Expected list object from API, got %s" % (type(result).__name__) ) return result @classmethod def retrieve( cls, id: str, **params: Unpack["TransactionEntry.RetrieveParams"] ) -> "TransactionEntry": """ Retrieves a TransactionEntry object. """ instance = cls(id, **params) instance.refresh() return instance @classmethod async def retrieve_async( cls, id: str, **params: Unpack["TransactionEntry.RetrieveParams"] ) -> "TransactionEntry": """ Retrieves a TransactionEntry object. """ instance = cls(id, **params) await instance.refresh_async() return instance @classmethod def class_url(cls): return "/v1/treasury/transaction_entries" _inner_class_types = { "balance_impact": BalanceImpact, "flow_details": FlowDetails, } ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/treasury/_transaction_entry_service.py0000644000175100001770000001317014637354563023711 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.treasury._transaction_entry import TransactionEntry from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict class TransactionEntryService(StripeService): class ListParams(TypedDict): created: NotRequired["TransactionEntryService.ListParamsCreated|int"] """ Only return TransactionEntries that were created during the given date interval. """ effective_at: NotRequired[ "TransactionEntryService.ListParamsEffectiveAt|int" ] ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ financial_account: str """ Returns objects associated with this FinancialAccount. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ order_by: NotRequired[Literal["created", "effective_at"]] """ The results are in reverse chronological order by `created` or `effective_at`. The default is `created`. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ transaction: NotRequired[str] """ Only return TransactionEntries associated with this Transaction. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsEffectiveAt(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def list( self, params: "TransactionEntryService.ListParams", options: RequestOptions = {}, ) -> ListObject[TransactionEntry]: """ Retrieves a list of TransactionEntry objects. """ return cast( ListObject[TransactionEntry], self._request( "get", "/v1/treasury/transaction_entries", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "TransactionEntryService.ListParams", options: RequestOptions = {}, ) -> ListObject[TransactionEntry]: """ Retrieves a list of TransactionEntry objects. """ return cast( ListObject[TransactionEntry], await self._request_async( "get", "/v1/treasury/transaction_entries", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, id: str, params: "TransactionEntryService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> TransactionEntry: """ Retrieves a TransactionEntry object. """ return cast( TransactionEntry, self._request( "get", "/v1/treasury/transaction_entries/{id}".format( id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, id: str, params: "TransactionEntryService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> TransactionEntry: """ Retrieves a TransactionEntry object. """ return cast( TransactionEntry, await self._request_async( "get", "/v1/treasury/transaction_entries/{id}".format( id=sanitize_id(id), ), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/treasury/_transaction_service.py0000644000175100001770000001367014637354563022475 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from stripe._list_object import ListObject from stripe._request_options import RequestOptions from stripe._stripe_service import StripeService from stripe._util import sanitize_id from stripe.treasury._transaction import Transaction from typing import List, cast from typing_extensions import Literal, NotRequired, TypedDict class TransactionService(StripeService): class ListParams(TypedDict): created: NotRequired["TransactionService.ListParamsCreated|int"] """ Only return Transactions that were created during the given date interval. """ ending_before: NotRequired[str] """ A cursor for use in pagination. `ending_before` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, starting with `obj_bar`, your subsequent call can include `ending_before=obj_bar` in order to fetch the previous page of the list. """ expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ financial_account: str """ Returns objects associated with this FinancialAccount. """ limit: NotRequired[int] """ A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10. """ order_by: NotRequired[Literal["created", "posted_at"]] """ The results are in reverse chronological order by `created` or `posted_at`. The default is `created`. """ starting_after: NotRequired[str] """ A cursor for use in pagination. `starting_after` is an object ID that defines your place in the list. For instance, if you make a list request and receive 100 objects, ending with `obj_foo`, your subsequent call can include `starting_after=obj_foo` in order to fetch the next page of the list. """ status: NotRequired[Literal["open", "posted", "void"]] """ Only return Transactions that have the given status: `open`, `posted`, or `void`. """ status_transitions: NotRequired[ "TransactionService.ListParamsStatusTransitions" ] """ A filter for the `status_transitions.posted_at` timestamp. When using this filter, `status=posted` and `order_by=posted_at` must also be specified. """ class ListParamsCreated(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class ListParamsStatusTransitions(TypedDict): posted_at: NotRequired[ "TransactionService.ListParamsStatusTransitionsPostedAt|int" ] """ Returns Transactions with `posted_at` within the specified range. """ class ListParamsStatusTransitionsPostedAt(TypedDict): gt: NotRequired[int] """ Minimum value to filter by (exclusive) """ gte: NotRequired[int] """ Minimum value to filter by (inclusive) """ lt: NotRequired[int] """ Maximum value to filter by (exclusive) """ lte: NotRequired[int] """ Maximum value to filter by (inclusive) """ class RetrieveParams(TypedDict): expand: NotRequired[List[str]] """ Specifies which fields in the response should be expanded. """ def list( self, params: "TransactionService.ListParams", options: RequestOptions = {}, ) -> ListObject[Transaction]: """ Retrieves a list of Transaction objects. """ return cast( ListObject[Transaction], self._request( "get", "/v1/treasury/transactions", api_mode="V1", base_address="api", params=params, options=options, ), ) async def list_async( self, params: "TransactionService.ListParams", options: RequestOptions = {}, ) -> ListObject[Transaction]: """ Retrieves a list of Transaction objects. """ return cast( ListObject[Transaction], await self._request_async( "get", "/v1/treasury/transactions", api_mode="V1", base_address="api", params=params, options=options, ), ) def retrieve( self, id: str, params: "TransactionService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Transaction: """ Retrieves the details of an existing Transaction. """ return cast( Transaction, self._request( "get", "/v1/treasury/transactions/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) async def retrieve_async( self, id: str, params: "TransactionService.RetrieveParams" = {}, options: RequestOptions = {}, ) -> Transaction: """ Retrieves the details of an existing Transaction. """ return cast( Transaction, await self._request_async( "get", "/v1/treasury/transactions/{id}".format(id=sanitize_id(id)), api_mode="V1", base_address="api", params=params, options=options, ), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/util.py0000644000175100001770000000070514637354563015363 0ustar00runnerdocker# -*- coding: utf-8 -*- from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.util package is deprecated, please change your imports to import from stripe directly. From: from stripe.util import convert_to_stripe_object To: from stripe import convert_to_stripe_object """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._util import * # noqa ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/version.py0000644000175100001770000000056014637354563016072 0ustar00runnerdocker# -*- coding: utf-8 -*- from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.version package is deprecated and will become internal in the future. Pleasse access the version via stripe.VERSION. """, DeprecationWarning, ) if not TYPE_CHECKING: from stripe._version import ( # noqa VERSION, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/stripe/webhook.py0000644000175100001770000000073514637354563016047 0ustar00runnerdocker# -*- coding: utf-8 -*- from typing_extensions import TYPE_CHECKING from warnings import warn warn( """ The stripe.webhook package is deprecated, please change your imports to import from stripe directly. From: from stripe.webhook import Webhook To: from stripe import Webhook """, DeprecationWarning, stacklevel=2, ) if not TYPE_CHECKING: from stripe._webhook import ( # noqa Webhook, WebhookSignature, ) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5049403 stripe-10.1.0/stripe.egg-info/0000755000175100001770000000000014637354616015523 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523725.0 stripe-10.1.0/stripe.egg-info/PKG-INFO0000644000175100001770000000463514637354615016627 0ustar00runnerdockerMetadata-Version: 2.1 Name: stripe Version: 10.1.0 Summary: Python bindings for the Stripe API Home-page: https://github.com/stripe/stripe-python Author: Stripe Author-email: support@stripe.com License: MIT Project-URL: Bug Tracker, https://github.com/stripe/stripe-python/issues Project-URL: Changes, https://github.com/stripe/stripe-python/blob/master/CHANGELOG.md Project-URL: Documentation, https://stripe.com/docs/api/?lang=python Project-URL: Source Code, https://github.com/stripe/stripe-python Keywords: stripe api payments Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: MIT License Classifier: Operating System :: OS Independent Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3 :: Only Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: 3.12 Classifier: Programming Language :: Python :: Implementation :: CPython Classifier: Programming Language :: Python :: Implementation :: PyPy Classifier: Topic :: Software Development :: Libraries :: Python Modules Requires-Python: >=3.6 Description-Content-Type: text/x-rst License-File: LICENSE Official Stripe Bindings for Python =================================== A Python library for Stripe's API. Setup ----- You can install this package by using the pip tool and installing: $ pip install stripe Or: $ easy_install stripe Setting up a Stripe Account --------------------------- Sign up for Stripe at https://dashboard.stripe.com/register. Using the Stripe API -------------------- Documentation for the python bindings can be found alongside Stripe's other bindings here: - https://stripe.com/docs - https://stripe.com/docs/api/?lang=python In the standard documentation (the first link), most of the reference pages will have examples in Stripe's official bindings (including Python). Just click on the Python tab to get the relevant documentation. In the full API reference for python (the second link), the right half of the page will provide example requests and responses for various API calls. ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523725.0 stripe-10.1.0/stripe.egg-info/SOURCES.txt0000644000175100001770000005733314637354615017421 0ustar00runnerdocker.coveragerc .flake8 CHANGELOG.md LICENSE LONG_DESCRIPTION.rst MANIFEST.in README.md VERSION pyproject.toml setup.cfg setup.py tox.ini examples/charge.py examples/oauth.py examples/proxy.py examples/webhooks.py stripe/__init__.py stripe/_account.py stripe/_account_capability_service.py stripe/_account_external_account_service.py stripe/_account_link.py stripe/_account_link_service.py stripe/_account_login_link_service.py stripe/_account_person_service.py stripe/_account_service.py stripe/_account_session.py stripe/_account_session_service.py stripe/_any_iterator.py stripe/_api_mode.py stripe/_api_requestor.py stripe/_api_resource.py stripe/_api_version.py stripe/_app_info.py stripe/_apple_pay_domain.py stripe/_apple_pay_domain_service.py stripe/_application.py stripe/_application_fee.py stripe/_application_fee_refund.py stripe/_application_fee_refund_service.py stripe/_application_fee_service.py stripe/_apps_service.py stripe/_balance.py stripe/_balance_service.py stripe/_balance_transaction.py stripe/_balance_transaction_service.py stripe/_bank_account.py stripe/_base_address.py stripe/_billing_portal_service.py stripe/_billing_service.py stripe/_capability.py stripe/_card.py stripe/_cash_balance.py stripe/_charge.py stripe/_charge_service.py stripe/_checkout_service.py stripe/_client_options.py stripe/_climate_service.py stripe/_confirmation_token.py stripe/_confirmation_token_service.py stripe/_connect_collection_transfer.py stripe/_country_spec.py stripe/_country_spec_service.py stripe/_coupon.py stripe/_coupon_service.py stripe/_createable_api_resource.py stripe/_credit_note.py stripe/_credit_note_line_item.py stripe/_credit_note_line_item_service.py stripe/_credit_note_preview_lines_service.py stripe/_credit_note_service.py stripe/_custom_method.py stripe/_customer.py stripe/_customer_balance_transaction.py stripe/_customer_balance_transaction_service.py stripe/_customer_cash_balance_service.py stripe/_customer_cash_balance_transaction.py stripe/_customer_cash_balance_transaction_service.py stripe/_customer_funding_instructions_service.py stripe/_customer_payment_method_service.py stripe/_customer_payment_source_service.py stripe/_customer_service.py stripe/_customer_session.py stripe/_customer_session_service.py stripe/_customer_tax_id_service.py stripe/_deletable_api_resource.py stripe/_discount.py stripe/_dispute.py stripe/_dispute_service.py stripe/_encode.py stripe/_entitlements_service.py stripe/_ephemeral_key.py stripe/_ephemeral_key_service.py stripe/_error.py stripe/_error_object.py stripe/_event.py stripe/_event_service.py stripe/_exchange_rate.py stripe/_exchange_rate_service.py stripe/_expandable_field.py stripe/_file.py stripe/_file_link.py stripe/_file_link_service.py stripe/_file_service.py stripe/_financial_connections_service.py stripe/_forwarding_service.py stripe/_funding_instructions.py stripe/_http_client.py stripe/_identity_service.py stripe/_invoice.py stripe/_invoice_item.py stripe/_invoice_item_service.py stripe/_invoice_line_item.py stripe/_invoice_line_item_service.py stripe/_invoice_service.py stripe/_invoice_upcoming_lines_service.py stripe/_issuing_service.py stripe/_line_item.py stripe/_list_object.py stripe/_listable_api_resource.py stripe/_login_link.py stripe/_mandate.py stripe/_mandate_service.py stripe/_multipart_data_generator.py stripe/_nested_resource_class_methods.py stripe/_oauth.py stripe/_oauth_service.py stripe/_object_classes.py stripe/_payment_intent.py stripe/_payment_intent_service.py stripe/_payment_link.py stripe/_payment_link_line_item_service.py stripe/_payment_link_service.py stripe/_payment_method.py stripe/_payment_method_configuration.py stripe/_payment_method_configuration_service.py stripe/_payment_method_domain.py stripe/_payment_method_domain_service.py stripe/_payment_method_service.py stripe/_payout.py stripe/_payout_service.py stripe/_person.py stripe/_plan.py stripe/_plan_service.py stripe/_price.py stripe/_price_service.py stripe/_product.py stripe/_product_feature.py stripe/_product_feature_service.py stripe/_product_service.py stripe/_promotion_code.py stripe/_promotion_code_service.py stripe/_quote.py stripe/_quote_computed_upfront_line_items_service.py stripe/_quote_line_item_service.py stripe/_quote_service.py stripe/_radar_service.py stripe/_refund.py stripe/_refund_service.py stripe/_reporting_service.py stripe/_request_metrics.py stripe/_request_options.py stripe/_requestor_options.py stripe/_reserve_transaction.py stripe/_reversal.py stripe/_review.py stripe/_review_service.py stripe/_search_result_object.py stripe/_searchable_api_resource.py stripe/_setup_attempt.py stripe/_setup_attempt_service.py stripe/_setup_intent.py stripe/_setup_intent_service.py stripe/_shipping_rate.py stripe/_shipping_rate_service.py stripe/_sigma_service.py stripe/_singleton_api_resource.py stripe/_source.py stripe/_source_mandate_notification.py stripe/_source_service.py stripe/_source_transaction.py stripe/_source_transaction_service.py stripe/_stripe_client.py stripe/_stripe_object.py stripe/_stripe_response.py stripe/_stripe_service.py stripe/_subscription.py stripe/_subscription_item.py stripe/_subscription_item_service.py stripe/_subscription_item_usage_record_service.py stripe/_subscription_item_usage_record_summary_service.py stripe/_subscription_schedule.py stripe/_subscription_schedule_service.py stripe/_subscription_service.py stripe/_tax_code.py stripe/_tax_code_service.py stripe/_tax_deducted_at_source.py stripe/_tax_id.py stripe/_tax_id_service.py stripe/_tax_rate.py stripe/_tax_rate_service.py stripe/_tax_service.py stripe/_terminal_service.py stripe/_test_helpers.py stripe/_test_helpers_service.py stripe/_token.py stripe/_token_service.py stripe/_topup.py stripe/_topup_service.py stripe/_transfer.py stripe/_transfer_reversal_service.py stripe/_transfer_service.py stripe/_treasury_service.py stripe/_updateable_api_resource.py stripe/_usage_record.py stripe/_usage_record_summary.py stripe/_util.py stripe/_verify_mixin.py stripe/_version.py stripe/_webhook.py stripe/_webhook_endpoint.py stripe/_webhook_endpoint_service.py stripe/api_version.py stripe/app_info.py stripe/error.py stripe/http_client.py stripe/multipart_data_generator.py stripe/oauth.py stripe/oauth_error.py stripe/py.typed stripe/request_metrics.py stripe/request_options.py stripe/stripe_object.py stripe/stripe_response.py stripe/util.py stripe/version.py stripe/webhook.py stripe.egg-info/PKG-INFO stripe.egg-info/SOURCES.txt stripe.egg-info/dependency_links.txt stripe.egg-info/not-zip-safe stripe.egg-info/requires.txt stripe.egg-info/top_level.txt stripe/api_resources/__init__.py stripe/api_resources/account.py stripe/api_resources/account_link.py stripe/api_resources/account_session.py stripe/api_resources/apple_pay_domain.py stripe/api_resources/application.py stripe/api_resources/application_fee.py stripe/api_resources/application_fee_refund.py stripe/api_resources/balance.py stripe/api_resources/balance_transaction.py stripe/api_resources/bank_account.py stripe/api_resources/capability.py stripe/api_resources/card.py stripe/api_resources/cash_balance.py stripe/api_resources/charge.py stripe/api_resources/confirmation_token.py stripe/api_resources/connect_collection_transfer.py stripe/api_resources/country_spec.py stripe/api_resources/coupon.py stripe/api_resources/credit_note.py stripe/api_resources/credit_note_line_item.py stripe/api_resources/customer.py stripe/api_resources/customer_balance_transaction.py stripe/api_resources/customer_cash_balance_transaction.py stripe/api_resources/customer_session.py stripe/api_resources/discount.py stripe/api_resources/dispute.py stripe/api_resources/ephemeral_key.py stripe/api_resources/error_object.py stripe/api_resources/event.py stripe/api_resources/exchange_rate.py stripe/api_resources/file.py stripe/api_resources/file_link.py stripe/api_resources/funding_instructions.py stripe/api_resources/invoice.py stripe/api_resources/invoice_item.py stripe/api_resources/invoice_line_item.py stripe/api_resources/line_item.py stripe/api_resources/list_object.py stripe/api_resources/login_link.py stripe/api_resources/mandate.py stripe/api_resources/payment_intent.py stripe/api_resources/payment_link.py stripe/api_resources/payment_method.py stripe/api_resources/payment_method_configuration.py stripe/api_resources/payment_method_domain.py stripe/api_resources/payout.py stripe/api_resources/person.py stripe/api_resources/plan.py stripe/api_resources/price.py stripe/api_resources/product.py stripe/api_resources/product_feature.py stripe/api_resources/promotion_code.py stripe/api_resources/quote.py stripe/api_resources/recipient_transfer.py stripe/api_resources/refund.py stripe/api_resources/reserve_transaction.py stripe/api_resources/reversal.py stripe/api_resources/review.py stripe/api_resources/search_result_object.py stripe/api_resources/setup_attempt.py stripe/api_resources/setup_intent.py stripe/api_resources/shipping_rate.py stripe/api_resources/source.py stripe/api_resources/source_mandate_notification.py stripe/api_resources/source_transaction.py stripe/api_resources/subscription.py stripe/api_resources/subscription_item.py stripe/api_resources/subscription_schedule.py stripe/api_resources/tax_code.py stripe/api_resources/tax_deducted_at_source.py stripe/api_resources/tax_id.py stripe/api_resources/tax_rate.py stripe/api_resources/token.py stripe/api_resources/topup.py stripe/api_resources/transfer.py stripe/api_resources/usage_record.py stripe/api_resources/usage_record_summary.py stripe/api_resources/webhook_endpoint.py stripe/api_resources/abstract/__init__.py stripe/api_resources/abstract/api_resource.py stripe/api_resources/abstract/createable_api_resource.py stripe/api_resources/abstract/custom_method.py stripe/api_resources/abstract/deletable_api_resource.py stripe/api_resources/abstract/listable_api_resource.py stripe/api_resources/abstract/nested_resource_class_methods.py stripe/api_resources/abstract/searchable_api_resource.py stripe/api_resources/abstract/singleton_api_resource.py stripe/api_resources/abstract/test_helpers.py stripe/api_resources/abstract/updateable_api_resource.py stripe/api_resources/abstract/verify_mixin.py stripe/api_resources/apps/__init__.py stripe/api_resources/apps/secret.py stripe/api_resources/billing/__init__.py stripe/api_resources/billing/meter.py stripe/api_resources/billing/meter_event.py stripe/api_resources/billing/meter_event_adjustment.py stripe/api_resources/billing/meter_event_summary.py stripe/api_resources/billing_portal/__init__.py stripe/api_resources/billing_portal/configuration.py stripe/api_resources/billing_portal/session.py stripe/api_resources/checkout/__init__.py stripe/api_resources/checkout/session.py stripe/api_resources/climate/__init__.py stripe/api_resources/climate/order.py stripe/api_resources/climate/product.py stripe/api_resources/climate/supplier.py stripe/api_resources/entitlements/__init__.py stripe/api_resources/entitlements/active_entitlement.py stripe/api_resources/entitlements/active_entitlement_summary.py stripe/api_resources/entitlements/feature.py stripe/api_resources/financial_connections/__init__.py stripe/api_resources/financial_connections/account.py stripe/api_resources/financial_connections/account_owner.py stripe/api_resources/financial_connections/account_ownership.py stripe/api_resources/financial_connections/session.py stripe/api_resources/financial_connections/transaction.py stripe/api_resources/forwarding/__init__.py stripe/api_resources/forwarding/request.py stripe/api_resources/identity/__init__.py stripe/api_resources/identity/verification_report.py stripe/api_resources/identity/verification_session.py stripe/api_resources/issuing/__init__.py stripe/api_resources/issuing/authorization.py stripe/api_resources/issuing/card.py stripe/api_resources/issuing/cardholder.py stripe/api_resources/issuing/dispute.py stripe/api_resources/issuing/personalization_design.py stripe/api_resources/issuing/physical_bundle.py stripe/api_resources/issuing/token.py stripe/api_resources/issuing/transaction.py stripe/api_resources/radar/__init__.py stripe/api_resources/radar/early_fraud_warning.py stripe/api_resources/radar/value_list.py stripe/api_resources/radar/value_list_item.py stripe/api_resources/reporting/__init__.py stripe/api_resources/reporting/report_run.py stripe/api_resources/reporting/report_type.py stripe/api_resources/sigma/__init__.py stripe/api_resources/sigma/scheduled_query_run.py stripe/api_resources/tax/__init__.py stripe/api_resources/tax/calculation.py stripe/api_resources/tax/calculation_line_item.py stripe/api_resources/tax/registration.py stripe/api_resources/tax/settings.py stripe/api_resources/tax/transaction.py stripe/api_resources/tax/transaction_line_item.py stripe/api_resources/terminal/__init__.py stripe/api_resources/terminal/configuration.py stripe/api_resources/terminal/connection_token.py stripe/api_resources/terminal/location.py stripe/api_resources/terminal/reader.py stripe/api_resources/test_helpers/__init__.py stripe/api_resources/test_helpers/test_clock.py stripe/api_resources/treasury/__init__.py stripe/api_resources/treasury/credit_reversal.py stripe/api_resources/treasury/debit_reversal.py stripe/api_resources/treasury/financial_account.py stripe/api_resources/treasury/financial_account_features.py stripe/api_resources/treasury/inbound_transfer.py stripe/api_resources/treasury/outbound_payment.py stripe/api_resources/treasury/outbound_transfer.py stripe/api_resources/treasury/received_credit.py stripe/api_resources/treasury/received_debit.py stripe/api_resources/treasury/transaction.py stripe/api_resources/treasury/transaction_entry.py stripe/apps/__init__.py stripe/apps/_secret.py stripe/apps/_secret_service.py stripe/billing/__init__.py stripe/billing/_meter.py stripe/billing/_meter_event.py stripe/billing/_meter_event_adjustment.py stripe/billing/_meter_event_adjustment_service.py stripe/billing/_meter_event_service.py stripe/billing/_meter_event_summary.py stripe/billing/_meter_event_summary_service.py stripe/billing/_meter_service.py stripe/billing_portal/__init__.py stripe/billing_portal/_configuration.py stripe/billing_portal/_configuration_service.py stripe/billing_portal/_session.py stripe/billing_portal/_session_service.py stripe/checkout/__init__.py stripe/checkout/_session.py stripe/checkout/_session_line_item_service.py stripe/checkout/_session_service.py stripe/climate/__init__.py stripe/climate/_order.py stripe/climate/_order_service.py stripe/climate/_product.py stripe/climate/_product_service.py stripe/climate/_supplier.py stripe/climate/_supplier_service.py stripe/data/ca-certificates.crt stripe/entitlements/__init__.py stripe/entitlements/_active_entitlement.py stripe/entitlements/_active_entitlement_service.py stripe/entitlements/_active_entitlement_summary.py stripe/entitlements/_feature.py stripe/entitlements/_feature_service.py stripe/financial_connections/__init__.py stripe/financial_connections/_account.py stripe/financial_connections/_account_owner.py stripe/financial_connections/_account_owner_service.py stripe/financial_connections/_account_ownership.py stripe/financial_connections/_account_service.py stripe/financial_connections/_session.py stripe/financial_connections/_session_service.py stripe/financial_connections/_transaction.py stripe/financial_connections/_transaction_service.py stripe/forwarding/__init__.py stripe/forwarding/_request.py stripe/forwarding/_request_service.py stripe/identity/__init__.py stripe/identity/_verification_report.py stripe/identity/_verification_report_service.py stripe/identity/_verification_session.py stripe/identity/_verification_session_service.py stripe/issuing/__init__.py stripe/issuing/_authorization.py stripe/issuing/_authorization_service.py stripe/issuing/_card.py stripe/issuing/_card_service.py stripe/issuing/_cardholder.py stripe/issuing/_cardholder_service.py stripe/issuing/_dispute.py stripe/issuing/_dispute_service.py stripe/issuing/_personalization_design.py stripe/issuing/_personalization_design_service.py stripe/issuing/_physical_bundle.py stripe/issuing/_physical_bundle_service.py stripe/issuing/_token.py stripe/issuing/_token_service.py stripe/issuing/_transaction.py stripe/issuing/_transaction_service.py stripe/radar/__init__.py stripe/radar/_early_fraud_warning.py stripe/radar/_early_fraud_warning_service.py stripe/radar/_value_list.py stripe/radar/_value_list_item.py stripe/radar/_value_list_item_service.py stripe/radar/_value_list_service.py stripe/reporting/__init__.py stripe/reporting/_report_run.py stripe/reporting/_report_run_service.py stripe/reporting/_report_type.py stripe/reporting/_report_type_service.py stripe/sigma/__init__.py stripe/sigma/_scheduled_query_run.py stripe/sigma/_scheduled_query_run_service.py stripe/tax/__init__.py stripe/tax/_calculation.py stripe/tax/_calculation_line_item.py stripe/tax/_calculation_line_item_service.py stripe/tax/_calculation_service.py stripe/tax/_registration.py stripe/tax/_registration_service.py stripe/tax/_settings.py stripe/tax/_settings_service.py stripe/tax/_transaction.py stripe/tax/_transaction_line_item.py stripe/tax/_transaction_line_item_service.py stripe/tax/_transaction_service.py stripe/terminal/__init__.py stripe/terminal/_configuration.py stripe/terminal/_configuration_service.py stripe/terminal/_connection_token.py stripe/terminal/_connection_token_service.py stripe/terminal/_location.py stripe/terminal/_location_service.py stripe/terminal/_reader.py stripe/terminal/_reader_service.py stripe/test_helpers/__init__.py stripe/test_helpers/_confirmation_token_service.py stripe/test_helpers/_customer_service.py stripe/test_helpers/_issuing_service.py stripe/test_helpers/_refund_service.py stripe/test_helpers/_terminal_service.py stripe/test_helpers/_test_clock.py stripe/test_helpers/_test_clock_service.py stripe/test_helpers/_treasury_service.py stripe/test_helpers/issuing/__init__.py stripe/test_helpers/issuing/_authorization_service.py stripe/test_helpers/issuing/_card_service.py stripe/test_helpers/issuing/_personalization_design_service.py stripe/test_helpers/issuing/_transaction_service.py stripe/test_helpers/terminal/__init__.py stripe/test_helpers/terminal/_reader_service.py stripe/test_helpers/treasury/__init__.py stripe/test_helpers/treasury/_inbound_transfer_service.py stripe/test_helpers/treasury/_outbound_payment_service.py stripe/test_helpers/treasury/_outbound_transfer_service.py stripe/test_helpers/treasury/_received_credit_service.py stripe/test_helpers/treasury/_received_debit_service.py stripe/treasury/__init__.py stripe/treasury/_credit_reversal.py stripe/treasury/_credit_reversal_service.py stripe/treasury/_debit_reversal.py stripe/treasury/_debit_reversal_service.py stripe/treasury/_financial_account.py stripe/treasury/_financial_account_features.py stripe/treasury/_financial_account_features_service.py stripe/treasury/_financial_account_service.py stripe/treasury/_inbound_transfer.py stripe/treasury/_inbound_transfer_service.py stripe/treasury/_outbound_payment.py stripe/treasury/_outbound_payment_service.py stripe/treasury/_outbound_transfer.py stripe/treasury/_outbound_transfer_service.py stripe/treasury/_received_credit.py stripe/treasury/_received_credit_service.py stripe/treasury/_received_debit.py stripe/treasury/_received_debit_service.py stripe/treasury/_transaction.py stripe/treasury/_transaction_entry.py stripe/treasury/_transaction_entry_service.py stripe/treasury/_transaction_service.py tests/__init__.py tests/conftest.py tests/http_client_mock.py tests/request_mock.py tests/stripe_mock.py tests/test_api_requestor.py tests/test_error.py tests/test_exports.py tests/test_generated_examples.py tests/test_http_client.py tests/test_integration.py tests/test_multipart_data_generator.py tests/test_oauth.py tests/test_oauth_error.py tests/test_request_options.py tests/test_requestor_options.py tests/test_stripe_client.py tests/test_stripe_object.py tests/test_stripe_response.py tests/test_util.py tests/test_webhook.py tests/api_resources/__init__.py tests/api_resources/test_account.py tests/api_resources/test_account_link.py tests/api_resources/test_apple_pay_domain.py tests/api_resources/test_application_fee.py tests/api_resources/test_application_fee_refund.py tests/api_resources/test_balance.py tests/api_resources/test_balance_transaction.py tests/api_resources/test_bank_account.py tests/api_resources/test_capability.py tests/api_resources/test_card.py tests/api_resources/test_charge.py tests/api_resources/test_country_spec.py tests/api_resources/test_coupon.py tests/api_resources/test_credit_note.py tests/api_resources/test_customer.py tests/api_resources/test_customer_balance_transaction.py tests/api_resources/test_dispute.py tests/api_resources/test_ephemeral_key.py tests/api_resources/test_event.py tests/api_resources/test_exchange_rate.py tests/api_resources/test_file.py tests/api_resources/test_file_link.py tests/api_resources/test_file_upload.py tests/api_resources/test_invoice.py tests/api_resources/test_invoice_item.py tests/api_resources/test_invoice_line_item.py tests/api_resources/test_list_object.py tests/api_resources/test_mandate.py tests/api_resources/test_payment_intent.py tests/api_resources/test_payment_method.py tests/api_resources/test_payout.py tests/api_resources/test_person.py tests/api_resources/test_plan.py tests/api_resources/test_price.py tests/api_resources/test_product.py tests/api_resources/test_promotion_code.py tests/api_resources/test_quote.py tests/api_resources/test_refund.py tests/api_resources/test_reversal.py tests/api_resources/test_review.py tests/api_resources/test_search_result_object.py tests/api_resources/test_setup_attempt.py tests/api_resources/test_setup_intent.py tests/api_resources/test_source.py tests/api_resources/test_source_transaction.py tests/api_resources/test_subscription.py tests/api_resources/test_subscription_item.py tests/api_resources/test_subscription_schedule.py tests/api_resources/test_tax_code.py tests/api_resources/test_tax_id.py tests/api_resources/test_tax_rate.py tests/api_resources/test_topup.py tests/api_resources/test_transfer.py tests/api_resources/test_usage_record.py tests/api_resources/test_usage_record_summary.py tests/api_resources/test_webhook_endpoint.py tests/api_resources/abstract/__init__.py tests/api_resources/abstract/test_api_resource.py tests/api_resources/abstract/test_createable_api_resource.py tests/api_resources/abstract/test_custom_method.py tests/api_resources/abstract/test_deletable_api_resource.py tests/api_resources/abstract/test_listable_api_resource.py tests/api_resources/abstract/test_nested_resource_class_methods.py tests/api_resources/abstract/test_searchable_api_resource.py tests/api_resources/abstract/test_singleton_api_resource.py tests/api_resources/abstract/test_test_helpers_api_resource.py tests/api_resources/abstract/test_updateable_api_resource.py tests/api_resources/billing_portal/__init__.py tests/api_resources/billing_portal/test_configuration.py tests/api_resources/billing_portal/test_session.py tests/api_resources/checkout/__init__.py tests/api_resources/checkout/test_session.py tests/api_resources/identity/test_verification_report.py tests/api_resources/identity/test_verification_session.py tests/api_resources/issuing/__init__.py tests/api_resources/issuing/test_authorization.py tests/api_resources/issuing/test_card.py tests/api_resources/issuing/test_cardholder.py tests/api_resources/issuing/test_dispute.py tests/api_resources/issuing/test_transaction.py tests/api_resources/radar/__init__.py tests/api_resources/radar/test_early_fraud_warning.py tests/api_resources/radar/test_value_list.py tests/api_resources/radar/test_value_list_item.py tests/api_resources/reporting/__init__.py tests/api_resources/reporting/test_report_run.py tests/api_resources/reporting/test_report_type.py tests/api_resources/sigma/__init__.py tests/api_resources/sigma/test_scheduled_query_run.py tests/api_resources/terminal/__init__.py tests/api_resources/terminal/test_connection_token.py tests/api_resources/terminal/test_location.py tests/api_resources/terminal/test_reader.py tests/services/test_file_upload.py tests/services/test_oauth.py tests/services/test_quote.py././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523725.0 stripe-10.1.0/stripe.egg-info/dependency_links.txt0000644000175100001770000000000114637354615021570 0ustar00runnerdocker ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523725.0 stripe-10.1.0/stripe.egg-info/not-zip-safe0000644000175100001770000000000114637354615017750 0ustar00runnerdocker ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523725.0 stripe-10.1.0/stripe.egg-info/requires.txt0000644000175100001770000000023314637354615020120 0ustar00runnerdocker [:python_version < "3.7"] typing_extensions<=4.2.0,>3.7.2 [:python_version >= "3.0"] requests>=2.20 [:python_version >= "3.7"] typing_extensions>=4.5.0 ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523725.0 stripe-10.1.0/stripe.egg-info/top_level.txt0000644000175100001770000000000714637354615020251 0ustar00runnerdockerstripe ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5609407 stripe-10.1.0/tests/0000755000175100001770000000000014637354616013665 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/__init__.py0000644000175100001770000000000014637354563015765 0ustar00runnerdocker././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5689406 stripe-10.1.0/tests/api_resources/0000755000175100001770000000000014637354616016530 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/__init__.py0000644000175100001770000000000014637354563020630 0ustar00runnerdocker././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5729406 stripe-10.1.0/tests/api_resources/abstract/0000755000175100001770000000000014637354616020333 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/abstract/__init__.py0000644000175100001770000000000014637354563022433 0ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/abstract/test_api_resource.py0000644000175100001770000002365714637354563024442 0ustar00runnerdockerimport pytest import stripe class TestAPIResource(object): class MyResource(stripe.APIResource): OBJECT_NAME = "myresource" class MyDeletableResource(stripe.DeletableAPIResource): OBJECT_NAME = "myresource" @classmethod def my_method(cls, **params): return cls._static_request( "post", cls.class_url(), params=params, ) @classmethod async def my_method_async(cls, **params): return cls.construct_from( await cls._static_request_async( "post", cls.class_url(), params=params, ), stripe.api_key, ) def test_retrieve_and_refresh(self, http_client_mock): path = "/v1/myresources/foo%2A" query_string = "myparam=5" key = "sk_test_123" stripe_version = "2018-02-28" stripe_account = "acct_foo" http_client_mock.stub_request( "get", path, query_string, '{"id": "foo2", "bobble": "scrobble"}', rheaders={"request-id": "req_id"}, ) res = self.MyResource.retrieve( "foo*", myparam=5, stripe_version="2018-02-28", stripe_account="acct_foo", ) http_client_mock.assert_requested( "get", path=path, query_string=query_string, api_key=key, stripe_version=stripe_version, stripe_account=stripe_account, ) assert res.bobble == "scrobble" assert res.id == "foo2" assert res.api_key == key assert res.stripe_version == stripe_version assert res.stripe_account == stripe_account assert res.last_response is not None assert res.last_response.request_id == "req_id" path = "/v1/myresources/foo2" query_string = "myparam=5" http_client_mock.stub_request( "get", path, query_string, '{"frobble": 5}' ) res = res.refresh() http_client_mock.assert_requested( "get", path=path, query_string=query_string, api_key=key, stripe_version=stripe_version, stripe_account=stripe_account, ) assert res.frobble == 5 with pytest.raises(KeyError): res["bobble"] def test_convert_to_stripe_object(self): sample = { "foo": "bar", "adict": {"object": "charge", "id": 42, "amount": 7}, "alist": [{"object": "customer", "name": "chilango"}], } converted = stripe.util.convert_to_stripe_object( sample, "akey", None, None ) # Types assert isinstance(converted, stripe.stripe_object.StripeObject) assert isinstance(converted.adict, stripe.Charge) assert len(converted.alist) == 1 assert isinstance(converted.alist[0], stripe.Customer) # Values assert converted.foo == "bar" assert converted.adict.id == 42 assert converted.alist[0].name == "chilango" # Stripping # TODO: We should probably be stripping out this property # self.assertRaises(AttributeError, getattr, converted.adict, 'object') def test_raise_on_incorrect_id_type(self): for obj in [None, 1, 3.14, dict(), list(), set(), tuple(), object()]: with pytest.raises(stripe.error.InvalidRequestError): self.MyResource.retrieve(obj) def test_class_methods_use_global_options(self, http_client_mock): key = "newkey" stripe_version = "2023-01-01" stripe_account = "acct_foo" resource = self.MyDeletableResource.construct_from( {"id": "foo"}, key=key, stripe_version=stripe_version, stripe_account=stripe_account, ) http_client_mock.stub_request( "get", "/v1/myresources/foo", rbody='{"id": "foo"}', ) resource.retrieve("foo") http_client_mock.assert_requested( "get", path="/v1/myresources/foo", api_key=stripe.api_key, stripe_version=stripe.api_version, extra_headers={"Stripe-Account": None}, ) http_client_mock.stub_request( "post", "/v1/myresources", rbody='{"id": "foo", "object": "myresource"}', ) self.MyDeletableResource.my_method() http_client_mock.assert_requested( "post", path="/v1/myresources", api_key=stripe.api_key, stripe_version=stripe.api_version, extra_headers={"Stripe-Account": None}, ) def test_class_method_prefers_method_arguments(self, http_client_mock): http_client_mock.stub_request( "get", "/v1/myresources/foo", rbody='{"id": "foo"}', ) resource = self.MyResource.construct_from( {"id": "foo"}, key="oldkey", stripe_version="2000-01-01", stripe_account="acct_foo", ) resource.retrieve( "foo", api_key="newkey", stripe_version="2023-01-01", stripe_account="acct_bar", ) http_client_mock.assert_requested( "get", path="/v1/myresources/foo", api_key="newkey", stripe_version="2023-01-01", stripe_account="acct_bar", ) def test_retrieve_forwards_options(self, http_client_mock): http_client_mock.stub_request( "get", "/v1/myresources/foo", rbody='{"id": "foo"}', ) res = self.MyDeletableResource.retrieve( "foo", api_key="newkey", stripe_version="2023-01-01", stripe_account="foo", ) http_client_mock.assert_requested( "get", path="/v1/myresources/foo", api_key="newkey", stripe_version="2023-01-01", stripe_account="foo", ) http_client_mock.stub_request( "delete", "/v1/myresources/foo", ) res.delete() http_client_mock.assert_requested( "delete", path="/v1/myresources/foo", api_key="newkey", stripe_version="2023-01-01", stripe_account="foo", ) def test_class_method_forwards_options(self, http_client_mock): from stripe._object_classes import OBJECT_CLASSES OBJECT_CLASSES["myresource"] = self.MyDeletableResource http_client_mock.stub_request( "post", "/v1/myresources", rbody='{"id": "foo", "object": "myresource"}', ) res = self.MyDeletableResource.my_method( api_key="newkey", stripe_version="2023-01-01", stripe_account="foo" ) http_client_mock.assert_requested( "post", path="/v1/myresources", api_key="newkey", stripe_version="2023-01-01", stripe_account="foo", ) http_client_mock.stub_request( "delete", "/v1/myresources/foo", ) res.delete() http_client_mock.assert_requested( "delete", path="/v1/myresources/foo", api_key="newkey", stripe_version="2023-01-01", stripe_account="foo", ) del OBJECT_CLASSES["myresource"] def test_instance_method_forwards_options(self, http_client_mock): http_client_mock.stub_request( "get", "/v1/myresources/foo", rbody='{"id": "foo"}', ) key = "newkey" stripe_version = "2023-01-01" stripe_account = "acct_foo" resource = self.MyResource.construct_from( {"id": "foo"}, key=key, stripe_version=stripe_version, stripe_account=stripe_account, ) resource.refresh() http_client_mock.assert_requested( "get", path="/v1/myresources/foo", api_key=key, stripe_version=stripe_version, stripe_account=stripe_account, ) def test_instance_method_prefers_method_arguments(self, http_client_mock): class MyDeletableResource(stripe.DeletableAPIResource): OBJECT_NAME = "mydeletableresource" http_client_mock.stub_request( "delete", "/v1/mydeletableresources/foo", rbody='{"id": "foo"}', ) resource = MyDeletableResource.construct_from( {"id": "foo"}, key="oldkey", stripe_version="2000-01-01", stripe_account="acct_foo", ) resource.delete( api_key="newkey", stripe_version="2023-01-01", stripe_account="acct_bar", ) http_client_mock.assert_requested( "delete", path="/v1/mydeletableresources/foo", api_key="newkey", stripe_version="2023-01-01", stripe_account="acct_bar", ) @pytest.mark.anyio async def test_async_methods_succeed(self, http_client_mock): http_client_mock.stub_request( "post", "/v1/myresources", rbody='{"id": "foo", "object": "myresource"}', ) resource = await self.MyDeletableResource.my_method_async() http_client_mock.assert_requested( "post", path="/v1/myresources", ) http_client_mock.stub_request( "get", "/v1/myresources/foo", rbody='{"id": "foo", "object": "myresource"}', ) await resource.refresh_async() http_client_mock.assert_requested( "get", path="/v1/myresources/foo", ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/abstract/test_createable_api_resource.py0000644000175100001770000000247114637354563026600 0ustar00runnerdockerimport stripe class TestCreateableAPIResource(object): class MyCreatable(stripe.api_resources.abstract.CreateableAPIResource): OBJECT_NAME = "mycreatable" def test_create(self, http_client_mock): http_client_mock.stub_request( "post", path="/v1/mycreatables", rbody='{"object": "charge", "foo": "bar"}', rheaders={"request-id": "req_id"}, ) res = self.MyCreatable.create() http_client_mock.assert_requested( "post", path="/v1/mycreatables", post_data="" ) assert isinstance(res, stripe.Charge) assert res.foo == "bar" assert res.last_response is not None assert res.last_response.request_id == "req_id" def test_idempotent_create(self, http_client_mock): http_client_mock.stub_request( "post", path="/v1/mycreatables", rbody='{"object": "charge", "foo": "bar"}', rheaders={"idempotency-key": "foo"}, ) res = self.MyCreatable.create(idempotency_key="foo") http_client_mock.assert_requested( "post", path="/v1/mycreatables", post_data="", idempotency_key="foo", ) assert isinstance(res, stripe.Charge) assert res.foo == "bar" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/abstract/test_custom_method.py0000644000175100001770000002424414637354563024625 0ustar00runnerdockerimport stripe from stripe import util class TestCustomMethod(object): @stripe.api_resources.abstract.custom_method( "do_stuff", http_verb="post", http_path="do_the_thing" ) @stripe.api_resources.abstract.custom_method( "do_list_stuff", http_verb="get", http_path="do_the_list_thing" ) @stripe.api_resources.abstract.custom_method( "do_stream_stuff", http_verb="post", http_path="do_the_stream_thing", is_streaming=True, ) class MyResource(stripe.api_resources.abstract.APIResource): OBJECT_NAME = "myresource" def do_stuff(self, idempotency_key=None, **params): url = self.instance_url() + "/do_the_thing" self._request_and_refresh( "post", url, {**params, "idempotency_key": idempotency_key} ) return self def do_stream_stuff(self, idempotency_key=None, **params): url = self.instance_url() + "/do_the_stream_thing" return self._request_stream( "post", url, {**params, "idempotency_key": idempotency_key} ) @classmethod def _cls_do_stuff_new_codegen(cls, id, **params): return cls._static_request( "post", "/v1/myresources/{id}/do_the_thing".format( id=util.sanitize_id(id) ), params=params, ) @util.class_method_variant("_cls_do_stuff_new_codegen") def do_stuff_new_codegen(self, **params): return self._request( "post", "/v1/myresources/{id}/do_the_thing".format( id=util.sanitize_id(self.get("id")) ), params=params, ) def test_call_custom_method_class(self, http_client_mock): http_client_mock.stub_request( "post", path="/v1/myresources/mid/do_the_thing", rbody='{"id": "mid", "thing_done": true}', rheaders={"request-id": "req_id"}, ) obj = self.MyResource.do_stuff("mid", foo="bar") http_client_mock.assert_requested( "post", path="/v1/myresources/mid/do_the_thing", post_data="foo=bar", ) assert obj.thing_done is True def test_call_custom_list_method_class_paginates(self, http_client_mock): http_client_mock.stub_request( "get", path="/v1/myresources/mid/do_the_list_thing", query_string="param1=abc¶m2=def", rbody='{"object": "list", "url": "/v1/myresources/mid/do_the_list_thing", "has_more": true, "data": [{"id": "cus_1", "object": "customer"}, {"id": "cus_2", "object": "customer"}]}', rheaders={"request-id": "req_123"}, ) resp = self.MyResource.do_list_stuff("mid", param1="abc", param2="def") http_client_mock.assert_requested( "get", path="/v1/myresources/mid/do_the_list_thing", query_string="param1=abc¶m2=def", ) # Stub out the second request which will happen automatically. http_client_mock.stub_request( "get", path="/v1/myresources/mid/do_the_list_thing", query_string="param1=abc¶m2=def&starting_after=cus_2", rbody='{"object": "list", "url": "/v1/myresources/mid/do_the_list_thing", "has_more": false, "data": [{"id": "cus_3", "object": "customer"}]}', rheaders={"request-id": "req_123"}, ) # Iterate through entire content ids = [] for i in resp.auto_paging_iter(): ids.append(i.id) # Explicitly assert that the pagination parameter were kept for the # second request along with the starting_after param. http_client_mock.assert_requested( "get", path="/v1/myresources/mid/do_the_list_thing", query_string="param1=abc¶m2=def&starting_after=cus_2", ) assert ids == ["cus_1", "cus_2", "cus_3"] def test_call_custom_stream_method_class(self, http_client_mock): http_client_mock.stub_request( "post", path="/v1/myresources/mid/do_the_stream_thing", rbody=util.io.BytesIO(str.encode("response body")), rheaders={"request-id": "req_id"}, ) resp = self.MyResource.do_stream_stuff("mid", foo="bar") http_client_mock.assert_requested( "post", path="/v1/myresources/mid/do_the_stream_thing", post_data="foo=bar", ) body_content = resp.io.read() if hasattr(body_content, "decode"): body_content = body_content.decode("utf-8") assert body_content == "response body" def test_call_custom_method_class_with_object(self, http_client_mock): http_client_mock.stub_request( "post", path="/v1/myresources/mid/do_the_thing", rbody='{"id": "mid", "thing_done": true}', rheaders={"request-id": "req_id"}, ) obj = self.MyResource.construct_from({"id": "mid"}, "mykey") self.MyResource.do_stuff(obj, foo="bar") http_client_mock.assert_requested( "post", path="/v1/myresources/mid/do_the_thing", post_data="foo=bar", ) assert obj.thing_done is True def test_call_custom_stream_method_class_with_object( self, http_client_mock ): http_client_mock.stub_request( "post", path="/v1/myresources/mid/do_the_stream_thing", rbody=util.io.BytesIO(str.encode("response body")), rheaders={"request-id": "req_id"}, ) obj = self.MyResource.construct_from({"id": "mid"}, "mykey") resp = self.MyResource.do_stream_stuff(obj, foo="bar") http_client_mock.assert_requested( "post", path="/v1/myresources/mid/do_the_stream_thing", post_data="foo=bar", ) body_content = resp.io.read() if hasattr(body_content, "decode"): body_content = body_content.decode("utf-8") assert body_content == "response body" def test_call_custom_method_instance(self, http_client_mock): http_client_mock.stub_request( "post", path="/v1/myresources/mid/do_the_thing", rbody='{"id": "mid", "thing_done": true}', rheaders={"request-id": "req_id"}, ) obj = self.MyResource.construct_from({"id": "mid"}, "mykey") obj.do_stuff(foo="bar") http_client_mock.assert_requested( "post", path="/v1/myresources/mid/do_the_thing", post_data="foo=bar", ) assert obj.thing_done is True def test_call_custom_stream_method_instance(self, http_client_mock): http_client_mock.stub_request( "post", path="/v1/myresources/mid/do_the_stream_thing", rbody=util.io.BytesIO(str.encode("response body")), rheaders={"request-id": "req_id"}, ) obj = self.MyResource.construct_from({"id": "mid"}, "mykey") resp = obj.do_stream_stuff(foo="bar") http_client_mock.assert_requested( "post", path="/v1/myresources/mid/do_the_stream_thing", post_data="foo=bar", ) body_content = resp.io.read() if hasattr(body_content, "decode"): body_content = body_content.decode("utf-8") assert body_content == "response body" def test_call_custom_method_class_special_fields(self, http_client_mock): http_client_mock.stub_request( "post", path="/v1/myresources/mid/do_the_thing", rbody='{"id": "mid", "thing_done": true}', rheaders={"request-id": "req_id"}, ) self.MyResource.do_stuff( "mid", foo="bar", stripe_version="2017-08-15", api_key="APIKEY", idempotency_key="IdempotencyKey", stripe_account="Acc", ) http_client_mock.assert_requested( "post", path="/v1/myresources/mid/do_the_thing", post_data="foo=bar", api_key="APIKEY", stripe_version="2017-08-15", stripe_account="Acc", idempotency_key="IdempotencyKey", ) def test_call_custom_method_class_newcodegen_special_fields( self, http_client_mock ): http_client_mock.stub_request( "post", path="/v1/myresources/mid/do_the_thing", rbody='{"id": "mid", "thing_done": true}', rheaders={"request-id": "req_id"}, ) self.MyResource.do_stuff_new_codegen( "mid", foo="bar", stripe_version="2017-08-15", api_key="APIKEY", idempotency_key="IdempotencyKey", stripe_account="Acc", ) http_client_mock.assert_requested( "post", path="/v1/myresources/mid/do_the_thing", post_data="foo=bar", api_key="APIKEY", stripe_version="2017-08-15", stripe_account="Acc", idempotency_key="IdempotencyKey", ) def test_call_custom_method_instance_newcodegen_special_fields( self, http_client_mock ): http_client_mock.stub_request( "post", path="/v1/myresources/mid/do_the_thing", rbody='{"id": "mid", "thing_done": true}', rheaders={"request-id": "req_id"}, ) obj = self.MyResource.construct_from({"id": "mid"}, "mykey") obj.do_stuff_new_codegen( foo="bar", stripe_version="2017-08-15", api_key="APIKEY", idempotency_key="IdempotencyKey", stripe_account="Acc", headers={"extra_header": "val"}, ) http_client_mock.assert_requested( "post", path="/v1/myresources/mid/do_the_thing", post_data="foo=bar", api_key="APIKEY", stripe_version="2017-08-15", stripe_account="Acc", idempotency_key="IdempotencyKey", extra_headers={"extra_header": "val"}, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/abstract/test_deletable_api_resource.py0000644000175100001770000000570714637354563026437 0ustar00runnerdockerimport stripe class TestDeletableAPIResource(object): class MyDeletable(stripe.api_resources.abstract.DeletableAPIResource): OBJECT_NAME = "mydeletable" def test_delete_class(self, http_client_mock): http_client_mock.stub_request( "delete", path="/v1/mydeletables/mid", rbody='{"id": "mid", "deleted": true}', rheaders={"request-id": "req_id"}, ) obj = self.MyDeletable.delete("mid") http_client_mock.assert_requested( "delete", path="/v1/mydeletables/mid", query_string="" ) assert obj.deleted is True assert obj.id == "mid" assert obj.last_response is not None assert obj.last_response.request_id == "req_id" def test_delete_class_with_object(self, http_client_mock): http_client_mock.stub_request( "delete", path="/v1/mydeletables/mid", rbody='{"id": "mid", "deleted": true}', rheaders={"request-id": "req_id"}, ) obj = self.MyDeletable.construct_from({"id": "mid"}, "mykey") self.MyDeletable.delete(obj) http_client_mock.assert_requested( "delete", path="/v1/mydeletables/mid", query_string="" ) assert obj.deleted is True assert obj.id == "mid" assert obj.last_response is not None assert obj.last_response.request_id == "req_id" def test_delete_instance(self, http_client_mock): http_client_mock.stub_request( "delete", path="/v1/mydeletables/mid", rbody='{"id": "mid", "deleted": true}', rheaders={"request-id": "req_id"}, ) obj = self.MyDeletable.construct_from({"id": "mid"}, "mykey") assert obj is obj.delete() http_client_mock.assert_requested( "delete", path="/v1/mydeletables/mid", query_string="" ) assert obj.deleted is True assert obj.id == "mid" assert obj.last_response is not None assert obj.last_response.request_id == "req_id" def test_delete_with_all_special_fields(self, http_client_mock): http_client_mock.stub_request( "delete", path="/v1/mydeletables/foo", query_string="bobble=new_scrobble", rbody='{"id": "foo", "bobble": "new_scrobble"}', rheaders={"Idempotency-Key": "IdempotencyKey"}, ) self.MyDeletable.delete( "foo", stripe_version="2017-08-15", api_key="APIKEY", idempotency_key="IdempotencyKey", stripe_account="Acc", bobble="new_scrobble", ) http_client_mock.assert_requested( "delete", path="/v1/mydeletables/foo", query_string="bobble=new_scrobble", stripe_version="2017-08-15", api_key="APIKEY", idempotency_key="IdempotencyKey", stripe_account="Acc", ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/abstract/test_listable_api_resource.py0000644000175100001770000000170714637354563026311 0ustar00runnerdockerimport stripe class TestListableAPIResource(object): class MyListable(stripe.api_resources.abstract.ListableAPIResource): OBJECT_NAME = "mylistable" def test_all(self, http_client_mock): http_client_mock.stub_request( "get", path="/v1/mylistables", rbody='{"object": "list", "data": [{"object": "charge", "name": "jose"}, {"object": "charge", "name": "curly"}], "url": "/v1/charges", "has_more": false}', rheaders={"request-id": "req_id"}, ) res = self.MyListable.list() http_client_mock.assert_requested( "get", path="/v1/mylistables", query_string="" ) assert len(res.data) == 2 assert all(isinstance(obj, stripe.Charge) for obj in res.data) assert res.data[0].name == "jose" assert res.data[1].name == "curly" assert res.last_response is not None assert res.last_response.request_id == "req_id" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/abstract/test_nested_resource_class_methods.py0000644000175100001770000000557314637354563030060 0ustar00runnerdockerimport stripe class TestNestedResourceClassMethods(object): @stripe.api_resources.abstract.nested_resource_class_methods( "nested", operations=["create", "retrieve", "update", "delete", "list"] ) class MainResource(stripe.api_resources.abstract.APIResource): OBJECT_NAME = "mainresource" def test_create_nested(self, http_client_mock): http_client_mock.stub_request( "post", path="/v1/mainresources/id/nesteds", rbody='{"id": "nested_id", "object": "nested", "foo": "bar"}', ) nested_resource = self.MainResource.create_nested("id", foo="bar") http_client_mock.assert_requested( "post", path="/v1/mainresources/id/nesteds", post_data="foo=bar" ) assert nested_resource.foo == "bar" def test_retrieve_nested(self, http_client_mock): http_client_mock.stub_request( "get", path="/v1/mainresources/id/nesteds/nested_id", rbody='{"id": "nested_id", "object": "nested", "foo": "bar"}', ) nested_resource = self.MainResource.retrieve_nested("id", "nested_id") http_client_mock.assert_requested( "get", path="/v1/mainresources/id/nesteds/nested_id", query_string="", ) assert nested_resource.foo == "bar" def test_modify_nested(self, http_client_mock): http_client_mock.stub_request( "post", path="/v1/mainresources/id/nesteds/nested_id", rbody='{"id": "nested_id", "object": "nested", "foo": "baz"}', ) nested_resource = self.MainResource.modify_nested( "id", "nested_id", foo="baz" ) http_client_mock.assert_requested( "post", path="/v1/mainresources/id/nesteds/nested_id", post_data="foo=baz", ) assert nested_resource.foo == "baz" def test_delete_nested(self, http_client_mock): http_client_mock.stub_request( "delete", path="/v1/mainresources/id/nesteds/nested_id", rbody='{"id": "nested_id", "object": "nested", "deleted": true}', ) nested_resource = self.MainResource.delete_nested("id", "nested_id") http_client_mock.assert_requested( "delete", path="/v1/mainresources/id/nesteds/nested_id", query_string="", ) assert nested_resource.deleted is True def test_list_nesteds(self, http_client_mock): http_client_mock.stub_request( "get", path="/v1/mainresources/id/nesteds", rbody='{"object": "list", "data": []}', ) nested_resource = self.MainResource.list_nesteds("id") http_client_mock.assert_requested( "get", path="/v1/mainresources/id/nesteds", query_string="" ) assert isinstance(nested_resource.data, list) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/abstract/test_searchable_api_resource.py0000644000175100001770000000537114637354563026604 0ustar00runnerdockerimport stripe class TestSearchableAPIResource(object): class MySearchable(stripe.api_resources.abstract.SearchableAPIResource): OBJECT_NAME = "mysearchable" @classmethod def search(cls, *args, **kwargs): return cls._search( search_url="/v1/mysearchables/search", *args, **kwargs ) def test_search(self, http_client_mock): path = "/v1/mysearchables/search" query_string = "query=currency%3A%22CAD%22" http_client_mock.stub_request( "get", path, query_string, '{"object": "search_result", "data": [{"object": "charge", "name": "jose"}, {"object": "charge", "name": "curly"}], "url": "/v1/charges", "has_more": false, "next_page": null}', rheaders={"request-id": "req_id"}, ) res = self.MySearchable.search(query='currency:"CAD"') http_client_mock.assert_requested( "get", path=path, query_string=query_string ) assert len(res.data) == 2 assert all(isinstance(obj, stripe.Charge) for obj in res.data) assert res.data[0].name == "jose" assert res.data[1].name == "curly" assert res.last_response is not None assert res.last_response.request_id == "req_id" def test_search_multiple_pages(self, http_client_mock): path = "/v1/mysearchables/search" query_string = 'query=currency:"CAD"' http_client_mock.stub_request( "get", path, query_string, '{"object": "search_result", "data": [{"object": "charge", "name": "jose"}, {"object": "charge", "name": "curly"}], "url": "/v1/charges", "has_more": true, "next_page": "next-page-token"}', rheaders={"request-id": "req_id"}, ) res = self.MySearchable.search(query='currency:"CAD"') http_client_mock.assert_requested( "get", path=path, query_string=query_string ) assert res.next_page == "next-page-token" query_string = 'page=next-page-token&query=currency:"CAD"' http_client_mock.stub_request( "get", path, query_string, '{"object": "search_result", "data": [{"object": "charge", "name": "test"}], "url": "/v1/charges", "has_more": false, "next_page": null}', rheaders={"request-id": "req_id"}, ) res2 = self.MySearchable.search( query='currency:"CAD"', page=res.next_page ) http_client_mock.assert_requested( "get", path=path, query_string=query_string, ) assert len(res2.data) == 1 assert all(isinstance(obj, stripe.Charge) for obj in res2.data) assert res2.data[0].name == "test" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/abstract/test_singleton_api_resource.py0000644000175100001770000000122314637354563026505 0ustar00runnerdockerimport stripe class TestSingletonAPIResource(object): class MySingleton(stripe.api_resources.abstract.SingletonAPIResource): OBJECT_NAME = "mysingleton" def test_retrieve(self, http_client_mock): http_client_mock.stub_request( "get", path="/v1/mysingleton", rbody='{"single": "ton"}', rheaders={"request-id": "req_id"}, ) res = self.MySingleton.retrieve() http_client_mock.assert_requested("get", path="/v1/mysingleton") assert res.single == "ton" assert res.last_response is not None assert res.last_response.request_id == "req_id" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/abstract/test_test_helpers_api_resource.py0000644000175100001770000000425314637354563027212 0ustar00runnerdockerimport stripe from stripe._test_helpers import APIResourceTestHelpers class TestTestHelperAPIResource(object): class MyTestHelpersResource(stripe.api_resources.abstract.APIResource): OBJECT_NAME = "myresource" @stripe.api_resources.abstract.custom_method( "do_stuff", http_verb="post", http_path="do_the_thing" ) class TestHelpers(APIResourceTestHelpers): def __init__(self, resource): self.resource = resource def do_stuff(self, idempotency_key=None, **params): url = self.instance_url() + "/do_the_thing" self.resource._request_and_refresh( "post", url, {**params, "idempotency_key": idempotency_key} ) return self.resource @property def test_helpers(self): return self.TestHelpers(self) MyTestHelpersResource.TestHelpers._resource_cls = MyTestHelpersResource def test_call_custom_method_class(self, http_client_mock): http_client_mock.stub_request( "post", path="/v1/test_helpers/myresources/mid/do_the_thing", rbody='{"id": "mid", "thing_done": true}', rheaders={"request-id": "req_id"}, ) obj = self.MyTestHelpersResource.TestHelpers.do_stuff("mid", foo="bar") http_client_mock.assert_requested( "post", path="/v1/test_helpers/myresources/mid/do_the_thing", post_data="foo=bar", ) assert obj.thing_done is True def test_call_custom_method_instance_via_property(self, http_client_mock): http_client_mock.stub_request( "post", path="/v1/test_helpers/myresources/mid/do_the_thing", rbody='{"id": "mid", "thing_done": true}', rheaders={"request-id": "req_id"}, ) obj = self.MyTestHelpersResource.construct_from({"id": "mid"}, "mykey") obj.test_helpers.do_stuff(foo="bar") http_client_mock.assert_requested( "post", path="/v1/test_helpers/myresources/mid/do_the_thing", post_data="foo=bar", ) assert obj.thing_done is True ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/abstract/test_updateable_api_resource.py0000644000175100001770000002423514637354563026621 0ustar00runnerdockerimport pytest import json import stripe class TestUpdateableAPIResource(object): class MyUpdateable(stripe.api_resources.abstract.UpdateableAPIResource): OBJECT_NAME = "myupdateable" @pytest.fixture def obj(self, http_client_mock): http_client_mock.stub_request( "post", path="/v1/myupdateables/myid", rbody=json.dumps({"id": "myid", "thats": "it"}), rheaders={"request-id": "req_id"}, ) return self.MyUpdateable.construct_from( { "id": "myid", "foo": "bar", "baz": "boz", "metadata": {"size": "l", "score": 4, "height": 10}, "object": "obj", }, "mykey", ) def checkSave(self, obj): assert obj is obj.save() assert obj.thats == "it" # TODO: Should we force id to be retained? # assert obj.id == 'myid' with pytest.raises(AttributeError): obj.baz def test_idempotent_save(self, http_client_mock, obj): obj.baz = "updated" obj.save(idempotency_key="foo") http_client_mock.assert_requested( "post", path="/v1/myupdateables/myid", post_data="baz=updated", idempotency_key="foo", ) def test_save(self, http_client_mock, obj): obj.baz = "updated" obj.other = "newval" obj.metadata.size = "m" obj.metadata.info = "a2" obj.metadata.height = None self.checkSave(obj) http_client_mock.assert_requested( "post", path="/v1/myupdateables/myid", post_data="baz=updated&metadata[info]=a2&metadata[size]=m&other=newval", ) assert obj.last_response is not None assert obj.last_response.request_id == "req_id" # Saving again should not cause any request. http_client_mock.reset_mock() self.checkSave(obj) http_client_mock.assert_no_request() # Setting the same value should cause a request. http_client_mock.reset_mock() http_client_mock.stub_request( "post", path="/v1/myupdateables/myid", rbody=json.dumps({"id": "myid", "thats": "it"}), ) obj.thats = "it" self.checkSave(obj) http_client_mock.assert_requested( "post", path="/v1/myupdateables/myid", post_data="thats=it" ) # Changing the value should cause a request. http_client_mock.reset_mock() http_client_mock.stub_request( "post", path="/v1/myupdateables/myid", rbody=json.dumps({"id": "myid", "thats": "it"}), ) obj.id = "myid" obj.thats = "updated" self.checkSave(obj) http_client_mock.assert_requested( "post", path="/v1/myupdateables/myid", post_data="thats=updated" ) def test_add_key_to_nested_object(self, http_client_mock, obj): acct = self.MyUpdateable.construct_from( { "id": "myid", "legal_entity": {"size": "l", "score": 4, "height": 10}, }, "mykey", ) acct.legal_entity["first_name"] = "bob" assert acct is acct.save() http_client_mock.assert_requested( "post", path="/v1/myupdateables/myid", post_data="legal_entity[first_name]=bob", ) def test_save_nothing(self, http_client_mock, obj): acct = self.MyUpdateable.construct_from( {"id": "myid", "metadata": {"key": "value"}}, "mykey" ) assert acct is acct.save() http_client_mock.assert_no_request() def test_replace_nested_object(self, http_client_mock, obj): acct = self.MyUpdateable.construct_from( {"id": "myid", "legal_entity": {"last_name": "smith"}}, "mykey" ) acct.legal_entity = {"first_name": "bob"} assert acct is acct.save() http_client_mock.assert_requested( "post", path="/v1/myupdateables/myid", post_data="legal_entity[first_name]=bob&legal_entity[last_name]=", ) def test_array_setting(self, http_client_mock, obj): acct = self.MyUpdateable.construct_from( {"id": "myid", "legal_entity": {}}, "mykey" ) acct.legal_entity.additional_owners = [{"first_name": "Bob"}] assert acct is acct.save() http_client_mock.assert_requested( "post", path="/v1/myupdateables/myid", post_data="legal_entity[additional_owners][0][first_name]=Bob", ) def test_array_none(self, http_client_mock, obj): acct = self.MyUpdateable.construct_from( {"id": "myid", "legal_entity": {"additional_owners": None}}, "mykey", ) acct.foo = "bar" assert acct is acct.save() http_client_mock.assert_requested( "post", path="/v1/myupdateables/myid", post_data="foo=bar" ) def test_array_insertion(self, http_client_mock, obj): acct = self.MyUpdateable.construct_from( {"id": "myid", "legal_entity": {"additional_owners": []}}, "mykey" ) acct.legal_entity.additional_owners.append({"first_name": "Bob"}) assert acct is acct.save() http_client_mock.assert_requested( "post", path="/v1/myupdateables/myid", post_data="legal_entity[additional_owners][0][first_name]=Bob", ) def test_array_update(self, http_client_mock, obj): acct = self.MyUpdateable.construct_from( { "id": "myid", "legal_entity": { "additional_owners": [ {"first_name": "Bob"}, {"first_name": "Jane"}, ] }, }, "mykey", ) acct.legal_entity.additional_owners[1].first_name = "Janet" assert acct is acct.save() http_client_mock.assert_requested( "post", path="/v1/myupdateables/myid", post_data="legal_entity[additional_owners][1][first_name]=Janet", ) def test_array_noop(self, http_client_mock, obj): acct = self.MyUpdateable.construct_from( { "id": "myid", "legal_entity": {"additional_owners": [{"first_name": "Bob"}]}, "currencies_supported": ["usd", "cad"], }, "mykey", ) assert acct is acct.save() http_client_mock.assert_requested( "post", path="/v1/myupdateables/myid", post_data="", ) def test_hash_noop(self, http_client_mock, obj): acct = self.MyUpdateable.construct_from( { "id": "myid", "legal_entity": {"address": {"line1": "1 Two Three"}}, }, "mykey", ) assert acct is acct.save() http_client_mock.assert_no_request() def test_save_replace_metadata_with_number(self, http_client_mock, obj): obj.baz = "updated" obj.other = "newval" obj.metadata = 3 self.checkSave(obj) http_client_mock.assert_requested( "post", path="/v1/myupdateables/myid", post_data="baz=updated&metadata=3&other=newval", ) def test_save_overwrite_metadata(self, http_client_mock, obj): obj.metadata = {} self.checkSave(obj) http_client_mock.assert_requested( "post", path="/v1/myupdateables/myid", post_data="metadata[size]=&metadata[score]=&metadata[height]=", ) def test_save_replace_metadata(self, http_client_mock, obj): obj.baz = "updated" obj.other = "newval" obj.metadata = {"size": "m", "info": "a2", "score": 4} self.checkSave(obj) http_client_mock.assert_requested( "post", path="/v1/myupdateables/myid", post_data="baz=updated&metadata[info]=a2&metadata[size]=m&metadata[score]=4&other=newval", ) def test_save_update_metadata(self, http_client_mock, obj): obj.baz = "updated" obj.other = "newval" obj.metadata.update({"size": "m", "info": "a2", "score": 4}) self.checkSave(obj) http_client_mock.assert_requested( "post", path="/v1/myupdateables/myid", post_data="baz=updated&metadata[info]=a2&metadata[size]=m&metadata[score]=4&other=newval", ) def test_retrieve_and_update_with_stripe_version( self, http_client_mock, obj ): http_client_mock.stub_request( "get", path="/v1/myupdateables/foo", rbody=json.dumps({"id": "foo", "bobble": "scrobble"}), ) res = self.MyUpdateable.retrieve("foo", stripe_version="2017-08-15") http_client_mock.assert_requested(stripe_version="2017-08-15") http_client_mock.stub_request( "post", path="/v1/myupdateables/foo", rbody=json.dumps({"id": "foo", "bobble": "new_scrobble"}), ) res.bobble = "new_scrobble" res.save() http_client_mock.assert_requested(stripe_version="2017-08-15") def test_modify_with_all_special_fields(self, http_client_mock, obj): http_client_mock.stub_request( "post", path="/v1/myupdateables/foo", rbody=json.dumps({"id": "foo", "bobble": "new_scrobble"}), rheaders={"Idempotency-Key": "IdempotencyKey"}, ) self.MyUpdateable.modify( "foo", stripe_version="2017-08-15", api_key="APIKEY", idempotency_key="IdempotencyKey", stripe_account="Acc", bobble="new_scrobble", headers={"extra_header": "val"}, ) http_client_mock.assert_requested( "post", path="/v1/myupdateables/foo", post_data="bobble=new_scrobble", stripe_version="2017-08-15", idempotency_key="IdempotencyKey", extra_headers={"extra_header": "val"}, ) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5729406 stripe-10.1.0/tests/api_resources/billing_portal/0000755000175100001770000000000014637354616021531 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/billing_portal/__init__.py0000644000175100001770000000000014637354563023631 0ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/billing_portal/test_configuration.py0000644000175100001770000000404214637354563026012 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "bpc_123" class TestConfiguration(object): def test_is_creatable(self, http_client_mock): resource = stripe.billing_portal.Configuration.create( business_profile={ "privacy_policy_url": "https://example.com/privacy", "terms_of_service_url": "https://example.com/tos", }, features={ "customer_update": { "allowed_updates": ["address"], "enabled": True, } }, ) http_client_mock.assert_requested( "post", path="/v1/billing_portal/configurations", post_data="business_profile[privacy_policy_url]=https://example.com/privacy&business_profile[terms_of_service_url]=https://example.com/tos&features[customer_update][allowed_updates][0]=address&features[customer_update][enabled]=True", ) assert isinstance(resource, stripe.billing_portal.Configuration) def test_is_retrievable(self, http_client_mock): resource = stripe.billing_portal.Configuration.retrieve( TEST_RESOURCE_ID ) http_client_mock.assert_requested( "get", path="/v1/billing_portal/configurations/%s" % (TEST_RESOURCE_ID), ) assert isinstance(resource, stripe.billing_portal.Configuration) def test_is_modifiable(self, http_client_mock): resource = stripe.billing_portal.Configuration.modify(TEST_RESOURCE_ID) http_client_mock.assert_requested( "post", path="/v1/billing_portal/configurations/%s" % (TEST_RESOURCE_ID), ) assert isinstance(resource, stripe.billing_portal.Configuration) def test_is_listable(self, http_client_mock): resource = stripe.billing_portal.Configuration.list() http_client_mock.assert_requested( "get", path="/v1/billing_portal/configurations" ) assert isinstance( resource.data[0], stripe.billing_portal.Configuration ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/billing_portal/test_session.py0000644000175100001770000000102214637354563024621 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "pts_123" class TestSession(object): def test_is_creatable(self, http_client_mock): resource = stripe.billing_portal.Session.create( customer="cus_123", return_url="https://stripe.com/return" ) http_client_mock.assert_requested( "post", path="/v1/billing_portal/sessions", post_data="customer=cus_123&return_url=https://stripe.com/return", ) assert isinstance(resource, stripe.billing_portal.Session) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5729406 stripe-10.1.0/tests/api_resources/checkout/0000755000175100001770000000000014637354616020335 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/checkout/__init__.py0000644000175100001770000000000014637354563022435 0ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/checkout/test_session.py0000644000175100001770000000402614637354563023434 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "cs_123" class TestSession(object): def test_is_creatable(self, http_client_mock): resource = stripe.checkout.Session.create( cancel_url="https://stripe.com/cancel", client_reference_id="1234", line_items=[ { "amount": 123, "currency": "usd", "description": "item 1", "images": ["https://stripe.com/img1"], "name": "name", "quantity": 2, } ], payment_intent_data={"receipt_email": "test@stripe.com"}, payment_method_types=["card"], success_url="https://stripe.com/success", ) http_client_mock.assert_requested( "post", path="/v1/checkout/sessions", post_data="cancel_url=https://stripe.com/cancel&client_reference_id=1234&line_items[0][amount]=123&line_items[0][currency]=usd&line_items[0][description]=item+1&line_items[0][images][0]=https://stripe.com/img1&line_items[0][name]=name&line_items[0][quantity]=2&payment_intent_data[receipt_email]=test@stripe.com&payment_method_types[0]=card&success_url=https://stripe.com/success", ) assert isinstance(resource, stripe.checkout.Session) def test_is_retrievable(self, http_client_mock): resource = stripe.checkout.Session.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/checkout/sessions/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.checkout.Session) class TestSessionLineItems(object): def test_is_listable(self, http_client_mock): resources = stripe.checkout.Session.list_line_items(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/checkout/sessions/%s/line_items" % TEST_RESOURCE_ID, ) assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.LineItem) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5729406 stripe-10.1.0/tests/api_resources/identity/0000755000175100001770000000000014637354616020361 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/identity/test_verification_report.py0000644000175100001770000000150514637354563026051 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "vs_123" class TestVerificationReport(object): def test_is_listable(self, http_client_mock): resources = stripe.identity.VerificationReport.list() http_client_mock.assert_requested( "get", path="/v1/identity/verification_reports" ) assert isinstance(resources.data, list) assert isinstance( resources.data[0], stripe.identity.VerificationReport ) def test_is_retrievable(self, http_client_mock): resource = stripe.identity.VerificationReport.retrieve( TEST_RESOURCE_ID ) http_client_mock.assert_requested( "get", path="/v1/identity/verification_reports/%s" % TEST_RESOURCE_ID, ) assert isinstance(resource, stripe.identity.VerificationReport) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/identity/test_verification_session.py0000644000175100001770000000776614637354563026240 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "vs_123" class TestVerificationSession(object): def test_is_creatable(self, http_client_mock): resource = stripe.identity.VerificationSession.create(type="id_number") http_client_mock.assert_requested( "post", path="/v1/identity/verification_sessions", post_data="type=id_number", ) assert isinstance(resource, stripe.identity.VerificationSession) def test_is_listable(self, http_client_mock): resources = stripe.identity.VerificationSession.list() http_client_mock.assert_requested( "get", path="/v1/identity/verification_sessions" ) assert isinstance(resources.data, list) assert isinstance( resources.data[0], stripe.identity.VerificationSession ) def test_is_modifiable(self, http_client_mock): resource = stripe.identity.VerificationSession.modify( TEST_RESOURCE_ID, metadata={"key": "value"} ) http_client_mock.assert_requested( "post", path="/v1/identity/verification_sessions/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) assert isinstance(resource, stripe.identity.VerificationSession) def test_is_retrievable(self, http_client_mock): resource = stripe.identity.VerificationSession.retrieve( TEST_RESOURCE_ID ) http_client_mock.assert_requested( "get", path="/v1/identity/verification_sessions/%s" % TEST_RESOURCE_ID, ) assert isinstance(resource, stripe.identity.VerificationSession) def test_is_saveable(self, http_client_mock): resource = stripe.identity.VerificationSession.retrieve( TEST_RESOURCE_ID ) resource.metadata["key"] = "value" verification_session = resource.save() http_client_mock.assert_requested( "post", path="/v1/identity/verification_sessions/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) assert isinstance(resource, stripe.identity.VerificationSession) assert resource is verification_session def test_can_cancel(self, http_client_mock): resource = stripe.identity.VerificationSession.retrieve( TEST_RESOURCE_ID ) verification_session = resource.cancel() http_client_mock.assert_requested( "post", path="/v1/identity/verification_sessions/%s/cancel" % TEST_RESOURCE_ID, post_data="", ) assert isinstance(resource, stripe.identity.VerificationSession) assert resource is verification_session def test_can_cancel_classmethod(self, http_client_mock): resource = stripe.identity.VerificationSession.cancel(TEST_RESOURCE_ID) http_client_mock.assert_requested( "post", path="/v1/identity/verification_sessions/%s/cancel" % TEST_RESOURCE_ID, post_data="", ) assert isinstance(resource, stripe.identity.VerificationSession) def test_can_redact(self, http_client_mock): resource = stripe.identity.VerificationSession.retrieve( TEST_RESOURCE_ID ) verification_session = resource.redact() http_client_mock.assert_requested( "post", path="/v1/identity/verification_sessions/%s/redact" % TEST_RESOURCE_ID, post_data="", ) assert isinstance(resource, stripe.identity.VerificationSession) assert resource is verification_session def test_can_redact_classmethod(self, http_client_mock): resource = stripe.identity.VerificationSession.redact(TEST_RESOURCE_ID) http_client_mock.assert_requested( "post", path="/v1/identity/verification_sessions/%s/redact" % TEST_RESOURCE_ID, post_data="", ) assert isinstance(resource, stripe.identity.VerificationSession) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5729406 stripe-10.1.0/tests/api_resources/issuing/0000755000175100001770000000000014637354616020211 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/issuing/__init__.py0000644000175100001770000000000014637354563022311 0ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/issuing/test_authorization.py0000644000175100001770000000640514637354563024530 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "iauth_123" class TestAuthorization(object): def test_is_listable(self, http_client_mock): resources = stripe.issuing.Authorization.list() http_client_mock.assert_requested( "get", path="/v1/issuing/authorizations" ) assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.issuing.Authorization) def test_is_modifiable(self, http_client_mock): resource = stripe.issuing.Authorization.modify( TEST_RESOURCE_ID, metadata={"key": "value"} ) http_client_mock.assert_requested( "post", path="/v1/issuing/authorizations/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) assert isinstance(resource, stripe.issuing.Authorization) def test_is_retrievable(self, http_client_mock): resource = stripe.issuing.Authorization.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/issuing/authorizations/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.issuing.Authorization) def test_is_saveable(self, http_client_mock): resource = stripe.issuing.Authorization.retrieve(TEST_RESOURCE_ID) resource.metadata["key"] = "value" authorization = resource.save() http_client_mock.assert_requested( "post", path="/v1/issuing/authorizations/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) assert isinstance(resource, stripe.issuing.Authorization) assert resource is authorization def test_can_approve(self, http_client_mock): resource = stripe.issuing.Authorization.retrieve(TEST_RESOURCE_ID) authorization = resource.approve() http_client_mock.assert_requested( "post", path="/v1/issuing/authorizations/%s/approve" % TEST_RESOURCE_ID, post_data="", ) assert isinstance(resource, stripe.issuing.Authorization) assert resource is authorization def test_can_approve_classmethod(self, http_client_mock): resource = stripe.issuing.Authorization.approve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "post", path="/v1/issuing/authorizations/%s/approve" % TEST_RESOURCE_ID, post_data="", ) assert isinstance(resource, stripe.issuing.Authorization) def test_can_decline(self, http_client_mock): resource = stripe.issuing.Authorization.retrieve(TEST_RESOURCE_ID) authorization = resource.decline() http_client_mock.assert_requested( "post", path="/v1/issuing/authorizations/%s/decline" % TEST_RESOURCE_ID, post_data="", ) assert isinstance(resource, stripe.issuing.Authorization) assert resource is authorization def test_can_decline_classmethod(self, http_client_mock): resource = stripe.issuing.Authorization.decline(TEST_RESOURCE_ID) http_client_mock.assert_requested( "post", path="/v1/issuing/authorizations/%s/decline" % TEST_RESOURCE_ID, post_data="", ) assert isinstance(resource, stripe.issuing.Authorization) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/issuing/test_card.py0000644000175100001770000000350614637354563022540 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "ic_123" class TestCard(object): def test_is_creatable(self, http_client_mock): resource = stripe.issuing.Card.create(currency="usd", type="physical") http_client_mock.assert_requested( "post", path="/v1/issuing/cards", post_data="currency=usd&type=physical", ) assert isinstance(resource, stripe.issuing.Card) def test_is_listable(self, http_client_mock): resources = stripe.issuing.Card.list() http_client_mock.assert_requested("get", path="/v1/issuing/cards") assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.issuing.Card) def test_is_modifiable(self, http_client_mock): resource = stripe.issuing.Card.modify( TEST_RESOURCE_ID, metadata={"key": "value"} ) http_client_mock.assert_requested( "post", path="/v1/issuing/cards/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) assert isinstance(resource, stripe.issuing.Card) def test_is_retrievable(self, http_client_mock): resource = stripe.issuing.Card.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/issuing/cards/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.issuing.Card) def test_is_saveable(self, http_client_mock): resource = stripe.issuing.Card.retrieve(TEST_RESOURCE_ID) resource.metadata["key"] = "value" card = resource.save() http_client_mock.assert_requested( "post", path="/v1/issuing/cards/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) assert isinstance(resource, stripe.issuing.Card) assert resource is card ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/issuing/test_cardholder.py0000644000175100001770000000455614637354563023744 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "ich_123" class TestCardholder(object): def test_is_creatable(self, http_client_mock): resource = stripe.issuing.Cardholder.create( billing={ "address": { "city": "city", "country": "US", "line1": "line1", "postal_code": "postal_code", } }, name="Jenny Rosen", type="individual", ) http_client_mock.assert_requested( "post", path="/v1/issuing/cardholders", post_data="billing[address][city]=city&billing[address][country]=US&billing[address][line1]=line1&billing[address][postal_code]=postal_code&name=Jenny+Rosen&type=individual", ) assert isinstance(resource, stripe.issuing.Cardholder) def test_is_listable(self, http_client_mock): resources = stripe.issuing.Cardholder.list() http_client_mock.assert_requested( "get", path="/v1/issuing/cardholders" ) assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.issuing.Cardholder) def test_is_modifiable(self, http_client_mock): resource = stripe.issuing.Cardholder.modify( TEST_RESOURCE_ID, metadata={"key": "value"} ) http_client_mock.assert_requested( "post", path="/v1/issuing/cardholders/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) assert isinstance(resource, stripe.issuing.Cardholder) def test_is_retrievable(self, http_client_mock): resource = stripe.issuing.Cardholder.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/issuing/cardholders/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.issuing.Cardholder) def test_is_saveable(self, http_client_mock): resource = stripe.issuing.Cardholder.retrieve(TEST_RESOURCE_ID) resource.metadata["key"] = "value" cardholder = resource.save() http_client_mock.assert_requested( "post", path="/v1/issuing/cardholders/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) assert isinstance(resource, stripe.issuing.Cardholder) assert resource is cardholder ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/issuing/test_dispute.py0000644000175100001770000000325514637354563023305 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "idp_123" class TestDispute(object): def test_is_creatable(self, http_client_mock): resource = stripe.issuing.Dispute.create(transaction="ipi_123") http_client_mock.assert_requested( "post", path="/v1/issuing/disputes", post_data="transaction=ipi_123", ) assert isinstance(resource, stripe.issuing.Dispute) def test_is_listable(self, http_client_mock): resources = stripe.issuing.Dispute.list() http_client_mock.assert_requested("get", path="/v1/issuing/disputes") assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.issuing.Dispute) def test_is_modifiable(self, http_client_mock): resource = stripe.issuing.Dispute.modify(TEST_RESOURCE_ID) http_client_mock.assert_requested( "post", path="/v1/issuing/disputes/%s" % TEST_RESOURCE_ID, post_data="", ) assert isinstance(resource, stripe.issuing.Dispute) def test_is_retrievable(self, http_client_mock): resource = stripe.issuing.Dispute.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/issuing/disputes/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.issuing.Dispute) def test_is_submittable(self, http_client_mock): resource = stripe.issuing.Dispute.submit(TEST_RESOURCE_ID) http_client_mock.assert_requested( "post", path="/v1/issuing/disputes/%s/submit" % TEST_RESOURCE_ID, post_data="", ) assert isinstance(resource, stripe.issuing.Dispute) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/issuing/test_transaction.py0000644000175100001770000000314714637354563024155 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "ipi_123" class TestTransaction(object): def test_is_listable(self, http_client_mock): resources = stripe.issuing.Transaction.list() http_client_mock.assert_requested( "get", path="/v1/issuing/transactions" ) assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.issuing.Transaction) def test_is_modifiable(self, http_client_mock): resource = stripe.issuing.Transaction.modify( TEST_RESOURCE_ID, metadata={"key": "value"} ) http_client_mock.assert_requested( "post", path="/v1/issuing/transactions/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) assert isinstance(resource, stripe.issuing.Transaction) def test_is_retrievable(self, http_client_mock): resource = stripe.issuing.Transaction.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/issuing/transactions/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.issuing.Transaction) def test_is_saveable(self, http_client_mock): resource = stripe.issuing.Transaction.retrieve(TEST_RESOURCE_ID) resource.metadata["key"] = "value" transaction = resource.save() http_client_mock.assert_requested( "post", path="/v1/issuing/transactions/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) assert isinstance(resource, stripe.issuing.Transaction) assert resource is transaction ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5769408 stripe-10.1.0/tests/api_resources/radar/0000755000175100001770000000000014637354616017621 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/radar/__init__.py0000644000175100001770000000000014637354563021721 0ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/radar/test_early_fraud_warning.py0000644000175100001770000000137014637354563025256 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "issfr_123" class TestEarlyFraudWarning(object): def test_is_listable(self, http_client_mock): resources = stripe.radar.EarlyFraudWarning.list() http_client_mock.assert_requested( "get", path="/v1/radar/early_fraud_warnings" ) assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.radar.EarlyFraudWarning) def test_is_retrievable(self, http_client_mock): resource = stripe.radar.EarlyFraudWarning.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/radar/early_fraud_warnings/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.radar.EarlyFraudWarning) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/radar/test_value_list.py0000644000175100001770000000454514637354563023412 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "rsl_123" class TestValueList(object): def test_is_listable(self, http_client_mock): resources = stripe.radar.ValueList.list() http_client_mock.assert_requested("get", path="/v1/radar/value_lists") assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.radar.ValueList) def test_is_retrievable(self, http_client_mock): resource = stripe.radar.ValueList.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/radar/value_lists/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.radar.ValueList) def test_is_creatable(self, http_client_mock): resource = stripe.radar.ValueList.create(alias="alias", name="name") http_client_mock.assert_requested( "post", path="/v1/radar/value_lists", post_data="alias=alias&name=name", ) assert isinstance(resource, stripe.radar.ValueList) def test_is_saveable(self, http_client_mock): resource = stripe.radar.ValueList.retrieve(TEST_RESOURCE_ID) resource.metadata["key"] = "value" resource.save() http_client_mock.assert_requested( "post", path="/v1/radar/value_lists/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) def test_is_modifiable(self, http_client_mock): resource = stripe.radar.ValueList.modify( TEST_RESOURCE_ID, metadata={"key": "value"} ) http_client_mock.assert_requested( "post", path="/v1/radar/value_lists/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) assert isinstance(resource, stripe.radar.ValueList) def test_is_deletable(self, http_client_mock): resource = stripe.radar.ValueList.retrieve(TEST_RESOURCE_ID) resource.delete() http_client_mock.assert_requested( "delete", path="/v1/radar/value_lists/%s" % TEST_RESOURCE_ID ) assert resource.deleted is True def test_can_delete(self, http_client_mock): resource = stripe.radar.ValueList.delete(TEST_RESOURCE_ID) http_client_mock.assert_requested( "delete", path="/v1/radar/value_lists/%s" % TEST_RESOURCE_ID ) assert resource.deleted is True ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/radar/test_value_list_item.py0000644000175100001770000000335114637354563024422 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "rsli_123" class TestValueListItem(object): def test_is_listable(self, http_client_mock): resources = stripe.radar.ValueListItem.list(value_list="rsl_123") http_client_mock.assert_requested( "get", path="/v1/radar/value_list_items" ) assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.radar.ValueListItem) def test_is_retrievable(self, http_client_mock): resource = stripe.radar.ValueListItem.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/radar/value_list_items/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.radar.ValueListItem) def test_is_creatable(self, http_client_mock): resource = stripe.radar.ValueListItem.create( value_list="rsl_123", value="value" ) http_client_mock.assert_requested( "post", path="/v1/radar/value_list_items", post_data="value_list=rsl_123&value=value", ) assert isinstance(resource, stripe.radar.ValueListItem) def test_is_deletable(self, http_client_mock): resource = stripe.radar.ValueListItem.retrieve(TEST_RESOURCE_ID) resource.delete() http_client_mock.assert_requested( "delete", path="/v1/radar/value_list_items/%s" % TEST_RESOURCE_ID ) assert resource.deleted is True def test_can_delete(self, http_client_mock): resource = stripe.radar.ValueListItem.delete(TEST_RESOURCE_ID) http_client_mock.assert_requested( "delete", path="/v1/radar/value_list_items/%s" % TEST_RESOURCE_ID ) assert resource.deleted is True ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5769408 stripe-10.1.0/tests/api_resources/reporting/0000755000175100001770000000000014637354616020541 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/reporting/__init__.py0000644000175100001770000000000014637354563022641 0ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/reporting/test_report_run.py0000644000175100001770000000230614637354563024353 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "frr_123" class TestReportRun(object): def test_is_creatable(self, http_client_mock): resource = stripe.reporting.ReportRun.create( parameters={"connected_account": "acct_123"}, report_type="activity.summary.1", ) http_client_mock.assert_requested( "post", path="/v1/reporting/report_runs", post_data="parameters[connected_account]=acct_123&report_type=activity.summary.1", ) assert isinstance(resource, stripe.reporting.ReportRun) def test_is_listable(self, http_client_mock): resources = stripe.reporting.ReportRun.list() http_client_mock.assert_requested( "get", path="/v1/reporting/report_runs" ) assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.reporting.ReportRun) def test_is_retrievable(self, http_client_mock): resource = stripe.reporting.ReportRun.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/reporting/report_runs/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.reporting.ReportRun) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/reporting/test_report_type.py0000644000175100001770000000134614637354563024533 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "activity.summary.1" class TestReportType(object): def test_is_listable(self, http_client_mock): resources = stripe.reporting.ReportType.list() http_client_mock.assert_requested( "get", path="/v1/reporting/report_types" ) assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.reporting.ReportType) def test_is_retrievable(self, http_client_mock): resource = stripe.reporting.ReportType.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/reporting/report_types/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.reporting.ReportType) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5769408 stripe-10.1.0/tests/api_resources/sigma/0000755000175100001770000000000014637354616017630 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/sigma/__init__.py0000644000175100001770000000000014637354563021730 0ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/sigma/test_scheduled_query_run.py0000644000175100001770000000136014637354563025313 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "sqr_123" class TestTransaction(object): def test_is_listable(self, http_client_mock): resources = stripe.sigma.ScheduledQueryRun.list() http_client_mock.assert_requested( "get", path="/v1/sigma/scheduled_query_runs" ) assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.sigma.ScheduledQueryRun) def test_is_retrievable(self, http_client_mock): resource = stripe.sigma.ScheduledQueryRun.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/sigma/scheduled_query_runs/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.sigma.ScheduledQueryRun) ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5769408 stripe-10.1.0/tests/api_resources/terminal/0000755000175100001770000000000014637354616020343 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/terminal/__init__.py0000644000175100001770000000000014637354563022443 0ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/terminal/test_connection_token.py0000644000175100001770000000060314637354563025313 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "rdr_123" class TestConnectionToken(object): def test_is_creatable(self, http_client_mock): resource = stripe.terminal.ConnectionToken.create() http_client_mock.assert_requested( "post", path="/v1/terminal/connection_tokens", post_data="" ) assert isinstance(resource, stripe.terminal.ConnectionToken) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/terminal/test_location.py0000644000175100001770000000550614637354563023573 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "loc_123" class TestLocation(object): def test_is_creatable(self, http_client_mock): resource = stripe.terminal.Location.create( display_name="name", address={ "line1": "line1", "country": "US", "state": "CA", "postal_code": "12345", "city": "San Francisco", }, ) http_client_mock.assert_requested( "post", path="/v1/terminal/locations", post_data="display_name=name&address[city]=San+Francisco&address[country]=US&address[line1]=line1&address[postal_code]=12345&address[state]=CA", ) assert isinstance(resource, stripe.terminal.Location) def test_is_listable(self, http_client_mock): resources = stripe.terminal.Location.list() http_client_mock.assert_requested("get", path="/v1/terminal/locations") assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.terminal.Location) def test_is_modifiable(self, http_client_mock): resource = stripe.terminal.Location.modify( TEST_RESOURCE_ID, display_name="new-name" ) http_client_mock.assert_requested( "post", path="/v1/terminal/locations/%s" % TEST_RESOURCE_ID, post_data="display_name=new-name", ) assert isinstance(resource, stripe.terminal.Location) def test_is_retrievable(self, http_client_mock): resource = stripe.terminal.Location.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/terminal/locations/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.terminal.Location) def test_is_saveable(self, http_client_mock): resource = stripe.terminal.Location.retrieve(TEST_RESOURCE_ID) resource.display_name = "new-name" location = resource.save() http_client_mock.assert_requested( "post", path="/v1/terminal/locations/%s" % TEST_RESOURCE_ID, post_data="display_name=new-name", ) assert isinstance(resource, stripe.terminal.Location) assert resource is location def test_is_deletable(self, http_client_mock): resource = stripe.terminal.Location.retrieve(TEST_RESOURCE_ID) resource.delete() http_client_mock.assert_requested( "delete", path="/v1/terminal/locations/%s" % TEST_RESOURCE_ID ) assert resource.deleted is True def test_can_delete(self, http_client_mock): resource = stripe.terminal.Location.delete(TEST_RESOURCE_ID) http_client_mock.assert_requested( "delete", path="/v1/terminal/locations/%s" % TEST_RESOURCE_ID ) assert resource.deleted is True ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/terminal/test_reader.py0000644000175100001770000000563514637354563023230 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "rdr_123" class TestReader(object): def test_is_creatable(self, http_client_mock): resource = stripe.terminal.Reader.create( registration_code="a-b-c", label="name" ) http_client_mock.assert_requested( "post", path="/v1/terminal/readers", post_data="label=name®istration_code=a-b-c", ) assert isinstance(resource, stripe.terminal.Reader) def test_is_listable(self, http_client_mock): resources = stripe.terminal.Reader.list() http_client_mock.assert_requested("get", path="/v1/terminal/readers") assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.terminal.Reader) def test_is_modifiable(self, http_client_mock): resource = stripe.terminal.Reader.modify( TEST_RESOURCE_ID, label="new-name" ) http_client_mock.assert_requested( "post", path="/v1/terminal/readers/%s" % TEST_RESOURCE_ID, post_data="label=new-name", ) assert isinstance(resource, stripe.terminal.Reader) def test_is_retrievable(self, http_client_mock): resource = stripe.terminal.Reader.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/terminal/readers/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.terminal.Reader) def test_is_saveable(self, http_client_mock): resource = stripe.terminal.Reader.retrieve(TEST_RESOURCE_ID) resource.label = "new-name" reader = resource.save() http_client_mock.assert_requested( "post", path="/v1/terminal/readers/%s" % TEST_RESOURCE_ID, post_data="label=new-name", ) assert isinstance(resource, stripe.terminal.Reader) assert resource is reader def test_is_deletable(self, http_client_mock): resource = stripe.terminal.Reader.retrieve(TEST_RESOURCE_ID) resource.delete() http_client_mock.assert_requested( "delete", path="/v1/terminal/readers/%s" % TEST_RESOURCE_ID ) assert resource.deleted is True def test_can_delete(self, http_client_mock): resource = stripe.terminal.Reader.delete(TEST_RESOURCE_ID) http_client_mock.assert_requested( "delete", path="/v1/terminal/readers/%s" % TEST_RESOURCE_ID ) assert resource.deleted is True def test_can_present_payment_method(self, http_client_mock): resource = stripe.terminal.Reader.TestHelpers.present_payment_method( TEST_RESOURCE_ID ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/terminal/readers/%s/present_payment_method" % TEST_RESOURCE_ID, post_data="", ) assert isinstance(resource, stripe.terminal.Reader) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_account.py0000644000175100001770000002463014637354563021603 0ustar00runnerdockerimport stripe import json TEST_RESOURCE_ID = "acct_123" TEST_CAPABILITY_ID = "acap_123" TEST_EXTERNALACCOUNT_ID = "ba_123" TEST_PERSON_ID = "person_123" class TestAccount(object): def test_is_listable(self, http_client_mock): resources = stripe.Account.list() http_client_mock.assert_requested("get", path="/v1/accounts") assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.Account) def test_is_retrievable(self, http_client_mock): resource = stripe.Account.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/accounts/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Account) def test_is_creatable(self, http_client_mock): resource = stripe.Account.create(country="US", type="custom") http_client_mock.assert_requested("post", path="/v1/accounts") assert isinstance(resource, stripe.Account) def test_is_saveable(self, http_client_mock): account = stripe.Account.retrieve(TEST_RESOURCE_ID) account.metadata["key"] = "value" resource = account.save() http_client_mock.assert_requested( "post", path="/v1/accounts/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) assert isinstance(resource, stripe.Account) assert resource is account def test_is_saveable_with_individual(self, http_client_mock): individual = stripe.Person.construct_from( {"id": "person_123", "object": "person", "first_name": "Jenny"}, stripe.api_key, ) account = stripe.Account.construct_from( {"id": "acct_123", "object": "account", "individual": individual}, stripe.api_key, ) account.individual.first_name = "Jane" http_client_mock.stub_request( "post", path="/v1/accounts/%s" % TEST_RESOURCE_ID, rbody=json.dumps(account.to_dict_recursive()), ) resource = account.save() http_client_mock.assert_requested( "post", path="/v1/accounts/%s" % TEST_RESOURCE_ID, post_data="individual[first_name]=Jane", ) assert isinstance(resource, stripe.Account) assert resource is account def test_is_modifiable(self, http_client_mock): resource = stripe.Account.modify( TEST_RESOURCE_ID, metadata={"key": "value"} ) http_client_mock.assert_requested( "post", path="/v1/accounts/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Account) def test_is_deletable(self, http_client_mock): resource = stripe.Account.retrieve(TEST_RESOURCE_ID) resource.delete() http_client_mock.assert_requested( "delete", path="/v1/accounts/%s" % TEST_RESOURCE_ID ) assert resource.deleted is True def test_can_delete(self, http_client_mock): resource = stripe.Account.delete(TEST_RESOURCE_ID) http_client_mock.assert_requested( "delete", path="/v1/accounts/%s" % TEST_RESOURCE_ID ) assert resource.deleted is True def test_can_retrieve_no_id(self, http_client_mock): resource = stripe.Account.retrieve() http_client_mock.assert_requested("get", path="/v1/account") assert isinstance(resource, stripe.Account) def test_can_reject(self, http_client_mock): account = stripe.Account.retrieve(TEST_RESOURCE_ID) resource = account.reject(reason="fraud") http_client_mock.assert_requested( "post", path="/v1/accounts/%s/reject" % TEST_RESOURCE_ID, post_data="reason=fraud", ) assert isinstance(resource, stripe.Account) assert resource is account def test_can_reject_classmethod(self, http_client_mock): resource = stripe.Account.reject(TEST_RESOURCE_ID, reason="fraud") http_client_mock.assert_requested( "post", path="/v1/accounts/%s/reject" % TEST_RESOURCE_ID, post_data="reason=fraud", ) assert isinstance(resource, stripe.Account) def test_is_deauthorizable(self, http_client_mock): account = stripe.Account.retrieve(TEST_RESOURCE_ID) http_client_mock.stub_request( "post", path="/oauth/deauthorize", rbody='{"stripe_user_id": "%s"}' % account.id, ) account.deauthorize() http_client_mock.assert_requested( "post", path="/oauth/deauthorize", post_data="client_id=%s&stripe_user_id=%s" % ( stripe.client_id, account.id, ), ) def test_can_call_persons(self, http_client_mock): account = stripe.Account.retrieve(TEST_RESOURCE_ID) resources = account.persons() http_client_mock.assert_requested( "get", path="/v1/accounts/%s/persons" % TEST_RESOURCE_ID ) assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.Person) class TestAccountCapabilities(object): def test_is_listable(self, http_client_mock): resources = stripe.Account.list_capabilities(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/accounts/%s/capabilities" % TEST_RESOURCE_ID ) assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.Capability) def test_is_modifiable(self, http_client_mock): resource = stripe.Account.modify_capability( TEST_RESOURCE_ID, TEST_CAPABILITY_ID, requested=True ) http_client_mock.assert_requested( "post", path="/v1/accounts/%s/capabilities/%s" % (TEST_RESOURCE_ID, TEST_CAPABILITY_ID), ) assert isinstance(resource, stripe.Capability) def test_is_retrievable(self, http_client_mock): resource = stripe.Account.retrieve_capability( TEST_RESOURCE_ID, TEST_CAPABILITY_ID ) http_client_mock.assert_requested( "get", path="/v1/accounts/%s/capabilities/%s" % (TEST_RESOURCE_ID, TEST_CAPABILITY_ID), ) assert isinstance(resource, stripe.Capability) class TestAccountExternalAccounts(object): def test_is_listable(self, http_client_mock): resources = stripe.Account.list_external_accounts(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/accounts/%s/external_accounts" % TEST_RESOURCE_ID ) assert isinstance(resources.data, list) def test_is_retrievable(self, http_client_mock): resource = stripe.Account.retrieve_external_account( TEST_RESOURCE_ID, TEST_EXTERNALACCOUNT_ID ) http_client_mock.assert_requested( "get", path="/v1/accounts/%s/external_accounts/%s" % (TEST_RESOURCE_ID, TEST_EXTERNALACCOUNT_ID), ) assert isinstance(resource, stripe.BankAccount) def test_is_creatable(self, http_client_mock): resource = stripe.Account.create_external_account( TEST_RESOURCE_ID, external_account="btok_123" ) http_client_mock.assert_requested( "post", path="/v1/accounts/%s/external_accounts" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.BankAccount) def test_is_modifiable(self, http_client_mock): resource = stripe.Account.modify_external_account( TEST_RESOURCE_ID, TEST_EXTERNALACCOUNT_ID, metadata={"foo": "bar"} ) http_client_mock.assert_requested( "post", path="/v1/accounts/%s/external_accounts/%s" % (TEST_RESOURCE_ID, TEST_EXTERNALACCOUNT_ID), ) assert isinstance(resource, stripe.BankAccount) def test_is_deletable(self, http_client_mock): resource = stripe.Account.delete_external_account( TEST_RESOURCE_ID, TEST_EXTERNALACCOUNT_ID ) http_client_mock.assert_requested( "delete", path="/v1/accounts/%s/external_accounts/%s" % (TEST_RESOURCE_ID, TEST_EXTERNALACCOUNT_ID), ) assert resource.deleted is True class TestAccountLoginLinks(object): def test_is_creatable(self, http_client_mock): resource = stripe.Account.create_login_link(TEST_RESOURCE_ID) http_client_mock.assert_requested( "post", path="/v1/accounts/%s/login_links" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.LoginLink) class TestAccountPersons(object): def test_is_creatable(self, http_client_mock): resource = stripe.Account.create_person( TEST_RESOURCE_ID, dob={"day": 1, "month": 1, "year": 1980} ) http_client_mock.assert_requested( "post", path="/v1/accounts/%s/persons" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Person) def test_is_deletable(self, http_client_mock): resource = stripe.Account.delete_person( TEST_RESOURCE_ID, TEST_PERSON_ID ) http_client_mock.assert_requested( "delete", path="/v1/accounts/%s/persons/%s" % (TEST_RESOURCE_ID, TEST_PERSON_ID), ) assert resource.deleted is True def test_is_listable(self, http_client_mock): resources = stripe.Account.list_persons(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/accounts/%s/persons" % TEST_RESOURCE_ID ) assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.Person) def test_is_modifiable(self, http_client_mock): resource = stripe.Account.modify_person( TEST_RESOURCE_ID, TEST_PERSON_ID, metadata={"foo": "bar"} ) http_client_mock.assert_requested( "post", path="/v1/accounts/%s/persons/%s" % (TEST_RESOURCE_ID, TEST_PERSON_ID), ) assert isinstance(resource, stripe.Person) def test_is_retrievable(self, http_client_mock): resource = stripe.Account.retrieve_person( TEST_RESOURCE_ID, TEST_PERSON_ID ) http_client_mock.assert_requested( "get", path="/v1/accounts/%s/persons/%s" % (TEST_RESOURCE_ID, TEST_PERSON_ID), ) assert isinstance(resource, stripe.Person) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_account_link.py0000644000175100001770000000072014637354563022612 0ustar00runnerdockerimport stripe class TestAccountLink(object): def test_is_creatable(self, http_client_mock): resource = stripe.AccountLink.create( account="acct_123", refresh_url="https://stripe.com/failure", return_url="https://stripe.com/success", type="account_onboarding", ) http_client_mock.assert_requested("post", path="/v1/account_links") assert isinstance(resource, stripe.AccountLink) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_apple_pay_domain.py0000644000175100001770000000300114637354563023435 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "apwc_123" class TestApplePayDomain(object): def test_is_listable(self, http_client_mock): resources = stripe.ApplePayDomain.list() http_client_mock.assert_requested("get", path="/v1/apple_pay/domains") assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.ApplePayDomain) def test_is_retrievable(self, http_client_mock): resource = stripe.ApplePayDomain.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/apple_pay/domains/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.ApplePayDomain) def test_is_creatable(self, http_client_mock): resource = stripe.ApplePayDomain.create(domain_name="test.com") http_client_mock.assert_requested("post", path="/v1/apple_pay/domains") assert isinstance(resource, stripe.ApplePayDomain) def test_is_deletable(self, http_client_mock): resource = stripe.ApplePayDomain.retrieve(TEST_RESOURCE_ID) resource.delete() http_client_mock.assert_requested( "delete", path="/v1/apple_pay/domains/%s" % TEST_RESOURCE_ID ) assert resource.deleted is True def test_can_delete(self, http_client_mock): resource = stripe.ApplePayDomain.delete(TEST_RESOURCE_ID) http_client_mock.assert_requested( "delete", path="/v1/apple_pay/domains/%s" % TEST_RESOURCE_ID ) assert resource.deleted is True ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_application_fee.py0000644000175100001770000000375314637354563023274 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "fee_123" TEST_FEEREFUND_ID = "fr_123" class TestApplicationFee(object): def test_is_listable(self, http_client_mock): resources = stripe.ApplicationFee.list() http_client_mock.assert_requested("get", path="/v1/application_fees") assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.ApplicationFee) class TestApplicationFeeRefunds(object): def test_is_listable(self, http_client_mock): resources = stripe.ApplicationFee.list_refunds(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/application_fees/%s/refunds" % TEST_RESOURCE_ID ) assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.ApplicationFeeRefund) def test_is_retrievable(self, http_client_mock): resource = stripe.ApplicationFee.retrieve_refund( TEST_RESOURCE_ID, TEST_FEEREFUND_ID ) http_client_mock.assert_requested( "get", path="/v1/application_fees/%s/refunds/%s" % (TEST_RESOURCE_ID, TEST_FEEREFUND_ID), ) assert isinstance(resource, stripe.ApplicationFeeRefund) def test_is_creatable(self, http_client_mock): resource = stripe.ApplicationFee.create_refund( TEST_RESOURCE_ID, amount=100 ) http_client_mock.assert_requested( "post", path="/v1/application_fees/%s/refunds" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.ApplicationFeeRefund) def test_is_modifiable(self, http_client_mock): resource = stripe.ApplicationFee.modify_refund( TEST_RESOURCE_ID, TEST_FEEREFUND_ID, metadata={"foo": "bar"} ) http_client_mock.assert_requested( "post", path="/v1/application_fees/%s/refunds/%s" % (TEST_RESOURCE_ID, TEST_FEEREFUND_ID), ) assert isinstance(resource, stripe.ApplicationFeeRefund) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_application_fee_refund.py0000644000175100001770000000215714637354563024634 0ustar00runnerdockerimport pytest import stripe TEST_RESOURCE_ID = "fr_123" TEST_APPFEE_ID = "fee_123" class TestApplicationFeeRefund(object): def test_is_saveable(self, http_client_mock): appfee = stripe.ApplicationFee.retrieve(TEST_APPFEE_ID) resource = appfee.refunds.retrieve(TEST_RESOURCE_ID) resource.metadata["key"] = "value" resource.save() http_client_mock.assert_requested( "post", path="/v1/application_fees/%s/refunds/%s" % (TEST_APPFEE_ID, TEST_RESOURCE_ID), ) def test_is_modifiable(self, http_client_mock): resource = stripe.ApplicationFeeRefund.modify( TEST_APPFEE_ID, TEST_RESOURCE_ID, metadata={"key": "value"} ) http_client_mock.assert_requested( "post", path="/v1/application_fees/%s/refunds/%s" % (TEST_APPFEE_ID, TEST_RESOURCE_ID), ) assert isinstance(resource, stripe.ApplicationFeeRefund) def test_is_not_retrievable(self): with pytest.raises(NotImplementedError): stripe.ApplicationFeeRefund.retrieve(TEST_RESOURCE_ID) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_balance.py0000644000175100001770000000040614637354563021527 0ustar00runnerdockerimport stripe class TestBalance(object): def test_is_retrievable(self, http_client_mock): resource = stripe.Balance.retrieve() http_client_mock.assert_requested("get", path="/v1/balance") assert isinstance(resource, stripe.Balance) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_balance_transaction.py0000644000175100001770000000132714637354563024137 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "txn_123" class TestBalanceTransaction(object): def test_is_listable(self, http_client_mock): resources = stripe.BalanceTransaction.list() http_client_mock.assert_requested( "get", path="/v1/balance_transactions" ) assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.BalanceTransaction) def test_is_retrievable(self, http_client_mock): resource = stripe.BalanceTransaction.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/balance_transactions/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.BalanceTransaction) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_bank_account.py0000644000175100001770000000444714637354563022602 0ustar00runnerdockerimport pytest import stripe TEST_RESOURCE_ID = "ba_123" class TestBankAccountTest(object): def construct_resource(self, **params): bank_dict = { "id": TEST_RESOURCE_ID, "object": "bank_account", "metadata": {}, } bank_dict.update(params) return stripe.BankAccount.construct_from(bank_dict, stripe.api_key) def test_has_account_instance_url(self): resource = self.construct_resource(account="acct_123") assert ( resource.instance_url() == "/v1/accounts/acct_123/external_accounts/%s" % TEST_RESOURCE_ID ) def test_has_customer_instance_url(self): resource = self.construct_resource(customer="cus_123") assert ( resource.instance_url() == "/v1/customers/cus_123/sources/%s" % TEST_RESOURCE_ID ) # The previous tests already ensure that the request will be routed to the # correct URL, so we only test the API operations once. def test_is_not_retrievable(self): with pytest.raises(NotImplementedError): stripe.BankAccount.retrieve(TEST_RESOURCE_ID) def test_is_saveable(self, http_client_mock): resource = self.construct_resource(customer="cus_123") resource.metadata["key"] = "value" resource.save() http_client_mock.assert_requested( "post", path="/v1/customers/cus_123/sources/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) def test_is_not_modifiable(self): with pytest.raises(NotImplementedError): stripe.BankAccount.modify( TEST_RESOURCE_ID, metadata={"key": "value"} ) def test_is_deletable(self, http_client_mock): resource = self.construct_resource(customer="cus_123") resource.delete() http_client_mock.assert_requested( "delete", path="/v1/customers/cus_123/sources/%s" % TEST_RESOURCE_ID, ) def test_is_verifiable(self, http_client_mock): resource = self.construct_resource(customer="cus_123") resource.verify() http_client_mock.assert_requested( "post", path="/v1/customers/cus_123/sources/%s/verify" % TEST_RESOURCE_ID, post_data="", ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_capability.py0000644000175100001770000000233414637354563022265 0ustar00runnerdockerimport pytest import stripe TEST_RESOURCE_ID = "acap_123" class TestCapability(object): def construct_resource(self): capability_dict = { "id": TEST_RESOURCE_ID, "object": "capability", "account": "acct_123", } return stripe.Capability.construct_from( capability_dict, stripe.api_key ) def test_has_instance_url(self): resource = self.construct_resource() assert ( resource.instance_url() == "/v1/accounts/acct_123/capabilities/%s" % TEST_RESOURCE_ID ) def test_is_not_modifiable(self): with pytest.raises(NotImplementedError): stripe.Capability.modify(TEST_RESOURCE_ID, requested=True) def test_is_not_retrievable(self): with pytest.raises(NotImplementedError): stripe.Capability.retrieve(TEST_RESOURCE_ID) def test_is_saveable(self, http_client_mock): resource = self.construct_resource() resource.requested = True resource.save() http_client_mock.assert_requested( "post", path="/v1/accounts/acct_123/capabilities/%s" % TEST_RESOURCE_ID, post_data="requested=True", ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_card.py0000644000175100001770000000356414637354563021063 0ustar00runnerdockerimport pytest import stripe TEST_RESOURCE_ID = "card_123" class TestCard(object): def construct_resource(self, **params): card_dict = {"id": TEST_RESOURCE_ID, "object": "card", "metadata": {}} card_dict.update(params) return stripe.Card.construct_from(card_dict, stripe.api_key) def test_has_account_instance_url(self): resource = self.construct_resource(account="acct_123") assert ( resource.instance_url() == "/v1/accounts/acct_123/external_accounts/%s" % TEST_RESOURCE_ID ) def test_has_customer_instance_url(self): resource = self.construct_resource(customer="cus_123") assert ( resource.instance_url() == "/v1/customers/cus_123/sources/%s" % TEST_RESOURCE_ID ) # The previous tests already ensure that the request will be routed to the # correct URL, so we only test the API operations once. def test_is_not_retrievable(self): with pytest.raises(NotImplementedError): stripe.Card.retrieve(TEST_RESOURCE_ID) def test_is_saveable(self, http_client_mock): resource = self.construct_resource(customer="cus_123") resource.metadata["key"] = "value" resource.save() http_client_mock.assert_requested( "post", path="/v1/customers/cus_123/sources/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) def test_is_not_modifiable(self): with pytest.raises(NotImplementedError): stripe.Card.modify(TEST_RESOURCE_ID, metadata={"key": "value"}) def test_is_deletable(self, http_client_mock): resource = self.construct_resource(customer="cus_123") resource.delete() http_client_mock.assert_requested( "delete", path="/v1/customers/cus_123/sources/%s" % TEST_RESOURCE_ID, ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_charge.py0000644000175100001770000000726514637354563021405 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "ch_123" class TestCharge(object): def test_is_listable(self, http_client_mock): resources = stripe.Charge.list() http_client_mock.assert_requested("get", path="/v1/charges") assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.Charge) def test_is_searchable(self, http_client_mock): resources = stripe.Charge.search(query='currency:"USD"') http_client_mock.assert_requested( "get", path="/v1/charges/search", query_string='query=currency:"USD"', ) assert resources.total_count == 1 assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.Charge) cnt = 0 for c in resources.auto_paging_iter(): assert isinstance(c, stripe.Charge) cnt += 1 assert cnt == 1 def test_is_retrievable(self, http_client_mock): resource = stripe.Charge.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/charges/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Charge) def test_is_creatable(self, http_client_mock): resource = stripe.Charge.create( amount=100, currency="usd", source="tok_123" ) http_client_mock.assert_requested( "post", path="/v1/charges", post_data="amount=100¤cy=usd&source=tok_123", ) assert isinstance(resource, stripe.Charge) def test_is_saveable(self, http_client_mock): resource = stripe.Charge.retrieve(TEST_RESOURCE_ID) resource.metadata["key"] = "value" resource.save() http_client_mock.assert_requested( "post", path="/v1/charges/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) assert isinstance(resource, stripe.Charge) def test_is_modifiable(self, http_client_mock): resource = stripe.Charge.modify( TEST_RESOURCE_ID, metadata={"key": "value"} ) http_client_mock.assert_requested( "post", path="/v1/charges/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) assert isinstance(resource, stripe.Charge) def test_can_capture(self, http_client_mock): charge = stripe.Charge.retrieve(TEST_RESOURCE_ID) resource = charge.capture() http_client_mock.assert_requested( "post", path="/v1/charges/%s/capture" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Charge) def test_can_capture_classmethod(self, http_client_mock): resource = stripe.Charge.capture(TEST_RESOURCE_ID) http_client_mock.assert_requested( "post", path="/v1/charges/%s/capture" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Charge) def test_can_mark_as_fraudulent(self, http_client_mock): charge = stripe.Charge.retrieve(TEST_RESOURCE_ID) resource = charge.mark_as_fraudulent() http_client_mock.assert_requested( "post", path="/v1/charges/%s" % charge.id, post_data="fraud_details[user_report]=fraudulent", ) assert isinstance(resource, stripe.Charge) def test_can_mark_as_safe(self, http_client_mock): charge = stripe.Charge.retrieve(TEST_RESOURCE_ID) resource = charge.mark_as_safe() http_client_mock.assert_requested( "post", path="/v1/charges/%s" % charge.id, post_data="fraud_details[user_report]=safe", ) assert isinstance(resource, stripe.Charge) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_country_spec.py0000644000175100001770000000121314637354563022654 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "US" class TestCountrySpec(object): def test_is_listable(self, http_client_mock): resources = stripe.CountrySpec.list() http_client_mock.assert_requested("get", path="/v1/country_specs") assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.CountrySpec) def test_is_retrievable(self, http_client_mock): resource = stripe.CountrySpec.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/country_specs/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.CountrySpec) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_coupon.py0000644000175100001770000000441614637354563021452 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "250FF" class TestCoupon(object): def test_is_listable(self, http_client_mock): resources = stripe.Coupon.list() http_client_mock.assert_requested("get", path="/v1/coupons") assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.Coupon) def test_is_retrievable(self, http_client_mock): resource = stripe.Coupon.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/coupons/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Coupon) def test_is_creatable(self, http_client_mock): resource = stripe.Coupon.create( percent_off=25, duration="repeating", duration_in_months=3, id="250FF", ) http_client_mock.assert_requested( "post", path="/v1/coupons", post_data="duration=repeating&duration_in_months=3&id=250FF&percent_off=25", ) assert isinstance(resource, stripe.Coupon) def test_is_saveable(self, http_client_mock): resource = stripe.Coupon.retrieve(TEST_RESOURCE_ID) resource.metadata["key"] = "value" resource.save() http_client_mock.assert_requested( "post", path="/v1/coupons/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) def test_is_modifiable(self, http_client_mock): resource = stripe.Coupon.modify( TEST_RESOURCE_ID, metadata={"key": "value"} ) http_client_mock.assert_requested( "post", path="/v1/coupons/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Coupon) def test_is_deletable(self, http_client_mock): resource = stripe.Coupon.retrieve(TEST_RESOURCE_ID) resource.delete() http_client_mock.assert_requested( "delete", path="/v1/coupons/%s" % TEST_RESOURCE_ID ) assert resource.deleted is True def test_can_delete(self, http_client_mock): resource = stripe.Coupon.delete(TEST_RESOURCE_ID) http_client_mock.assert_requested( "delete", path="/v1/coupons/%s" % TEST_RESOURCE_ID ) assert resource.deleted is True ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_credit_note.py0000644000175100001770000000553314637354563022447 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "cn_123" class TestCreditNote(object): def test_is_listable(self, http_client_mock): resources = stripe.CreditNote.list() http_client_mock.assert_requested("get", path="/v1/credit_notes") assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.CreditNote) def test_is_retrievable(self, http_client_mock): resource = stripe.CreditNote.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/credit_notes/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.CreditNote) def test_is_creatable(self, http_client_mock): resource = stripe.CreditNote.create( amount=100, invoice="in_123", reason="duplicate" ) http_client_mock.assert_requested( "post", path="/v1/credit_notes", post_data="amount=100&invoice=in_123&reason=duplicate", ) assert isinstance(resource, stripe.CreditNote) def test_is_saveable(self, http_client_mock): resource = stripe.CreditNote.retrieve(TEST_RESOURCE_ID) resource.metadata["key"] = "value" resource.save() http_client_mock.assert_requested( "post", path="/v1/credit_notes/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) def test_is_modifiable(self, http_client_mock): resource = stripe.CreditNote.modify( TEST_RESOURCE_ID, metadata={"key": "value"} ) http_client_mock.assert_requested( "post", path="/v1/credit_notes/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) assert isinstance(resource, stripe.CreditNote) def test_can_preview(self, http_client_mock): resource = stripe.CreditNote.preview(invoice="in_123", amount=500) http_client_mock.assert_requested( "get", path="/v1/credit_notes/preview", query_string="amount=500&invoice=in_123", ) assert isinstance(resource, stripe.CreditNote) def test_can_void_credit_note(self, http_client_mock): resource = stripe.CreditNote.retrieve(TEST_RESOURCE_ID) resource = resource.void_credit_note() http_client_mock.assert_requested( "post", path="/v1/credit_notes/%s/void" % TEST_RESOURCE_ID, post_data="", ) assert isinstance(resource, stripe.CreditNote) def test_can_void_credit_note_classmethod(self, http_client_mock): resource = stripe.CreditNote.void_credit_note(TEST_RESOURCE_ID) http_client_mock.assert_requested( "post", path="/v1/credit_notes/%s/void" % TEST_RESOURCE_ID, post_data="", ) assert isinstance(resource, stripe.CreditNote) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_customer.py0000644000175100001770000002140314637354563022003 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "cus_123" TEST_SUB_ID = "sub_123" TEST_SOURCE_ID = "ba_123" TEST_TAX_ID_ID = "txi_123" TEST_TRANSACTION_ID = "cbtxn_123" class TestCustomer(object): def test_is_listable(self, http_client_mock): resources = stripe.Customer.list() http_client_mock.assert_requested("get", path="/v1/customers") assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.Customer) def test_is_retrievable(self, http_client_mock): resource = stripe.Customer.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/customers/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Customer) def test_is_creatable(self, http_client_mock): resource = stripe.Customer.create() http_client_mock.assert_requested("post", path="/v1/customers") assert isinstance(resource, stripe.Customer) def test_is_saveable(self, http_client_mock): resource = stripe.Customer.retrieve(TEST_RESOURCE_ID) resource.metadata["key"] = "value" resource.save() http_client_mock.assert_requested( "post", path="/v1/customers/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) def test_is_modifiable(self, http_client_mock): resource = stripe.Customer.modify( TEST_RESOURCE_ID, metadata={"key": "value"} ) http_client_mock.assert_requested( "post", path="/v1/customers/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) assert isinstance(resource, stripe.Customer) def test_is_deletable(self, http_client_mock): resource = stripe.Customer.retrieve(TEST_RESOURCE_ID) resource.delete() http_client_mock.assert_requested( "delete", path="/v1/customers/%s" % TEST_RESOURCE_ID ) assert resource.deleted is True def test_can_delete(self, http_client_mock): resource = stripe.Customer.delete(TEST_RESOURCE_ID) http_client_mock.assert_requested( "delete", path="/v1/customers/%s" % TEST_RESOURCE_ID ) assert resource.deleted is True def test_can_delete_discount(self, http_client_mock): resource = stripe.Customer.retrieve(TEST_RESOURCE_ID) resource.delete_discount() http_client_mock.assert_requested( "delete", path="/v1/customers/%s/discount" % TEST_RESOURCE_ID ) def test_can_delete_discount_class_method(self, http_client_mock): stripe.Customer.delete_discount(TEST_RESOURCE_ID) http_client_mock.assert_requested( "delete", path="/v1/customers/%s/discount" % TEST_RESOURCE_ID ) class TestCustomerSources(object): def test_is_creatable(self, http_client_mock): stripe.Customer.create_source(TEST_RESOURCE_ID, source="btok_123") http_client_mock.assert_requested( "post", path="/v1/customers/%s/sources" % TEST_RESOURCE_ID, post_data="source=btok_123", ) def test_is_retrievable(self, http_client_mock): stripe.Customer.retrieve_source(TEST_RESOURCE_ID, TEST_SOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/customers/%s/sources/%s" % (TEST_RESOURCE_ID, TEST_SOURCE_ID), ) def test_is_modifiable(self, http_client_mock): stripe.Customer.modify_source( TEST_RESOURCE_ID, TEST_SOURCE_ID, metadata={"foo": "bar"} ) http_client_mock.assert_requested( "post", path="/v1/customers/%s/sources/%s" % (TEST_RESOURCE_ID, TEST_SOURCE_ID), post_data="metadata[foo]=bar", ) def test_is_deletable(self, http_client_mock): stripe.Customer.delete_source(TEST_RESOURCE_ID, TEST_SOURCE_ID) http_client_mock.assert_requested( "delete", path="/v1/customers/%s/sources/%s" % (TEST_RESOURCE_ID, TEST_SOURCE_ID), ) def test_is_listable(self, http_client_mock): resources = stripe.Customer.list_sources(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/customers/%s/sources" % TEST_RESOURCE_ID ) assert isinstance(resources.data, list) class TestCustomerTaxIds(object): def test_is_creatable(self, http_client_mock): resource = stripe.Customer.create_tax_id( TEST_RESOURCE_ID, type="eu_vat", value="11111" ) http_client_mock.assert_requested( "post", path="/v1/customers/%s/tax_ids" % TEST_RESOURCE_ID, post_data="type=eu_vat&value=11111", ) assert isinstance(resource, stripe.TaxId) def test_is_retrievable(self, http_client_mock): stripe.Customer.retrieve_tax_id(TEST_RESOURCE_ID, TEST_TAX_ID_ID) http_client_mock.assert_requested( "get", path="/v1/customers/%s/tax_ids/%s" % (TEST_RESOURCE_ID, TEST_TAX_ID_ID), ) def test_is_deletable(self, http_client_mock): stripe.Customer.delete_tax_id(TEST_RESOURCE_ID, TEST_TAX_ID_ID) http_client_mock.assert_requested( "delete", path="/v1/customers/%s/tax_ids/%s" % (TEST_RESOURCE_ID, TEST_TAX_ID_ID), ) def test_is_listable(self, http_client_mock): resources = stripe.Customer.list_tax_ids(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/customers/%s/tax_ids" % TEST_RESOURCE_ID ) assert isinstance(resources.data, list) class TestCustomerTransactions(object): def test_is_creatable(self, http_client_mock): resource = stripe.Customer.create_balance_transaction( TEST_RESOURCE_ID, amount=1234, currency="usd" ) http_client_mock.assert_requested( "post", path="/v1/customers/%s/balance_transactions" % TEST_RESOURCE_ID, ) assert isinstance(resource, stripe.CustomerBalanceTransaction) def test_is_retrievable(self, http_client_mock): stripe.Customer.retrieve_balance_transaction( TEST_RESOURCE_ID, TEST_TRANSACTION_ID ) http_client_mock.assert_requested( "get", path="/v1/customers/%s/balance_transactions/%s" % (TEST_RESOURCE_ID, TEST_TRANSACTION_ID), ) def test_is_listable(self, http_client_mock): resources = stripe.Customer.list_balance_transactions(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/customers/%s/balance_transactions" % TEST_RESOURCE_ID, ) assert isinstance(resources.data, list) class TestCustomerPaymentMethods(object): def test_is_listable(self, http_client_mock): stripe.Customer.list_payment_methods(TEST_RESOURCE_ID, type="card") http_client_mock.assert_requested( "get", path="/v1/customers/%s/payment_methods" % TEST_RESOURCE_ID ) def test_is_listable_on_object(self, http_client_mock): resource = stripe.Customer.retrieve( TEST_RESOURCE_ID ).list_payment_methods(type="card") http_client_mock.assert_requested( "get", path="/v1/customers/%s/payment_methods" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.ListObject) class TestCustomerCashBalanceMethods(object): # These tests are present for compatibility purposes. Previously the cash # balance methods required None as a second nested_id parameter. The method # has been patched to no longer require this, but we want to preserve # compatibility for existing users. def test_customer_cashbalance_retrieve_legacy_call_pattern( self, http_client_mock ): stripe.Customer.retrieve_cash_balance("cus_123") http_client_mock.assert_requested( "get", path="/v1/customers/cus_123/cash_balance" ) def test_customer_cashbalance_modify_legacy_call_pattern( self, http_client_mock ): stripe.Customer.modify_cash_balance( "cus_123", settings={"reconciliation_mode": "manual"}, ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_123/cash_balance", post_data="settings[reconciliation_mode]=manual", ) def test_customer_cashbalance_modify_fixed_pattern(self, http_client_mock): stripe.Customer.modify_cash_balance( "cus_123", settings={"reconciliation_mode": "manual"}, ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_123/cash_balance", post_data="settings[reconciliation_mode]=manual", ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_customer_balance_transaction.py0000644000175100001770000000146414637354563026062 0ustar00runnerdockerimport pytest import stripe TEST_RESOURCE_ID = "cbtxn_123" class TestCustomerBalanceTransaction(object): def construct_resource(self): tax_id_dict = { "id": TEST_RESOURCE_ID, "object": "customer_balance_transaction", "customer": "cus_123", } return stripe.CustomerBalanceTransaction.construct_from( tax_id_dict, stripe.api_key ) def test_has_instance_url(self): resource = self.construct_resource() assert ( resource.instance_url() == "/v1/customers/cus_123/balance_transactions/%s" % TEST_RESOURCE_ID ) def test_is_not_retrievable(self): with pytest.raises(NotImplementedError): stripe.CustomerBalanceTransaction.retrieve(TEST_RESOURCE_ID) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_dispute.py0000644000175100001770000000365314637354563021626 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "dp_123" class TestDispute(object): def test_is_listable(self, http_client_mock): resources = stripe.Dispute.list() http_client_mock.assert_requested("get", path="/v1/disputes") assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.Dispute) def test_is_retrievable(self, http_client_mock): resource = stripe.Dispute.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/disputes/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Dispute) def test_is_saveable(self, http_client_mock): resource = stripe.Dispute.retrieve(TEST_RESOURCE_ID) resource.metadata["key"] = "value" resource.save() http_client_mock.assert_requested( "post", path="/v1/disputes/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) def test_is_modifiable(self, http_client_mock): resource = stripe.Dispute.modify( TEST_RESOURCE_ID, metadata={"key": "value"} ) http_client_mock.assert_requested( "post", path="/v1/disputes/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) assert isinstance(resource, stripe.Dispute) def test_can_close(self, http_client_mock): resource = stripe.Dispute.retrieve(TEST_RESOURCE_ID) resource.close() http_client_mock.assert_requested( "post", path="/v1/disputes/%s/close" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Dispute) def test_can_close_classmethod(self, http_client_mock): resource = stripe.Dispute.close(TEST_RESOURCE_ID) http_client_mock.assert_requested( "post", path="/v1/disputes/%s/close" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Dispute) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_ephemeral_key.py0000644000175100001770000000252514637354563022760 0ustar00runnerdockerimport pytest import stripe class TestEphemeralKey(object): def test_is_creatable(self, http_client_mock): resource = stripe.EphemeralKey.create( customer="cus_123", stripe_version="2017-05-25" ) http_client_mock.assert_requested( "post", path="/v1/ephemeral_keys", stripe_version="2017-05-25", post_data="customer=cus_123", ) assert isinstance(resource, stripe.EphemeralKey) def test_is_not_creatable_without_an_explicit_api_version(self): with pytest.raises( ValueError, match="stripe_version must be specified" ): stripe.EphemeralKey.create(customer="cus_123") def test_is_deletable(self, http_client_mock): resource = stripe.EphemeralKey.create( customer="cus_123", stripe_version="2017-05-25" ) resource.delete() http_client_mock.assert_requested( "delete", path="/v1/ephemeral_keys/%s" % resource.id ) assert isinstance(resource, stripe.EphemeralKey) def test_can_delete(self, http_client_mock): resource = stripe.EphemeralKey.delete("ephkey_123") http_client_mock.assert_requested( "delete", path="/v1/ephemeral_keys/ephkey_123" ) assert isinstance(resource, stripe.EphemeralKey) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_event.py0000644000175100001770000000114414637354563021263 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "evt_123" class TestEvent(object): def test_is_listable(self, http_client_mock): resources = stripe.Event.list() http_client_mock.assert_requested("get", path="/v1/events") assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.Event) def test_is_retrievable(self, http_client_mock): resource = stripe.Event.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/events/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Event) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_exchange_rate.py0000644000175100001770000000122314637354563022735 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "usd" class TestExchangeRate(object): def test_is_listable(self, http_client_mock): resources = stripe.ExchangeRate.list() http_client_mock.assert_requested("get", path="/v1/exchange_rates") assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.ExchangeRate) def test_is_retrievable(self, http_client_mock): resource = stripe.ExchangeRate.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/exchange_rates/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.ExchangeRate) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_file.py0000644000175100001770000000571514637354563021071 0ustar00runnerdockerimport tempfile import pytest import stripe TEST_RESOURCE_ID = "file_123" class TestFile(object): @pytest.fixture(scope="function") def setup_upload_api_base(self): stripe.upload_api_base = stripe.api_base stripe.api_base = None yield stripe.api_base = stripe.upload_api_base stripe.upload_api_base = "https://files.stripe.com" def test_is_listable(self, http_client_mock): resources = stripe.File.list() http_client_mock.assert_requested("get", path="/v1/files") assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.File) def test_is_retrievable(self, http_client_mock): resource = stripe.File.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/files/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.File) def test_is_creatable(self, setup_upload_api_base, http_client_mock): stripe.multipart_data_generator.MultipartDataGenerator._initialize_boundary = ( lambda self: 1234567890 ) test_file = tempfile.TemporaryFile() resource = stripe.File.create( purpose="dispute_evidence", file=test_file, file_link_data={"create": True}, ) http_client_mock.assert_requested( "post", path="/v1/files", api_base=stripe.upload_api_base, content_type="multipart/form-data; boundary=1234567890", ) assert isinstance(resource, stripe.File) def test_create_respects_stripe_version( self, setup_upload_api_base, http_client_mock ): test_file = tempfile.TemporaryFile() stripe.File.create( purpose="dispute_evidence", file=test_file, stripe_version="foo" ) http_client_mock.assert_requested( "post", api_base=stripe.upload_api_base, path="/v1/files", stripe_version="foo", ) # You can use api_version instead of stripe_version # in File.create. We preserve it for backwards compatibility def test_create_respects_api_version( self, setup_upload_api_base, http_client_mock ): test_file = tempfile.TemporaryFile() stripe.File.create( purpose="dispute_evidence", file=test_file, stripe_version="foo" ) http_client_mock.assert_requested( "post", api_base=stripe.upload_api_base, path="/v1/files", stripe_version="foo", ) def test_deserializes_from_file(self): obj = stripe.util.convert_to_stripe_object( {"object": "file"}, api_mode="V1" ) assert isinstance(obj, stripe.File) def test_deserializes_from_file_upload(self): obj = stripe.util.convert_to_stripe_object( {"object": "file_upload"}, api_mode="V1" ) assert isinstance(obj, stripe.File) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_file_link.py0000644000175100001770000000312214637354563022074 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "link_123" class TestFileLink(object): def test_is_listable(self, http_client_mock): resources = stripe.FileLink.list() http_client_mock.assert_requested("get", path="/v1/file_links") assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.FileLink) def test_is_retrievable(self, http_client_mock): resource = stripe.FileLink.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/file_links/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.FileLink) def test_is_creatable(self, http_client_mock): resource = stripe.FileLink.create(file="file_123") http_client_mock.assert_requested("post", path="/v1/file_links") assert isinstance(resource, stripe.FileLink) def test_is_saveable(self, http_client_mock): resource = stripe.FileLink.retrieve(TEST_RESOURCE_ID) resource.metadata["key"] = "value" resource.save() http_client_mock.assert_requested( "post", path="/v1/file_links/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) def test_is_modifiable(self, http_client_mock): resource = stripe.FileLink.modify( TEST_RESOURCE_ID, metadata={"key": "value"} ) http_client_mock.assert_requested( "post", path="/v1/file_links/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) assert isinstance(resource, stripe.FileLink) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_file_upload.py0000644000175100001770000000401314637354563022423 0ustar00runnerdockerimport tempfile import pytest import stripe TEST_RESOURCE_ID = "file_123" class TestFileUpload(object): @pytest.fixture(scope="function") def setup_upload_api_base(self): stripe.upload_api_base = stripe.api_base stripe.api_base = None yield stripe.api_base = stripe.upload_api_base stripe.upload_api_base = "https://files.stripe.com" def test_is_listable(self, http_client_mock): resources = stripe.FileUpload.list() http_client_mock.assert_requested("get", path="/v1/files") assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.FileUpload) def test_is_retrievable(self, http_client_mock): resource = stripe.FileUpload.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/files/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.FileUpload) def test_is_creatable(self, setup_upload_api_base, http_client_mock): stripe.multipart_data_generator.MultipartDataGenerator._initialize_boundary = ( lambda self: 1234567890 ) test_file = tempfile.TemporaryFile() resource = stripe.FileUpload.create( purpose="dispute_evidence", file=test_file, file_link_data={"create": True}, ) http_client_mock.assert_requested( "post", api_base=stripe.upload_api_base, path="/v1/files", content_type="multipart/form-data; boundary=1234567890", ) assert isinstance(resource, stripe.FileUpload) def test_deserializes_from_file(self): obj = stripe.util.convert_to_stripe_object( {"object": "file"}, api_mode="V1" ) assert isinstance(obj, stripe.FileUpload) def test_deserializes_from_file_upload(self): obj = stripe.util.convert_to_stripe_object( {"object": "file_upload"}, api_mode="V1" ) assert isinstance(obj, stripe.FileUpload) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_invoice.py0000644000175100001770000001371714637354563021607 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "in_123" class TestInvoice(object): def test_is_listable(self, http_client_mock): resources = stripe.Invoice.list() http_client_mock.assert_requested("get", path="/v1/invoices") assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.Invoice) def test_is_retrievable(self, http_client_mock): resource = stripe.Invoice.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/invoices/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Invoice) def test_is_creatable(self, http_client_mock): resource = stripe.Invoice.create(customer="cus_123") http_client_mock.assert_requested("post", path="/v1/invoices") assert isinstance(resource, stripe.Invoice) def test_is_saveable(self, http_client_mock): resource = stripe.Invoice.retrieve(TEST_RESOURCE_ID) resource.metadata["key"] = "value" resource.save() http_client_mock.assert_requested( "post", path="/v1/invoices/%s" % TEST_RESOURCE_ID ) def test_is_modifiable(self, http_client_mock): resource = stripe.Invoice.modify( TEST_RESOURCE_ID, metadata={"key": "value"} ) http_client_mock.assert_requested( "post", path="/v1/invoices/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Invoice) def test_is_deletable(self, http_client_mock): resource = stripe.Invoice.retrieve(TEST_RESOURCE_ID) resource.delete() http_client_mock.assert_requested( "delete", path="/v1/invoices/%s" % TEST_RESOURCE_ID ) assert resource.deleted is True def test_can_delete(self, http_client_mock): resource = stripe.Invoice.delete(TEST_RESOURCE_ID) http_client_mock.assert_requested( "delete", path="/v1/invoices/%s" % TEST_RESOURCE_ID ) assert resource.deleted is True def test_can_finalize_invoice(self, http_client_mock): resource = stripe.Invoice.retrieve(TEST_RESOURCE_ID) resource = resource.finalize_invoice() http_client_mock.assert_requested( "post", path="/v1/invoices/%s/finalize" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Invoice) def test_can_finalize_invoice_classmethod(self, http_client_mock): resource = stripe.Invoice.finalize_invoice(TEST_RESOURCE_ID) http_client_mock.assert_requested( "post", path="/v1/invoices/%s/finalize" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Invoice) def test_can_mark_uncollectible(self, http_client_mock): resource = stripe.Invoice.retrieve(TEST_RESOURCE_ID) resource = resource.mark_uncollectible() http_client_mock.assert_requested( "post", path="/v1/invoices/%s/mark_uncollectible" % TEST_RESOURCE_ID, ) assert isinstance(resource, stripe.Invoice) def test_can_mark_uncollectible_classmethod(self, http_client_mock): resource = stripe.Invoice.mark_uncollectible(TEST_RESOURCE_ID) http_client_mock.assert_requested( "post", path="/v1/invoices/%s/mark_uncollectible" % TEST_RESOURCE_ID, ) assert isinstance(resource, stripe.Invoice) def test_can_pay(self, http_client_mock): resource = stripe.Invoice.retrieve(TEST_RESOURCE_ID) resource = resource.pay() http_client_mock.assert_requested( "post", path="/v1/invoices/%s/pay" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Invoice) def test_can_pay_classmethod(self, http_client_mock): resource = stripe.Invoice.pay(TEST_RESOURCE_ID) http_client_mock.assert_requested( "post", path="/v1/invoices/%s/pay" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Invoice) def test_can_send_invoice(self, http_client_mock): resource = stripe.Invoice.retrieve(TEST_RESOURCE_ID) resource = resource.send_invoice() http_client_mock.assert_requested( "post", path="/v1/invoices/%s/send" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Invoice) def test_can_send_invoice_classmethod(self, http_client_mock): resource = stripe.Invoice.send_invoice(TEST_RESOURCE_ID) http_client_mock.assert_requested( "post", path="/v1/invoices/%s/send" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Invoice) def test_can_upcoming(self, http_client_mock): resource = stripe.Invoice.upcoming(customer="cus_123") http_client_mock.assert_requested("get", path="/v1/invoices/upcoming") assert isinstance(resource, stripe.Invoice) def test_can_void_invoice(self, http_client_mock): resource = stripe.Invoice.retrieve(TEST_RESOURCE_ID) resource = resource.void_invoice() http_client_mock.assert_requested( "post", path="/v1/invoices/%s/void" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Invoice) def test_can_void_invoice_classmethod(self, http_client_mock): resource = stripe.Invoice.void_invoice(TEST_RESOURCE_ID) http_client_mock.assert_requested( "post", path="/v1/invoices/%s/void" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Invoice) def test_can_iterate_lines(self): resource = stripe.Invoice.retrieve(TEST_RESOURCE_ID) assert isinstance(resource.lines.data, list) assert isinstance(resource.lines.data[0], stripe.InvoiceLineItem) seen = [item["id"] for item in resource.lines.auto_paging_iter()] assert seen.__len__() > 0 def test_can_list_line_items(self): resource = stripe.Invoice.list_lines(TEST_RESOURCE_ID) assert isinstance(resource.data, list) assert isinstance(resource.data[0], stripe.InvoiceLineItem) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_invoice_item.py0000644000175100001770000000452414637354563022621 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "ii_123" class TestInvoiceItem(object): def test_is_listable(self, http_client_mock): resources = stripe.InvoiceItem.list() http_client_mock.assert_requested("get", path="/v1/invoiceitems") assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.InvoiceItem) def test_is_retrievable(self, http_client_mock): resource = stripe.InvoiceItem.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/invoiceitems/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.InvoiceItem) def test_is_creatable(self, http_client_mock): resource = stripe.InvoiceItem.create( customer="cus_123", amount=123, currency="usd" ) http_client_mock.assert_requested( "post", path="/v1/invoiceitems", post_data="customer=cus_123&amount=123¤cy=usd", ) assert isinstance(resource, stripe.InvoiceItem) def test_is_saveable(self, http_client_mock): resource = stripe.InvoiceItem.retrieve(TEST_RESOURCE_ID) resource.metadata["key"] = "value" resource.save() http_client_mock.assert_requested( "post", path="/v1/invoiceitems/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) def test_can_delete(self, http_client_mock): resource = stripe.InvoiceItem.delete(TEST_RESOURCE_ID) http_client_mock.assert_requested( "delete", path="/v1/invoiceitems/%s" % TEST_RESOURCE_ID ) assert resource.deleted is True def test_is_modifiable(self, http_client_mock): resource = stripe.InvoiceItem.modify( TEST_RESOURCE_ID, metadata={"key": "value"} ) http_client_mock.assert_requested( "post", path="/v1/invoiceitems/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) assert isinstance(resource, stripe.InvoiceItem) def test_is_deletable(self, http_client_mock): resource = stripe.InvoiceItem.retrieve(TEST_RESOURCE_ID) resource.delete() http_client_mock.assert_requested( "delete", path="/v1/invoiceitems/%s" % TEST_RESOURCE_ID ) assert resource.deleted is True ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_invoice_line_item.py0000644000175100001770000000045014637354563023622 0ustar00runnerdockerimport stripe TEST_INVOICE_ID = "in_123" class TestInvoiceLineItem(object): def test_deserialize(self): invoice = stripe.Invoice.retrieve(TEST_INVOICE_ID) assert isinstance(invoice.lines.data, list) assert isinstance(invoice.lines.data[0], stripe.InvoiceLineItem) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_list_object.py0000644000175100001770000004037014637354563022447 0ustar00runnerdockerimport json import pytest import stripe class TestListObject(object): @pytest.fixture def list_object(self): return stripe.ListObject.construct_from( {"object": "list", "url": "/my/path", "data": ["foo"]}, "mykey" ) def test_list(self, http_client_mock, list_object): http_client_mock.stub_request( "get", path="/my/path", query_string="myparam=you", rbody='{"object": "list", "data": [{"object": "charge", "foo": "bar"}]}', ) res = list_object.list(myparam="you", stripe_account="acct_123") http_client_mock.assert_requested( "get", path="/my/path", query_string="myparam=you", stripe_account="acct_123", ) assert isinstance(res, stripe.ListObject) assert res.stripe_account == "acct_123" assert isinstance(res.data, list) assert isinstance(res.data[0], stripe.Charge) assert res.data[0].foo == "bar" def test_create(self, http_client_mock, list_object): http_client_mock.stub_request( "post", path="/my/path", rbody='{"object": "charge", "foo": "bar"}' ) res = list_object.create(myparam="eter", stripe_account="acct_123") http_client_mock.assert_requested( "post", path="/my/path", post_data="myparam=eter", stripe_account="acct_123", ) assert isinstance(res, stripe.Charge) assert res.foo == "bar" assert res.stripe_account == "acct_123" def test_create_maintains_list_properties( self, http_client_mock, list_object ): # Testing with real requests because our mock makes it impossible to # test otherwise charge = stripe.Charge.retrieve("ch_123", api_key="sk_test_custom") res = charge.refunds.create(amount=123) http_client_mock.assert_requested( "post", path="/v1/charges/ch_123/refunds", post_data="amount=123" ) assert res.api_key == "sk_test_custom" def test_retrieve(self, http_client_mock, list_object): http_client_mock.stub_request( "get", path="/my/path/myid", query_string="myparam=cow", rbody='{"object": "charge", "foo": "bar"}', ) res = list_object.retrieve( "myid", myparam="cow", stripe_account="acct_123" ) http_client_mock.assert_requested( "get", path="/my/path/myid", query_string="myparam=cow", stripe_account="acct_123", ) assert isinstance(res, stripe.Charge) assert res.foo == "bar" assert res.stripe_account == "acct_123" def test_is_empty(self): lo = stripe.ListObject.construct_from({"data": []}, None) assert lo.is_empty is True def test_empty_list(self): lo = stripe.ListObject._empty_list() assert lo.is_empty def test_iter(self): arr = [{"id": 1}, {"id": 2}, {"id": 3}] expected = stripe.util.convert_to_stripe_object(arr) lo = stripe.ListObject.construct_from({"data": arr}, None) assert list(lo) == expected def test_iter_reversed(self): arr = [{"id": 1}, {"id": 2}, {"id": 3}] expected = stripe.util.convert_to_stripe_object(list(reversed(arr))) lo = stripe.ListObject.construct_from({"data": arr}, None) assert list(reversed(lo)) == expected def test_len(self, list_object): assert len(list_object) == 1 def test_bool(self, list_object): assert list_object empty = stripe.ListObject.construct_from( {"object": "list", "url": "/my/path", "data": []}, "mykey" ) assert bool(empty) is False def test_next_page(self, http_client_mock): lo = stripe.ListObject.construct_from( { "object": "list", "data": [{"id": 1}], "has_more": True, "url": "/things", }, None, ) http_client_mock.stub_request( "get", path="/things", query_string="starting_after=1", rbody='{"object": "list", "data": [{"id": 2}], "has_more": false, "url": "/things"}', ) next_lo = lo.next_page() assert not next_lo.is_empty assert next_lo.data[0].id == 2 def test_next_page_with_filters(self, http_client_mock): lo = stripe.ListObject.construct_from( { "object": "list", "data": [{"id": 1}], "has_more": True, "url": "/things", }, None, ) lo._retrieve_params = {"expand": ["data.source"], "limit": 3} http_client_mock.stub_request( "get", path="/things", query_string="expand[0]=data.source&limit=3&starting_after=1", rbody='{"object": "list", "data": [{"id": 2}], "has_more": false, "url": "/things"}', ) next_lo = lo.next_page() assert next_lo._retrieve_params == { "expand": ["data.source"], "limit": 3, "starting_after": 1, } def test_next_page_empty_list(self): lo = stripe.ListObject.construct_from( { "object": "list", "data": [{"id": 1}], "has_more": False, "url": "/things", }, None, ) next_lo = lo.next_page() assert next_lo == stripe.ListObject._empty_list() def test_prev_page(self, http_client_mock): lo = stripe.ListObject.construct_from( { "object": "list", "data": [{"id": 2}], "has_more": True, "url": "/things", }, None, ) http_client_mock.stub_request( "get", path="/things", query_string="ending_before=2", rbody='{"object": "list", "data": [{"id": 1}], "has_more": false, "url": "/things"}', ) previous_lo = lo.previous_page() assert not previous_lo.is_empty assert previous_lo.data[0].id == 1 def test_prev_page_with_filters(self, http_client_mock): lo = stripe.ListObject.construct_from( { "object": "list", "data": [{"id": 2}], "has_more": True, "url": "/things", }, None, ) lo._retrieve_params = {"expand": ["data.source"], "limit": 3} http_client_mock.stub_request( "get", path="/things", query_string="ending_before=2&expand[0]=data.source&limit=3", rbody='{"object": "list", "data": [{"id": 1}], "has_more": false, "url": "/things"}', ) previous_lo = lo.previous_page() assert previous_lo._retrieve_params == { "expand": ["data.source"], "limit": 3, "ending_before": 2, } def test_serialize_empty_list(self): empty = stripe.ListObject.construct_from( {"object": "list", "data": []}, "mykey" ) serialized = str(empty) deserialized = stripe.ListObject.construct_from( json.loads(serialized), "mykey" ) assert deserialized == empty def test_serialize_nested_empty_list(self): empty = stripe.ListObject.construct_from( {"object": "list", "data": []}, "mykey" ) obj = stripe.stripe_object.StripeObject.construct_from( {"nested": empty}, "mykey" ) serialized = str(obj) deserialized = stripe.stripe_object.StripeObject.construct_from( json.loads(serialized), "mykey" ) assert deserialized.nested == empty class TestAutoPaging: @staticmethod def pageable_model_response(ids, has_more): return { "object": "list", "url": "/v1/pageablemodels", "data": [{"id": id, "object": "pageablemodel"} for id in ids], "has_more": has_more, } def test_iter_one_page(self, http_client_mock): lo = stripe.ListObject.construct_from( self.pageable_model_response(["pm_123", "pm_124"], False), "mykey" ) http_client_mock.assert_no_request() seen = [item["id"] for item in lo.auto_paging_iter()] assert seen == ["pm_123", "pm_124"] def test_iter_two_pages(self, http_client_mock): lo = stripe.ListObject.construct_from( self.pageable_model_response(["pm_123", "pm_124"], True), "mykey" ) lo._retrieve_params = {"foo": "bar"} http_client_mock.stub_request( "get", path="/v1/pageablemodels", query_string="starting_after=pm_124&foo=bar", rbody=json.dumps( self.pageable_model_response(["pm_125", "pm_126"], False) ), ) seen = [item["id"] for item in lo.auto_paging_iter()] http_client_mock.assert_requested( "get", path="/v1/pageablemodels", query_string="starting_after=pm_124&foo=bar", ) assert seen == ["pm_123", "pm_124", "pm_125", "pm_126"] def test_iter_reverse(self, http_client_mock): lo = stripe.ListObject.construct_from( self.pageable_model_response(["pm_125", "pm_126"], True), "mykey" ) lo._retrieve_params = {"foo": "bar", "ending_before": "pm_127"} http_client_mock.stub_request( "get", path="/v1/pageablemodels", query_string="ending_before=pm_125&foo=bar", rbody=json.dumps( self.pageable_model_response(["pm_123", "pm_124"], False) ), ) seen = [item["id"] for item in lo.auto_paging_iter()] http_client_mock.assert_requested( "get", path="/v1/pageablemodels", query_string="ending_before=pm_125&foo=bar", ) assert seen == ["pm_126", "pm_125", "pm_124", "pm_123"] def test_class_method_two_pages(self, http_client_mock): http_client_mock.stub_request( "get", path="/v1/charges", query_string="limit=25&foo=bar", rbody='{"object": "list", "data": [{"id": "ch_001"}], "url": "/v1/charges", "has_more": false}', ) seen = [ item["id"] for item in stripe.Charge.auto_paging_iter(limit=25, foo="bar") ] http_client_mock.assert_requested( "get", path="/v1/charges", query_string="limit=25&foo=bar" ) assert seen == ["ch_001"] def test_iter_forwards_api_key_resource(self, http_client_mock): http_client_mock.stub_request( "get", path="/v1/charges", rbody='{"object": "list", "data": [{"id": "ch_001"}], "url": "/v1/charges", "has_more": true}', ) http_client_mock.stub_request( "get", path="/v1/charges", query_string="starting_after=ch_001", rbody='{"object": "list", "data": [{"id": "ch_002"}], "url": "/v1/charges", "has_more": false}', ) lo = stripe.Charge.list(api_key="sk_test_iter_forwards_options") assert lo.api_key == "sk_test_iter_forwards_options" seen = [item["id"] for item in lo.auto_paging_iter()] http_client_mock.assert_requested( "get", path="/v1/charges", api_key="sk_test_iter_forwards_options" ) http_client_mock.assert_requested( "get", path="/v1/charges", query_string="starting_after=ch_001", api_key="sk_test_iter_forwards_options", ) assert seen == ["ch_001", "ch_002"] def test_iter_forwards_api_key_client(self, http_client_mock): client = stripe.StripeClient( http_client=http_client_mock.get_mock_http_client(), api_key="sk_test_xyz", ) http_client_mock.stub_request( "get", path="/v1/charges", rbody='{"object": "list", "data": [{"id": "x"}], "url": "/v1/charges", "has_more": true}', ) http_client_mock.stub_request( "get", path="/v1/charges", query_string="starting_after=x", rbody='{"object": "list", "data": [{"id": "y"}, {"id": "z"}], "url": "/v1/charges", "has_more": false}', ) lo = client.charges.list( options={"api_key": "sk_test_iter_forwards_options"} ) seen = [item["id"] for item in lo.auto_paging_iter()] assert seen == ["x", "y", "z"] http_client_mock.assert_requested( "get", path="/v1/charges", api_key="sk_test_iter_forwards_options", ) http_client_mock.assert_requested( "get", path="/v1/charges", query_string="starting_after=x", api_key="sk_test_iter_forwards_options", ) def test_forwards_api_key_to_nested_resources(self, http_client_mock): http_client_mock.stub_request( "get", path="/v1/products", rbody='{"object": "list", "data": [{"id": "prod_001", "object": "product"}], "url": "/v1/products", "has_more": true}', ) lo = stripe.Product.list(api_key="sk_test_iter_forwards_options") assert lo.api_key == "sk_test_iter_forwards_options" http_client_mock.assert_requested( "get", path="/v1/products", api_key="sk_test_iter_forwards_options" ) http_client_mock.stub_request( "delete", path="/v1/products/prod_001", ) lo.data[0].delete() http_client_mock.assert_requested( "delete", path="/v1/products/prod_001", api_key="sk_test_iter_forwards_options", ) assert lo.data[0].api_key == "sk_test_iter_forwards_options" class TestAutoPagingAsync: @staticmethod def pageable_model_response(ids, has_more): return { "object": "list", "url": "/v1/pageablemodels", "data": [{"id": id, "object": "pageablemodel"} for id in ids], "has_more": has_more, } @pytest.mark.anyio async def test_iter_one_page(self, http_client_mock): lo = stripe.ListObject.construct_from( self.pageable_model_response(["pm_123", "pm_124"], False), "mykey" ) http_client_mock.assert_no_request() seen = [item["id"] async for item in lo.auto_paging_iter()] assert seen == ["pm_123", "pm_124"] @pytest.mark.anyio async def test_iter_two_pages(self, http_client_mock): lo = stripe.ListObject.construct_from( self.pageable_model_response(["pm_123", "pm_124"], True), "mykey" ) lo._retrieve_params = {"foo": "bar"} http_client_mock.stub_request( "get", path="/v1/pageablemodels", query_string="starting_after=pm_124&foo=bar", rbody=json.dumps( self.pageable_model_response(["pm_125", "pm_126"], False) ), ) seen = [item["id"] async for item in lo.auto_paging_iter()] http_client_mock.assert_requested( "get", path="/v1/pageablemodels", query_string="starting_after=pm_124&foo=bar", ) assert seen == ["pm_123", "pm_124", "pm_125", "pm_126"] @pytest.mark.anyio async def test_iter_reverse(self, http_client_mock): lo = stripe.ListObject.construct_from( self.pageable_model_response(["pm_125", "pm_126"], True), "mykey" ) lo._retrieve_params = {"foo": "bar", "ending_before": "pm_127"} http_client_mock.stub_request( "get", path="/v1/pageablemodels", query_string="ending_before=pm_125&foo=bar", rbody=json.dumps( self.pageable_model_response(["pm_123", "pm_124"], False) ), ) seen = [item["id"] async for item in lo.auto_paging_iter()] http_client_mock.assert_requested( "get", path="/v1/pageablemodels", query_string="ending_before=pm_125&foo=bar", ) assert seen == ["pm_126", "pm_125", "pm_124", "pm_123"] ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_mandate.py0000644000175100001770000000055614637354563021561 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "mandate_123" class TestMandateSchedule(object): def test_is_retrievable(self, http_client_mock): resource = stripe.Mandate.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/mandates/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Mandate) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_payment_intent.py0000644000175100001770000000745114637354563023207 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "pi_123" class TestPaymentIntent(object): def test_is_listable(self, http_client_mock): resources = stripe.PaymentIntent.list() http_client_mock.assert_requested("get", path="/v1/payment_intents") assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.PaymentIntent) def test_is_retrievable(self, http_client_mock): resource = stripe.PaymentIntent.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/payment_intents/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.PaymentIntent) def test_is_creatable(self, http_client_mock): resource = stripe.PaymentIntent.create( amount="1234", currency="amount", payment_method_types=["card"] ) http_client_mock.assert_requested( "post", path="/v1/payment_intents", post_data="amount=1234¤cy=amount&payment_method_types[0]=card", ) assert isinstance(resource, stripe.PaymentIntent) def test_is_modifiable(self, http_client_mock): resource = stripe.PaymentIntent.modify( TEST_RESOURCE_ID, metadata={"key": "value"} ) http_client_mock.assert_requested( "post", path="/v1/payment_intents/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) assert isinstance(resource, stripe.PaymentIntent) def test_is_saveable(self, http_client_mock): resource = stripe.PaymentIntent.retrieve(TEST_RESOURCE_ID) resource.metadata["key"] = "value" resource.save() http_client_mock.assert_requested( "post", path="/v1/payment_intents/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) assert isinstance(resource, stripe.PaymentIntent) def test_can_cancel(self, http_client_mock): resource = stripe.PaymentIntent.retrieve(TEST_RESOURCE_ID) resource.cancel() http_client_mock.assert_requested( "post", path="/v1/payment_intents/%s/cancel" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.PaymentIntent) def test_can_cancel_classmethod(self, http_client_mock): resource = stripe.PaymentIntent.cancel(TEST_RESOURCE_ID) http_client_mock.assert_requested( "post", path="/v1/payment_intents/%s/cancel" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.PaymentIntent) def test_can_capture(self, http_client_mock): resource = stripe.PaymentIntent.retrieve(TEST_RESOURCE_ID) resource.capture() http_client_mock.assert_requested( "post", path="/v1/payment_intents/%s/capture" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.PaymentIntent) def test_can_capture_classmethod(self, http_client_mock): resource = stripe.PaymentIntent.capture(TEST_RESOURCE_ID) http_client_mock.assert_requested( "post", path="/v1/payment_intents/%s/capture" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.PaymentIntent) def test_can_confirm(self, http_client_mock): resource = stripe.PaymentIntent.retrieve(TEST_RESOURCE_ID) resource.confirm() http_client_mock.assert_requested( "post", path="/v1/payment_intents/%s/confirm" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.PaymentIntent) def test_can_confirm_classmethod(self, http_client_mock): resource = stripe.PaymentIntent.confirm(TEST_RESOURCE_ID) http_client_mock.assert_requested( "post", path="/v1/payment_intents/%s/confirm" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.PaymentIntent) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_payment_method.py0000644000175100001770000000641114637354563023161 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "pm_123" class TestPaymentMethod(object): def test_is_listable(self, http_client_mock): resources = stripe.PaymentMethod.list(customer="cus_123", type="card") http_client_mock.assert_requested("get", path="/v1/payment_methods") assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.PaymentMethod) def test_is_retrievable(self, http_client_mock): resource = stripe.PaymentMethod.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/payment_methods/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.PaymentMethod) def test_is_creatable(self, http_client_mock): resource = stripe.PaymentMethod.create( type="card", card={"token": "tok_123"} ) http_client_mock.assert_requested( "post", path="/v1/payment_methods", post_data="type=card&card[token]=tok_123", ) assert isinstance(resource, stripe.PaymentMethod) def test_is_saveable(self, http_client_mock): resource = stripe.PaymentMethod.retrieve(TEST_RESOURCE_ID) resource.metadata["key"] = "value" resource.save() http_client_mock.assert_requested( "post", path="/v1/payment_methods/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) def test_is_modifiable(self, http_client_mock): resource = stripe.PaymentMethod.modify( TEST_RESOURCE_ID, metadata={"key": "value"} ) http_client_mock.assert_requested( "post", path="/v1/payment_methods/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) assert isinstance(resource, stripe.PaymentMethod) def test_can_attach(self, http_client_mock): resource = stripe.PaymentMethod.retrieve(TEST_RESOURCE_ID) resource = resource.attach(customer="cus_123") http_client_mock.assert_requested( "post", path="/v1/payment_methods/%s/attach" % TEST_RESOURCE_ID, post_data="customer=cus_123", ) assert isinstance(resource, stripe.PaymentMethod) def test_can_attach_classmethod(self, http_client_mock): resource = stripe.PaymentMethod.attach( TEST_RESOURCE_ID, customer="cus_123" ) http_client_mock.assert_requested( "post", path="/v1/payment_methods/%s/attach" % TEST_RESOURCE_ID, post_data="customer=cus_123", ) assert isinstance(resource, stripe.PaymentMethod) def test_can_detach(self, http_client_mock): resource = stripe.PaymentMethod.retrieve(TEST_RESOURCE_ID) resource = resource.detach() http_client_mock.assert_requested( "post", path="/v1/payment_methods/%s/detach" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.PaymentMethod) def test_can_detach_classmethod(self, http_client_mock): resource = stripe.PaymentMethod.detach(TEST_RESOURCE_ID) http_client_mock.assert_requested( "post", path="/v1/payment_methods/%s/detach" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.PaymentMethod) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_payout.py0000644000175100001770000000546714637354563021477 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "po_123" class TestPayout(object): def test_is_listable(self, http_client_mock): resources = stripe.Payout.list() http_client_mock.assert_requested("get", path="/v1/payouts") assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.Payout) def test_is_retrievable(self, http_client_mock): resource = stripe.Payout.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/payouts/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Payout) def test_is_creatable(self, http_client_mock): resource = stripe.Payout.create(amount=100, currency="usd") http_client_mock.assert_requested( "post", path="/v1/payouts", post_data="amount=100¤cy=usd" ) assert isinstance(resource, stripe.Payout) def test_is_saveable(self, http_client_mock): resource = stripe.Payout.retrieve(TEST_RESOURCE_ID) resource.metadata["key"] = "value" resource.save() http_client_mock.assert_requested( "post", path="/v1/payouts/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) def test_is_modifiable(self, http_client_mock): resource = stripe.Payout.modify( TEST_RESOURCE_ID, metadata={"key": "value"} ) http_client_mock.assert_requested( "post", path="/v1/payouts/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) assert isinstance(resource, stripe.Payout) def test_can_cancel(self, http_client_mock): payout = stripe.Payout.retrieve(TEST_RESOURCE_ID) resource = payout.cancel() http_client_mock.assert_requested( "post", path="/v1/payouts/%s/cancel" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Payout) def test_can_cancel_classmethod(self, http_client_mock): resource = stripe.Payout.cancel(TEST_RESOURCE_ID) http_client_mock.assert_requested( "post", path="/v1/payouts/%s/cancel" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Payout) def test_can_reverse(self, http_client_mock): payout = stripe.Payout.retrieve(TEST_RESOURCE_ID) resource = payout.reverse() http_client_mock.assert_requested( "post", path="/v1/payouts/%s/reverse" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Payout) def test_can_reverse_classmethod(self, http_client_mock): resource = stripe.Payout.reverse(TEST_RESOURCE_ID) http_client_mock.assert_requested( "post", path="/v1/payouts/%s/reverse" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Payout) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_person.py0000644000175100001770000000224614637354563021454 0ustar00runnerdockerimport pytest import stripe TEST_RESOURCE_ID = "trr_123" class TestPerson(object): def construct_resource(self): person_dict = { "id": TEST_RESOURCE_ID, "object": "person", "account": "acct_123", } return stripe.Person.construct_from(person_dict, stripe.api_key) def test_has_instance_url(self): resource = self.construct_resource() assert ( resource.instance_url() == "/v1/accounts/acct_123/persons/%s" % TEST_RESOURCE_ID ) def test_is_not_modifiable(self): with pytest.raises(NotImplementedError): stripe.Person.modify(TEST_RESOURCE_ID, first_name="John") def test_is_not_retrievable(self): with pytest.raises(NotImplementedError): stripe.Person.retrieve(TEST_RESOURCE_ID) def test_is_saveable(self, http_client_mock): resource = self.construct_resource() resource.first_name = "John" resource.save() http_client_mock.assert_requested( "post", path="/v1/accounts/acct_123/persons/%s" % TEST_RESOURCE_ID, post_data="first_name=John", ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_plan.py0000644000175100001770000000450514637354563021100 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "250FF" class TestPlan(object): def test_is_listable(self, http_client_mock): resources = stripe.Plan.list() http_client_mock.assert_requested("get", path="/v1/plans") assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.Plan) def test_is_retrievable(self, http_client_mock): resource = stripe.Plan.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/plans/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Plan) def test_is_creatable(self, http_client_mock): resource = stripe.Plan.create( amount=100, currency="usd", id="plan_id", interval="month", nickname="plan_nickname", ) http_client_mock.assert_requested( "post", path="/v1/plans", post_data="amount=100¤cy=usd&id=plan_id&interval=month&nickname=plan_nickname", ) assert isinstance(resource, stripe.Plan) def test_is_saveable(self, http_client_mock): resource = stripe.Plan.retrieve(TEST_RESOURCE_ID) resource.metadata["key"] = "value" resource.save() http_client_mock.assert_requested( "post", path="/v1/plans/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) def test_is_modifiable(self, http_client_mock): resource = stripe.Plan.modify( TEST_RESOURCE_ID, metadata={"key": "value"} ) http_client_mock.assert_requested( "post", path="/v1/plans/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) assert isinstance(resource, stripe.Plan) def test_is_deletable(self, http_client_mock): resource = stripe.Plan.retrieve(TEST_RESOURCE_ID) resource.delete() http_client_mock.assert_requested( "delete", path="/v1/plans/%s" % TEST_RESOURCE_ID ) assert resource.deleted is True def test_can_delete(self, http_client_mock): resource = stripe.Plan.delete(TEST_RESOURCE_ID) http_client_mock.assert_requested( "delete", path="/v1/plans/%s" % TEST_RESOURCE_ID ) assert resource.deleted is True ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_price.py0000644000175100001770000000351514637354563021250 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "price_123" class TestPrice(object): def test_is_listable(self, http_client_mock): resources = stripe.Price.list() http_client_mock.assert_requested("get", path="/v1/prices") assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.Price) def test_is_retrievable(self, http_client_mock): resource = stripe.Price.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/prices/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Price) def test_is_creatable(self, http_client_mock): resource = stripe.Price.create( unit_amount=1000, currency="usd", recurring={"interval": "month"}, product_data={"name": "price_nickname"}, ) http_client_mock.assert_requested( "post", path="/v1/prices", post_data="unit_amount=1000¤cy=usd&recurring[interval]=month&product_data[name]=price_nickname", ) assert isinstance(resource, stripe.Price) def test_is_saveable(self, http_client_mock): resource = stripe.Price.retrieve(TEST_RESOURCE_ID) resource.metadata["key"] = "value" resource.save() http_client_mock.assert_requested( "post", path="/v1/prices/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) def test_is_modifiable(self, http_client_mock): resource = stripe.Price.modify( TEST_RESOURCE_ID, metadata={"key": "value"} ) http_client_mock.assert_requested( "post", path="/v1/prices/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) assert isinstance(resource, stripe.Price) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_product.py0000644000175100001770000000423114637354563021622 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "prod_123" class TestProduct(object): def test_is_listable(self, http_client_mock): resources = stripe.Product.list() http_client_mock.assert_requested("get", path="/v1/products") assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.Product) def test_is_retrievable(self, http_client_mock): resource = stripe.Product.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/products/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Product) def test_is_creatable(self, http_client_mock): resource = stripe.Product.create(name="NAME") http_client_mock.assert_requested( "post", path="/v1/products", post_data="name=NAME" ) assert isinstance(resource, stripe.Product) def test_is_saveable(self, http_client_mock): resource = stripe.Product.retrieve(TEST_RESOURCE_ID) resource.metadata["key"] = "value" resource.save() http_client_mock.assert_requested( "post", path="/v1/products/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) def test_is_modifiable(self, http_client_mock): resource = stripe.Product.modify( TEST_RESOURCE_ID, metadata={"key": "value"} ) http_client_mock.assert_requested( "post", path="/v1/products/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) assert isinstance(resource, stripe.Product) def test_is_deletable(self, http_client_mock): resource = stripe.Product.retrieve(TEST_RESOURCE_ID) resource.delete() http_client_mock.assert_requested( "delete", path="/v1/products/%s" % TEST_RESOURCE_ID ) assert resource.deleted is True def test_can_delete(self, http_client_mock): resource = stripe.Product.delete(TEST_RESOURCE_ID) http_client_mock.assert_requested( "delete", path="/v1/products/%s" % TEST_RESOURCE_ID ) assert resource.deleted is True ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_promotion_code.py0000644000175100001770000000340314637354563023162 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "promo_123" class TestPromotionCode(object): def test_is_listable(self, http_client_mock): resources = stripe.PromotionCode.list() http_client_mock.assert_requested("get", path="/v1/promotion_codes") assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.PromotionCode) def test_is_retrievable(self, http_client_mock): resource = stripe.PromotionCode.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/promotion_codes/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.PromotionCode) def test_is_creatable(self, http_client_mock): resource = stripe.PromotionCode.create(coupon="co_123", code="MYCODE") http_client_mock.assert_requested( "post", path="/v1/promotion_codes", post_data="code=MYCODE&coupon=co_123", ) assert isinstance(resource, stripe.PromotionCode) def test_is_saveable(self, http_client_mock): resource = stripe.PromotionCode.retrieve(TEST_RESOURCE_ID) resource.metadata["key"] = "value" resource.save() http_client_mock.assert_requested( "post", path="/v1/promotion_codes/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) def test_is_modifiable(self, http_client_mock): resource = stripe.PromotionCode.modify( TEST_RESOURCE_ID, metadata={"key": "value"} ) http_client_mock.assert_requested( "post", path="/v1/promotion_codes/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) assert isinstance(resource, stripe.PromotionCode) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_quote.py0000644000175100001770000001405314637354563021302 0ustar00runnerdockerimport stripe import pytest TEST_RESOURCE_ID = "qt_123" class TestQuote(object): @pytest.fixture(scope="function") def setup_upload_api_base(self): stripe.upload_api_base = stripe.api_base yield stripe.api_base = stripe.upload_api_base stripe.upload_api_base = "https://files.stripe.com" def test_is_listable(self, http_client_mock): resources = stripe.Quote.list() http_client_mock.assert_requested("get", path="/v1/quotes") assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.Quote) def test_is_retrievable(self, http_client_mock): resource = stripe.Quote.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/quotes/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Quote) def test_is_creatable(self, http_client_mock): resource = stripe.Quote.create(customer="cus_123") http_client_mock.assert_requested( "post", path="/v1/quotes", post_data="customer=cus_123" ) assert isinstance(resource, stripe.Quote) def test_is_saveable(self, http_client_mock): resource = stripe.Quote.retrieve(TEST_RESOURCE_ID) resource.metadata["key"] = "value" resource.save() http_client_mock.assert_requested( "post", path="/v1/quotes/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) def test_is_modifiable(self, http_client_mock): resource = stripe.Quote.modify( TEST_RESOURCE_ID, metadata={"key": "value"} ) http_client_mock.assert_requested( "post", path="/v1/quotes/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) assert isinstance(resource, stripe.Quote) def test_can_finalize_quote(self, http_client_mock): resource = stripe.Quote.retrieve(TEST_RESOURCE_ID) resource = resource.finalize_quote() http_client_mock.assert_requested( "post", path="/v1/quotes/%s/finalize" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Quote) def test_can_finalize_quote_classmethod(self, http_client_mock): resource = stripe.Quote.finalize_quote(TEST_RESOURCE_ID) http_client_mock.assert_requested( "post", path="/v1/quotes/%s/finalize" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Quote) def test_can_cancel(self, http_client_mock): resource = stripe.Quote.retrieve(TEST_RESOURCE_ID) resource = resource.cancel() http_client_mock.assert_requested( "post", path="/v1/quotes/%s/cancel" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Quote) def test_can_cancel_classmethod(self, http_client_mock): resource = stripe.Quote.cancel(TEST_RESOURCE_ID) http_client_mock.assert_requested( "post", path="/v1/quotes/%s/cancel" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Quote) def test_can_accept(self, http_client_mock): resource = stripe.Quote.retrieve(TEST_RESOURCE_ID) resource = resource.accept() http_client_mock.assert_requested( "post", path="/v1/quotes/%s/accept" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Quote) def test_can_accept_classmethod(self, http_client_mock): resource = stripe.Quote.accept(TEST_RESOURCE_ID) http_client_mock.assert_requested( "post", path="/v1/quotes/%s/accept" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Quote) def test_can_list_line_items(self, http_client_mock): resources = stripe.Quote.list_line_items(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/quotes/%s/line_items" % TEST_RESOURCE_ID ) assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.LineItem) def test_can_list_line_items_classmethod(self, http_client_mock): resources = stripe.Quote.list_line_items(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/quotes/%s/line_items" % TEST_RESOURCE_ID ) assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.LineItem) def test_can_list_computed_upfront_line_items(self, http_client_mock): resources = stripe.Quote.list_computed_upfront_line_items( TEST_RESOURCE_ID ) http_client_mock.assert_requested( "get", path="/v1/quotes/%s/computed_upfront_line_items" % TEST_RESOURCE_ID, ) assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.LineItem) def test_can_list_computed_upfront_line_items_classmethod( self, http_client_mock ): resources = stripe.Quote.list_computed_upfront_line_items( TEST_RESOURCE_ID ) http_client_mock.assert_requested( "get", path="/v1/quotes/%s/computed_upfront_line_items" % TEST_RESOURCE_ID, ) assert isinstance(resources.data[0], stripe.LineItem) def test_can_pdf(self, setup_upload_api_base, http_client_mock): resource = stripe.Quote.retrieve(TEST_RESOURCE_ID) stream = resource.pdf() http_client_mock.assert_requested( "get", api_base=stripe.upload_api_base, path="/v1/quotes/%s/pdf" % TEST_RESOURCE_ID, ) content = stream.io.read() assert content == b"Stripe binary response" def test_can_pdf_classmethod( self, setup_upload_api_base, http_client_mock ): stream = stripe.Quote.pdf(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", api_base=stripe.upload_api_base, path="/v1/quotes/%s/pdf" % TEST_RESOURCE_ID, ) content = stream.io.read() assert content == b"Stripe binary response" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_refund.py0000644000175100001770000000313614637354563021430 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "re_123" class TestRefund(object): def test_is_listable(self, http_client_mock): resources = stripe.Refund.list() http_client_mock.assert_requested("get", path="/v1/refunds") assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.Refund) def test_is_retrievable(self, http_client_mock): resource = stripe.Refund.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/refunds/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Refund) def test_is_creatable(self, http_client_mock): resource = stripe.Refund.create(charge="ch_123") http_client_mock.assert_requested( "post", path="/v1/refunds", post_data="charge=ch_123" ) assert isinstance(resource, stripe.Refund) def test_is_saveable(self, http_client_mock): resource = stripe.Refund.retrieve(TEST_RESOURCE_ID) resource.metadata["key"] = "value" resource.save() http_client_mock.assert_requested( "post", path="/v1/refunds/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) def test_is_modifiable(self, http_client_mock): resource = stripe.Refund.modify( TEST_RESOURCE_ID, metadata={"key": "value"} ) http_client_mock.assert_requested( "post", path="/v1/refunds/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) assert isinstance(resource, stripe.Refund) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_reversal.py0000644000175100001770000000234314637354563021767 0ustar00runnerdockerimport pytest import stripe TEST_RESOURCE_ID = "trr_123" class TestReversal(object): def construct_resource(self): reversal_dict = { "id": TEST_RESOURCE_ID, "object": "reversal", "metadata": {}, "transfer": "tr_123", } return stripe.Reversal.construct_from(reversal_dict, stripe.api_key) def test_has_instance_url(self): resource = self.construct_resource() assert ( resource.instance_url() == "/v1/transfers/tr_123/reversals/%s" % TEST_RESOURCE_ID ) def test_is_not_modifiable(self): with pytest.raises(NotImplementedError): stripe.Reversal.modify(TEST_RESOURCE_ID, metadata={"key": "value"}) def test_is_not_retrievable(self): with pytest.raises(NotImplementedError): stripe.Reversal.retrieve(TEST_RESOURCE_ID) def test_is_saveable(self, http_client_mock): resource = self.construct_resource() resource.metadata["key"] = "value" resource.save() http_client_mock.assert_requested( "post", path="/v1/transfers/tr_123/reversals/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_review.py0000644000175100001770000000231114637354563021440 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "prv_123" class TestReview(object): def test_is_listable(self, http_client_mock): resources = stripe.Review.list() http_client_mock.assert_requested("get", path="/v1/reviews") assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.Review) def test_is_retrievable(self, http_client_mock): resource = stripe.Review.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/reviews/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Review) def test_can_approve(self, http_client_mock): resource = stripe.Review.retrieve(TEST_RESOURCE_ID) resource.approve() http_client_mock.assert_requested( "post", path="/v1/reviews/%s/approve" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Review) def test_can_approve_classmethod(self, http_client_mock): resource = stripe.Review.approve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "post", path="/v1/reviews/%s/approve" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Review) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_search_result_object.py0000644000175100001770000002317514637354563024343 0ustar00runnerdockerimport json import pytest import stripe class TestSearchResultObject(object): @pytest.fixture def search_result_object(self): return stripe.SearchResultObject.construct_from( {"object": "search_result", "url": "/my/path", "data": ["foo"]}, "mykey", ) def test_search(self, http_client_mock, search_result_object): http_client_mock.stub_request( "get", path="/my/path", query_string="myparam=you", rbody=json.dumps( { "object": "search_result", "data": [{"object": "charge", "foo": "bar"}], } ), ) res = search_result_object.search( myparam="you", stripe_account="acct_123" ) http_client_mock.assert_requested( "get", path="/my/path", query_string="myparam=you", stripe_account="acct_123", ) assert isinstance(res, stripe.SearchResultObject) assert res.stripe_account == "acct_123" assert isinstance(res.data, list) assert isinstance(res.data[0], stripe.Charge) assert res.data[0].foo == "bar" @pytest.mark.anyio async def test_search_async(self, http_client_mock, search_result_object): http_client_mock.stub_request( "get", path="/my/path", query_string="myparam=you", rbody=json.dumps( { "object": "search_result", "data": [{"object": "charge", "foo": "bar"}], } ), ) res = await search_result_object._search_async( myparam="you", stripe_account="acct_123" ) http_client_mock.assert_requested( "get", path="/my/path", query_string="myparam=you", stripe_account="acct_123", ) assert isinstance(res, stripe.SearchResultObject) assert res.stripe_account == "acct_123" assert isinstance(res.data, list) assert isinstance(res.data[0], stripe.Charge) assert res.data[0].foo == "bar" def test_is_empty(self): sro = stripe.SearchResultObject.construct_from({"data": []}, None) assert sro.is_empty is True def test_empty_search_result(self): sro = stripe.SearchResultObject._empty_search_result() assert sro.is_empty def test_iter(self): arr = [{"id": 1}, {"id": 2}, {"id": 3}] expected = stripe.util.convert_to_stripe_object(arr) sro = stripe.SearchResultObject.construct_from({"data": arr}, None) assert list(sro) == expected def test_len(self, search_result_object): assert len(search_result_object) == 1 def test_bool(self, search_result_object): assert search_result_object empty = stripe.SearchResultObject.construct_from( {"object": "search_result", "url": "/my/path", "data": []}, "mykey" ) assert bool(empty) is False def test_next_search_result_page(self, http_client_mock): sro = stripe.SearchResultObject.construct_from( { "object": "search_result", "data": [{"id": 1}], "has_more": True, "next_page": "next_page_token", "url": "/things", }, None, ) http_client_mock.stub_request( "get", path="/things", query_string="page=next_page_token", rbody=json.dumps( { "object": "search_result", "data": [{"id": 2}], "has_more": False, "url": "/things", } ), ) next_sro = sro.next_search_result_page() http_client_mock.assert_requested( "get", path="/things", query_string="page=next_page_token" ) assert not next_sro.is_empty assert next_sro.data[0].id == 2 def test_next_search_result_page_with_filters(self, http_client_mock): sro = stripe.SearchResultObject.construct_from( { "object": "search_result", "data": [{"id": 1}], "has_more": True, "next_page": "next_page_token", "url": "/things", }, None, ) sro._retrieve_params = {"expand": ["data.source"], "limit": 3} http_client_mock.stub_request( "get", path="/things", query_string="expand[0]=data.source&limit=3&page=next_page_token", rbody=json.dumps( { "object": "search_result", "data": [{"id": 2}], "has_more": False, "next_page": None, "url": "/things", } ), ) next_sro = sro.next_search_result_page() assert next_sro._retrieve_params == { "expand": ["data.source"], "limit": 3, "page": "next_page_token", } def test_next_search_result_page_empty_search_result(self): sro = stripe.SearchResultObject.construct_from( { "object": "search_result", "data": [{"id": 1}], "has_more": False, "next_page": None, "url": "/things", }, None, ) next_sro = sro.next_search_result_page() assert next_sro == stripe.SearchResultObject._empty_search_result() def test_serialize_empty_search_result(self): empty = stripe.SearchResultObject.construct_from( {"object": "search_result", "data": []}, "mykey" ) serialized = str(empty) deserialized = stripe.SearchResultObject.construct_from( json.loads(serialized), "mykey" ) assert deserialized == empty def test_serialize_nested_empty_search_result(self): empty = stripe.SearchResultObject.construct_from( {"object": "search_result", "data": []}, "mykey" ) obj = stripe.stripe_object.StripeObject.construct_from( {"nested": empty}, "mykey" ) serialized = str(obj) deserialized = stripe.stripe_object.StripeObject.construct_from( json.loads(serialized), "mykey" ) assert deserialized.nested == empty class TestAutoPaging: @staticmethod def pageable_model_response(ids, has_more, next_page_token): model = { "object": "search_result", "url": "/v1/pageablemodels", "data": [{"id": id, "object": "pageablemodel"} for id in ids], "has_more": has_more, "next_page": next_page_token, } return model def test_iter_one_page(self, http_client_mock): sro = stripe.SearchResultObject.construct_from( self.pageable_model_response(["pm_123", "pm_124"], False, None), "mykey", ) http_client_mock.assert_no_request() seen = [item["id"] for item in sro.auto_paging_iter()] assert seen == ["pm_123", "pm_124"] def test_iter_two_pages(self, http_client_mock): sro = stripe.SearchResultObject.construct_from( self.pageable_model_response(["pm_123", "pm_124"], True, "token"), "mykey", ) sro._retrieve_params = {"foo": "bar"} http_client_mock.stub_request( "get", path="/v1/pageablemodels", query_string="page=token&foo=bar", rbody=json.dumps( self.pageable_model_response(["pm_125", "pm_126"], False, None) ), ) seen = [item["id"] for item in sro.auto_paging_iter()] http_client_mock.assert_requested( "get", path="/v1/pageablemodels", query_string="page=token&foo=bar", ) assert seen == ["pm_123", "pm_124", "pm_125", "pm_126"] class TestAutoPagingAsync: @staticmethod def pageable_model_response(ids, has_more, next_page_token): model = { "object": "search_result", "url": "/v1/pageablemodels", "data": [{"id": id, "object": "pageablemodel"} for id in ids], "has_more": has_more, "next_page": next_page_token, } return model @pytest.mark.anyio async def test_iter_one_page(self, http_client_mock): sro = stripe.SearchResultObject.construct_from( self.pageable_model_response(["pm_123", "pm_124"], False, None), "mykey", ) http_client_mock.assert_no_request() seen = [item["id"] async for item in sro.auto_paging_iter()] assert seen == ["pm_123", "pm_124"] @pytest.mark.anyio async def test_iter_two_pages(self, http_client_mock): sro = stripe.SearchResultObject.construct_from( self.pageable_model_response(["pm_123", "pm_124"], True, "token"), "mykey", ) sro._retrieve_params = {"foo": "bar"} http_client_mock.stub_request( "get", path="/v1/pageablemodels", query_string="page=token&foo=bar", rbody=json.dumps( self.pageable_model_response(["pm_125", "pm_126"], False, None) ), ) seen = [item["id"] async for item in sro.auto_paging_iter()] http_client_mock.assert_requested( "get", path="/v1/pageablemodels", query_string="page=token&foo=bar", ) assert seen == ["pm_123", "pm_124", "pm_125", "pm_126"] ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_setup_attempt.py0000644000175100001770000000067314637354563023046 0ustar00runnerdockerimport stripe class TestSetupAttempt(object): def test_is_listable(self, http_client_mock): resources = stripe.SetupAttempt.list(setup_intent="seti_123") http_client_mock.assert_requested( "get", path="/v1/setup_attempts", query_string="setup_intent=seti_123", ) assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.SetupAttempt) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_setup_intent.py0000644000175100001770000000602514637354563022666 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "seti_123" class TestSetupIntent(object): def test_is_listable(self, http_client_mock): resources = stripe.SetupIntent.list() http_client_mock.assert_requested("get", path="/v1/setup_intents") assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.SetupIntent) def test_is_retrievable(self, http_client_mock): resource = stripe.SetupIntent.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/setup_intents/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.SetupIntent) def test_is_creatable(self, http_client_mock): resource = stripe.SetupIntent.create(payment_method_types=["card"]) http_client_mock.assert_requested( "post", path="/v1/setup_intents", post_data="payment_method_types[0]=card", ) assert isinstance(resource, stripe.SetupIntent) def test_is_modifiable(self, http_client_mock): resource = stripe.SetupIntent.modify( TEST_RESOURCE_ID, metadata={"key": "value"} ) http_client_mock.assert_requested( "post", path="/v1/setup_intents/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) assert isinstance(resource, stripe.SetupIntent) def test_is_saveable(self, http_client_mock): resource = stripe.SetupIntent.retrieve(TEST_RESOURCE_ID) resource.metadata["key"] = "value" resource.save() http_client_mock.assert_requested( "post", path="/v1/setup_intents/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) assert isinstance(resource, stripe.SetupIntent) def test_can_cancel(self, http_client_mock): resource = stripe.SetupIntent.retrieve(TEST_RESOURCE_ID) resource.cancel() http_client_mock.assert_requested( "post", path="/v1/setup_intents/%s/cancel" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.SetupIntent) def test_can_cancel_classmethod(self, http_client_mock): resource = stripe.SetupIntent.cancel(TEST_RESOURCE_ID) http_client_mock.assert_requested( "post", path="/v1/setup_intents/%s/cancel" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.SetupIntent) def test_can_confirm(self, http_client_mock): resource = stripe.SetupIntent.retrieve(TEST_RESOURCE_ID) resource.confirm() http_client_mock.assert_requested( "post", path="/v1/setup_intents/%s/confirm" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.SetupIntent) def test_can_confirm_classmethod(self, http_client_mock): resource = stripe.SetupIntent.confirm(TEST_RESOURCE_ID) http_client_mock.assert_requested( "post", path="/v1/setup_intents/%s/confirm" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.SetupIntent) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_source.py0000644000175100001770000000556514637354563021455 0ustar00runnerdockerimport pytest import stripe TEST_RESOURCE_ID = "src_123" class TestSource(object): def test_is_retrievable(self, http_client_mock): resource = stripe.Source.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/sources/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Source) def test_is_creatable(self, http_client_mock): resource = stripe.Source.create(type="card", token="tok_123") http_client_mock.assert_requested( "post", path="/v1/sources", post_data="type=card&token=tok_123" ) assert isinstance(resource, stripe.Source) def test_is_saveable(self, http_client_mock): resource = stripe.Source.retrieve(TEST_RESOURCE_ID) resource.metadata["key"] = "value" resource.save() http_client_mock.assert_requested( "post", path="/v1/sources/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) def test_is_modifiable(self, http_client_mock): resource = stripe.Source.modify( TEST_RESOURCE_ID, metadata={"key": "value"} ) http_client_mock.assert_requested( "post", path="/v1/sources/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) assert isinstance(resource, stripe.Source) def test_is_detachable_when_attached(self, http_client_mock): resource = stripe.Source.construct_from( { "id": TEST_RESOURCE_ID, "object": "source", "customer": "cus_123", }, stripe.api_key, ) source = resource.detach() assert source is resource http_client_mock.assert_requested( "delete", path="/v1/customers/cus_123/sources/%s" % TEST_RESOURCE_ID, ) def test_is_not_detachable_when_unattached(self, http_client_mock): resource = stripe.Source.retrieve(TEST_RESOURCE_ID) with pytest.raises(stripe.error.InvalidRequestError): resource.detach() def test_is_verifiable(self, http_client_mock): resource = stripe.Source.retrieve(TEST_RESOURCE_ID) source = resource.verify(values=[1, 2]) assert source is resource http_client_mock.assert_requested( "post", path="/v1/sources/%s/verify" % TEST_RESOURCE_ID, post_data="values[0]=1&values[1]=2", ) class TestSourceTransactions(object): def test_is_listable(self, http_client_mock): resource = stripe.Source.list_source_transactions(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/sources/%s/source_transactions" % TEST_RESOURCE_ID ) assert isinstance(resource.data, list) assert isinstance(resource.data[0], stripe.SourceTransaction) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_source_transaction.py0000644000175100001770000000107214637354563024047 0ustar00runnerdockerimport stripe class TestSourceTransaction(object): def test_is_listable(self, http_client_mock): source = stripe.Source.construct_from( {"id": "src_123", "object": "source"}, stripe.api_key ) source_transactions = source.list_source_transactions() http_client_mock.assert_requested( "get", path="/v1/sources/src_123/source_transactions" ) assert isinstance(source_transactions.data, list) assert isinstance( source_transactions.data[0], stripe.SourceTransaction ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_subscription.py0000644000175100001770000000547614637354563022702 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "sub_123" class TestSubscription(object): def test_is_listable(self, http_client_mock): resources = stripe.Subscription.list() http_client_mock.assert_requested("get", path="/v1/subscriptions") assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.Subscription) def test_is_retrievable(self, http_client_mock): resource = stripe.Subscription.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/subscriptions/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Subscription) def test_is_creatable(self, http_client_mock): resource = stripe.Subscription.create(customer="cus_123") http_client_mock.assert_requested( "post", path="/v1/subscriptions", post_data="customer=cus_123" ) assert isinstance(resource, stripe.Subscription) def test_is_saveable(self, http_client_mock): resource = stripe.Subscription.retrieve(TEST_RESOURCE_ID) resource.metadata["key"] = "value" resource.save() http_client_mock.assert_requested( "post", path="/v1/subscriptions/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) def test_is_modifiable(self, http_client_mock): resource = stripe.Subscription.modify( TEST_RESOURCE_ID, metadata={"key": "value"} ) http_client_mock.assert_requested( "post", path="/v1/subscriptions/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) assert isinstance(resource, stripe.Subscription) def test_is_deletable(self, http_client_mock): resource = stripe.Subscription.retrieve(TEST_RESOURCE_ID) resource.delete() http_client_mock.assert_requested( "delete", path="/v1/subscriptions/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Subscription) def test_can_delete(self, http_client_mock): resource = stripe.Subscription.delete(TEST_RESOURCE_ID) http_client_mock.assert_requested( "delete", path="/v1/subscriptions/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Subscription) def test_can_delete_discount(self, http_client_mock): sub = stripe.Subscription.retrieve(TEST_RESOURCE_ID) sub.delete_discount() http_client_mock.assert_requested( "delete", path="/v1/subscriptions/%s/discount" % sub.id ) def test_can_delete_discount_classmethod(self, http_client_mock): stripe.Subscription.delete_discount(TEST_RESOURCE_ID) http_client_mock.assert_requested( "delete", path="/v1/subscriptions/%s/discount" % TEST_RESOURCE_ID ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_subscription_item.py0000644000175100001770000000705114637354563023707 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "si_123" class TestSubscriptionItem(object): def test_is_listable(self, http_client_mock): resources = stripe.SubscriptionItem.list(subscription="sub_123") http_client_mock.assert_requested( "get", path="/v1/subscription_items", query_string="subscription=sub_123", ) assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.SubscriptionItem) def test_is_retrievable(self, http_client_mock): resource = stripe.SubscriptionItem.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/subscription_items/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.SubscriptionItem) def test_is_creatable(self, http_client_mock): resource = stripe.SubscriptionItem.create( price="price_123", subscription="sub_123" ) http_client_mock.assert_requested( "post", path="/v1/subscription_items", post_data="price=price_123&subscription=sub_123", ) assert isinstance(resource, stripe.SubscriptionItem) def test_is_saveable(self, http_client_mock): resource = stripe.SubscriptionItem.retrieve(TEST_RESOURCE_ID) resource.price = "price_123" resource.save() http_client_mock.assert_requested( "post", path="/v1/subscription_items/%s" % TEST_RESOURCE_ID, post_data="price=price_123", ) def test_is_modifiable(self, http_client_mock): resource = stripe.SubscriptionItem.modify( TEST_RESOURCE_ID, price="price_123" ) http_client_mock.assert_requested( "post", path="/v1/subscription_items/%s" % TEST_RESOURCE_ID, post_data="price=price_123", ) assert isinstance(resource, stripe.SubscriptionItem) def test_is_deletable(self, http_client_mock): resource = stripe.SubscriptionItem.retrieve(TEST_RESOURCE_ID) resource.delete() http_client_mock.assert_requested( "delete", path="/v1/subscription_items/%s" % TEST_RESOURCE_ID ) assert resource.deleted is True def test_can_delete(self, http_client_mock): resource = stripe.SubscriptionItem.delete(TEST_RESOURCE_ID) http_client_mock.assert_requested( "delete", path="/v1/subscription_items/%s" % TEST_RESOURCE_ID ) assert resource.deleted is True class TestUsageRecords(object): def test_is_creatable(self, http_client_mock): resource = stripe.SubscriptionItem.create_usage_record( TEST_RESOURCE_ID, quantity=5000, timestamp=1524182400, action="increment", ) http_client_mock.assert_requested( "post", path="/v1/subscription_items/%s/usage_records" % TEST_RESOURCE_ID, post_data="action=increment&quantity=5000×tamp=1524182400", ) assert isinstance(resource, stripe.UsageRecord) class TestUsageRecordSummaries(object): def test_is_listable(self, http_client_mock): resource = stripe.SubscriptionItem.list_usage_record_summaries( TEST_RESOURCE_ID ) http_client_mock.assert_requested( "get", path="/v1/subscription_items/%s/usage_record_summaries" % TEST_RESOURCE_ID, ) assert isinstance(resource.data, list) assert isinstance(resource.data[0], stripe.UsageRecordSummary) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_subscription_schedule.py0000644000175100001770000000644514637354563024553 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "sub_sched_123" class TestSubscriptionScheduleSchedule(object): def test_is_listable(self, http_client_mock): resources = stripe.SubscriptionSchedule.list() http_client_mock.assert_requested( "get", path="/v1/subscription_schedules" ) assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.SubscriptionSchedule) def test_is_retrievable(self, http_client_mock): resource = stripe.SubscriptionSchedule.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/subscription_schedules/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.SubscriptionSchedule) def test_is_creatable(self, http_client_mock): resource = stripe.SubscriptionSchedule.create(customer="cus_123") http_client_mock.assert_requested( "post", path="/v1/subscription_schedules", post_data="customer=cus_123", ) assert isinstance(resource, stripe.SubscriptionSchedule) def test_is_saveable(self, http_client_mock): resource = stripe.SubscriptionSchedule.retrieve(TEST_RESOURCE_ID) resource.metadata["key"] = "value" resource.save() http_client_mock.assert_requested( "post", path="/v1/subscription_schedules/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) def test_is_modifiable(self, http_client_mock): resource = stripe.SubscriptionSchedule.modify( TEST_RESOURCE_ID, metadata={"key": "value"} ) http_client_mock.assert_requested( "post", path="/v1/subscription_schedules/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) assert isinstance(resource, stripe.SubscriptionSchedule) def test_can_cancel(self, http_client_mock): resource = stripe.SubscriptionSchedule.retrieve(TEST_RESOURCE_ID) resource = resource.cancel() http_client_mock.assert_requested( "post", path="/v1/subscription_schedules/%s/cancel" % TEST_RESOURCE_ID, ) assert isinstance(resource, stripe.SubscriptionSchedule) def test_can_cancel_classmethod(self, http_client_mock): resource = stripe.SubscriptionSchedule.cancel(TEST_RESOURCE_ID) http_client_mock.assert_requested( "post", path="/v1/subscription_schedules/%s/cancel" % TEST_RESOURCE_ID, ) assert isinstance(resource, stripe.SubscriptionSchedule) def test_can_release(self, http_client_mock): resource = stripe.SubscriptionSchedule.retrieve(TEST_RESOURCE_ID) resource = resource.release() http_client_mock.assert_requested( "post", path="/v1/subscription_schedules/%s/release" % TEST_RESOURCE_ID, ) assert isinstance(resource, stripe.SubscriptionSchedule) def test_can_release_classmethod(self, http_client_mock): resource = stripe.SubscriptionSchedule.release(TEST_RESOURCE_ID) http_client_mock.assert_requested( "post", path="/v1/subscription_schedules/%s/release" % TEST_RESOURCE_ID, ) assert isinstance(resource, stripe.SubscriptionSchedule) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_tax_code.py0000644000175100001770000000116514637354563021733 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "txcd_123" class TestTaxCode(object): def test_is_listable(self, http_client_mock): resources = stripe.TaxCode.list() http_client_mock.assert_requested("get", path="/v1/tax_codes") assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.TaxCode) def test_is_retrievable(self, http_client_mock): resource = stripe.TaxCode.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/tax_codes/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.TaxCode) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_tax_id.py0000644000175100001770000000330714637354563021415 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "txi_123" class TestTaxId(object): def construct_resource(self): tax_id_dict = { "id": TEST_RESOURCE_ID, "object": "tax_id", "customer": "cus_123", } return stripe.TaxId.construct_from(tax_id_dict, stripe.api_key) def test_has_instance_url(self): resource = self.construct_resource() assert resource.instance_url() == "/v1/tax_ids/%s" % TEST_RESOURCE_ID def test_is_creatable(self, http_client_mock): stripe.TaxId.create( type="eu_vat", value="DE123456789", ) http_client_mock.assert_requested("post", path="/v1/tax_ids") def test_is_retrievable(self, http_client_mock): stripe.TaxId.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/tax_ids/%s" % TEST_RESOURCE_ID ) def test_is_deletable(self, http_client_mock): resource = stripe.TaxId.retrieve(TEST_RESOURCE_ID) resource.delete() http_client_mock.assert_requested( "delete", path="/v1/tax_ids/%s" % TEST_RESOURCE_ID ) assert resource.deleted is True def test_can_delete(self, http_client_mock): resource = stripe.TaxId.delete(TEST_RESOURCE_ID) http_client_mock.assert_requested( "delete", path="/v1/tax_ids/%s" % TEST_RESOURCE_ID ) assert resource.deleted is True def test_is_listable(self, http_client_mock): resources = stripe.TaxId.list() http_client_mock.assert_requested("get", path="/v1/tax_ids") assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.TaxId) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_tax_rate.py0000644000175100001770000000335614637354563021760 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "txr_123" class TestTaxRate(object): def test_is_listable(self, http_client_mock): resources = stripe.TaxRate.list() http_client_mock.assert_requested("get", path="/v1/tax_rates") assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.TaxRate) def test_is_retrievable(self, http_client_mock): resource = stripe.TaxRate.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/tax_rates/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.TaxRate) def test_is_creatable(self, http_client_mock): resource = stripe.TaxRate.create( display_name="name", inclusive=False, percentage=10.15 ) http_client_mock.assert_requested( "post", path="/v1/tax_rates", post_data="display_name=name&inclusive=False&percentage=10.15", ) assert isinstance(resource, stripe.TaxRate) def test_is_saveable(self, http_client_mock): resource = stripe.TaxRate.retrieve(TEST_RESOURCE_ID) resource.metadata["key"] = "value" resource.save() http_client_mock.assert_requested( "post", path="/v1/tax_rates/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) def test_is_modifiable(self, http_client_mock): resource = stripe.TaxRate.modify( TEST_RESOURCE_ID, metadata={"key": "value"} ) http_client_mock.assert_requested( "post", path="/v1/tax_rates/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) assert isinstance(resource, stripe.TaxRate) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_topup.py0000644000175100001770000000471414637354563021317 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "tu_123" class TestTopup(object): def test_is_listable(self, http_client_mock): resources = stripe.Topup.list() http_client_mock.assert_requested("get", path="/v1/topups") assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.Topup) def test_is_retrievable(self, http_client_mock): resource = stripe.Topup.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/topups/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Topup) def test_is_creatable(self, http_client_mock): resource = stripe.Topup.create( amount=100, currency="usd", source="src_123", description="description", statement_descriptor="statement descriptor", ) http_client_mock.assert_requested( "post", path="/v1/topups", post_data="amount=100¤cy=usd&description=description&source=src_123&statement_descriptor=statement+descriptor", ) assert isinstance(resource, stripe.Topup) def test_is_saveable(self, http_client_mock): resource = stripe.Topup.retrieve(TEST_RESOURCE_ID) resource.metadata["key"] = "value" resource.save() http_client_mock.assert_requested( "post", path="/v1/topups/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) def test_is_modifiable(self, http_client_mock): resource = stripe.Topup.modify( TEST_RESOURCE_ID, metadata={"key": "value"} ) http_client_mock.assert_requested( "post", path="/v1/topups/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) assert isinstance(resource, stripe.Topup) def test_can_cancel(self, http_client_mock): resource = stripe.Topup.retrieve(TEST_RESOURCE_ID) resource = resource.cancel() http_client_mock.assert_requested( "post", path="/v1/topups/%s/cancel" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Topup) def test_can_cancel_classmethod(self, http_client_mock): resource = stripe.Topup.cancel(TEST_RESOURCE_ID) http_client_mock.assert_requested( "post", path="/v1/topups/%s/cancel" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Topup) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_transfer.py0000644000175100001770000000653214637354563021774 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "tr_123" TEST_REVERSAL_ID = "trr_123" class TestTransfer(object): def test_is_listable(self, http_client_mock): resources = stripe.Transfer.list() http_client_mock.assert_requested("get", path="/v1/transfers") assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.Transfer) def test_is_retrievable(self, http_client_mock): resource = stripe.Transfer.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/transfers/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Transfer) def test_is_creatable(self, http_client_mock): resource = stripe.Transfer.create( amount=100, currency="usd", destination="acct_123" ) http_client_mock.assert_requested( "post", path="/v1/transfers", post_data="amount=100¤cy=usd&destination=acct_123", ) assert isinstance(resource, stripe.Transfer) def test_is_saveable(self, http_client_mock): resource = stripe.Transfer.retrieve(TEST_RESOURCE_ID) resource.metadata["key"] = "value" resource.save() http_client_mock.assert_requested( "post", path="/v1/transfers/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) def test_is_modifiable(self, http_client_mock): resource = stripe.Transfer.modify( TEST_RESOURCE_ID, metadata={"key": "value"} ) http_client_mock.assert_requested( "post", path="/v1/transfers/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) assert isinstance(resource, stripe.Transfer) class TestTransferReversals: def test_is_listable(self, http_client_mock): resources = stripe.Transfer.list_reversals(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/transfers/%s/reversals" % TEST_RESOURCE_ID ) assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.Reversal) def test_is_retrievable(self, http_client_mock): resource = stripe.Transfer.retrieve_reversal( TEST_RESOURCE_ID, TEST_REVERSAL_ID ) http_client_mock.assert_requested( "get", path="/v1/transfers/%s/reversals/%s" % (TEST_RESOURCE_ID, TEST_REVERSAL_ID), ) assert isinstance(resource, stripe.Reversal) def test_is_creatable(self, http_client_mock): resource = stripe.Transfer.create_reversal( TEST_RESOURCE_ID, amount=100 ) http_client_mock.assert_requested( "post", path="/v1/transfers/%s/reversals" % TEST_RESOURCE_ID, post_data="amount=100", ) assert isinstance(resource, stripe.Reversal) def test_is_modifiable(self, http_client_mock): resource = stripe.Transfer.modify_reversal( TEST_RESOURCE_ID, TEST_REVERSAL_ID, metadata={"foo": "bar"} ) http_client_mock.assert_requested( "post", path="/v1/transfers/%s/reversals/%s" % (TEST_RESOURCE_ID, TEST_REVERSAL_ID), post_data="metadata[foo]=bar", ) assert isinstance(resource, stripe.Reversal) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_usage_record.py0000644000175100001770000000146614637354563022613 0ustar00runnerdockerimport pytest import stripe TEST_SUBSCRIPTION_ITEM_ID = "si_123" class TestUsageRecord(object): def test_is_creatable(self, http_client_mock): resource = stripe.UsageRecord.create( subscription_item=TEST_SUBSCRIPTION_ITEM_ID, quantity=5000, timestamp=1524182400, action="increment", ) http_client_mock.assert_requested( "post", path="/v1/subscription_items/%s/usage_records" % (TEST_SUBSCRIPTION_ITEM_ID), ) assert isinstance(resource, stripe.UsageRecord) def test_raises_when_creating_without_subscription_item(self): with pytest.raises(ValueError): stripe.UsageRecord.create( quantity=5000, timestamp=1524182400, action="increment" ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_usage_record_summary.py0000644000175100001770000000101314637354563024354 0ustar00runnerdockerimport stripe class TestUsageRecordSummary(object): def test_is_listable(self, http_client_mock): usage_record_summaries = ( stripe.SubscriptionItem.list_usage_record_summaries("si_123") ) http_client_mock.assert_requested( "get", path="/v1/subscription_items/si_123/usage_record_summaries" ) assert isinstance(usage_record_summaries.data, list) assert isinstance( usage_record_summaries.data[0], stripe.UsageRecordSummary ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/api_resources/test_webhook_endpoint.py0000644000175100001770000000510514637354563023501 0ustar00runnerdockerimport stripe TEST_RESOURCE_ID = "we_123" class TestWebhookEndpoint(object): def test_is_listable(self, http_client_mock): resources = stripe.WebhookEndpoint.list() http_client_mock.assert_requested("get", path="/v1/webhook_endpoints") assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.WebhookEndpoint) def test_is_retrievable(self, http_client_mock): resource = stripe.WebhookEndpoint.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/webhook_endpoints/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.WebhookEndpoint) def test_is_creatable(self, http_client_mock): resource = stripe.WebhookEndpoint.create( enabled_events=["charge.succeeded"], url="https://stripe.com" ) http_client_mock.assert_requested( "post", path="/v1/webhook_endpoints", post_data="enabled_events[0]=charge.succeeded&url=https://stripe.com", ) assert isinstance(resource, stripe.WebhookEndpoint) def test_is_saveable(self, http_client_mock): resource = stripe.WebhookEndpoint.retrieve(TEST_RESOURCE_ID) resource.enabled_events = ["charge.succeeded"] resource.save() http_client_mock.assert_requested( "post", path="/v1/webhook_endpoints/%s" % TEST_RESOURCE_ID, post_data="enabled_events[0]=charge.succeeded", ) def test_is_modifiable(self, http_client_mock): resource = stripe.WebhookEndpoint.modify( TEST_RESOURCE_ID, enabled_events=["charge.succeeded"], url="https://stripe.com", ) http_client_mock.assert_requested( "post", path="/v1/webhook_endpoints/%s" % TEST_RESOURCE_ID, post_data="enabled_events[0]=charge.succeeded&url=https://stripe.com", ) assert isinstance(resource, stripe.WebhookEndpoint) def test_is_deletable(self, http_client_mock): resource = stripe.WebhookEndpoint.retrieve(TEST_RESOURCE_ID) resource.delete() http_client_mock.assert_requested( "delete", path="/v1/webhook_endpoints/%s" % TEST_RESOURCE_ID ) assert resource.deleted is True def test_can_delete(self, http_client_mock): resource = stripe.WebhookEndpoint.delete(TEST_RESOURCE_ID) http_client_mock.assert_requested( "delete", path="/v1/webhook_endpoints/%s" % TEST_RESOURCE_ID ) assert resource.deleted is True ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/conftest.py0000644000175100001770000000573514637354563016077 0ustar00runnerdockerimport atexit import os import sys import pytest import stripe from stripe import StripeClient import requests from tests.stripe_mock import StripeMock from tests.http_client_mock import HTTPClientMock pytest_plugins = ("anyio",) MOCK_MINIMUM_VERSION = "0.109.0" # Starts stripe-mock if an OpenAPI spec override is found in `openapi/`, and # otherwise fall back to `STRIPE_MOCK_PORT` or 12111. if StripeMock.start(): MOCK_PORT = StripeMock.port() else: MOCK_PORT = os.environ.get("STRIPE_MOCK_PORT", 12111) MOCK_API_BASE = "http://localhost:%s" % MOCK_PORT MOCK_API_KEY = "sk_test_123" @atexit.register def stop_stripe_mock(): StripeMock.stop() def pytest_configure(config): if not config.getoption("--nomock"): try: requests.get("http://localhost:%s/" % MOCK_PORT) except Exception: sys.exit( "Couldn't reach stripe-mock at `localhost:%s`. Is " "it running? Please see README for setup instructions." % MOCK_PORT ) def pytest_addoption(parser): parser.addoption( "--nomock", action="store_true", help="only run tests that don't need stripe-mock", ) def pytest_runtest_setup(item): if "http_client_mock" in item.fixturenames and item.config.getoption( "--nomock" ): pytest.skip( "run stripe-mock locally and remove --nomock flag to run skipped tests" ) @pytest.fixture(autouse=True) def setup_stripe(): orig_attrs = { "api_base": stripe.api_base, "upload_api_base": stripe.upload_api_base, "api_key": stripe.api_key, "client_id": stripe.client_id, "default_http_client": stripe.default_http_client, } http_client = stripe.http_client.new_default_http_client() stripe.api_base = MOCK_API_BASE stripe.upload_api_base = MOCK_API_BASE stripe.api_key = MOCK_API_KEY stripe.client_id = "ca_123" stripe.default_http_client = http_client yield http_client.close() stripe.api_base = orig_attrs["api_base"] stripe.upload_api_base = orig_attrs["upload_api_base"] stripe.api_key = orig_attrs["api_key"] stripe.client_id = orig_attrs["client_id"] stripe.default_http_client = orig_attrs["default_http_client"] @pytest.fixture def http_client_mock(mocker): mock_client = HTTPClientMock(mocker) old_client = stripe.default_http_client stripe.default_http_client = mock_client.get_mock_http_client() yield mock_client stripe.default_http_client = old_client @pytest.fixture def stripe_mock_stripe_client(http_client_mock): return StripeClient( MOCK_API_KEY, base_addresses={"api": MOCK_API_BASE}, http_client=http_client_mock.get_mock_http_client(), ) @pytest.fixture def file_stripe_mock_stripe_client(http_client_mock): return StripeClient( MOCK_API_KEY, base_addresses={"files": MOCK_API_BASE}, http_client=http_client_mock.get_mock_http_client(), ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/http_client_mock.py0000644000175100001770000003116114637354563017570 0ustar00runnerdockerfrom __future__ import absolute_import, division, print_function from typing import List import stripe from urllib.parse import urlsplit, urlencode, parse_qsl import json from unittest.mock import Mock def parse_and_sort(query_string, strict_parsing=False): """ Helper function to parse a query string and return a sorted list of tuples. """ return sorted(parse_qsl(query_string, strict_parsing=strict_parsing)) def extract_api_base(abs_url): """ Helper function to extract the api_base from an absolute URL. """ return urlsplit(abs_url).scheme + "://" + urlsplit(abs_url).netloc class StripeRequestCall(object): def __init__( self, method=None, abs_url=None, headers=None, post_data=None, usage=None, max_network_retries=None, ): self.method = method self.abs_url = abs_url self.headers = headers self.post_data = post_data self.usage = usage self.max_network_retries = max_network_retries @classmethod def from_mock_call(cls, mock_call): return cls( method=mock_call[0][0], abs_url=mock_call[0][1], headers=mock_call[0][2], post_data=mock_call[0][3], usage=mock_call[1]["_usage"], max_network_retries=mock_call[1]["max_network_retries"], ) def __repr__(self): return "".format( method=self.method, abs_url=self.abs_url, headers=self.headers, post_data=self.post_data, ) def get_raw_header(self, header): if self.headers is None: return None return self.headers.get(header) def check( self, method=None, abs_url=None, api_base=None, path=None, query_string=None, api_key=None, stripe_version=None, stripe_account=None, stripe_context=None, content_type=None, idempotency_key=None, user_agent=None, extra_headers=None, post_data=None, is_json=False, usage=None, max_network_retries=None, ): # METHOD if method is not None: self.assert_method(method) # URL if abs_url is not None: self.assert_abs_url(abs_url) if api_base is not None: self.assert_api_base(api_base) if path is not None: self.assert_path(path) if query_string is not None: self.assert_query_string(query_string) # HEADERS if api_key is not None: self.assert_header("Authorization", "Bearer %s" % (api_key,)) if stripe_version is not None: self.assert_header("Stripe-Version", stripe_version) if stripe_account is not None: self.assert_header("Stripe-Account", stripe_account) if stripe_context is not None: self.assert_header("Stripe-Context", stripe_context) if content_type is not None: self.assert_header("Content-Type", content_type) if idempotency_key is not None: self.assert_header("Idempotency-Key", idempotency_key) if user_agent is not None: self.assert_header("User-Agent", user_agent) if extra_headers is not None: self.assert_extra_headers(extra_headers) if usage is not None: self.assert_usage(usage) # BODY if post_data is not None: self.assert_post_data(post_data, is_json=is_json) # OPTIONS if max_network_retries is not None: self.assert_max_network_retries(max_network_retries) return True def assert_max_network_retries(self, expected): actual = self.max_network_retries if actual != expected: raise AssertionError( "Expected max_network_retries to be %s, got %s" % (expected, actual) ) def assert_method(self, expected): if self.method != expected: raise AssertionError( "Expected request method %s, got %s" % (expected, self.method) ) def assert_abs_url(self, expected): expected_url = urlsplit(expected) self.assert_api_base(extract_api_base(expected)) self.assert_path(expected_url.path) self.assert_query_string(expected_url.query) def assert_api_base(self, expected): actual_base = ( urlsplit(self.abs_url).scheme + "://" + urlsplit(self.abs_url).netloc ) if actual_base != expected: raise AssertionError( "Expected URL base %s, got %s" % (expected, actual_base) ) def assert_path(self, expected): actual_path = urlsplit(self.abs_url).path if actual_path != expected: raise AssertionError( "Expected URL path %s, got %s" % (expected, actual_path) ) def assert_query_string(self, expected): splitted = urlsplit(self.abs_url) actual_query = None if splitted.query: actual_query = splitted.query actual_query_params = parse_and_sort(actual_query) expected_query_params = parse_and_sort(expected) if actual_query_params != expected_query_params: raise AssertionError( "Expected URL query string %s, got %s" % (expected, actual_query) ) def assert_header(self, header, expected): actual = self.headers.get(header) if actual != expected: raise AssertionError( "Expected %s to be %s, got %s" % (header, expected, actual) ) def assert_extra_headers(self, expected): for header, value in expected.items(): actual_value = self.headers.get(header) if actual_value != value: raise AssertionError( "Expected header %s to be %s, got %s" % (header, value, actual_value) ) def assert_usage(self, expected): if self.usage != expected: raise AssertionError( "Expected usage to be %s, got %s" % (expected, self.usage) ) def assert_post_data(self, expected, is_json=False): actual_data = self.post_data expected_data = expected if is_json: actual_data = json.loads(self.post_data) expected_data = json.loads(expected) elif expected: # only attempt to parse non-empty query strings actual_data = parse_and_sort(self.post_data, strict_parsing=True) expected_data = parse_and_sort(expected, strict_parsing=True) if actual_data != expected_data: raise AssertionError( "Expected POST data %s, got %s" % (expected, self.post_data) ) class HTTPClientMock(object): def __init__(self, mocker): self.mock_client = mocker.Mock( wraps=stripe.http_client.new_default_http_client( async_fallback_client=stripe.http_client.new_http_client_async_fallback() ) ) self.mock_client._verify_ssl_certs = True self.mock_client.name = "mockclient" self.registered_responses = {} self.funcs = [ self.mock_client.request_with_retries, self.mock_client.request_stream_with_retries, self.mock_client.request_with_retries_async, self.mock_client.request_stream_with_retries_async, ] self.func_call_order = [] def get_mock_http_client(self) -> Mock: return self.mock_client def stub_request( self, method, path="", query_string="", rbody="{}", rcode=200, rheaders={}, ) -> None: def custom_side_effect_for_func(func): def custom_side_effect( called_method, called_abs_url, *args, **kwargs ): self.func_call_order.append(func) called_path = urlsplit(called_abs_url).path called_query = "" if urlsplit(called_abs_url).query: called_query = urlencode( parse_and_sort(urlsplit(called_abs_url).query) ) if ( called_method, called_path, called_query, ) not in self.registered_responses: raise AssertionError( "Unexpected request made to %s %s %s" % (called_method, called_path, called_query) ) ret = self.registered_responses[ (called_method, called_path, called_query) ] if func._mock_name.endswith("async"): return awaitable(ret) return ret return custom_side_effect async def awaitable(x): return x self.registered_responses[ (method, path, urlencode(parse_and_sort(query_string))) ] = (rbody, rcode, rheaders) for func in self.funcs: func.side_effect = custom_side_effect_for_func(func) def get_last_call(self) -> StripeRequestCall: if len(self.func_call_order) == 0: raise AssertionError( "Expected request to have been made, but no calls were found." ) return StripeRequestCall.from_mock_call( self.func_call_order[-1].call_args ) def get_all_calls(self) -> List[StripeRequestCall]: calls_by_func = { func: list(func.call_args_list) for func in self.funcs } calls = [] for func in self.func_call_order: calls.append(calls_by_func[func].pop(0)) return [ StripeRequestCall.from_mock_call(call_args) for call_args in calls ] def find_call( self, method, api_base, path, query_string ) -> StripeRequestCall: for func in self.funcs: for call_args in func.call_args_list: request_call = StripeRequestCall.from_mock_call(call_args) try: if request_call.check( method=method, api_base=api_base, path=path, query_string=query_string, ): return request_call except AssertionError: pass raise AssertionError( "Expected request to have been made, but no calls were found." ) def assert_requested( self, method=None, abs_url=None, api_base=None, path=None, query_string=None, api_key=None, stripe_version=None, stripe_account=None, content_type=None, idempotency_key=None, user_agent=None, extra_headers=None, post_data=None, is_json=False, usage=None, max_network_retries=None, ) -> None: if abs_url and (api_base or path or query_string): raise ValueError( "Received both `abs_url` and one of `api_base`, `path`, or `query_string`. Please only use `abs_url`." ) if abs_url: api_base = extract_api_base(abs_url) path = urlsplit(abs_url).path query_string = urlsplit(abs_url).query last_call = self.find_call(method, api_base, path, query_string) last_call.check( method=method, abs_url=abs_url, api_base=api_base, path=path, query_string=query_string, api_key=api_key, stripe_version=stripe_version, stripe_account=stripe_account, content_type=content_type, idempotency_key=idempotency_key, user_agent=user_agent, extra_headers=extra_headers, post_data=post_data, is_json=is_json, usage=usage, max_network_retries=max_network_retries, ) def assert_no_request(self): for func in self.funcs: if func.called: msg = ( "Expected no request to have been made, but %s calls were " "found." % (sum([func.call_count for func in self.funcs])) ) raise AssertionError(msg) def reset_mock(self): for func in self.funcs: func.reset_mock() self.registered_responses = {} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/request_mock.py0000644000175100001770000002046514637354563016750 0ustar00runnerdockerimport json import stripe from stripe import util from stripe._stripe_response import StripeResponse, StripeStreamResponse class RequestMock(object): def __init__(self, mocker): self._mocker = mocker self._real_request = stripe.api_requestor.APIRequestor.request self._real_request_async = ( stripe.api_requestor.APIRequestor.request_async ) self._real_request_stream = ( stripe.api_requestor.APIRequestor.request_stream ) self._stub_request_handler = StubRequestHandler() self.constructor_patcher = self._mocker.patch( "stripe.api_requestor.APIRequestor.__init__", side_effect=stripe.api_requestor.APIRequestor.__init__, autospec=True, ) self.request_patcher = self._mocker.patch( "stripe.api_requestor.APIRequestor.request", side_effect=self._patched_request, autospec=True, ) self.request_async_patcher = self._mocker.patch( "stripe.api_requestor.APIRequestor.request_async", side_effect=self._patched_request_async, autospec=True, ) self.request_stream_patcher = self._mocker.patch( "stripe.api_requestor.APIRequestor.request_stream", side_effect=self._patched_request_stream, autospec=True, ) def _patched_request(self, requestor, method, url, *args, **kwargs): response = self._stub_request_handler.get_response( method, url, expect_stream=False ) if response is not None: return response, stripe.api_key return self._real_request(requestor, method, url, *args, **kwargs) async def _patched_request_async( self, requestor, method, url, *args, **kwargs ): response = self._stub_request_handler.get_response( method, url, expect_stream=False ) if response is not None: return response, stripe.api_key return self._real_request_async( requestor, method, url, *args, **kwargs ) def _patched_request_stream(self, requestor, method, url, *args, **kwargs): response = self._stub_request_handler.get_response( method, url, expect_stream=True ) if response is not None: return response, stripe.api_key return self._real_request_stream( requestor, method, url, *args, **kwargs ) def stub_request(self, method, url, rbody={}, rcode=200, rheaders={}): self._stub_request_handler.register( method, url, rbody, rcode, rheaders, is_streaming=False ) def stub_request_stream( self, method, url, rbody={}, rcode=200, rheaders={} ): self._stub_request_handler.register( method, url, rbody, rcode, rheaders, is_streaming=True ) def assert_api_base(self, expected_api_base): # Note that this method only checks that an API base was provided # as a keyword argument in APIRequestor's constructor, not as a # positional argument. if "api_base" not in self.constructor_patcher.call_args[1]: msg = ( "Expected APIRequestor to have been constructed with " "api_base='%s'. No API base was provided." % expected_api_base ) raise AssertionError(msg) actual_api_base = self.constructor_patcher.call_args[1]["api_base"] if actual_api_base != expected_api_base: msg = ( "Expected APIRequestor to have been constructed with " "api_base='%s'. Constructed with api_base='%s' " "instead." % (expected_api_base, actual_api_base) ) raise AssertionError(msg) def assert_api_version(self, expected_api_version): # Note that this method only checks that an API version was provided # as a keyword argument in APIRequestor's constructor, not as a # positional argument. if "api_version" not in self.constructor_patcher.call_args[1]: msg = ( "Expected APIRequestor to have been constructed with " "api_version='%s'. No API version was provided." % expected_api_version ) raise AssertionError(msg) actual_api_version = self.constructor_patcher.call_args[1][ "api_version" ] if actual_api_version != expected_api_version: msg = ( "Expected APIRequestor to have been constructed with " "api_version='%s'. Constructed with api_version='%s' " "instead." % (expected_api_version, actual_api_version) ) raise AssertionError(msg) def assert_requested( self, method, url, params=None, headers=None, api_mode=None, _usage=None, ): self.assert_requested_internal( self.request_patcher, method, url, params, headers, api_mode, _usage, ) def assert_requested_stream( self, method, url, params=None, headers=None, api_mode=None, _usage=None, ): self.assert_requested_internal( self.request_stream_patcher, method, url, params, headers, api_mode, _usage, ) def assert_requested_internal( self, patcher, method, url, params, headers, api_mode, usage ): params = params or self._mocker.ANY headers = headers or self._mocker.ANY api_mode = api_mode or self._mocker.ANY usage = usage or self._mocker.ANY called = False exception = None # Sadly, ANY does not match a missing optional argument, so we # check all the possible signatures of the request method possible_called_args = [ (self._mocker.ANY, method, url), (self._mocker.ANY, method, url, params), (self._mocker.ANY, method, url, params, headers), (self._mocker.ANY, method, url, params, headers, api_mode), ] possible_called_kwargs = [{}, {"_usage": usage}] for args in possible_called_args: for kwargs in possible_called_kwargs: try: patcher.assert_called_with(*args, **kwargs) except AssertionError as e: exception = e else: called = True break if not called: raise exception def assert_no_request(self): if self.request_patcher.call_count != 0: msg = ( "Expected 'request' to not have been called. " "Called %s times." % (self.request_patcher.call_count) ) raise AssertionError(msg) def assert_no_request_stream(self): if self.request_stream_patcher.call_count != 0: msg = ( "Expected 'request_stream' to not have been called. " "Called %s times." % (self.request_stream_patcher.call_count) ) raise AssertionError(msg) def reset_mock(self): self.request_patcher.reset_mock() self.request_stream_patcher.reset_mock() class StubRequestHandler(object): def __init__(self): self._entries = {} def register( self, method, url, rbody={}, rcode=200, rheaders={}, is_streaming=False ): self._entries[(method, url)] = (rbody, rcode, rheaders, is_streaming) def get_response(self, method, url, expect_stream=False): if (method, url) in self._entries: rbody, rcode, rheaders, is_streaming = self._entries.pop( (method, url) ) if expect_stream != is_streaming: return None if not isinstance(rbody, str): rbody = json.dumps(rbody) if is_streaming: stripe_response = StripeStreamResponse( util.io.BytesIO(str.encode(rbody)), rcode, rheaders ) else: stripe_response = StripeResponse(rbody, rcode, rheaders) return stripe_response return None ././@PaxHeader0000000000000000000000000000003400000000000010212 xustar0028 mtime=1719523725.5769408 stripe-10.1.0/tests/services/0000755000175100001770000000000014637354616015510 5ustar00runnerdocker././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/services/test_file_upload.py0000644000175100001770000000345414637354563021413 0ustar00runnerdockerfrom __future__ import absolute_import, division, print_function import tempfile import stripe TEST_RESOURCE_ID = "file_123" class TestFileUpload(object): def test_is_listable(self, http_client_mock, stripe_mock_stripe_client): resources = stripe_mock_stripe_client.files.list() http_client_mock.assert_requested("get", path="/v1/files") assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.FileUpload) def test_is_retrievable(self, http_client_mock, stripe_mock_stripe_client): resource = stripe_mock_stripe_client.files.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/files/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.FileUpload) def test_is_creatable( self, file_stripe_mock_stripe_client, http_client_mock, ): stripe.multipart_data_generator.MultipartDataGenerator._initialize_boundary = ( lambda self: 1234567890 ) test_file = tempfile.TemporaryFile() # We create a new client here instead of re-using the stripe_mock_stripe_client fixture # because stripe_mock_stripe_client overrides the "api" base address, which we want to # be empty for this test. resource = file_stripe_mock_stripe_client.files.create( params={ "purpose": "dispute_evidence", "file": test_file, "file_link_data": {"create": True}, } ) http_client_mock.assert_requested( "post", api_base=stripe.upload_api_base, path="/v1/files", content_type="multipart/form-data; boundary=1234567890", ) assert isinstance(resource, stripe.FileUpload) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/services/test_oauth.py0000644000175100001770000001010214637354563020234 0ustar00runnerdockerimport pytest from urllib.parse import parse_qs, urlparse import stripe from stripe._stripe_client import StripeClient class TestOAuth(object): @pytest.fixture def stripe_client(self, http_client_mock) -> StripeClient: return StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), client_id="ca_123", ) def test_authorize_url(self, stripe_client: StripeClient): url = stripe_client.oauth.authorize_url( { "scope": "read_write", "state": "csrf_token", "stripe_user": { "email": "test@example.com", "url": "https://example.com/profile/test", "country": "US", }, } ) o = urlparse(url) params = parse_qs(o.query) url_express = stripe_client.oauth.authorize_url( {"scope": "read_write", "state": "csrf_token"}, {"express": True} ) o_express = urlparse(url_express) assert o.scheme == "https" assert o.netloc == "connect.stripe.com" assert o.path == "/oauth/authorize" assert o_express.path == "/express/oauth/authorize" assert params["client_id"] == ["ca_123"] assert params["scope"] == ["read_write"] assert params["stripe_user[email]"] == ["test@example.com"] assert params["stripe_user[url]"] == [ "https://example.com/profile/test" ] assert params["stripe_user[country]"] == ["US"] def test_token(self, stripe_client: StripeClient, http_client_mock): http_client_mock.stub_request( "post", path="/oauth/token", rbody='{"access_token":"sk_access_token","scope":"read_only","livemode":"false","token_type":"bearer","refresh_token":"sk_refresh_token","stripe_user_id":"acct_test","stripe_publishable_key":"pk_test"}', ) resp = stripe_client.oauth.token( { "grant_type": "authorization_code", "code": "this_is_an_authorization_code", } ) http_client_mock.assert_requested( "post", api_base=stripe.connect_api_base, path="/oauth/token", post_data="grant_type=authorization_code&code=this_is_an_authorization_code", ) assert resp["access_token"] == "sk_access_token" def test_deauthorize(self, stripe_client: StripeClient, http_client_mock): http_client_mock.stub_request( "post", path="/oauth/deauthorize", rbody='{"stripe_user_id":"acct_test_deauth"}', ) resp = stripe_client.oauth.deauthorize( { "stripe_user_id": "acct_test_deauth", } ) http_client_mock.assert_requested( "post", api_base=stripe.connect_api_base, path="/oauth/deauthorize", post_data="client_id=ca_123&stripe_user_id=acct_test_deauth", ) assert resp["stripe_user_id"] == "acct_test_deauth" def test_uses_client_connect_api_base(self, http_client_mock): http_client_mock.stub_request( "post", path="/oauth/token", rbody='{"access_token":"sk_access_token","scope":"read_only","livemode":"false","token_type":"bearer","refresh_token":"sk_refresh_token","stripe_user_id":"acct_test","stripe_publishable_key":"pk_test"}', ) expected_api_base = "https://connect.example.com" client = stripe.StripeClient( "sk_test_123", base_addresses={"connect": expected_api_base}, http_client=http_client_mock.get_mock_http_client(), ) resp = client.oauth.token( { "grant_type": "authorization_code", "code": "ac_123456789", } ) http_client_mock.assert_requested( "post", api_base=expected_api_base, path="/oauth/token", ) assert resp["access_token"] == "sk_access_token" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/services/test_quote.py0000644000175100001770000001053614637354563020264 0ustar00runnerdockerfrom __future__ import absolute_import, division, print_function import stripe TEST_RESOURCE_ID = "qt_123" class TestQuote(object): def test_is_listable(self, http_client_mock, stripe_mock_stripe_client): resources = stripe_mock_stripe_client.quotes.list() http_client_mock.assert_requested("get", path="/v1/quotes") assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.Quote) def test_is_retrievable(self, http_client_mock, stripe_mock_stripe_client): resource = stripe_mock_stripe_client.quotes.retrieve(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", path="/v1/quotes/%s" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Quote) def test_is_creatable(self, http_client_mock, stripe_mock_stripe_client): resource = stripe_mock_stripe_client.quotes.create( params={"customer": "cus_123"} ) http_client_mock.assert_requested( "post", path="/v1/quotes", post_data="customer=cus_123" ) assert isinstance(resource, stripe.Quote) def test_is_updateable(self, http_client_mock, stripe_mock_stripe_client): resource = stripe_mock_stripe_client.quotes.update( TEST_RESOURCE_ID, params={"metadata": {"key": "value"}} ) http_client_mock.assert_requested( "post", path="/v1/quotes/%s" % TEST_RESOURCE_ID, post_data="metadata[key]=value", ) assert isinstance(resource, stripe.Quote) def test_can_finalize_quote( self, http_client_mock, stripe_mock_stripe_client ): resource = stripe_mock_stripe_client.quotes.retrieve(TEST_RESOURCE_ID) resource = resource.finalize_quote() http_client_mock.assert_requested( "post", path="/v1/quotes/%s/finalize" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Quote) def test_can_finalize_quote_classmethod( self, http_client_mock, stripe_mock_stripe_client ): resource = stripe_mock_stripe_client.quotes.finalize_quote( TEST_RESOURCE_ID ) http_client_mock.assert_requested( "post", path="/v1/quotes/%s/finalize" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Quote) def test_can_cancel(self, http_client_mock, stripe_mock_stripe_client): resource = stripe_mock_stripe_client.quotes.cancel(TEST_RESOURCE_ID) http_client_mock.assert_requested( "post", path="/v1/quotes/%s/cancel" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Quote) def test_can_accept(self, http_client_mock, stripe_mock_stripe_client): resource = stripe_mock_stripe_client.quotes.accept(TEST_RESOURCE_ID) http_client_mock.assert_requested( "post", path="/v1/quotes/%s/accept" % TEST_RESOURCE_ID ) assert isinstance(resource, stripe.Quote) def test_can_list_line_items( self, http_client_mock, stripe_mock_stripe_client ): resources = stripe_mock_stripe_client.quotes.line_items.list( TEST_RESOURCE_ID ) http_client_mock.assert_requested( "get", path="/v1/quotes/%s/line_items" % TEST_RESOURCE_ID ) assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.LineItem) def test_can_list_computed_upfront_line_items( self, http_client_mock, stripe_mock_stripe_client ): resources = ( stripe_mock_stripe_client.quotes.computed_upfront_line_items.list( TEST_RESOURCE_ID ) ) http_client_mock.assert_requested( "get", path="/v1/quotes/%s/computed_upfront_line_items" % TEST_RESOURCE_ID, ) assert isinstance(resources.data, list) assert isinstance(resources.data[0], stripe.LineItem) def test_can_pdf( self, file_stripe_mock_stripe_client, http_client_mock, ): stream = file_stripe_mock_stripe_client.quotes.pdf(TEST_RESOURCE_ID) http_client_mock.assert_requested( "get", api_base=stripe.upload_api_base, path="/v1/quotes/%s/pdf" % TEST_RESOURCE_ID, ) content = stream.io.read() assert content == b"Stripe binary response" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/stripe_mock.py0000644000175100001770000000356614637354563016571 0ustar00runnerdockerimport os import socket import subprocess import sys import time class StripeMock(object): PATH_SPEC = ( os.path.dirname(os.path.realpath(__file__)) + "/openapi/spec3.json" ) PATH_FIXTURES = ( os.path.dirname(os.path.realpath(__file__)) + "/openapi/fixtures3.json" ) _port = -1 _process = None @classmethod def start(cls): if not os.path.isfile(cls.PATH_SPEC): return False if cls._process is not None: print("stripe-mock already running on port %s" % cls._port) return True cls._port = cls.find_available_port() print("Starting stripe-mock on port %s..." % cls._port) cls._process = subprocess.Popen( [ "stripe-mock", "-http-port", str(cls._port), "-spec", cls.PATH_SPEC, "-fixtures", cls.PATH_FIXTURES, ], stdout=subprocess.PIPE, stderr=subprocess.PIPE, ) time.sleep(1) if cls._process.poll() is None: print("Started stripe-mock, PID = %d" % cls._process.pid) else: print("stripe-mock terminated early: %d" % cls._process.returncode) sys.exit(1) return True @classmethod def stop(cls): if cls._process is None: return print("Stopping stripe-mock...") cls._process.terminate() cls._process.wait() cls._process = None cls._port = -1 print("Stopped stripe-mock") @classmethod def port(cls): return cls._port @staticmethod def find_available_port(): s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind(("localhost", 0)) s.listen(1) port = s.getsockname()[1] s.close() return port ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/test_api_requestor.py0000644000175100001770000006671514637354563020200 0ustar00runnerdockerimport datetime import json import tempfile import uuid from collections import OrderedDict import pytest import stripe from stripe import util from stripe._stripe_response import ( StripeStreamResponse, StripeStreamResponseAsync, ) from stripe._api_requestor import _APIRequestor, _api_encode from stripe._stripe_object import StripeObject from stripe._requestor_options import ( _GlobalRequestorOptions, ) from stripe._request_options import RequestOptions from urllib.parse import urlencode, urlsplit import urllib3 VALID_API_METHODS = ("get", "post", "delete") class GMT1(datetime.tzinfo): def utcoffset(self, dt): return datetime.timedelta(hours=1) def dst(self, dt): return datetime.timedelta(0) def tzname(self, dt): return "Europe/Prague" class AnyUUID4Matcher(object): def __eq__(self, other): try: uuid.UUID(other, version=4) except ValueError: return False return True def __repr__(self): return "AnyUUID4Matcher()" class TestAPIRequestor(object): ENCODE_INPUTS = { "dict": { "astring": "bar", "anint": 5, "anull": None, "adatetime": datetime.datetime(2013, 1, 1, tzinfo=GMT1()), "atuple": (1, 2), "adict": {"foo": "bar", "boz": 5}, "alist": ["foo", "bar"], }, "list": [1, "foo", "baz"], "string": "boo", "unicode": "\u1234", "datetime": datetime.datetime(2013, 1, 1, second=1, tzinfo=GMT1()), "none": None, } ENCODE_EXPECTATIONS = { "dict": [ ("%s[astring]", "bar"), ("%s[anint]", 5), ("%s[adatetime]", 1356994800), ("%s[adict][foo]", "bar"), ("%s[adict][boz]", 5), ("%s[alist][0]", "foo"), ("%s[alist][1]", "bar"), ("%s[atuple][0]", 1), ("%s[atuple][1]", 2), ], "list": [("%s[0]", 1), ("%s[1]", "foo"), ("%s[2]", "baz")], "string": [("%s", "boo")], "unicode": [("%s", "\u1234")], "datetime": [("%s", 1356994801)], "none": [], } @pytest.fixture(autouse=True) def setup_stripe(self): orig_attrs = { "api_key": stripe.api_key, "api_version": stripe.api_version, "default_http_client": stripe.default_http_client, "enable_telemetry": stripe.enable_telemetry, } stripe.api_key = "sk_test_123" stripe.api_version = "2017-12-14" stripe.default_http_client = None stripe.enable_telemetry = False yield stripe.api_key = orig_attrs["api_key"] stripe.api_version = orig_attrs["api_version"] stripe.default_http_client = orig_attrs["default_http_client"] stripe.enable_telemetry = orig_attrs["enable_telemetry"] @pytest.fixture def requestor(self, http_client_mock): requestor = _APIRequestor( client=http_client_mock.get_mock_http_client(), options=_GlobalRequestorOptions(), ) return requestor @property def valid_path(self): return "/foo" def encoder_check(self, key): stk_key = "my%s" % (key,) value = self.ENCODE_INPUTS[key] expectation = [ (k % (stk_key,), v) for k, v in self.ENCODE_EXPECTATIONS[key] ] stk = [] fn = getattr(_APIRequestor, "encode_%s" % (key,)) fn(stk, stk_key, value) if isinstance(value, dict): expectation.sort() stk.sort() assert stk == expectation, stk def _test_encode_naive_datetime(self): stk = [] _APIRequestor.encode_datetime( stk, "test", datetime.datetime(2013, 1, 1) ) # Naive datetimes will encode differently depending on your system # local time. Since we don't know the local time of your system, # we just check that naive encodings are within 24 hours of correct. assert abs(stk[0][1] - 1356994800) <= 60 * 60 * 24 def test_param_encoding(self, requestor, http_client_mock): expectation = [] for type_, values in iter(self.ENCODE_EXPECTATIONS.items()): expectation.extend([(k % (type_,), str(v)) for k, v in values]) query_string = ( urlencode(expectation).replace("%5B", "[").replace("%5D", "]") ) http_client_mock.stub_request( "get", query_string=query_string, rbody="{}", rcode=200 ) requestor.request( "get", "", self.ENCODE_INPUTS, base_address="api", api_mode="V1" ) http_client_mock.assert_requested("get", query_string=query_string) def test_dictionary_list_encoding(self): params = {"foo": {"0": {"bar": "bat"}}} encoded = list(_api_encode(params)) key, value = encoded[0] assert key == "foo[0][bar]" assert value == "bat" def test_ordereddict_encoding(self): params = { "ordered": OrderedDict( [ ("one", 1), ("two", 2), ("three", 3), ("nested", OrderedDict([("a", "a"), ("b", "b")])), ] ) } encoded = list(_api_encode(params)) assert encoded[0][0] == "ordered[one]" assert encoded[1][0] == "ordered[two]" assert encoded[2][0] == "ordered[three]" assert encoded[3][0] == "ordered[nested][a]" assert encoded[4][0] == "ordered[nested][b]" def test_url_construction(self, requestor, http_client_mock): CASES = ( ("%s?foo=bar" % stripe.api_base, "", {"foo": "bar"}), ("%s?foo=bar" % stripe.api_base, "?", {"foo": "bar"}), (stripe.api_base, "", {}), ( "%s/%%20spaced?foo=bar%%24&baz=5" % stripe.api_base, "/%20spaced?foo=bar%24", {"baz": "5"}, ), ( "%s?foo=bar&foo=bar" % stripe.api_base, "?foo=bar", {"foo": "bar"}, ), ) for expected, url, params in CASES: path = urlsplit(expected).path query_string = urlsplit(expected).query http_client_mock.stub_request( "get", path=path, query_string=query_string, rbody="{}", rcode=200, ) requestor.request( "get", url, params, base_address="api", api_mode="V1" ) http_client_mock.assert_requested("get", abs_url=expected) def test_empty_methods(self, requestor, http_client_mock): for meth in VALID_API_METHODS: http_client_mock.stub_request( meth, path=self.valid_path, rbody="{}", rcode=200 ) resp = requestor.request( meth, self.valid_path, {}, base_address="api", api_mode="V1" ) if meth == "post": post_data = "" else: post_data = None http_client_mock.assert_requested(meth, post_data=post_data) assert isinstance(resp, StripeObject) assert resp == {} @pytest.mark.anyio async def test_empty_methods_async(self, requestor, http_client_mock): for meth in VALID_API_METHODS: http_client_mock.stub_request( meth, path=self.valid_path, rbody="{}", rcode=200, ) resp = await requestor.request_async( meth, self.valid_path, {}, base_address="api", api_mode="V1" ) if meth == "post": post_data = "" else: post_data = None http_client_mock.assert_requested(meth, post_data=post_data) assert isinstance(resp, StripeObject) assert resp == {} @pytest.mark.anyio async def test_empty_methods_streaming_response_async( self, requestor, http_client_mock ): async def async_iter(): yield b"this" yield b"is" yield b"data" for meth in VALID_API_METHODS: http_client_mock.stub_request( meth, path=self.valid_path, rbody=async_iter(), rcode=200, ) resp = await requestor.request_stream_async( meth, self.valid_path, {}, base_address="api", api_mode="V1", ) if meth == "post": post_data = "" else: post_data = None http_client_mock.assert_requested(meth, post_data=post_data) assert isinstance(resp, StripeStreamResponseAsync) assert b"".join([x async for x in resp.stream()]) == b"thisisdata" def test_empty_methods_streaming_response( self, requestor, http_client_mock ): for meth in VALID_API_METHODS: http_client_mock.stub_request( meth, path=self.valid_path, rbody=util.io.BytesIO(b"thisisdata"), rcode=200, ) resp = requestor.request_stream( meth, self.valid_path, {}, base_address="api", api_mode="V1", ) if meth == "post": post_data = "" else: post_data = None http_client_mock.assert_requested(meth, post_data=post_data) assert isinstance(resp, StripeStreamResponse) assert resp.io.getvalue() == b"thisisdata" def test_methods_with_params_and_response( self, requestor, http_client_mock ): for method in VALID_API_METHODS: encoded = ( "adict[frobble]=bits&adatetime=1356994800&" "alist[0]=1&alist[1]=2&alist[2]=3" ) http_client_mock.stub_request( method, path=self.valid_path, query_string=encoded if method != "post" else "", rbody='{"foo": "bar", "baz": 6}', rcode=200, ) params = { "alist": [1, 2, 3], "adict": {"frobble": "bits"}, "adatetime": datetime.datetime(2013, 1, 1, tzinfo=GMT1()), } resp = requestor.request( method, self.valid_path, params, base_address="api", api_mode="V1", ) assert isinstance(resp, StripeObject) assert resp == {"foo": "bar", "baz": 6} if method == "post": http_client_mock.assert_requested( method, post_data=encoded, ) else: abs_url = "%s%s?%s" % ( stripe.api_base, self.valid_path, encoded, ) http_client_mock.assert_requested(method, abs_url=abs_url) def test_methods_with_params_and_streaming_response( self, requestor, http_client_mock ): for method in VALID_API_METHODS: encoded = ( "adict[frobble]=bits&adatetime=1356994800&" "alist[0]=1&alist[1]=2&alist[2]=3" ) http_client_mock.stub_request( method, path=self.valid_path, query_string=encoded if method != "post" else "", rbody=util.io.BytesIO(b'{"foo": "bar", "baz": 6}'), rcode=200, ) params = { "alist": [1, 2, 3], "adict": {"frobble": "bits"}, "adatetime": datetime.datetime(2013, 1, 1, tzinfo=GMT1()), } resp = requestor.request_stream( method, self.valid_path, params, base_address="api", api_mode="V1", ) assert isinstance(resp, StripeStreamResponse) assert resp.io.getvalue() == b'{"foo": "bar", "baz": 6}' if method == "post": http_client_mock.assert_requested(method, post_data=encoded) else: abs_url = "%s%s?%s" % ( stripe.api_base, self.valid_path, encoded, ) http_client_mock.assert_requested(method, abs_url=abs_url) def test_uses_headers(self, requestor, http_client_mock): http_client_mock.stub_request( "get", path=self.valid_path, rbody="{}", rcode=200 ) request_options: RequestOptions = {"headers": {"foo": "bar"}} requestor.request( "get", self.valid_path, {}, options=request_options, base_address="api", api_mode="V1", ) http_client_mock.assert_requested("get", extra_headers={"foo": "bar"}) def test_uses_api_version(self, requestor, http_client_mock): http_client_mock.stub_request( "get", path=self.valid_path, rbody="{}", rcode=200 ) request_options: RequestOptions = {"stripe_version": "fooversion"} requestor.request( "get", self.valid_path, options=request_options, base_address="api", api_mode="V1", ) http_client_mock.assert_requested( "get", stripe_version="fooversion", ) def test_prefers_headers_api_version(self, requestor, http_client_mock): http_client_mock.stub_request( "get", path=self.valid_path, rbody="{}", rcode=200 ) request_options: RequestOptions = { "stripe_version": "fooversion", "headers": {"Stripe-Version": "barversion"}, } requestor.request( "get", self.valid_path, {}, options=request_options, base_address="api", api_mode="V1", ) http_client_mock.assert_requested( "get", stripe_version="barversion", ) def test_uses_instance_key(self, requestor, http_client_mock): key = "fookey" requestor = requestor._replace_options(RequestOptions(api_key=key)) http_client_mock.stub_request( "get", path=self.valid_path, rbody="{}", rcode=200 ) requestor.request( "get", self.valid_path, {}, base_address="api", api_mode="V1" ) http_client_mock.assert_requested("get", api_key=key) assert requestor.api_key == key def test_uses_instance_account(self, requestor, http_client_mock): account = "acct_foo" requestor = requestor._replace_options( RequestOptions(stripe_account=account) ) http_client_mock.stub_request( "get", path=self.valid_path, rbody="{}", rcode=200 ) requestor.request( "get", self.valid_path, {}, base_address="api", api_mode="V1" ) http_client_mock.assert_requested( "get", stripe_account=account, ) def test_sets_default_http_client(self, mocker): assert not stripe.default_http_client _APIRequestor( client=mocker.Mock(stripe.http_client.HTTPClient) )._get_http_client() # default_http_client is not populated if a client is provided assert not stripe.default_http_client _APIRequestor()._get_http_client() # default_http_client is set when no client is specified assert stripe.default_http_client new_default_client = stripe.default_http_client _APIRequestor() # the newly created client is reused assert stripe.default_http_client == new_default_client def test_uses_app_info(self, requestor, http_client_mock): try: old = stripe.app_info stripe.set_app_info( "MyAwesomePlugin", url="https://myawesomeplugin.info", version="1.2.34", partner_id="partner_12345", ) http_client_mock.stub_request( "get", path=self.valid_path, rbody="{}", rcode=200 ) requestor.request( "get", self.valid_path, {}, base_address="api", api_mode="V1" ) ua = "Stripe/v1 PythonBindings/%s" % (stripe.VERSION,) ua += " MyAwesomePlugin/1.2.34 (https://myawesomeplugin.info)" expected_app_info = { "name": "MyAwesomePlugin", "url": "https://myawesomeplugin.info", "version": "1.2.34", "partner_id": "partner_12345", } last_call = http_client_mock.get_last_call() last_call.assert_method("get") last_call.assert_header("User-Agent", ua) assert ( json.loads( last_call.get_raw_header("X-Stripe-Client-User-Agent") )["application"] == expected_app_info ) finally: stripe.app_info = old def test_handles_failed_platform_call( self, requestor, mocker, http_client_mock ): http_client_mock.stub_request( "get", path=self.valid_path, rbody="{}", rcode=200 ) def fail(): raise RuntimeError mocker.patch("platform.platform", side_effect=fail) requestor.request( "get", self.valid_path, {}, {}, base_address="api", api_mode="V1" ) last_call = http_client_mock.get_last_call() last_call.assert_method("get") assert ( json.loads(last_call.get_raw_header("X-Stripe-Client-User-Agent"))[ "platform" ] == "(disabled)" ) def test_uses_given_idempotency_key(self, requestor, http_client_mock): meth = "post" http_client_mock.stub_request( meth, path=self.valid_path, rbody="{}", rcode=200 ) request_options: RequestOptions = {"idempotency_key": "123abc"} requestor.request( meth, self.valid_path, {}, options=request_options, base_address="api", api_mode="V1", ) http_client_mock.assert_requested( meth, idempotency_key="123abc", post_data="" ) def test_uuid4_idempotency_key_when_not_given( self, requestor, http_client_mock ): meth = "post" http_client_mock.stub_request( meth, path=self.valid_path, rbody="{}", rcode=200 ) requestor.request( meth, self.valid_path, {}, base_address="api", api_mode="V1" ) http_client_mock.assert_requested( meth, idempotency_key=AnyUUID4Matcher(), post_data="" ) def test_fails_without_api_key(self, requestor): stripe.api_key = None with pytest.raises(stripe.error.AuthenticationError): requestor.request( "get", self.valid_path, {}, base_address="api", api_mode="V1" ) def test_invalid_request_error_404(self, requestor, http_client_mock): http_client_mock.stub_request( "get", path=self.valid_path, rbody='{"error": {}}', rcode=404 ) with pytest.raises(stripe.error.InvalidRequestError): requestor.request( "get", self.valid_path, {}, base_address="api", api_mode="V1" ) def test_invalid_request_error_400(self, requestor, http_client_mock): http_client_mock.stub_request( "get", path=self.valid_path, rbody='{"error": {}}', rcode=400 ) with pytest.raises(stripe.error.InvalidRequestError): requestor.request( "get", self.valid_path, {}, base_address="api", api_mode="V1" ) def test_idempotency_error(self, requestor, http_client_mock): http_client_mock.stub_request( "get", path=self.valid_path, rbody='{"error": {"type": "idempotency_error"}}', rcode=400, ) with pytest.raises(stripe.error.IdempotencyError): requestor.request( "get", self.valid_path, {}, base_address="api", api_mode="V1" ) def test_authentication_error(self, requestor, http_client_mock): http_client_mock.stub_request( "get", path=self.valid_path, rbody='{"error": {}}', rcode=401 ) with pytest.raises(stripe.error.AuthenticationError): requestor.request( "get", self.valid_path, {}, base_address="api", api_mode="V1" ) def test_permissions_error(self, requestor, http_client_mock): http_client_mock.stub_request( "get", path=self.valid_path, rbody='{"error": {}}', rcode=403 ) with pytest.raises(stripe.error.PermissionError): requestor.request( "get", self.valid_path, {}, base_address="api", api_mode="V1" ) def test_card_error(self, requestor, http_client_mock): http_client_mock.stub_request( "get", path=self.valid_path, rbody='{"error": {"code": "invalid_expiry_year"}}', rcode=402, ) with pytest.raises(stripe.error.CardError) as excinfo: requestor.request( "get", self.valid_path, {}, base_address="api", api_mode="V1" ) assert excinfo.value.code == "invalid_expiry_year" def test_rate_limit_error(self, requestor, http_client_mock): http_client_mock.stub_request( "get", path=self.valid_path, rbody='{"error": {}}', rcode=429 ) with pytest.raises(stripe.error.RateLimitError): requestor.request( "get", self.valid_path, {}, base_address="api", api_mode="V1" ) def test_old_rate_limit_error(self, requestor, http_client_mock): """ Tests legacy rate limit error pre-2015-09-18 """ http_client_mock.stub_request( "get", path=self.valid_path, rbody='{"error": {"code":"rate_limit"}}', rcode=400, ) with pytest.raises(stripe.error.RateLimitError): requestor.request( "get", self.valid_path, {}, base_address="api", api_mode="V1" ) def test_server_error(self, requestor, http_client_mock): http_client_mock.stub_request( "get", path=self.valid_path, rbody='{"error": {}}', rcode=500 ) with pytest.raises(stripe.error.APIError): requestor.request( "get", self.valid_path, {}, base_address="api", api_mode="V1" ) def test_invalid_json(self, requestor, http_client_mock): http_client_mock.stub_request( "get", path=self.valid_path, rbody="{", rcode=200 ) with pytest.raises(stripe.error.APIError): requestor.request( "get", self.valid_path, {}, base_address="api", api_mode="V1" ) def test_invalid_method(self, requestor): with pytest.raises(stripe.error.APIConnectionError): requestor.request("foo", "bar", base_address="api", api_mode="V1") def test_oauth_invalid_requestor_error(self, requestor, http_client_mock): http_client_mock.stub_request( "get", path=self.valid_path, rbody='{"error": "invalid_request"}', rcode=400, ) with pytest.raises(stripe.oauth_error.InvalidRequestError): requestor.request( "get", self.valid_path, {}, base_address="api", api_mode="V1" ) def test_invalid_client_error(self, requestor, http_client_mock): http_client_mock.stub_request( "get", path=self.valid_path, rbody='{"error": "invalid_client"}', rcode=401, ) with pytest.raises(stripe.oauth_error.InvalidClientError): requestor.request( "get", self.valid_path, {}, base_address="api", api_mode="V1" ) def test_invalid_grant_error(self, requestor, http_client_mock): http_client_mock.stub_request( "get", path=self.valid_path, rbody='{"error": "invalid_grant"}', rcode=400, ) with pytest.raises(stripe.oauth_error.InvalidGrantError): requestor.request( "get", self.valid_path, {}, base_address="api", api_mode="V1" ) def test_extract_error_from_stream_request_for_bytes( self, requestor, http_client_mock ): http_client_mock.stub_request( "get", path=self.valid_path, rbody=util.io.BytesIO(b'{"error": "invalid_grant"}'), rcode=400, ) with pytest.raises(stripe.oauth_error.InvalidGrantError): requestor.request_stream( "get", self.valid_path, {}, base_address="api", api_mode="V1" ) def test_extract_error_from_stream_request_for_response( self, requestor, http_client_mock ): # Responses don't have getvalue, they only have a read method. http_client_mock.stub_request( "get", path=self.valid_path, rbody=urllib3.response.HTTPResponse( body=util.io.BytesIO(b'{"error": "invalid_grant"}'), preload_content=False, ), rcode=400, ) with pytest.raises(stripe.oauth_error.InvalidGrantError): requestor.request_stream( "get", self.valid_path, {}, base_address="api", api_mode="V1" ) def test_raw_request_with_file_param(self, requestor, http_client_mock): test_file = tempfile.NamedTemporaryFile() test_file.write("\u263a".encode("utf-16")) test_file.seek(0) meth = "post" path = "/v1/files" params = {"file": test_file, "purpose": "dispute_evidence"} supplied_headers = {"Content-Type": "multipart/form-data"} http_client_mock.stub_request(meth, path=path, rbody="{}", rcode=200) requestor.request( meth, path, params, supplied_headers, base_address="api", api_mode="V1", ) assert supplied_headers["Content-Type"] == "multipart/form-data" class TestDefaultClient(object): @pytest.fixture(autouse=True) def setup_stripe(self): orig_attrs = { "api_key": stripe.api_key, "default_http_client": stripe.default_http_client, } stripe.api_key = "sk_test_123" yield stripe.api_key = orig_attrs["api_key"] stripe.default_http_client = orig_attrs["default_http_client"] def test_default_http_client_called(self, http_client_mock): http_client_mock.stub_request( "get", path="/v1/charges", query_string="limit=3", rbody='{"object": "list", "data": []}', rcode=200, rheaders={}, ) stripe.Charge.list(limit=3) last_call = http_client_mock.get_last_call() last_call.assert_method("get") last_call.assert_abs_url("https://api.stripe.com/v1/charges?limit=3") last_call.assert_post_data(None) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/test_error.py0000644000175100001770000000374414637354563016440 0ustar00runnerdocker# -*- coding: utf-8 -*- from stripe import error class TestStripeError(object): def test_formatting(self): err = error.StripeError("öre") assert str(err) == "öre" def test_formatting_with_request_id(self): err = error.StripeError("öre", headers={"request-id": "123"}) assert str(err) == "Request 123: öre" def test_formatting_with_none(self): err = error.StripeError(None, headers={"request-id": "123"}) assert str(err) == "Request 123: " def test_formatting_with_message_none_and_request_id_none(self): err = error.StripeError(None) assert str(err) == "" def test_repr(self): err = error.StripeError("öre", headers={"request-id": "123"}) assert ( repr(err) == "StripeError(message='öre', http_status=None, " "request_id='123')" ) def test_error_object(self): err = error.StripeError( "message", json_body={"error": {"code": "some_error"}} ) assert err.error is not None assert err.error.code == "some_error" assert err.error.charge is None def test_error_object_not_dict(self): err = error.StripeError("message", json_body={"error": "not a dict"}) assert err.error is None class TestStripeErrorWithParamCode(object): def test_repr(self): err = error.CardError( "öre", param="cparam", code="ccode", http_status=403, headers={"request-id": "123"}, ) assert ( repr(err) == "CardError(message='öre', param='cparam', code='ccode', " "http_status=403, request_id='123')" ) class TestApiConnectionError(object): def test_default_no_retry(self): err = error.APIConnectionError("msg") assert err.should_retry is False err = error.APIConnectionError("msg", should_retry=True) assert err.should_retry ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/test_exports.py0000644000175100001770000004315614637354563017014 0ustar00runnerdocker# pyright: strict # we specifically test various import patterns from typing import Any import stripe import subprocess import sys def assert_output(code: str, expected: str) -> None: process = subprocess.Popen( [sys.executable, "-c", f"import stripe; print({code})"], stdout=subprocess.PIPE, stderr=subprocess.PIPE, ) stdout, stderr = process.communicate() assert not stderr, f"Error: {stderr.decode()}" output = stdout.decode().strip() # assert the output assert output == expected def test_can_import_stripe_object() -> None: # fmt: off from stripe.stripe_object import StripeObject as StripeObjectFromStripeStripeObject # type: ignore # fmt: on from stripe import ( StripeObject as StripeObjectFromStripe, ) # fmt: off assert stripe.stripe_object.StripeObject is StripeObjectFromStripeStripeObject # type: ignore # fmt: on assert stripe.StripeObject is StripeObjectFromStripeStripeObject assert StripeObjectFromStripe is StripeObjectFromStripeStripeObject def test_can_import_request_options() -> None: # fmt: off from stripe.request_options import RequestOptions as RequestOptionsStripeRequestOptions # type: ignore # fmt: on from stripe import ( RequestOptions as RequestOptionsFromStripe, ) assert stripe.RequestOptions is RequestOptionsStripeRequestOptions assert RequestOptionsFromStripe is RequestOptionsStripeRequestOptions def test_can_import_http_client() -> None: from stripe.http_client import HTTPClient as HTTPClientFromStripeHTTPClient # type: ignore # fmt: off from stripe.http_client import PycurlClient as PycurlClientFromStripeHTTPClient # type: ignore from stripe.http_client import RequestsClient as RequestsClientFromStripeHTTPClient # type: ignore from stripe.http_client import UrlFetchClient as UrlFetchClientFromStripeHTTPClient # type: ignore from stripe.http_client import new_default_http_client as new_default_http_clientFromStripeHTTPClient # type: ignore # fmt: on from stripe import ( HTTPClient as HTTPClientFromStripe, PycurlClient as PycurlClientFromStripe, RequestsClient as RequestsClientFromStripe, UrlFetchClient as UrlFetchClientFromStripe, new_default_http_client as new_default_http_clientFromStripe, ) assert HTTPClientFromStripe is HTTPClientFromStripeHTTPClient assert PycurlClientFromStripe is PycurlClientFromStripeHTTPClient assert RequestsClientFromStripe is RequestsClientFromStripeHTTPClient assert UrlFetchClientFromStripe is UrlFetchClientFromStripeHTTPClient assert ( new_default_http_clientFromStripe is new_default_http_clientFromStripeHTTPClient ) assert stripe.HTTPClient is HTTPClientFromStripeHTTPClient assert stripe.PycurlClient is PycurlClientFromStripeHTTPClient assert stripe.RequestsClient is RequestsClientFromStripeHTTPClient assert stripe.UrlFetchClient is UrlFetchClientFromStripeHTTPClient assert ( stripe.new_default_http_client is new_default_http_clientFromStripeHTTPClient ) def test_can_import_webhook_members() -> None: from stripe.webhook import Webhook as WebhookFromStripeWebhook # type: ignore # fmt: off from stripe.webhook import WebhookSignature as WebhookSignatureFromStripeWebhook # type: ignore # fmt: on from stripe import ( Webhook, WebhookSignature, ) assert Webhook is not None assert WebhookSignature is not None assert WebhookFromStripeWebhook is Webhook assert WebhookSignatureFromStripeWebhook is WebhookSignature def test_can_import_list_search_objects() -> None: # This import has to be single line, mypy and pyright are producing errors # on different lines of multiline import # fmt: off from stripe.api_resources import ListObject as ListObjectFromResources # type: ignore from stripe import ListObject as LOFromStripe from stripe.api_resources import SearchResultObject as SearchObjectFromResources # type: ignore from stripe import SearchResultObject as SOFromStripe # fmt: on from stripe import StripeObject assert ( ListObjectFromResources[StripeObject] == stripe.ListObject[StripeObject] ) assert ( SearchObjectFromResources[StripeObject] == stripe.SearchResultObject[StripeObject] ) assert ListObjectFromResources[StripeObject] == LOFromStripe[StripeObject] assert ( SearchObjectFromResources[StripeObject] == SOFromStripe[StripeObject] ) def test_can_import_misc_resources() -> None: from stripe.api_resources import ErrorObject, OAuthErrorObject # type: ignore from stripe import ( ErrorObject as ErrorObjectFromStripe, OAuthErrorObject as OAuthErrorObjectFromStripe, ) # fmt: off from stripe.api_resources.error_object import ErrorObject as ErrorObjectFromStripeApiResources # type: ignore from stripe.api_resources.error_object import OAuthErrorObject as OAuthErrorObjectFromStripeApiResources # type: ignore # fmt: on # FileUpload is an old alias for File, time to hide it from stripe.api_resources import FileUpload as FileUploadFromApiResources # type: ignore from stripe import FileUpload as FileUploadFromStripe # type: ignore assert ErrorObject is stripe.ErrorObject assert ErrorObjectFromStripe is stripe.ErrorObject assert ErrorObjectFromStripe is ErrorObjectFromStripeApiResources assert OAuthErrorObject is stripe.OAuthErrorObject assert OAuthErrorObjectFromStripe is stripe.OAuthErrorObject assert OAuthErrorObject is OAuthErrorObjectFromStripeApiResources assert FileUploadFromApiResources is stripe.FileUpload # type: ignore assert FileUploadFromApiResources is FileUploadFromStripe assert_output("stripe.error is not None", "True") def test_can_import_abstract() -> None: # fmt: off from stripe.api_resources.abstract import APIResource as APIResourceFromAbstract # type: ignore from stripe.api_resources.abstract import SingletonAPIResource as SingletonFromAbstract # type: ignore from stripe.api_resources.abstract import CreateableAPIResource as CreateableFromAbstract # type: ignore from stripe.api_resources.abstract import UpdateableAPIResource as UpdateableFromAbstract # type: ignore from stripe.api_resources.abstract import DeletableAPIResource as DeletableFromAbstract # type: ignore from stripe.api_resources.abstract import ListableAPIResource as ListableFromAbstract # type: ignore from stripe.api_resources.abstract import SearchableAPIResource as SearchableFromAbstract # type: ignore from stripe.api_resources.abstract import VerifyMixin as VerifyMixinFromAbstract # type: ignore from stripe.api_resources.abstract import APIResourceTestHelpers as APIResourceTestHelpersFromAbstract # type: ignore from stripe.api_resources.abstract import custom_method as custom_methodFromAbstract from stripe.api_resources.abstract import nested_resource_class_methods as nested_resource_class_methodsFromAbstract from stripe import APIResource as APIResourceFromStripe from stripe import SingletonAPIResource as SingletonFromStripe from stripe import CreateableAPIResource as CreateableFromStripe from stripe import UpdateableAPIResource as UpdateableFromStripe from stripe import DeletableAPIResource as DeletableFromStripe from stripe import ListableAPIResource as ListableFromStripe from stripe import SearchableAPIResource as SearchableFromStripe from stripe import VerifyMixin as VerifyMixinFromStripe from stripe import APIResourceTestHelpers as APIResourceTestHelpersFromStripe from stripe import custom_method as custom_methodFromStripe # pyright: ignore[reportDeprecated] from stripe import nested_resource_class_methods as nested_resource_class_methodsFromStripe # fmt: on from stripe.stripe_object import StripeObject # type: ignore assert ( APIResourceFromAbstract[StripeObject] == stripe.abstract.APIResource[StripeObject] # type: ignore ) assert ( stripe.abstract.SingletonAPIResource[StripeObject] # type: ignore == SingletonFromAbstract[StripeObject] ) assert ( stripe.abstract.CreateableAPIResource[StripeObject] # type: ignore == CreateableFromAbstract[StripeObject] ) assert ( stripe.abstract.UpdateableAPIResource[StripeObject] # type: ignore == UpdateableFromAbstract[StripeObject] ) assert ( stripe.abstract.DeletableAPIResource[StripeObject] # type: ignore == DeletableFromAbstract[StripeObject] ) assert ( stripe.abstract.ListableAPIResource[StripeObject] # type: ignore == ListableFromAbstract[StripeObject] ) assert ( stripe.abstract.SearchableAPIResource[StripeObject] # type: ignore == SearchableFromAbstract[StripeObject] ) assert stripe.abstract.VerifyMixin is VerifyMixinFromAbstract # type: ignore assert ( stripe.abstract.custom_method is custom_methodFromAbstract # type: ignore ) assert ( stripe.abstract.APIResourceTestHelpers[Any] # type: ignore is APIResourceTestHelpersFromAbstract[Any] ) assert ( stripe.abstract.nested_resource_class_methods # type: ignore is nested_resource_class_methodsFromAbstract ) assert APIResourceFromStripe is APIResourceFromAbstract assert SingletonFromStripe is SingletonFromAbstract assert CreateableFromStripe is CreateableFromAbstract assert UpdateableFromStripe is UpdateableFromAbstract assert DeletableFromStripe is DeletableFromAbstract assert ListableFromStripe is ListableFromAbstract assert SearchableFromStripe is SearchableFromAbstract assert VerifyMixinFromStripe is VerifyMixinFromAbstract assert ( APIResourceTestHelpersFromStripe is APIResourceTestHelpersFromAbstract ) assert custom_methodFromStripe is custom_methodFromAbstract assert ( nested_resource_class_methodsFromStripe is nested_resource_class_methodsFromAbstract ) def test_can_import_app_info() -> None: from stripe.app_info import AppInfo as AppInfoFromStripeAppInfo # type: ignore from stripe import AppInfo as AppInfoFromStripe assert AppInfoFromStripeAppInfo is AppInfoFromStripe assert AppInfoFromStripeAppInfo is stripe.AppInfo def test_can_import_stripe_response() -> None: # fmt: off from stripe.stripe_response import StripeResponse as StripeResponseFromStripeResponse # type: ignore from stripe.stripe_response import StripeResponseBase as StripeResponseBaseFromStripeResponse # type: ignore from stripe.stripe_response import StripeStreamResponse as StripeStreamResponseFromStripeResponse # type: ignore # fmt: on from stripe import ( StripeResponse as StripeResponseFromStripe, StripeResponseBase as StripeResponseBaseFromStripe, StripeStreamResponse as StripeStreamResponseFromStripe, ) assert ( StripeResponseFromStripeResponse is stripe.stripe_response.StripeResponse # type: ignore ) assert StripeResponseFromStripe is StripeResponseFromStripeResponse assert StripeResponseFromStripe is stripe.StripeResponse assert StripeResponseBaseFromStripe is StripeResponseBaseFromStripeResponse assert StripeResponseBaseFromStripe is stripe.StripeResponseBase assert ( StripeStreamResponseFromStripe is StripeStreamResponseFromStripeResponse ) assert StripeStreamResponseFromStripe is stripe.StripeStreamResponse def test_can_import_oauth_members() -> None: from stripe.oauth import OAuth as OAuthFromStripeOAuth # type: ignore from stripe import ( OAuth, ) assert OAuth is not None assert OAuthFromStripeOAuth is OAuth assert OAuthFromStripeOAuth is stripe.OAuth def test_can_import_util() -> None: # fmt: off from stripe.util import convert_to_stripe_object as convert_to_stripe_objectFromStripeUtil # type: ignore # fmt: on from stripe import ( convert_to_stripe_object as convert_to_stripe_objectFromStripe, ) assert ( stripe.convert_to_stripe_object is convert_to_stripe_objectFromStripe ) assert ( convert_to_stripe_objectFromStripe is convert_to_stripe_objectFromStripeUtil ) assert stripe.util.io is not None # type: ignore assert_output("stripe.util is not None", "True") def test_can_import_errors() -> None: # fmt: off from stripe.error import StripeError as StripeErrorFromStripeError # type: ignore from stripe.error import APIError as APIErrorFromStripeError # type: ignore from stripe.error import APIConnectionError as APIConnectionErrorFromStripeError # type: ignore from stripe.error import StripeErrorWithParamCode as StripeErrorWithParamCodeFromStripeError # type: ignore from stripe.error import CardError as CardErrorFromStripeError # type: ignore from stripe.error import IdempotencyError as IdempotencyErrorFromStripeError # type: ignore from stripe.error import InvalidRequestError as InvalidRequestErrorFromStripeError # type: ignore from stripe.error import AuthenticationError as AuthenticationErrorFromStripeError # type: ignore from stripe.error import PermissionError as PermissionErrorFromStripeError # type: ignore from stripe.error import RateLimitError as RateLimitErrorFromStripeError # type: ignore from stripe.error import SignatureVerificationError as SignatureVerificationErrorFromStripeError # type: ignore # fmt: on from stripe import StripeError as StripeErrorFromStripe from stripe import APIError as APIErrorFromStripe from stripe import APIConnectionError as APIConnectionErrorFromStripe from stripe import ( StripeErrorWithParamCode as StripeErrorWithParamCodeFromStripe, ) from stripe import CardError as CardErrorFromStripe from stripe import IdempotencyError as IdempotencyErrorFromStripe from stripe import InvalidRequestError as InvalidRequestErrorFromStripe from stripe import AuthenticationError as AuthenticationErrorFromStripe from stripe import PermissionError as PermissionErrorFromStripe from stripe import RateLimitError as RateLimitErrorFromStripe from stripe import ( SignatureVerificationError as SignatureVerificationErrorFromStripe, ) assert StripeErrorFromStripeError is StripeErrorFromStripe assert APIErrorFromStripeError is APIErrorFromStripe assert APIConnectionErrorFromStripeError is APIConnectionErrorFromStripe assert ( StripeErrorWithParamCodeFromStripeError is StripeErrorWithParamCodeFromStripe ) assert CardErrorFromStripeError is CardErrorFromStripe assert IdempotencyErrorFromStripeError is IdempotencyErrorFromStripe assert InvalidRequestErrorFromStripeError is InvalidRequestErrorFromStripe assert AuthenticationErrorFromStripeError is AuthenticationErrorFromStripe assert PermissionErrorFromStripeError is PermissionErrorFromStripe assert RateLimitErrorFromStripeError is RateLimitErrorFromStripe assert ( SignatureVerificationErrorFromStripeError is SignatureVerificationErrorFromStripe ) def test_can_import_top_level_resource() -> None: from stripe import Account as AccountFromStripe from stripe.api_resources import Account as AccountFromStripeResources # type: ignore # This import has to be single line, mypy and pyright are producing errors # on different lines of multiline import from stripe.api_resources.account import Account as AccFromModule # type: ignore assert stripe.Account == AccountFromStripe assert AccountFromStripe == AccountFromStripeResources assert AccFromModule == AccountFromStripeResources assert_output("stripe.api_resources.Account is not None", "True") assert_output("stripe.api_resources.account is not None", "True") assert_output("stripe.api_resources.account.Account is not None", "True") def test_can_import_namespaced_resource() -> None: from stripe import tax as TaxPackage from stripe.tax import ( Calculation as CalculationFromStripe, ) # This import has to be single line, mypy and pyright are producing errors # on different lines of multiline import from stripe.api_resources.tax import Calculation as CalcFromResources # type: ignore # This import has to be single line, mypy and pyright are producing errors # on different lines of multiline import # fmt: off from stripe.api_resources.tax.calculation import Calculation as CalcFromModule # type: ignore # fmt: on assert stripe.tax is TaxPackage assert stripe.tax.Calculation is CalculationFromStripe assert stripe.tax.Calculation is TaxPackage.Calculation assert stripe.tax.Calculation is CalcFromResources assert CalcFromResources is CalcFromModule assert_output("stripe.tax is not None", "True") assert_output("stripe.tax.Calculation is not None", "True") def test_can_import_top_level_service() -> None: from stripe import AccountService as AccountServiceFromStripe assert stripe.AccountService == AccountServiceFromStripe assert_output("stripe.AccountService is not None", "True") def test_can_import_namespaced_service() -> None: from stripe import tax as TaxPackage from stripe.tax import ( CalculationService as CalculationServiceFromStripe, ) assert stripe.tax is TaxPackage assert stripe.tax.CalculationService is CalculationServiceFromStripe assert stripe.tax.CalculationService is TaxPackage.CalculationService assert_output("stripe.tax is not None", "True") assert_output("stripe.tax.CalculationService is not None", "True") ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/test_generated_examples.py0000644000175100001770000416176514637354563021157 0ustar00runnerdocker# -*- coding: utf-8 -*- # File generated from our OpenAPI spec from __future__ import absolute_import, division, print_function import stripe from tests.http_client_mock import HTTPClientMock import io from stripe import StripeClient import pytest class TestGeneratedExamples(object): def test_account_links_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.AccountLink.create( account="acct_xxxxxxxxxxxxx", refresh_url="https://example.com/reauth", return_url="https://example.com/return", type="account_onboarding", ) http_client_mock.assert_requested( "post", path="/v1/account_links", query_string="", post_data="account=acct_xxxxxxxxxxxxx&refresh_url=https%3A%2F%2Fexample.com%2Freauth&return_url=https%3A%2F%2Fexample.com%2Freturn&type=account_onboarding", ) def test_account_links_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/account_links", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.account_links.create( { "account": "acct_xxxxxxxxxxxxx", "refresh_url": "https://example.com/reauth", "return_url": "https://example.com/return", "type": "account_onboarding", } ) http_client_mock.assert_requested( "post", path="/v1/account_links", query_string="", api_base="https://api.stripe.com", post_data="account=acct_xxxxxxxxxxxxx&refresh_url=https%3A%2F%2Fexample.com%2Freauth&return_url=https%3A%2F%2Fexample.com%2Freturn&type=account_onboarding", ) @pytest.mark.anyio async def test_account_links_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.AccountLink.create_async( account="acct_xxxxxxxxxxxxx", refresh_url="https://example.com/reauth", return_url="https://example.com/return", type="account_onboarding", ) http_client_mock.assert_requested( "post", path="/v1/account_links", query_string="", post_data="account=acct_xxxxxxxxxxxxx&refresh_url=https%3A%2F%2Fexample.com%2Freauth&return_url=https%3A%2F%2Fexample.com%2Freturn&type=account_onboarding", ) @pytest.mark.anyio async def test_account_links_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/account_links", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.account_links.create_async( { "account": "acct_xxxxxxxxxxxxx", "refresh_url": "https://example.com/reauth", "return_url": "https://example.com/return", "type": "account_onboarding", } ) http_client_mock.assert_requested( "post", path="/v1/account_links", query_string="", api_base="https://api.stripe.com", post_data="account=acct_xxxxxxxxxxxxx&refresh_url=https%3A%2F%2Fexample.com%2Freauth&return_url=https%3A%2F%2Fexample.com%2Freturn&type=account_onboarding", ) def test_accounts_capabilities_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.Account.list_capabilities("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/capabilities", query_string="", ) def test_accounts_capabilities_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/accounts/acct_xxxxxxxxxxxxx/capabilities", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.accounts.capabilities.list("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/capabilities", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_accounts_capabilities_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Account.list_capabilities_async("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/capabilities", query_string="", ) @pytest.mark.anyio async def test_accounts_capabilities_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/accounts/acct_xxxxxxxxxxxxx/capabilities", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.accounts.capabilities.list_async("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/capabilities", query_string="", api_base="https://api.stripe.com", ) def test_accounts_capabilities_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.Account.retrieve_capability( "acct_xxxxxxxxxxxxx", "card_payments", ) http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/capabilities/card_payments", query_string="", ) def test_accounts_capabilities_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/accounts/acct_xxxxxxxxxxxxx/capabilities/card_payments", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.accounts.capabilities.retrieve( "acct_xxxxxxxxxxxxx", "card_payments", ) http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/capabilities/card_payments", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_accounts_capabilities_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Account.retrieve_capability_async( "acct_xxxxxxxxxxxxx", "card_payments", ) http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/capabilities/card_payments", query_string="", ) @pytest.mark.anyio async def test_accounts_capabilities_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/accounts/acct_xxxxxxxxxxxxx/capabilities/card_payments", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.accounts.capabilities.retrieve_async( "acct_xxxxxxxxxxxxx", "card_payments", ) http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/capabilities/card_payments", query_string="", api_base="https://api.stripe.com", ) def test_accounts_capabilities_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.Account.modify_capability( "acct_xxxxxxxxxxxxx", "card_payments", requested=True, ) http_client_mock.assert_requested( "post", path="/v1/accounts/acct_xxxxxxxxxxxxx/capabilities/card_payments", query_string="", post_data="requested=True", ) def test_accounts_capabilities_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/accounts/acct_xxxxxxxxxxxxx/capabilities/card_payments", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.accounts.capabilities.update( "acct_xxxxxxxxxxxxx", "card_payments", {"requested": True}, ) http_client_mock.assert_requested( "post", path="/v1/accounts/acct_xxxxxxxxxxxxx/capabilities/card_payments", query_string="", api_base="https://api.stripe.com", post_data="requested=True", ) @pytest.mark.anyio async def test_accounts_capabilities_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Account.modify_capability_async( "acct_xxxxxxxxxxxxx", "card_payments", requested=True, ) http_client_mock.assert_requested( "post", path="/v1/accounts/acct_xxxxxxxxxxxxx/capabilities/card_payments", query_string="", post_data="requested=True", ) @pytest.mark.anyio async def test_accounts_capabilities_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/accounts/acct_xxxxxxxxxxxxx/capabilities/card_payments", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.accounts.capabilities.update_async( "acct_xxxxxxxxxxxxx", "card_payments", {"requested": True}, ) http_client_mock.assert_requested( "post", path="/v1/accounts/acct_xxxxxxxxxxxxx/capabilities/card_payments", query_string="", api_base="https://api.stripe.com", post_data="requested=True", ) def test_accounts_delete(self, http_client_mock: HTTPClientMock) -> None: stripe.Account.delete("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/accounts/acct_xxxxxxxxxxxxx", query_string="", ) def test_accounts_delete_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/accounts/acct_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.accounts.delete("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/accounts/acct_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_accounts_delete_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Account.delete_async("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/accounts/acct_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_accounts_delete_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/accounts/acct_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.accounts.delete_async("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/accounts/acct_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_accounts_external_accounts_delete( self, http_client_mock: HTTPClientMock ) -> None: stripe.Account.delete_external_account( "acct_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "delete", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx", query_string="", ) def test_accounts_external_accounts_delete_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.accounts.external_accounts.delete( "acct_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "delete", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_accounts_external_accounts_delete_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Account.delete_external_account_async( "acct_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "delete", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_accounts_external_accounts_delete_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.accounts.external_accounts.delete_async( "acct_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "delete", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_accounts_external_accounts_delete_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.Account.delete_external_account( "acct_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "delete", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx", query_string="", ) def test_accounts_external_accounts_delete_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.accounts.external_accounts.delete( "acct_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "delete", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_accounts_external_accounts_delete_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Account.delete_external_account_async( "acct_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "delete", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_accounts_external_accounts_delete_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.accounts.external_accounts.delete_async( "acct_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "delete", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_accounts_external_accounts_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.Account.list_external_accounts( "acct_xxxxxxxxxxxxx", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", query_string="limit=3", ) def test_accounts_external_accounts_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.accounts.external_accounts.list( "acct_xxxxxxxxxxxxx", {"limit": 3}, ) http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_accounts_external_accounts_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Account.list_external_accounts_async( "acct_xxxxxxxxxxxxx", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", query_string="limit=3", ) @pytest.mark.anyio async def test_accounts_external_accounts_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.accounts.external_accounts.list_async( "acct_xxxxxxxxxxxxx", {"limit": 3}, ) http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", query_string="limit=3", api_base="https://api.stripe.com", ) def test_accounts_external_accounts_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.Account.list_external_accounts( "acct_xxxxxxxxxxxxx", object="bank_account", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", query_string="object=bank_account&limit=3", ) def test_accounts_external_accounts_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", "object=bank_account&limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.accounts.external_accounts.list( "acct_xxxxxxxxxxxxx", {"object": "bank_account", "limit": 3}, ) http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", query_string="object=bank_account&limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_accounts_external_accounts_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Account.list_external_accounts_async( "acct_xxxxxxxxxxxxx", object="bank_account", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", query_string="object=bank_account&limit=3", ) @pytest.mark.anyio async def test_accounts_external_accounts_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", "object=bank_account&limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.accounts.external_accounts.list_async( "acct_xxxxxxxxxxxxx", {"object": "bank_account", "limit": 3}, ) http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", query_string="object=bank_account&limit=3", api_base="https://api.stripe.com", ) def test_accounts_external_accounts_get_3( self, http_client_mock: HTTPClientMock ) -> None: stripe.Account.list_external_accounts( "acct_xxxxxxxxxxxxx", object="card", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", query_string="object=card&limit=3", ) def test_accounts_external_accounts_get_3_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", "object=card&limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.accounts.external_accounts.list( "acct_xxxxxxxxxxxxx", {"object": "card", "limit": 3}, ) http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", query_string="object=card&limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_accounts_external_accounts_get_3_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Account.list_external_accounts_async( "acct_xxxxxxxxxxxxx", object="card", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", query_string="object=card&limit=3", ) @pytest.mark.anyio async def test_accounts_external_accounts_get_3_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", "object=card&limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.accounts.external_accounts.list_async( "acct_xxxxxxxxxxxxx", {"object": "card", "limit": 3}, ) http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", query_string="object=card&limit=3", api_base="https://api.stripe.com", ) def test_accounts_external_accounts_get_4( self, http_client_mock: HTTPClientMock ) -> None: stripe.Account.retrieve_external_account( "acct_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx", query_string="", ) def test_accounts_external_accounts_get_4_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.accounts.external_accounts.retrieve( "acct_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_accounts_external_accounts_get_4_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Account.retrieve_external_account_async( "acct_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_accounts_external_accounts_get_4_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.accounts.external_accounts.retrieve_async( "acct_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_accounts_external_accounts_get_5( self, http_client_mock: HTTPClientMock ) -> None: stripe.Account.retrieve_external_account( "acct_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx", query_string="", ) def test_accounts_external_accounts_get_5_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.accounts.external_accounts.retrieve( "acct_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_accounts_external_accounts_get_5_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Account.retrieve_external_account_async( "acct_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_accounts_external_accounts_get_5_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.accounts.external_accounts.retrieve_async( "acct_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_accounts_external_accounts_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.Account.create_external_account( "acct_xxxxxxxxxxxxx", external_account="btok_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", query_string="", post_data="external_account=btok_xxxxxxxxxxxxx", ) def test_accounts_external_accounts_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.accounts.external_accounts.create( "acct_xxxxxxxxxxxxx", {"external_account": "btok_xxxxxxxxxxxxx"}, ) http_client_mock.assert_requested( "post", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", query_string="", api_base="https://api.stripe.com", post_data="external_account=btok_xxxxxxxxxxxxx", ) @pytest.mark.anyio async def test_accounts_external_accounts_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Account.create_external_account_async( "acct_xxxxxxxxxxxxx", external_account="btok_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", query_string="", post_data="external_account=btok_xxxxxxxxxxxxx", ) @pytest.mark.anyio async def test_accounts_external_accounts_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.accounts.external_accounts.create_async( "acct_xxxxxxxxxxxxx", {"external_account": "btok_xxxxxxxxxxxxx"}, ) http_client_mock.assert_requested( "post", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", query_string="", api_base="https://api.stripe.com", post_data="external_account=btok_xxxxxxxxxxxxx", ) def test_accounts_external_accounts_post_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.Account.create_external_account( "acct_xxxxxxxxxxxxx", external_account="tok_xxxx_debit", ) http_client_mock.assert_requested( "post", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", query_string="", post_data="external_account=tok_xxxx_debit", ) def test_accounts_external_accounts_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.accounts.external_accounts.create( "acct_xxxxxxxxxxxxx", {"external_account": "tok_xxxx_debit"}, ) http_client_mock.assert_requested( "post", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", query_string="", api_base="https://api.stripe.com", post_data="external_account=tok_xxxx_debit", ) @pytest.mark.anyio async def test_accounts_external_accounts_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Account.create_external_account_async( "acct_xxxxxxxxxxxxx", external_account="tok_xxxx_debit", ) http_client_mock.assert_requested( "post", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", query_string="", post_data="external_account=tok_xxxx_debit", ) @pytest.mark.anyio async def test_accounts_external_accounts_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.accounts.external_accounts.create_async( "acct_xxxxxxxxxxxxx", {"external_account": "tok_xxxx_debit"}, ) http_client_mock.assert_requested( "post", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts", query_string="", api_base="https://api.stripe.com", post_data="external_account=tok_xxxx_debit", ) def test_accounts_external_accounts_post_3( self, http_client_mock: HTTPClientMock ) -> None: stripe.Account.modify_external_account( "acct_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) def test_accounts_external_accounts_post_3_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.accounts.external_accounts.update( "acct_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_accounts_external_accounts_post_3_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Account.modify_external_account_async( "acct_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_accounts_external_accounts_post_3_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.accounts.external_accounts.update_async( "acct_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/ba_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) def test_accounts_external_accounts_post_4( self, http_client_mock: HTTPClientMock ) -> None: stripe.Account.modify_external_account( "acct_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) def test_accounts_external_accounts_post_4_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.accounts.external_accounts.update( "acct_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_accounts_external_accounts_post_4_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Account.modify_external_account_async( "acct_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_accounts_external_accounts_post_4_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.accounts.external_accounts.update_async( "acct_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/accounts/acct_xxxxxxxxxxxxx/external_accounts/card_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) def test_accounts_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Account.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/accounts", query_string="limit=3", ) def test_accounts_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/accounts", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.accounts.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/accounts", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_accounts_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Account.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/accounts", query_string="limit=3", ) @pytest.mark.anyio async def test_accounts_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/accounts", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.accounts.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/accounts", query_string="limit=3", api_base="https://api.stripe.com", ) def test_accounts_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Account.retrieve("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx", query_string="", ) def test_accounts_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/accounts/acct_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.accounts.retrieve("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_accounts_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Account.retrieve_async("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_accounts_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/accounts/acct_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.accounts.retrieve_async("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_accounts_login_links_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.Account.create_login_link("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/accounts/acct_xxxxxxxxxxxxx/login_links", query_string="", ) def test_accounts_login_links_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/accounts/acct_xxxxxxxxxxxxx/login_links", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.accounts.login_links.create("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/accounts/acct_xxxxxxxxxxxxx/login_links", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_accounts_login_links_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Account.create_login_link_async("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/accounts/acct_xxxxxxxxxxxxx/login_links", query_string="", ) @pytest.mark.anyio async def test_accounts_login_links_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/accounts/acct_xxxxxxxxxxxxx/login_links", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.accounts.login_links.create_async("acct_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/accounts/acct_xxxxxxxxxxxxx/login_links", query_string="", api_base="https://api.stripe.com", ) def test_accounts_persons_delete( self, http_client_mock: HTTPClientMock ) -> None: stripe.Account.delete_person( "acct_xxxxxxxxxxxxx", "person_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "delete", path="/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", query_string="", ) def test_accounts_persons_delete_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.accounts.persons.delete( "acct_xxxxxxxxxxxxx", "person_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "delete", path="/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_accounts_persons_delete_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Account.delete_person_async( "acct_xxxxxxxxxxxxx", "person_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "delete", path="/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_accounts_persons_delete_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.accounts.persons.delete_async( "acct_xxxxxxxxxxxxx", "person_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "delete", path="/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_accounts_persons_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.Account.persons( "acct_xxxxxxxxxxxxx", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/persons", query_string="limit=3", ) def test_accounts_persons_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/accounts/acct_xxxxxxxxxxxxx/persons", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.accounts.persons.list( "acct_xxxxxxxxxxxxx", {"limit": 3}, ) http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/persons", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_accounts_persons_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Account.persons_async( "acct_xxxxxxxxxxxxx", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/persons", query_string="limit=3", ) @pytest.mark.anyio async def test_accounts_persons_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/accounts/acct_xxxxxxxxxxxxx/persons", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.accounts.persons.list_async( "acct_xxxxxxxxxxxxx", {"limit": 3}, ) http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/persons", query_string="limit=3", api_base="https://api.stripe.com", ) def test_accounts_persons_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.Account.retrieve_person( "acct_xxxxxxxxxxxxx", "person_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", query_string="", ) def test_accounts_persons_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.accounts.persons.retrieve( "acct_xxxxxxxxxxxxx", "person_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_accounts_persons_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Account.retrieve_person_async( "acct_xxxxxxxxxxxxx", "person_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_accounts_persons_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.accounts.persons.retrieve_async( "acct_xxxxxxxxxxxxx", "person_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_accounts_persons_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.Account.create_person( "acct_xxxxxxxxxxxxx", first_name="Jane", last_name="Diaz", ) http_client_mock.assert_requested( "post", path="/v1/accounts/acct_xxxxxxxxxxxxx/persons", query_string="", post_data="first_name=Jane&last_name=Diaz", ) def test_accounts_persons_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/accounts/acct_xxxxxxxxxxxxx/persons", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.accounts.persons.create( "acct_xxxxxxxxxxxxx", {"first_name": "Jane", "last_name": "Diaz"}, ) http_client_mock.assert_requested( "post", path="/v1/accounts/acct_xxxxxxxxxxxxx/persons", query_string="", api_base="https://api.stripe.com", post_data="first_name=Jane&last_name=Diaz", ) @pytest.mark.anyio async def test_accounts_persons_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Account.create_person_async( "acct_xxxxxxxxxxxxx", first_name="Jane", last_name="Diaz", ) http_client_mock.assert_requested( "post", path="/v1/accounts/acct_xxxxxxxxxxxxx/persons", query_string="", post_data="first_name=Jane&last_name=Diaz", ) @pytest.mark.anyio async def test_accounts_persons_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/accounts/acct_xxxxxxxxxxxxx/persons", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.accounts.persons.create_async( "acct_xxxxxxxxxxxxx", {"first_name": "Jane", "last_name": "Diaz"}, ) http_client_mock.assert_requested( "post", path="/v1/accounts/acct_xxxxxxxxxxxxx/persons", query_string="", api_base="https://api.stripe.com", post_data="first_name=Jane&last_name=Diaz", ) def test_accounts_persons_post_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.Account.modify_person( "acct_xxxxxxxxxxxxx", "person_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) def test_accounts_persons_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.accounts.persons.update( "acct_xxxxxxxxxxxxx", "person_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_accounts_persons_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Account.modify_person_async( "acct_xxxxxxxxxxxxx", "person_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_accounts_persons_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.accounts.persons.update_async( "acct_xxxxxxxxxxxxx", "person_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/accounts/acct_xxxxxxxxxxxxx/persons/person_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) def test_accounts_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Account.create( type="custom", country="US", email="jenny.rosen@example.com", capabilities={ "card_payments": {"requested": True}, "transfers": {"requested": True}, }, ) http_client_mock.assert_requested( "post", path="/v1/accounts", query_string="", post_data="type=custom&country=US&email=jenny.rosen%40example.com&capabilities[card_payments][requested]=True&capabilities[transfers][requested]=True", ) def test_accounts_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/accounts", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.accounts.create( { "type": "custom", "country": "US", "email": "jenny.rosen@example.com", "capabilities": { "card_payments": {"requested": True}, "transfers": {"requested": True}, }, } ) http_client_mock.assert_requested( "post", path="/v1/accounts", query_string="", api_base="https://api.stripe.com", post_data="type=custom&country=US&email=jenny.rosen%40example.com&capabilities[card_payments][requested]=True&capabilities[transfers][requested]=True", ) @pytest.mark.anyio async def test_accounts_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Account.create_async( type="custom", country="US", email="jenny.rosen@example.com", capabilities={ "card_payments": {"requested": True}, "transfers": {"requested": True}, }, ) http_client_mock.assert_requested( "post", path="/v1/accounts", query_string="", post_data="type=custom&country=US&email=jenny.rosen%40example.com&capabilities[card_payments][requested]=True&capabilities[transfers][requested]=True", ) @pytest.mark.anyio async def test_accounts_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/accounts", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.accounts.create_async( { "type": "custom", "country": "US", "email": "jenny.rosen@example.com", "capabilities": { "card_payments": {"requested": True}, "transfers": {"requested": True}, }, } ) http_client_mock.assert_requested( "post", path="/v1/accounts", query_string="", api_base="https://api.stripe.com", post_data="type=custom&country=US&email=jenny.rosen%40example.com&capabilities[card_payments][requested]=True&capabilities[transfers][requested]=True", ) def test_accounts_post_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Account.modify( "acct_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/accounts/acct_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) def test_accounts_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/accounts/acct_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.accounts.update( "acct_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/accounts/acct_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_accounts_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Account.modify_async( "acct_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/accounts/acct_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_accounts_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/accounts/acct_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.accounts.update_async( "acct_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/accounts/acct_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) def test_accounts_reject_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.Account.reject( "acct_xxxxxxxxxxxxx", reason="fraud", ) http_client_mock.assert_requested( "post", path="/v1/accounts/acct_xxxxxxxxxxxxx/reject", query_string="", post_data="reason=fraud", ) def test_accounts_reject_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/accounts/acct_xxxxxxxxxxxxx/reject", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.accounts.reject( "acct_xxxxxxxxxxxxx", {"reason": "fraud"}, ) http_client_mock.assert_requested( "post", path="/v1/accounts/acct_xxxxxxxxxxxxx/reject", query_string="", api_base="https://api.stripe.com", post_data="reason=fraud", ) @pytest.mark.anyio async def test_accounts_reject_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Account.reject_async( "acct_xxxxxxxxxxxxx", reason="fraud", ) http_client_mock.assert_requested( "post", path="/v1/accounts/acct_xxxxxxxxxxxxx/reject", query_string="", post_data="reason=fraud", ) @pytest.mark.anyio async def test_accounts_reject_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/accounts/acct_xxxxxxxxxxxxx/reject", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.accounts.reject_async( "acct_xxxxxxxxxxxxx", {"reason": "fraud"}, ) http_client_mock.assert_requested( "post", path="/v1/accounts/acct_xxxxxxxxxxxxx/reject", query_string="", api_base="https://api.stripe.com", post_data="reason=fraud", ) def test_application_fees_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.ApplicationFee.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/application_fees", query_string="limit=3", ) def test_application_fees_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/application_fees", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.application_fees.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/application_fees", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_application_fees_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.ApplicationFee.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/application_fees", query_string="limit=3", ) @pytest.mark.anyio async def test_application_fees_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/application_fees", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.application_fees.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/application_fees", query_string="limit=3", api_base="https://api.stripe.com", ) def test_application_fees_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.ApplicationFee.retrieve("fee_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/application_fees/fee_xxxxxxxxxxxxx", query_string="", ) def test_application_fees_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/application_fees/fee_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.application_fees.retrieve("fee_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/application_fees/fee_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_application_fees_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.ApplicationFee.retrieve_async("fee_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/application_fees/fee_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_application_fees_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/application_fees/fee_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.application_fees.retrieve_async("fee_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/application_fees/fee_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_application_fees_refunds_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.ApplicationFee.list_refunds( "fee_xxxxxxxxxxxxx", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds", query_string="limit=3", ) def test_application_fees_refunds_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/application_fees/fee_xxxxxxxxxxxxx/refunds", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.application_fees.refunds.list( "fee_xxxxxxxxxxxxx", {"limit": 3}, ) http_client_mock.assert_requested( "get", path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_application_fees_refunds_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.ApplicationFee.list_refunds_async( "fee_xxxxxxxxxxxxx", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds", query_string="limit=3", ) @pytest.mark.anyio async def test_application_fees_refunds_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/application_fees/fee_xxxxxxxxxxxxx/refunds", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.application_fees.refunds.list_async( "fee_xxxxxxxxxxxxx", {"limit": 3}, ) http_client_mock.assert_requested( "get", path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds", query_string="limit=3", api_base="https://api.stripe.com", ) def test_application_fees_refunds_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.ApplicationFee.retrieve_refund( "fee_xxxxxxxxxxxxx", "fr_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx", query_string="", ) def test_application_fees_refunds_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.application_fees.refunds.retrieve( "fee_xxxxxxxxxxxxx", "fr_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_application_fees_refunds_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.ApplicationFee.retrieve_refund_async( "fee_xxxxxxxxxxxxx", "fr_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_application_fees_refunds_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.application_fees.refunds.retrieve_async( "fee_xxxxxxxxxxxxx", "fr_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_application_fees_refunds_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.ApplicationFee.create_refund("fee_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds", query_string="", ) def test_application_fees_refunds_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/application_fees/fee_xxxxxxxxxxxxx/refunds", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.application_fees.refunds.create("fee_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_application_fees_refunds_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.ApplicationFee.create_refund_async("fee_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds", query_string="", ) @pytest.mark.anyio async def test_application_fees_refunds_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/application_fees/fee_xxxxxxxxxxxxx/refunds", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.application_fees.refunds.create_async("fee_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds", query_string="", api_base="https://api.stripe.com", ) def test_application_fees_refunds_post_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.ApplicationFee.modify_refund( "fee_xxxxxxxxxxxxx", "fr_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) def test_application_fees_refunds_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.application_fees.refunds.update( "fee_xxxxxxxxxxxxx", "fr_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_application_fees_refunds_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.ApplicationFee.modify_refund_async( "fee_xxxxxxxxxxxxx", "fr_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_application_fees_refunds_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.application_fees.refunds.update_async( "fee_xxxxxxxxxxxxx", "fr_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/application_fees/fee_xxxxxxxxxxxxx/refunds/fr_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) def test_apps_secrets_delete_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.apps.Secret.delete_where( name="my-api-key", scope={"type": "account"}, ) http_client_mock.assert_requested( "post", path="/v1/apps/secrets/delete", query_string="", post_data="name=my-api-key&scope[type]=account", ) def test_apps_secrets_delete_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/apps/secrets/delete", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.apps.secrets.delete_where( { "name": "my-api-key", "scope": {"type": "account"}, } ) http_client_mock.assert_requested( "post", path="/v1/apps/secrets/delete", query_string="", api_base="https://api.stripe.com", post_data="name=my-api-key&scope[type]=account", ) @pytest.mark.anyio async def test_apps_secrets_delete_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.apps.Secret.delete_where_async( name="my-api-key", scope={"type": "account"}, ) http_client_mock.assert_requested( "post", path="/v1/apps/secrets/delete", query_string="", post_data="name=my-api-key&scope[type]=account", ) @pytest.mark.anyio async def test_apps_secrets_delete_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/apps/secrets/delete", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.apps.secrets.delete_where_async( { "name": "my-api-key", "scope": {"type": "account"}, } ) http_client_mock.assert_requested( "post", path="/v1/apps/secrets/delete", query_string="", api_base="https://api.stripe.com", post_data="name=my-api-key&scope[type]=account", ) def test_apps_secrets_find_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.apps.Secret.find( name="sec_123", scope={"type": "account"}, ) http_client_mock.assert_requested( "get", path="/v1/apps/secrets/find", query_string="name=sec_123&scope[type]=account", ) def test_apps_secrets_find_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/apps/secrets/find", "name=sec_123&scope[type]=account", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.apps.secrets.find( { "name": "sec_123", "scope": {"type": "account"}, } ) http_client_mock.assert_requested( "get", path="/v1/apps/secrets/find", query_string="name=sec_123&scope[type]=account", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_apps_secrets_find_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.apps.Secret.find_async( name="sec_123", scope={"type": "account"}, ) http_client_mock.assert_requested( "get", path="/v1/apps/secrets/find", query_string="name=sec_123&scope[type]=account", ) @pytest.mark.anyio async def test_apps_secrets_find_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/apps/secrets/find", "name=sec_123&scope[type]=account", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.apps.secrets.find_async( { "name": "sec_123", "scope": {"type": "account"}, } ) http_client_mock.assert_requested( "get", path="/v1/apps/secrets/find", query_string="name=sec_123&scope[type]=account", api_base="https://api.stripe.com", ) def test_apps_secrets_get(self, http_client_mock: HTTPClientMock) -> None: stripe.apps.Secret.list( scope={"type": "account"}, limit=2, ) http_client_mock.assert_requested( "get", path="/v1/apps/secrets", query_string="scope[type]=account&limit=2", ) def test_apps_secrets_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/apps/secrets", "scope[type]=account&limit=2", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.apps.secrets.list({"scope": {"type": "account"}, "limit": 2}) http_client_mock.assert_requested( "get", path="/v1/apps/secrets", query_string="scope[type]=account&limit=2", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_apps_secrets_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.apps.Secret.list_async( scope={"type": "account"}, limit=2, ) http_client_mock.assert_requested( "get", path="/v1/apps/secrets", query_string="scope[type]=account&limit=2", ) @pytest.mark.anyio async def test_apps_secrets_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/apps/secrets", "scope[type]=account&limit=2", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.apps.secrets.list_async( { "scope": {"type": "account"}, "limit": 2, } ) http_client_mock.assert_requested( "get", path="/v1/apps/secrets", query_string="scope[type]=account&limit=2", api_base="https://api.stripe.com", ) def test_apps_secrets_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.apps.Secret.list( scope={"type": "account"}, limit=2, ) http_client_mock.assert_requested( "get", path="/v1/apps/secrets", query_string="scope[type]=account&limit=2", ) def test_apps_secrets_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/apps/secrets", "scope[type]=account&limit=2", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.apps.secrets.list({"scope": {"type": "account"}, "limit": 2}) http_client_mock.assert_requested( "get", path="/v1/apps/secrets", query_string="scope[type]=account&limit=2", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_apps_secrets_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.apps.Secret.list_async( scope={"type": "account"}, limit=2, ) http_client_mock.assert_requested( "get", path="/v1/apps/secrets", query_string="scope[type]=account&limit=2", ) @pytest.mark.anyio async def test_apps_secrets_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/apps/secrets", "scope[type]=account&limit=2", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.apps.secrets.list_async( { "scope": {"type": "account"}, "limit": 2, } ) http_client_mock.assert_requested( "get", path="/v1/apps/secrets", query_string="scope[type]=account&limit=2", api_base="https://api.stripe.com", ) def test_apps_secrets_post(self, http_client_mock: HTTPClientMock) -> None: stripe.apps.Secret.create( name="sec_123", payload="very secret string", scope={"type": "account"}, ) http_client_mock.assert_requested( "post", path="/v1/apps/secrets", query_string="", post_data="name=sec_123&payload=very%20secret%20string&scope[type]=account", ) def test_apps_secrets_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/apps/secrets", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.apps.secrets.create( { "name": "sec_123", "payload": "very secret string", "scope": {"type": "account"}, } ) http_client_mock.assert_requested( "post", path="/v1/apps/secrets", query_string="", api_base="https://api.stripe.com", post_data="name=sec_123&payload=very%20secret%20string&scope[type]=account", ) @pytest.mark.anyio async def test_apps_secrets_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.apps.Secret.create_async( name="sec_123", payload="very secret string", scope={"type": "account"}, ) http_client_mock.assert_requested( "post", path="/v1/apps/secrets", query_string="", post_data="name=sec_123&payload=very%20secret%20string&scope[type]=account", ) @pytest.mark.anyio async def test_apps_secrets_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/apps/secrets", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.apps.secrets.create_async( { "name": "sec_123", "payload": "very secret string", "scope": {"type": "account"}, } ) http_client_mock.assert_requested( "post", path="/v1/apps/secrets", query_string="", api_base="https://api.stripe.com", post_data="name=sec_123&payload=very%20secret%20string&scope[type]=account", ) def test_apps_secrets_post_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.apps.Secret.create( name="my-api-key", payload="secret_key_xxxxxx", scope={"type": "account"}, ) http_client_mock.assert_requested( "post", path="/v1/apps/secrets", query_string="", post_data="name=my-api-key&payload=secret_key_xxxxxx&scope[type]=account", ) def test_apps_secrets_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/apps/secrets", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.apps.secrets.create( { "name": "my-api-key", "payload": "secret_key_xxxxxx", "scope": {"type": "account"}, } ) http_client_mock.assert_requested( "post", path="/v1/apps/secrets", query_string="", api_base="https://api.stripe.com", post_data="name=my-api-key&payload=secret_key_xxxxxx&scope[type]=account", ) @pytest.mark.anyio async def test_apps_secrets_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.apps.Secret.create_async( name="my-api-key", payload="secret_key_xxxxxx", scope={"type": "account"}, ) http_client_mock.assert_requested( "post", path="/v1/apps/secrets", query_string="", post_data="name=my-api-key&payload=secret_key_xxxxxx&scope[type]=account", ) @pytest.mark.anyio async def test_apps_secrets_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/apps/secrets", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.apps.secrets.create_async( { "name": "my-api-key", "payload": "secret_key_xxxxxx", "scope": {"type": "account"}, } ) http_client_mock.assert_requested( "post", path="/v1/apps/secrets", query_string="", api_base="https://api.stripe.com", post_data="name=my-api-key&payload=secret_key_xxxxxx&scope[type]=account", ) def test_balance_transactions_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.BalanceTransaction.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/balance_transactions", query_string="limit=3", ) def test_balance_transactions_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/balance_transactions", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.balance_transactions.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/balance_transactions", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_balance_transactions_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.BalanceTransaction.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/balance_transactions", query_string="limit=3", ) @pytest.mark.anyio async def test_balance_transactions_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/balance_transactions", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.balance_transactions.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/balance_transactions", query_string="limit=3", api_base="https://api.stripe.com", ) def test_balance_transactions_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.BalanceTransaction.retrieve("txn_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/balance_transactions/txn_xxxxxxxxxxxxx", query_string="", ) def test_balance_transactions_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/balance_transactions/txn_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.balance_transactions.retrieve("txn_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/balance_transactions/txn_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_balance_transactions_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.BalanceTransaction.retrieve_async("txn_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/balance_transactions/txn_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_balance_transactions_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/balance_transactions/txn_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.balance_transactions.retrieve_async("txn_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/balance_transactions/txn_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_billing_portal_configurations_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.billing_portal.Configuration.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/billing_portal/configurations", query_string="limit=3", ) def test_billing_portal_configurations_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/billing_portal/configurations", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.billing_portal.configurations.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/billing_portal/configurations", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_billing_portal_configurations_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.billing_portal.Configuration.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/billing_portal/configurations", query_string="limit=3", ) @pytest.mark.anyio async def test_billing_portal_configurations_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/billing_portal/configurations", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.billing_portal.configurations.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/billing_portal/configurations", query_string="limit=3", api_base="https://api.stripe.com", ) def test_billing_portal_configurations_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.billing_portal.Configuration.retrieve("bpc_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/billing_portal/configurations/bpc_xxxxxxxxxxxxx", query_string="", ) def test_billing_portal_configurations_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/billing_portal/configurations/bpc_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.billing_portal.configurations.retrieve("bpc_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/billing_portal/configurations/bpc_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_billing_portal_configurations_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.billing_portal.Configuration.retrieve_async( "bpc_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/billing_portal/configurations/bpc_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_billing_portal_configurations_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/billing_portal/configurations/bpc_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.billing_portal.configurations.retrieve_async( "bpc_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/billing_portal/configurations/bpc_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_billing_portal_configurations_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.billing_portal.Configuration.create( features={ "customer_update": { "allowed_updates": ["email", "tax_id"], "enabled": True, }, "invoice_history": {"enabled": True}, }, business_profile={ "privacy_policy_url": "https://example.com/privacy", "terms_of_service_url": "https://example.com/terms", }, ) http_client_mock.assert_requested( "post", path="/v1/billing_portal/configurations", query_string="", post_data="features[customer_update][allowed_updates][0]=email&features[customer_update][allowed_updates][1]=tax_id&features[customer_update][enabled]=True&features[invoice_history][enabled]=True&business_profile[privacy_policy_url]=https%3A%2F%2Fexample.com%2Fprivacy&business_profile[terms_of_service_url]=https%3A%2F%2Fexample.com%2Fterms", ) def test_billing_portal_configurations_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/billing_portal/configurations", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.billing_portal.configurations.create( { "features": { "customer_update": { "allowed_updates": ["email", "tax_id"], "enabled": True, }, "invoice_history": {"enabled": True}, }, "business_profile": { "privacy_policy_url": "https://example.com/privacy", "terms_of_service_url": "https://example.com/terms", }, } ) http_client_mock.assert_requested( "post", path="/v1/billing_portal/configurations", query_string="", api_base="https://api.stripe.com", post_data="features[customer_update][allowed_updates][0]=email&features[customer_update][allowed_updates][1]=tax_id&features[customer_update][enabled]=True&features[invoice_history][enabled]=True&business_profile[privacy_policy_url]=https%3A%2F%2Fexample.com%2Fprivacy&business_profile[terms_of_service_url]=https%3A%2F%2Fexample.com%2Fterms", ) @pytest.mark.anyio async def test_billing_portal_configurations_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.billing_portal.Configuration.create_async( features={ "customer_update": { "allowed_updates": ["email", "tax_id"], "enabled": True, }, "invoice_history": {"enabled": True}, }, business_profile={ "privacy_policy_url": "https://example.com/privacy", "terms_of_service_url": "https://example.com/terms", }, ) http_client_mock.assert_requested( "post", path="/v1/billing_portal/configurations", query_string="", post_data="features[customer_update][allowed_updates][0]=email&features[customer_update][allowed_updates][1]=tax_id&features[customer_update][enabled]=True&features[invoice_history][enabled]=True&business_profile[privacy_policy_url]=https%3A%2F%2Fexample.com%2Fprivacy&business_profile[terms_of_service_url]=https%3A%2F%2Fexample.com%2Fterms", ) @pytest.mark.anyio async def test_billing_portal_configurations_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/billing_portal/configurations", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.billing_portal.configurations.create_async( { "features": { "customer_update": { "allowed_updates": ["email", "tax_id"], "enabled": True, }, "invoice_history": {"enabled": True}, }, "business_profile": { "privacy_policy_url": "https://example.com/privacy", "terms_of_service_url": "https://example.com/terms", }, } ) http_client_mock.assert_requested( "post", path="/v1/billing_portal/configurations", query_string="", api_base="https://api.stripe.com", post_data="features[customer_update][allowed_updates][0]=email&features[customer_update][allowed_updates][1]=tax_id&features[customer_update][enabled]=True&features[invoice_history][enabled]=True&business_profile[privacy_policy_url]=https%3A%2F%2Fexample.com%2Fprivacy&business_profile[terms_of_service_url]=https%3A%2F%2Fexample.com%2Fterms", ) def test_billing_portal_configurations_post_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.billing_portal.Configuration.modify( "bpc_xxxxxxxxxxxxx", business_profile={ "privacy_policy_url": "https://example.com/privacy", "terms_of_service_url": "https://example.com/terms", }, ) http_client_mock.assert_requested( "post", path="/v1/billing_portal/configurations/bpc_xxxxxxxxxxxxx", query_string="", post_data="business_profile[privacy_policy_url]=https%3A%2F%2Fexample.com%2Fprivacy&business_profile[terms_of_service_url]=https%3A%2F%2Fexample.com%2Fterms", ) def test_billing_portal_configurations_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/billing_portal/configurations/bpc_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.billing_portal.configurations.update( "bpc_xxxxxxxxxxxxx", { "business_profile": { "privacy_policy_url": "https://example.com/privacy", "terms_of_service_url": "https://example.com/terms", }, }, ) http_client_mock.assert_requested( "post", path="/v1/billing_portal/configurations/bpc_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="business_profile[privacy_policy_url]=https%3A%2F%2Fexample.com%2Fprivacy&business_profile[terms_of_service_url]=https%3A%2F%2Fexample.com%2Fterms", ) @pytest.mark.anyio async def test_billing_portal_configurations_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.billing_portal.Configuration.modify_async( "bpc_xxxxxxxxxxxxx", business_profile={ "privacy_policy_url": "https://example.com/privacy", "terms_of_service_url": "https://example.com/terms", }, ) http_client_mock.assert_requested( "post", path="/v1/billing_portal/configurations/bpc_xxxxxxxxxxxxx", query_string="", post_data="business_profile[privacy_policy_url]=https%3A%2F%2Fexample.com%2Fprivacy&business_profile[terms_of_service_url]=https%3A%2F%2Fexample.com%2Fterms", ) @pytest.mark.anyio async def test_billing_portal_configurations_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/billing_portal/configurations/bpc_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.billing_portal.configurations.update_async( "bpc_xxxxxxxxxxxxx", { "business_profile": { "privacy_policy_url": "https://example.com/privacy", "terms_of_service_url": "https://example.com/terms", }, }, ) http_client_mock.assert_requested( "post", path="/v1/billing_portal/configurations/bpc_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="business_profile[privacy_policy_url]=https%3A%2F%2Fexample.com%2Fprivacy&business_profile[terms_of_service_url]=https%3A%2F%2Fexample.com%2Fterms", ) def test_billing_portal_sessions_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.billing_portal.Session.create( customer="cus_xxxxxxxxxxxxx", return_url="https://example.com/account", ) http_client_mock.assert_requested( "post", path="/v1/billing_portal/sessions", query_string="", post_data="customer=cus_xxxxxxxxxxxxx&return_url=https%3A%2F%2Fexample.com%2Faccount", ) def test_billing_portal_sessions_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/billing_portal/sessions", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.billing_portal.sessions.create( { "customer": "cus_xxxxxxxxxxxxx", "return_url": "https://example.com/account", } ) http_client_mock.assert_requested( "post", path="/v1/billing_portal/sessions", query_string="", api_base="https://api.stripe.com", post_data="customer=cus_xxxxxxxxxxxxx&return_url=https%3A%2F%2Fexample.com%2Faccount", ) @pytest.mark.anyio async def test_billing_portal_sessions_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.billing_portal.Session.create_async( customer="cus_xxxxxxxxxxxxx", return_url="https://example.com/account", ) http_client_mock.assert_requested( "post", path="/v1/billing_portal/sessions", query_string="", post_data="customer=cus_xxxxxxxxxxxxx&return_url=https%3A%2F%2Fexample.com%2Faccount", ) @pytest.mark.anyio async def test_billing_portal_sessions_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/billing_portal/sessions", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.billing_portal.sessions.create_async( { "customer": "cus_xxxxxxxxxxxxx", "return_url": "https://example.com/account", } ) http_client_mock.assert_requested( "post", path="/v1/billing_portal/sessions", query_string="", api_base="https://api.stripe.com", post_data="customer=cus_xxxxxxxxxxxxx&return_url=https%3A%2F%2Fexample.com%2Faccount", ) def test_charges_capture_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.Charge.capture("ch_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/charges/ch_xxxxxxxxxxxxx/capture", query_string="", ) def test_charges_capture_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/charges/ch_xxxxxxxxxxxxx/capture", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.charges.capture("ch_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/charges/ch_xxxxxxxxxxxxx/capture", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_charges_capture_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Charge.capture_async("ch_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/charges/ch_xxxxxxxxxxxxx/capture", query_string="", ) @pytest.mark.anyio async def test_charges_capture_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/charges/ch_xxxxxxxxxxxxx/capture", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.charges.capture_async("ch_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/charges/ch_xxxxxxxxxxxxx/capture", query_string="", api_base="https://api.stripe.com", ) def test_charges_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Charge.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/charges", query_string="limit=3", ) def test_charges_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/charges", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.charges.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/charges", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_charges_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Charge.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/charges", query_string="limit=3", ) @pytest.mark.anyio async def test_charges_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/charges", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.charges.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/charges", query_string="limit=3", api_base="https://api.stripe.com", ) def test_charges_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Charge.retrieve("ch_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/charges/ch_xxxxxxxxxxxxx", query_string="", ) def test_charges_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/charges/ch_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.charges.retrieve("ch_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/charges/ch_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_charges_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Charge.retrieve_async("ch_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/charges/ch_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_charges_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/charges/ch_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.charges.retrieve_async("ch_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/charges/ch_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_charges_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Charge.create( amount=2000, currency="usd", source="tok_xxxx", description="My First Test Charge (created for API docs at https://www.stripe.com/docs/api)", ) http_client_mock.assert_requested( "post", path="/v1/charges", query_string="", post_data="amount=2000¤cy=usd&source=tok_xxxx&description=My%20First%20Test%20Charge%20%28created%20for%20API%20docs%20at%20https%3A%2F%2Fwww.stripe.com%2Fdocs%2Fapi%29", ) def test_charges_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/charges", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.charges.create( { "amount": 2000, "currency": "usd", "source": "tok_xxxx", "description": "My First Test Charge (created for API docs at https://www.stripe.com/docs/api)", } ) http_client_mock.assert_requested( "post", path="/v1/charges", query_string="", api_base="https://api.stripe.com", post_data="amount=2000¤cy=usd&source=tok_xxxx&description=My%20First%20Test%20Charge%20%28created%20for%20API%20docs%20at%20https%3A%2F%2Fwww.stripe.com%2Fdocs%2Fapi%29", ) @pytest.mark.anyio async def test_charges_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Charge.create_async( amount=2000, currency="usd", source="tok_xxxx", description="My First Test Charge (created for API docs at https://www.stripe.com/docs/api)", ) http_client_mock.assert_requested( "post", path="/v1/charges", query_string="", post_data="amount=2000¤cy=usd&source=tok_xxxx&description=My%20First%20Test%20Charge%20%28created%20for%20API%20docs%20at%20https%3A%2F%2Fwww.stripe.com%2Fdocs%2Fapi%29", ) @pytest.mark.anyio async def test_charges_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/charges", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.charges.create_async( { "amount": 2000, "currency": "usd", "source": "tok_xxxx", "description": "My First Test Charge (created for API docs at https://www.stripe.com/docs/api)", } ) http_client_mock.assert_requested( "post", path="/v1/charges", query_string="", api_base="https://api.stripe.com", post_data="amount=2000¤cy=usd&source=tok_xxxx&description=My%20First%20Test%20Charge%20%28created%20for%20API%20docs%20at%20https%3A%2F%2Fwww.stripe.com%2Fdocs%2Fapi%29", ) def test_charges_post_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Charge.modify( "ch_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/charges/ch_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) def test_charges_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/charges/ch_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.charges.update( "ch_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/charges/ch_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_charges_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Charge.modify_async( "ch_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/charges/ch_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_charges_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/charges/ch_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.charges.update_async( "ch_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/charges/ch_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) def test_charges_search_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.Charge.search( query="amount>999 AND metadata['order_id']:'6735'" ) http_client_mock.assert_requested( "get", path="/v1/charges/search", query_string="query=amount%3E999%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", ) def test_charges_search_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/charges/search", "query=amount%3E999%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.charges.search( { "query": "amount>999 AND metadata['order_id']:'6735'", } ) http_client_mock.assert_requested( "get", path="/v1/charges/search", query_string="query=amount%3E999%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_charges_search_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Charge.search_async( query="amount>999 AND metadata['order_id']:'6735'", ) http_client_mock.assert_requested( "get", path="/v1/charges/search", query_string="query=amount%3E999%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", ) @pytest.mark.anyio async def test_charges_search_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/charges/search", "query=amount%3E999%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.charges.search_async( { "query": "amount>999 AND metadata['order_id']:'6735'", } ) http_client_mock.assert_requested( "get", path="/v1/charges/search", query_string="query=amount%3E999%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", api_base="https://api.stripe.com", ) def test_checkout_sessions_expire_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.checkout.Session.expire("sess_xyz") http_client_mock.assert_requested( "post", path="/v1/checkout/sessions/sess_xyz/expire", query_string="", ) def test_checkout_sessions_expire_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/checkout/sessions/sess_xyz/expire", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.checkout.sessions.expire("sess_xyz") http_client_mock.assert_requested( "post", path="/v1/checkout/sessions/sess_xyz/expire", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_checkout_sessions_expire_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.checkout.Session.expire_async("sess_xyz") http_client_mock.assert_requested( "post", path="/v1/checkout/sessions/sess_xyz/expire", query_string="", ) @pytest.mark.anyio async def test_checkout_sessions_expire_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/checkout/sessions/sess_xyz/expire", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.checkout.sessions.expire_async("sess_xyz") http_client_mock.assert_requested( "post", path="/v1/checkout/sessions/sess_xyz/expire", query_string="", api_base="https://api.stripe.com", ) def test_checkout_sessions_expire_post_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.checkout.Session.expire("cs_test_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx/expire", query_string="", ) def test_checkout_sessions_expire_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx/expire", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.checkout.sessions.expire("cs_test_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx/expire", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_checkout_sessions_expire_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.checkout.Session.expire_async("cs_test_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx/expire", query_string="", ) @pytest.mark.anyio async def test_checkout_sessions_expire_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx/expire", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.checkout.sessions.expire_async("cs_test_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx/expire", query_string="", api_base="https://api.stripe.com", ) def test_checkout_sessions_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.checkout.Session.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/checkout/sessions", query_string="limit=3", ) def test_checkout_sessions_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/checkout/sessions", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.checkout.sessions.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/checkout/sessions", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_checkout_sessions_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.checkout.Session.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/checkout/sessions", query_string="limit=3", ) @pytest.mark.anyio async def test_checkout_sessions_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/checkout/sessions", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.checkout.sessions.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/checkout/sessions", query_string="limit=3", api_base="https://api.stripe.com", ) def test_checkout_sessions_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.checkout.Session.retrieve("cs_test_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx", query_string="", ) def test_checkout_sessions_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.checkout.sessions.retrieve("cs_test_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_checkout_sessions_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.checkout.Session.retrieve_async("cs_test_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_checkout_sessions_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.checkout.sessions.retrieve_async("cs_test_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/checkout/sessions/cs_test_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_checkout_sessions_line_items_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.checkout.Session.list_line_items("sess_xyz") http_client_mock.assert_requested( "get", path="/v1/checkout/sessions/sess_xyz/line_items", query_string="", ) def test_checkout_sessions_line_items_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/checkout/sessions/sess_xyz/line_items", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.checkout.sessions.line_items.list("sess_xyz") http_client_mock.assert_requested( "get", path="/v1/checkout/sessions/sess_xyz/line_items", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_checkout_sessions_line_items_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.checkout.Session.list_line_items_async("sess_xyz") http_client_mock.assert_requested( "get", path="/v1/checkout/sessions/sess_xyz/line_items", query_string="", ) @pytest.mark.anyio async def test_checkout_sessions_line_items_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/checkout/sessions/sess_xyz/line_items", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.checkout.sessions.line_items.list_async("sess_xyz") http_client_mock.assert_requested( "get", path="/v1/checkout/sessions/sess_xyz/line_items", query_string="", api_base="https://api.stripe.com", ) def test_checkout_sessions_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.checkout.Session.create( success_url="https://example.com/success", cancel_url="https://example.com/cancel", mode="payment", shipping_options=[ {"shipping_rate": "shr_standard"}, { "shipping_rate_data": { "display_name": "Standard", "delivery_estimate": { "minimum": {"unit": "day", "value": 5}, "maximum": {"unit": "day", "value": 7}, }, }, }, ], ) http_client_mock.assert_requested( "post", path="/v1/checkout/sessions", query_string="", post_data="success_url=https%3A%2F%2Fexample.com%2Fsuccess&cancel_url=https%3A%2F%2Fexample.com%2Fcancel&mode=payment&shipping_options[0][shipping_rate]=shr_standard&shipping_options[1][shipping_rate_data][display_name]=Standard&shipping_options[1][shipping_rate_data][delivery_estimate][minimum][unit]=day&shipping_options[1][shipping_rate_data][delivery_estimate][minimum][value]=5&shipping_options[1][shipping_rate_data][delivery_estimate][maximum][unit]=day&shipping_options[1][shipping_rate_data][delivery_estimate][maximum][value]=7", ) def test_checkout_sessions_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/checkout/sessions", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.checkout.sessions.create( { "success_url": "https://example.com/success", "cancel_url": "https://example.com/cancel", "mode": "payment", "shipping_options": [ {"shipping_rate": "shr_standard"}, { "shipping_rate_data": { "display_name": "Standard", "delivery_estimate": { "minimum": {"unit": "day", "value": 5}, "maximum": {"unit": "day", "value": 7}, }, }, }, ], } ) http_client_mock.assert_requested( "post", path="/v1/checkout/sessions", query_string="", api_base="https://api.stripe.com", post_data="success_url=https%3A%2F%2Fexample.com%2Fsuccess&cancel_url=https%3A%2F%2Fexample.com%2Fcancel&mode=payment&shipping_options[0][shipping_rate]=shr_standard&shipping_options[1][shipping_rate_data][display_name]=Standard&shipping_options[1][shipping_rate_data][delivery_estimate][minimum][unit]=day&shipping_options[1][shipping_rate_data][delivery_estimate][minimum][value]=5&shipping_options[1][shipping_rate_data][delivery_estimate][maximum][unit]=day&shipping_options[1][shipping_rate_data][delivery_estimate][maximum][value]=7", ) @pytest.mark.anyio async def test_checkout_sessions_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.checkout.Session.create_async( success_url="https://example.com/success", cancel_url="https://example.com/cancel", mode="payment", shipping_options=[ {"shipping_rate": "shr_standard"}, { "shipping_rate_data": { "display_name": "Standard", "delivery_estimate": { "minimum": {"unit": "day", "value": 5}, "maximum": {"unit": "day", "value": 7}, }, }, }, ], ) http_client_mock.assert_requested( "post", path="/v1/checkout/sessions", query_string="", post_data="success_url=https%3A%2F%2Fexample.com%2Fsuccess&cancel_url=https%3A%2F%2Fexample.com%2Fcancel&mode=payment&shipping_options[0][shipping_rate]=shr_standard&shipping_options[1][shipping_rate_data][display_name]=Standard&shipping_options[1][shipping_rate_data][delivery_estimate][minimum][unit]=day&shipping_options[1][shipping_rate_data][delivery_estimate][minimum][value]=5&shipping_options[1][shipping_rate_data][delivery_estimate][maximum][unit]=day&shipping_options[1][shipping_rate_data][delivery_estimate][maximum][value]=7", ) @pytest.mark.anyio async def test_checkout_sessions_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/checkout/sessions", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.checkout.sessions.create_async( { "success_url": "https://example.com/success", "cancel_url": "https://example.com/cancel", "mode": "payment", "shipping_options": [ {"shipping_rate": "shr_standard"}, { "shipping_rate_data": { "display_name": "Standard", "delivery_estimate": { "minimum": {"unit": "day", "value": 5}, "maximum": {"unit": "day", "value": 7}, }, }, }, ], } ) http_client_mock.assert_requested( "post", path="/v1/checkout/sessions", query_string="", api_base="https://api.stripe.com", post_data="success_url=https%3A%2F%2Fexample.com%2Fsuccess&cancel_url=https%3A%2F%2Fexample.com%2Fcancel&mode=payment&shipping_options[0][shipping_rate]=shr_standard&shipping_options[1][shipping_rate_data][display_name]=Standard&shipping_options[1][shipping_rate_data][delivery_estimate][minimum][unit]=day&shipping_options[1][shipping_rate_data][delivery_estimate][minimum][value]=5&shipping_options[1][shipping_rate_data][delivery_estimate][maximum][unit]=day&shipping_options[1][shipping_rate_data][delivery_estimate][maximum][value]=7", ) def test_checkout_sessions_post_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.checkout.Session.create( success_url="https://example.com/success", line_items=[{"price": "price_xxxxxxxxxxxxx", "quantity": 2}], mode="payment", ) http_client_mock.assert_requested( "post", path="/v1/checkout/sessions", query_string="", post_data="success_url=https%3A%2F%2Fexample.com%2Fsuccess&line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=2&mode=payment", ) def test_checkout_sessions_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/checkout/sessions", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.checkout.sessions.create( { "success_url": "https://example.com/success", "line_items": [ {"price": "price_xxxxxxxxxxxxx", "quantity": 2} ], "mode": "payment", } ) http_client_mock.assert_requested( "post", path="/v1/checkout/sessions", query_string="", api_base="https://api.stripe.com", post_data="success_url=https%3A%2F%2Fexample.com%2Fsuccess&line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=2&mode=payment", ) @pytest.mark.anyio async def test_checkout_sessions_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.checkout.Session.create_async( success_url="https://example.com/success", line_items=[{"price": "price_xxxxxxxxxxxxx", "quantity": 2}], mode="payment", ) http_client_mock.assert_requested( "post", path="/v1/checkout/sessions", query_string="", post_data="success_url=https%3A%2F%2Fexample.com%2Fsuccess&line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=2&mode=payment", ) @pytest.mark.anyio async def test_checkout_sessions_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/checkout/sessions", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.checkout.sessions.create_async( { "success_url": "https://example.com/success", "line_items": [ {"price": "price_xxxxxxxxxxxxx", "quantity": 2} ], "mode": "payment", } ) http_client_mock.assert_requested( "post", path="/v1/checkout/sessions", query_string="", api_base="https://api.stripe.com", post_data="success_url=https%3A%2F%2Fexample.com%2Fsuccess&line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=2&mode=payment", ) def test_country_specs_get(self, http_client_mock: HTTPClientMock) -> None: stripe.CountrySpec.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/country_specs", query_string="limit=3", ) def test_country_specs_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/country_specs", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.country_specs.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/country_specs", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_country_specs_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.CountrySpec.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/country_specs", query_string="limit=3", ) @pytest.mark.anyio async def test_country_specs_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/country_specs", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.country_specs.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/country_specs", query_string="limit=3", api_base="https://api.stripe.com", ) def test_country_specs_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.CountrySpec.retrieve("US") http_client_mock.assert_requested( "get", path="/v1/country_specs/US", query_string="", ) def test_country_specs_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/country_specs/US", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.country_specs.retrieve("US") http_client_mock.assert_requested( "get", path="/v1/country_specs/US", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_country_specs_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.CountrySpec.retrieve_async("US") http_client_mock.assert_requested( "get", path="/v1/country_specs/US", query_string="", ) @pytest.mark.anyio async def test_country_specs_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/country_specs/US", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.country_specs.retrieve_async("US") http_client_mock.assert_requested( "get", path="/v1/country_specs/US", query_string="", api_base="https://api.stripe.com", ) def test_coupons_delete(self, http_client_mock: HTTPClientMock) -> None: stripe.Coupon.delete("Z4OV52SU") http_client_mock.assert_requested( "delete", path="/v1/coupons/Z4OV52SU", query_string="", ) def test_coupons_delete_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/coupons/Z4OV52SU", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.coupons.delete("Z4OV52SU") http_client_mock.assert_requested( "delete", path="/v1/coupons/Z4OV52SU", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_coupons_delete_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Coupon.delete_async("Z4OV52SU") http_client_mock.assert_requested( "delete", path="/v1/coupons/Z4OV52SU", query_string="", ) @pytest.mark.anyio async def test_coupons_delete_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/coupons/Z4OV52SU", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.coupons.delete_async("Z4OV52SU") http_client_mock.assert_requested( "delete", path="/v1/coupons/Z4OV52SU", query_string="", api_base="https://api.stripe.com", ) def test_coupons_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Coupon.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/coupons", query_string="limit=3", ) def test_coupons_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/coupons", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.coupons.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/coupons", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_coupons_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Coupon.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/coupons", query_string="limit=3", ) @pytest.mark.anyio async def test_coupons_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/coupons", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.coupons.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/coupons", query_string="limit=3", api_base="https://api.stripe.com", ) def test_coupons_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Coupon.retrieve("Z4OV52SU") http_client_mock.assert_requested( "get", path="/v1/coupons/Z4OV52SU", query_string="", ) def test_coupons_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/coupons/Z4OV52SU", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.coupons.retrieve("Z4OV52SU") http_client_mock.assert_requested( "get", path="/v1/coupons/Z4OV52SU", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_coupons_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Coupon.retrieve_async("Z4OV52SU") http_client_mock.assert_requested( "get", path="/v1/coupons/Z4OV52SU", query_string="", ) @pytest.mark.anyio async def test_coupons_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/coupons/Z4OV52SU", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.coupons.retrieve_async("Z4OV52SU") http_client_mock.assert_requested( "get", path="/v1/coupons/Z4OV52SU", query_string="", api_base="https://api.stripe.com", ) def test_coupons_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Coupon.create( percent_off=25.5, duration="repeating", duration_in_months=3, ) http_client_mock.assert_requested( "post", path="/v1/coupons", query_string="", post_data="percent_off=25.5&duration=repeating&duration_in_months=3", ) def test_coupons_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/coupons", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.coupons.create( { "percent_off": 25.5, "duration": "repeating", "duration_in_months": 3, } ) http_client_mock.assert_requested( "post", path="/v1/coupons", query_string="", api_base="https://api.stripe.com", post_data="percent_off=25.5&duration=repeating&duration_in_months=3", ) @pytest.mark.anyio async def test_coupons_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Coupon.create_async( percent_off=25.5, duration="repeating", duration_in_months=3, ) http_client_mock.assert_requested( "post", path="/v1/coupons", query_string="", post_data="percent_off=25.5&duration=repeating&duration_in_months=3", ) @pytest.mark.anyio async def test_coupons_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/coupons", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.coupons.create_async( { "percent_off": 25.5, "duration": "repeating", "duration_in_months": 3, } ) http_client_mock.assert_requested( "post", path="/v1/coupons", query_string="", api_base="https://api.stripe.com", post_data="percent_off=25.5&duration=repeating&duration_in_months=3", ) def test_coupons_post_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Coupon.modify( "Z4OV52SU", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/coupons/Z4OV52SU", query_string="", post_data="metadata[order_id]=6735", ) def test_coupons_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/coupons/Z4OV52SU", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.coupons.update( "Z4OV52SU", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/coupons/Z4OV52SU", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_coupons_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Coupon.modify_async( "Z4OV52SU", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/coupons/Z4OV52SU", query_string="", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_coupons_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/coupons/Z4OV52SU", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.coupons.update_async( "Z4OV52SU", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/coupons/Z4OV52SU", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) def test_credit_notes_get(self, http_client_mock: HTTPClientMock) -> None: stripe.CreditNote.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/credit_notes", query_string="limit=3", ) def test_credit_notes_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/credit_notes", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.credit_notes.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/credit_notes", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_credit_notes_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.CreditNote.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/credit_notes", query_string="limit=3", ) @pytest.mark.anyio async def test_credit_notes_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/credit_notes", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.credit_notes.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/credit_notes", query_string="limit=3", api_base="https://api.stripe.com", ) def test_credit_notes_lines_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.CreditNote.list_lines( "cn_xxxxxxxxxxxxx", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/credit_notes/cn_xxxxxxxxxxxxx/lines", query_string="limit=3", ) def test_credit_notes_lines_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/credit_notes/cn_xxxxxxxxxxxxx/lines", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.credit_notes.line_items.list( "cn_xxxxxxxxxxxxx", {"limit": 3}, ) http_client_mock.assert_requested( "get", path="/v1/credit_notes/cn_xxxxxxxxxxxxx/lines", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_credit_notes_lines_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.CreditNote.list_lines_async( "cn_xxxxxxxxxxxxx", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/credit_notes/cn_xxxxxxxxxxxxx/lines", query_string="limit=3", ) @pytest.mark.anyio async def test_credit_notes_lines_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/credit_notes/cn_xxxxxxxxxxxxx/lines", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.credit_notes.line_items.list_async( "cn_xxxxxxxxxxxxx", {"limit": 3}, ) http_client_mock.assert_requested( "get", path="/v1/credit_notes/cn_xxxxxxxxxxxxx/lines", query_string="limit=3", api_base="https://api.stripe.com", ) def test_credit_notes_post(self, http_client_mock: HTTPClientMock) -> None: stripe.CreditNote.create( invoice="in_xxxxxxxxxxxxx", lines=[ { "type": "invoice_line_item", "invoice_line_item": "il_xxxxxxxxxxxxx", "quantity": 1, }, ], ) http_client_mock.assert_requested( "post", path="/v1/credit_notes", query_string="", post_data="invoice=in_xxxxxxxxxxxxx&lines[0][type]=invoice_line_item&lines[0][invoice_line_item]=il_xxxxxxxxxxxxx&lines[0][quantity]=1", ) def test_credit_notes_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/credit_notes", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.credit_notes.create( { "invoice": "in_xxxxxxxxxxxxx", "lines": [ { "type": "invoice_line_item", "invoice_line_item": "il_xxxxxxxxxxxxx", "quantity": 1, }, ], } ) http_client_mock.assert_requested( "post", path="/v1/credit_notes", query_string="", api_base="https://api.stripe.com", post_data="invoice=in_xxxxxxxxxxxxx&lines[0][type]=invoice_line_item&lines[0][invoice_line_item]=il_xxxxxxxxxxxxx&lines[0][quantity]=1", ) @pytest.mark.anyio async def test_credit_notes_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.CreditNote.create_async( invoice="in_xxxxxxxxxxxxx", lines=[ { "type": "invoice_line_item", "invoice_line_item": "il_xxxxxxxxxxxxx", "quantity": 1, }, ], ) http_client_mock.assert_requested( "post", path="/v1/credit_notes", query_string="", post_data="invoice=in_xxxxxxxxxxxxx&lines[0][type]=invoice_line_item&lines[0][invoice_line_item]=il_xxxxxxxxxxxxx&lines[0][quantity]=1", ) @pytest.mark.anyio async def test_credit_notes_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/credit_notes", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.credit_notes.create_async( { "invoice": "in_xxxxxxxxxxxxx", "lines": [ { "type": "invoice_line_item", "invoice_line_item": "il_xxxxxxxxxxxxx", "quantity": 1, }, ], } ) http_client_mock.assert_requested( "post", path="/v1/credit_notes", query_string="", api_base="https://api.stripe.com", post_data="invoice=in_xxxxxxxxxxxxx&lines[0][type]=invoice_line_item&lines[0][invoice_line_item]=il_xxxxxxxxxxxxx&lines[0][quantity]=1", ) def test_credit_notes_preview_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.CreditNote.preview( invoice="in_xxxxxxxxxxxxx", lines=[ { "type": "invoice_line_item", "invoice_line_item": "il_xxxxxxxxxxxxx", "quantity": 1, }, ], ) http_client_mock.assert_requested( "get", path="/v1/credit_notes/preview", query_string="invoice=in_xxxxxxxxxxxxx&lines[0][type]=invoice_line_item&lines[0][invoice_line_item]=il_xxxxxxxxxxxxx&lines[0][quantity]=1", ) def test_credit_notes_preview_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/credit_notes/preview", "invoice=in_xxxxxxxxxxxxx&lines[0][type]=invoice_line_item&lines[0][invoice_line_item]=il_xxxxxxxxxxxxx&lines[0][quantity]=1", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.credit_notes.preview( { "invoice": "in_xxxxxxxxxxxxx", "lines": [ { "type": "invoice_line_item", "invoice_line_item": "il_xxxxxxxxxxxxx", "quantity": 1, }, ], } ) http_client_mock.assert_requested( "get", path="/v1/credit_notes/preview", query_string="invoice=in_xxxxxxxxxxxxx&lines[0][type]=invoice_line_item&lines[0][invoice_line_item]=il_xxxxxxxxxxxxx&lines[0][quantity]=1", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_credit_notes_preview_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.CreditNote.preview_async( invoice="in_xxxxxxxxxxxxx", lines=[ { "type": "invoice_line_item", "invoice_line_item": "il_xxxxxxxxxxxxx", "quantity": 1, }, ], ) http_client_mock.assert_requested( "get", path="/v1/credit_notes/preview", query_string="invoice=in_xxxxxxxxxxxxx&lines[0][type]=invoice_line_item&lines[0][invoice_line_item]=il_xxxxxxxxxxxxx&lines[0][quantity]=1", ) @pytest.mark.anyio async def test_credit_notes_preview_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/credit_notes/preview", "invoice=in_xxxxxxxxxxxxx&lines[0][type]=invoice_line_item&lines[0][invoice_line_item]=il_xxxxxxxxxxxxx&lines[0][quantity]=1", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.credit_notes.preview_async( { "invoice": "in_xxxxxxxxxxxxx", "lines": [ { "type": "invoice_line_item", "invoice_line_item": "il_xxxxxxxxxxxxx", "quantity": 1, }, ], } ) http_client_mock.assert_requested( "get", path="/v1/credit_notes/preview", query_string="invoice=in_xxxxxxxxxxxxx&lines[0][type]=invoice_line_item&lines[0][invoice_line_item]=il_xxxxxxxxxxxxx&lines[0][quantity]=1", api_base="https://api.stripe.com", ) def test_credit_notes_preview_lines_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.CreditNote.preview_lines( limit=3, invoice="in_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/credit_notes/preview/lines", query_string="limit=3&invoice=in_xxxxxxxxxxxxx", ) def test_credit_notes_preview_lines_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/credit_notes/preview/lines", "limit=3&invoice=in_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.credit_notes.preview_lines.list( { "limit": 3, "invoice": "in_xxxxxxxxxxxxx", } ) http_client_mock.assert_requested( "get", path="/v1/credit_notes/preview/lines", query_string="limit=3&invoice=in_xxxxxxxxxxxxx", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_credit_notes_preview_lines_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.CreditNote.preview_lines_async( limit=3, invoice="in_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/credit_notes/preview/lines", query_string="limit=3&invoice=in_xxxxxxxxxxxxx", ) @pytest.mark.anyio async def test_credit_notes_preview_lines_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/credit_notes/preview/lines", "limit=3&invoice=in_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.credit_notes.preview_lines.list_async( { "limit": 3, "invoice": "in_xxxxxxxxxxxxx", } ) http_client_mock.assert_requested( "get", path="/v1/credit_notes/preview/lines", query_string="limit=3&invoice=in_xxxxxxxxxxxxx", api_base="https://api.stripe.com", ) def test_credit_notes_void_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.CreditNote.void_credit_note("cn_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/credit_notes/cn_xxxxxxxxxxxxx/void", query_string="", ) def test_credit_notes_void_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/credit_notes/cn_xxxxxxxxxxxxx/void", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.credit_notes.void_credit_note("cn_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/credit_notes/cn_xxxxxxxxxxxxx/void", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_credit_notes_void_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.CreditNote.void_credit_note_async("cn_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/credit_notes/cn_xxxxxxxxxxxxx/void", query_string="", ) @pytest.mark.anyio async def test_credit_notes_void_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/credit_notes/cn_xxxxxxxxxxxxx/void", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.credit_notes.void_credit_note_async("cn_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/credit_notes/cn_xxxxxxxxxxxxx/void", query_string="", api_base="https://api.stripe.com", ) def test_customer_sessions_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.CustomerSession.create( customer="cus_123", components={"buy_button": {"enabled": True}}, ) http_client_mock.assert_requested( "post", path="/v1/customer_sessions", query_string="", post_data="customer=cus_123&components[buy_button][enabled]=True", ) def test_customer_sessions_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/customer_sessions", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.customer_sessions.create( { "customer": "cus_123", "components": {"buy_button": {"enabled": True}}, } ) http_client_mock.assert_requested( "post", path="/v1/customer_sessions", query_string="", api_base="https://api.stripe.com", post_data="customer=cus_123&components[buy_button][enabled]=True", ) @pytest.mark.anyio async def test_customer_sessions_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.CustomerSession.create_async( customer="cus_123", components={"buy_button": {"enabled": True}}, ) http_client_mock.assert_requested( "post", path="/v1/customer_sessions", query_string="", post_data="customer=cus_123&components[buy_button][enabled]=True", ) @pytest.mark.anyio async def test_customer_sessions_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/customer_sessions", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.customer_sessions.create_async( { "customer": "cus_123", "components": {"buy_button": {"enabled": True}}, } ) http_client_mock.assert_requested( "post", path="/v1/customer_sessions", query_string="", api_base="https://api.stripe.com", post_data="customer=cus_123&components[buy_button][enabled]=True", ) def test_customers_balance_transactions_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.Customer.list_balance_transactions( "cus_xxxxxxxxxxxxx", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions", query_string="limit=3", ) def test_customers_balance_transactions_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.customers.balance_transactions.list( "cus_xxxxxxxxxxxxx", {"limit": 3}, ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_customers_balance_transactions_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Customer.list_balance_transactions_async( "cus_xxxxxxxxxxxxx", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions", query_string="limit=3", ) @pytest.mark.anyio async def test_customers_balance_transactions_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.customers.balance_transactions.list_async( "cus_xxxxxxxxxxxxx", {"limit": 3}, ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions", query_string="limit=3", api_base="https://api.stripe.com", ) def test_customers_balance_transactions_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.Customer.retrieve_balance_transaction( "cus_xxxxxxxxxxxxx", "cbtxn_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions/cbtxn_xxxxxxxxxxxxx", query_string="", ) def test_customers_balance_transactions_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions/cbtxn_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.customers.balance_transactions.retrieve( "cus_xxxxxxxxxxxxx", "cbtxn_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions/cbtxn_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_customers_balance_transactions_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Customer.retrieve_balance_transaction_async( "cus_xxxxxxxxxxxxx", "cbtxn_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions/cbtxn_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_customers_balance_transactions_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions/cbtxn_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.customers.balance_transactions.retrieve_async( "cus_xxxxxxxxxxxxx", "cbtxn_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions/cbtxn_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_customers_balance_transactions_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.Customer.create_balance_transaction( "cus_xxxxxxxxxxxxx", amount=-500, currency="usd", ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions", query_string="", post_data="amount=-500¤cy=usd", ) def test_customers_balance_transactions_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.customers.balance_transactions.create( "cus_xxxxxxxxxxxxx", {"amount": -500, "currency": "usd"}, ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions", query_string="", api_base="https://api.stripe.com", post_data="amount=-500¤cy=usd", ) @pytest.mark.anyio async def test_customers_balance_transactions_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Customer.create_balance_transaction_async( "cus_xxxxxxxxxxxxx", amount=-500, currency="usd", ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions", query_string="", post_data="amount=-500¤cy=usd", ) @pytest.mark.anyio async def test_customers_balance_transactions_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.customers.balance_transactions.create_async( "cus_xxxxxxxxxxxxx", {"amount": -500, "currency": "usd"}, ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions", query_string="", api_base="https://api.stripe.com", post_data="amount=-500¤cy=usd", ) def test_customers_balance_transactions_post_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.Customer.modify_balance_transaction( "cus_xxxxxxxxxxxxx", "cbtxn_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions/cbtxn_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) def test_customers_balance_transactions_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions/cbtxn_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.customers.balance_transactions.update( "cus_xxxxxxxxxxxxx", "cbtxn_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions/cbtxn_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_customers_balance_transactions_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Customer.modify_balance_transaction_async( "cus_xxxxxxxxxxxxx", "cbtxn_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions/cbtxn_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_customers_balance_transactions_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions/cbtxn_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.customers.balance_transactions.update_async( "cus_xxxxxxxxxxxxx", "cbtxn_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_xxxxxxxxxxxxx/balance_transactions/cbtxn_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) def test_customers_cash_balance_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.Customer.retrieve_cash_balance("cus_123") http_client_mock.assert_requested( "get", path="/v1/customers/cus_123/cash_balance", query_string="", ) def test_customers_cash_balance_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/customers/cus_123/cash_balance", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.customers.cash_balance.retrieve("cus_123") http_client_mock.assert_requested( "get", path="/v1/customers/cus_123/cash_balance", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_customers_cash_balance_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Customer.retrieve_cash_balance_async("cus_123") http_client_mock.assert_requested( "get", path="/v1/customers/cus_123/cash_balance", query_string="", ) @pytest.mark.anyio async def test_customers_cash_balance_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/customers/cus_123/cash_balance", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.customers.cash_balance.retrieve_async("cus_123") http_client_mock.assert_requested( "get", path="/v1/customers/cus_123/cash_balance", query_string="", api_base="https://api.stripe.com", ) def test_customers_cash_balance_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.Customer.modify_cash_balance( "cus_123", settings={"reconciliation_mode": "manual"}, ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_123/cash_balance", query_string="", post_data="settings[reconciliation_mode]=manual", ) def test_customers_cash_balance_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/customers/cus_123/cash_balance", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.customers.cash_balance.update( "cus_123", {"settings": {"reconciliation_mode": "manual"}}, ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_123/cash_balance", query_string="", api_base="https://api.stripe.com", post_data="settings[reconciliation_mode]=manual", ) @pytest.mark.anyio async def test_customers_cash_balance_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Customer.modify_cash_balance_async( "cus_123", settings={"reconciliation_mode": "manual"}, ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_123/cash_balance", query_string="", post_data="settings[reconciliation_mode]=manual", ) @pytest.mark.anyio async def test_customers_cash_balance_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/customers/cus_123/cash_balance", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.customers.cash_balance.update_async( "cus_123", {"settings": {"reconciliation_mode": "manual"}}, ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_123/cash_balance", query_string="", api_base="https://api.stripe.com", post_data="settings[reconciliation_mode]=manual", ) def test_customers_cash_balance_transactions_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.Customer.list_cash_balance_transactions( "cus_123", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_123/cash_balance_transactions", query_string="limit=3", ) def test_customers_cash_balance_transactions_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/customers/cus_123/cash_balance_transactions", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.customers.cash_balance_transactions.list( "cus_123", {"limit": 3}, ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_123/cash_balance_transactions", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_customers_cash_balance_transactions_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Customer.list_cash_balance_transactions_async( "cus_123", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_123/cash_balance_transactions", query_string="limit=3", ) @pytest.mark.anyio async def test_customers_cash_balance_transactions_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/customers/cus_123/cash_balance_transactions", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.customers.cash_balance_transactions.list_async( "cus_123", {"limit": 3}, ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_123/cash_balance_transactions", query_string="limit=3", api_base="https://api.stripe.com", ) def test_customers_delete(self, http_client_mock: HTTPClientMock) -> None: stripe.Customer.delete("cus_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/customers/cus_xxxxxxxxxxxxx", query_string="", ) def test_customers_delete_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/customers/cus_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.customers.delete("cus_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/customers/cus_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_customers_delete_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Customer.delete_async("cus_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/customers/cus_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_customers_delete_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/customers/cus_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.customers.delete_async("cus_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/customers/cus_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_customers_funding_instructions_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.Customer.create_funding_instructions( "cus_123", bank_transfer={ "requested_address_types": ["zengin"], "type": "jp_bank_transfer", }, currency="usd", funding_type="bank_transfer", ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_123/funding_instructions", query_string="", post_data="bank_transfer[requested_address_types][0]=zengin&bank_transfer[type]=jp_bank_transfer¤cy=usd&funding_type=bank_transfer", ) def test_customers_funding_instructions_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/customers/cus_123/funding_instructions", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.customers.funding_instructions.create( "cus_123", { "bank_transfer": { "requested_address_types": ["zengin"], "type": "jp_bank_transfer", }, "currency": "usd", "funding_type": "bank_transfer", }, ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_123/funding_instructions", query_string="", api_base="https://api.stripe.com", post_data="bank_transfer[requested_address_types][0]=zengin&bank_transfer[type]=jp_bank_transfer¤cy=usd&funding_type=bank_transfer", ) @pytest.mark.anyio async def test_customers_funding_instructions_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Customer.create_funding_instructions_async( "cus_123", bank_transfer={ "requested_address_types": ["zengin"], "type": "jp_bank_transfer", }, currency="usd", funding_type="bank_transfer", ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_123/funding_instructions", query_string="", post_data="bank_transfer[requested_address_types][0]=zengin&bank_transfer[type]=jp_bank_transfer¤cy=usd&funding_type=bank_transfer", ) @pytest.mark.anyio async def test_customers_funding_instructions_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/customers/cus_123/funding_instructions", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.customers.funding_instructions.create_async( "cus_123", { "bank_transfer": { "requested_address_types": ["zengin"], "type": "jp_bank_transfer", }, "currency": "usd", "funding_type": "bank_transfer", }, ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_123/funding_instructions", query_string="", api_base="https://api.stripe.com", post_data="bank_transfer[requested_address_types][0]=zengin&bank_transfer[type]=jp_bank_transfer¤cy=usd&funding_type=bank_transfer", ) def test_customers_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Customer.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/customers", query_string="limit=3", ) def test_customers_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/customers", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.customers.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/customers", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_customers_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Customer.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/customers", query_string="limit=3", ) @pytest.mark.anyio async def test_customers_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/customers", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.customers.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/customers", query_string="limit=3", api_base="https://api.stripe.com", ) def test_customers_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Customer.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/customers", query_string="limit=3", ) def test_customers_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/customers", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.customers.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/customers", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_customers_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Customer.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/customers", query_string="limit=3", ) @pytest.mark.anyio async def test_customers_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/customers", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.customers.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/customers", query_string="limit=3", api_base="https://api.stripe.com", ) def test_customers_get_3(self, http_client_mock: HTTPClientMock) -> None: stripe.Customer.retrieve("cus_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx", query_string="", ) def test_customers_get_3_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/customers/cus_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.customers.retrieve("cus_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_customers_get_3_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Customer.retrieve_async("cus_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_customers_get_3_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/customers/cus_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.customers.retrieve_async("cus_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_customers_payment_methods_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.Customer.list_payment_methods( "cus_xyz", type="card", ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_xyz/payment_methods", query_string="type=card", ) def test_customers_payment_methods_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/customers/cus_xyz/payment_methods", "type=card", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.customers.payment_methods.list( "cus_xyz", {"type": "card"}, ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_xyz/payment_methods", query_string="type=card", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_customers_payment_methods_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Customer.list_payment_methods_async( "cus_xyz", type="card", ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_xyz/payment_methods", query_string="type=card", ) @pytest.mark.anyio async def test_customers_payment_methods_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/customers/cus_xyz/payment_methods", "type=card", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.customers.payment_methods.list_async( "cus_xyz", {"type": "card"}, ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_xyz/payment_methods", query_string="type=card", api_base="https://api.stripe.com", ) def test_customers_payment_methods_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.Customer.list_payment_methods( "cus_xxxxxxxxxxxxx", type="card", ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx/payment_methods", query_string="type=card", ) def test_customers_payment_methods_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/customers/cus_xxxxxxxxxxxxx/payment_methods", "type=card", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.customers.payment_methods.list( "cus_xxxxxxxxxxxxx", {"type": "card"}, ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx/payment_methods", query_string="type=card", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_customers_payment_methods_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Customer.list_payment_methods_async( "cus_xxxxxxxxxxxxx", type="card", ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx/payment_methods", query_string="type=card", ) @pytest.mark.anyio async def test_customers_payment_methods_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/customers/cus_xxxxxxxxxxxxx/payment_methods", "type=card", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.customers.payment_methods.list_async( "cus_xxxxxxxxxxxxx", {"type": "card"}, ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx/payment_methods", query_string="type=card", api_base="https://api.stripe.com", ) def test_customers_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Customer.create( description="My First Test Customer (created for API docs at https://www.stripe.com/docs/api)", ) http_client_mock.assert_requested( "post", path="/v1/customers", query_string="", post_data="description=My%20First%20Test%20Customer%20%28created%20for%20API%20docs%20at%20https%3A%2F%2Fwww.stripe.com%2Fdocs%2Fapi%29", ) def test_customers_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/customers", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.customers.create( { "description": "My First Test Customer (created for API docs at https://www.stripe.com/docs/api)", } ) http_client_mock.assert_requested( "post", path="/v1/customers", query_string="", api_base="https://api.stripe.com", post_data="description=My%20First%20Test%20Customer%20%28created%20for%20API%20docs%20at%20https%3A%2F%2Fwww.stripe.com%2Fdocs%2Fapi%29", ) @pytest.mark.anyio async def test_customers_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Customer.create_async( description="My First Test Customer (created for API docs at https://www.stripe.com/docs/api)", ) http_client_mock.assert_requested( "post", path="/v1/customers", query_string="", post_data="description=My%20First%20Test%20Customer%20%28created%20for%20API%20docs%20at%20https%3A%2F%2Fwww.stripe.com%2Fdocs%2Fapi%29", ) @pytest.mark.anyio async def test_customers_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/customers", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.customers.create_async( { "description": "My First Test Customer (created for API docs at https://www.stripe.com/docs/api)", } ) http_client_mock.assert_requested( "post", path="/v1/customers", query_string="", api_base="https://api.stripe.com", post_data="description=My%20First%20Test%20Customer%20%28created%20for%20API%20docs%20at%20https%3A%2F%2Fwww.stripe.com%2Fdocs%2Fapi%29", ) def test_customers_post_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Customer.modify( "cus_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) def test_customers_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/customers/cus_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.customers.update( "cus_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_customers_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Customer.modify_async( "cus_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_customers_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/customers/cus_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.customers.update_async( "cus_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) def test_customers_search_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.Customer.search( query="name:'fakename' AND metadata['foo']:'bar'", ) http_client_mock.assert_requested( "get", path="/v1/customers/search", query_string="query=name%3A%27fakename%27%20AND%20metadata%5B%27foo%27%5D%3A%27bar%27", ) def test_customers_search_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/customers/search", "query=name%3A%27fakename%27%20AND%20metadata%5B%27foo%27%5D%3A%27bar%27", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.customers.search( { "query": "name:'fakename' AND metadata['foo']:'bar'", } ) http_client_mock.assert_requested( "get", path="/v1/customers/search", query_string="query=name%3A%27fakename%27%20AND%20metadata%5B%27foo%27%5D%3A%27bar%27", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_customers_search_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Customer.search_async( query="name:'fakename' AND metadata['foo']:'bar'", ) http_client_mock.assert_requested( "get", path="/v1/customers/search", query_string="query=name%3A%27fakename%27%20AND%20metadata%5B%27foo%27%5D%3A%27bar%27", ) @pytest.mark.anyio async def test_customers_search_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/customers/search", "query=name%3A%27fakename%27%20AND%20metadata%5B%27foo%27%5D%3A%27bar%27", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.customers.search_async( { "query": "name:'fakename' AND metadata['foo']:'bar'", } ) http_client_mock.assert_requested( "get", path="/v1/customers/search", query_string="query=name%3A%27fakename%27%20AND%20metadata%5B%27foo%27%5D%3A%27bar%27", api_base="https://api.stripe.com", ) def test_customers_search_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.Customer.search( query="name:'fakename' AND metadata['foo']:'bar'", ) http_client_mock.assert_requested( "get", path="/v1/customers/search", query_string="query=name%3A%27fakename%27%20AND%20metadata%5B%27foo%27%5D%3A%27bar%27", ) def test_customers_search_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/customers/search", "query=name%3A%27fakename%27%20AND%20metadata%5B%27foo%27%5D%3A%27bar%27", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.customers.search( { "query": "name:'fakename' AND metadata['foo']:'bar'", } ) http_client_mock.assert_requested( "get", path="/v1/customers/search", query_string="query=name%3A%27fakename%27%20AND%20metadata%5B%27foo%27%5D%3A%27bar%27", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_customers_search_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Customer.search_async( query="name:'fakename' AND metadata['foo']:'bar'", ) http_client_mock.assert_requested( "get", path="/v1/customers/search", query_string="query=name%3A%27fakename%27%20AND%20metadata%5B%27foo%27%5D%3A%27bar%27", ) @pytest.mark.anyio async def test_customers_search_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/customers/search", "query=name%3A%27fakename%27%20AND%20metadata%5B%27foo%27%5D%3A%27bar%27", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.customers.search_async( { "query": "name:'fakename' AND metadata['foo']:'bar'", } ) http_client_mock.assert_requested( "get", path="/v1/customers/search", query_string="query=name%3A%27fakename%27%20AND%20metadata%5B%27foo%27%5D%3A%27bar%27", api_base="https://api.stripe.com", ) def test_customers_sources_delete( self, http_client_mock: HTTPClientMock ) -> None: stripe.Customer.delete_source( "cus_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "delete", path="/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", query_string="", ) def test_customers_sources_delete_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.sources.detach( "cus_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "delete", path="/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_customers_sources_delete_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Customer.delete_source_async( "cus_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "delete", path="/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_customers_sources_delete_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.sources.detach_async( "cus_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "delete", path="/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_customers_sources_delete_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.Customer.delete_source( "cus_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "delete", path="/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", query_string="", ) def test_customers_sources_delete_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.sources.detach( "cus_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "delete", path="/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_customers_sources_delete_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Customer.delete_source_async( "cus_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "delete", path="/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_customers_sources_delete_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.sources.detach_async( "cus_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "delete", path="/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_customers_sources_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.Customer.list_sources( "cus_xxxxxxxxxxxxx", object="bank_account", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx/sources", query_string="object=bank_account&limit=3", ) def test_customers_sources_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/customers/cus_xxxxxxxxxxxxx/sources", "object=bank_account&limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.customers.payment_sources.list( "cus_xxxxxxxxxxxxx", {"object": "bank_account", "limit": 3}, ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx/sources", query_string="object=bank_account&limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_customers_sources_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Customer.list_sources_async( "cus_xxxxxxxxxxxxx", object="bank_account", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx/sources", query_string="object=bank_account&limit=3", ) @pytest.mark.anyio async def test_customers_sources_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/customers/cus_xxxxxxxxxxxxx/sources", "object=bank_account&limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.customers.payment_sources.list_async( "cus_xxxxxxxxxxxxx", {"object": "bank_account", "limit": 3}, ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx/sources", query_string="object=bank_account&limit=3", api_base="https://api.stripe.com", ) def test_customers_sources_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.Customer.list_sources( "cus_xxxxxxxxxxxxx", object="card", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx/sources", query_string="object=card&limit=3", ) def test_customers_sources_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/customers/cus_xxxxxxxxxxxxx/sources", "object=card&limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.customers.payment_sources.list( "cus_xxxxxxxxxxxxx", {"object": "card", "limit": 3}, ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx/sources", query_string="object=card&limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_customers_sources_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Customer.list_sources_async( "cus_xxxxxxxxxxxxx", object="card", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx/sources", query_string="object=card&limit=3", ) @pytest.mark.anyio async def test_customers_sources_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/customers/cus_xxxxxxxxxxxxx/sources", "object=card&limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.customers.payment_sources.list_async( "cus_xxxxxxxxxxxxx", {"object": "card", "limit": 3}, ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx/sources", query_string="object=card&limit=3", api_base="https://api.stripe.com", ) def test_customers_sources_get_3( self, http_client_mock: HTTPClientMock ) -> None: stripe.Customer.retrieve_source( "cus_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", query_string="", ) def test_customers_sources_get_3_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.customers.payment_sources.retrieve( "cus_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_customers_sources_get_3_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Customer.retrieve_source_async( "cus_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_customers_sources_get_3_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.customers.payment_sources.retrieve_async( "cus_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_customers_sources_get_4( self, http_client_mock: HTTPClientMock ) -> None: stripe.Customer.retrieve_source( "cus_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", query_string="", ) def test_customers_sources_get_4_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.customers.payment_sources.retrieve( "cus_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_customers_sources_get_4_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Customer.retrieve_source_async( "cus_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_customers_sources_get_4_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.customers.payment_sources.retrieve_async( "cus_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_customers_sources_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.Customer.modify_source( "cus_123", "card_123", account_holder_name="Kamil", ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_123/sources/card_123", query_string="", post_data="account_holder_name=Kamil", ) def test_customers_sources_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/customers/cus_123/sources/card_123", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.customers.payment_sources.update( "cus_123", "card_123", {"account_holder_name": "Kamil"}, ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_123/sources/card_123", query_string="", api_base="https://api.stripe.com", post_data="account_holder_name=Kamil", ) @pytest.mark.anyio async def test_customers_sources_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Customer.modify_source_async( "cus_123", "card_123", account_holder_name="Kamil", ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_123/sources/card_123", query_string="", post_data="account_holder_name=Kamil", ) @pytest.mark.anyio async def test_customers_sources_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/customers/cus_123/sources/card_123", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.customers.payment_sources.update_async( "cus_123", "card_123", {"account_holder_name": "Kamil"}, ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_123/sources/card_123", query_string="", api_base="https://api.stripe.com", post_data="account_holder_name=Kamil", ) def test_customers_sources_post_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.Customer.create_source( "cus_xxxxxxxxxxxxx", source="btok_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_xxxxxxxxxxxxx/sources", query_string="", post_data="source=btok_xxxxxxxxxxxxx", ) def test_customers_sources_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/customers/cus_xxxxxxxxxxxxx/sources", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.customers.payment_sources.create( "cus_xxxxxxxxxxxxx", {"source": "btok_xxxxxxxxxxxxx"}, ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_xxxxxxxxxxxxx/sources", query_string="", api_base="https://api.stripe.com", post_data="source=btok_xxxxxxxxxxxxx", ) @pytest.mark.anyio async def test_customers_sources_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Customer.create_source_async( "cus_xxxxxxxxxxxxx", source="btok_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_xxxxxxxxxxxxx/sources", query_string="", post_data="source=btok_xxxxxxxxxxxxx", ) @pytest.mark.anyio async def test_customers_sources_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/customers/cus_xxxxxxxxxxxxx/sources", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.customers.payment_sources.create_async( "cus_xxxxxxxxxxxxx", {"source": "btok_xxxxxxxxxxxxx"}, ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_xxxxxxxxxxxxx/sources", query_string="", api_base="https://api.stripe.com", post_data="source=btok_xxxxxxxxxxxxx", ) def test_customers_sources_post_3( self, http_client_mock: HTTPClientMock ) -> None: stripe.Customer.create_source( "cus_xxxxxxxxxxxxx", source="tok_xxxx", ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_xxxxxxxxxxxxx/sources", query_string="", post_data="source=tok_xxxx", ) def test_customers_sources_post_3_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/customers/cus_xxxxxxxxxxxxx/sources", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.customers.payment_sources.create( "cus_xxxxxxxxxxxxx", {"source": "tok_xxxx"}, ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_xxxxxxxxxxxxx/sources", query_string="", api_base="https://api.stripe.com", post_data="source=tok_xxxx", ) @pytest.mark.anyio async def test_customers_sources_post_3_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Customer.create_source_async( "cus_xxxxxxxxxxxxx", source="tok_xxxx", ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_xxxxxxxxxxxxx/sources", query_string="", post_data="source=tok_xxxx", ) @pytest.mark.anyio async def test_customers_sources_post_3_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/customers/cus_xxxxxxxxxxxxx/sources", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.customers.payment_sources.create_async( "cus_xxxxxxxxxxxxx", {"source": "tok_xxxx"}, ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_xxxxxxxxxxxxx/sources", query_string="", api_base="https://api.stripe.com", post_data="source=tok_xxxx", ) def test_customers_sources_post_4( self, http_client_mock: HTTPClientMock ) -> None: stripe.Customer.modify_source( "cus_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) def test_customers_sources_post_4_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.customers.payment_sources.update( "cus_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_customers_sources_post_4_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Customer.modify_source_async( "cus_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_customers_sources_post_4_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.customers.payment_sources.update_async( "cus_xxxxxxxxxxxxx", "ba_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_xxxxxxxxxxxxx/sources/ba_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) def test_customers_sources_post_5( self, http_client_mock: HTTPClientMock ) -> None: stripe.Customer.modify_source( "cus_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", name="Jenny Rosen", ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", query_string="", post_data="name=Jenny%20Rosen", ) def test_customers_sources_post_5_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.customers.payment_sources.update( "cus_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", {"name": "Jenny Rosen"}, ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="name=Jenny%20Rosen", ) @pytest.mark.anyio async def test_customers_sources_post_5_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Customer.modify_source_async( "cus_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", name="Jenny Rosen", ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", query_string="", post_data="name=Jenny%20Rosen", ) @pytest.mark.anyio async def test_customers_sources_post_5_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.customers.payment_sources.update_async( "cus_xxxxxxxxxxxxx", "card_xxxxxxxxxxxxx", {"name": "Jenny Rosen"}, ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_xxxxxxxxxxxxx/sources/card_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="name=Jenny%20Rosen", ) def test_customers_tax_ids_delete( self, http_client_mock: HTTPClientMock ) -> None: stripe.Customer.delete_tax_id( "cus_xxxxxxxxxxxxx", "txi_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "delete", path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids/txi_xxxxxxxxxxxxx", query_string="", ) def test_customers_tax_ids_delete_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/customers/cus_xxxxxxxxxxxxx/tax_ids/txi_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.customers.tax_ids.delete( "cus_xxxxxxxxxxxxx", "txi_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "delete", path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids/txi_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_customers_tax_ids_delete_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Customer.delete_tax_id_async( "cus_xxxxxxxxxxxxx", "txi_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "delete", path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids/txi_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_customers_tax_ids_delete_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/customers/cus_xxxxxxxxxxxxx/tax_ids/txi_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.customers.tax_ids.delete_async( "cus_xxxxxxxxxxxxx", "txi_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "delete", path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids/txi_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_customers_tax_ids_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.Customer.list_tax_ids( "cus_xxxxxxxxxxxxx", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids", query_string="limit=3", ) def test_customers_tax_ids_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/customers/cus_xxxxxxxxxxxxx/tax_ids", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.customers.tax_ids.list( "cus_xxxxxxxxxxxxx", {"limit": 3}, ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_customers_tax_ids_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Customer.list_tax_ids_async( "cus_xxxxxxxxxxxxx", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids", query_string="limit=3", ) @pytest.mark.anyio async def test_customers_tax_ids_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/customers/cus_xxxxxxxxxxxxx/tax_ids", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.customers.tax_ids.list_async( "cus_xxxxxxxxxxxxx", {"limit": 3}, ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids", query_string="limit=3", api_base="https://api.stripe.com", ) def test_customers_tax_ids_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.Customer.retrieve_tax_id( "cus_xxxxxxxxxxxxx", "txi_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids/txi_xxxxxxxxxxxxx", query_string="", ) def test_customers_tax_ids_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/customers/cus_xxxxxxxxxxxxx/tax_ids/txi_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.customers.tax_ids.retrieve( "cus_xxxxxxxxxxxxx", "txi_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids/txi_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_customers_tax_ids_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Customer.retrieve_tax_id_async( "cus_xxxxxxxxxxxxx", "txi_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids/txi_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_customers_tax_ids_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/customers/cus_xxxxxxxxxxxxx/tax_ids/txi_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.customers.tax_ids.retrieve_async( "cus_xxxxxxxxxxxxx", "txi_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids/txi_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_customers_tax_ids_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.Customer.create_tax_id( "cus_xxxxxxxxxxxxx", type="eu_vat", value="DE123456789", ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids", query_string="", post_data="type=eu_vat&value=DE123456789", ) def test_customers_tax_ids_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/customers/cus_xxxxxxxxxxxxx/tax_ids", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.customers.tax_ids.create( "cus_xxxxxxxxxxxxx", {"type": "eu_vat", "value": "DE123456789"}, ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids", query_string="", api_base="https://api.stripe.com", post_data="type=eu_vat&value=DE123456789", ) @pytest.mark.anyio async def test_customers_tax_ids_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Customer.create_tax_id_async( "cus_xxxxxxxxxxxxx", type="eu_vat", value="DE123456789", ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids", query_string="", post_data="type=eu_vat&value=DE123456789", ) @pytest.mark.anyio async def test_customers_tax_ids_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/customers/cus_xxxxxxxxxxxxx/tax_ids", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.customers.tax_ids.create_async( "cus_xxxxxxxxxxxxx", {"type": "eu_vat", "value": "DE123456789"}, ) http_client_mock.assert_requested( "post", path="/v1/customers/cus_xxxxxxxxxxxxx/tax_ids", query_string="", api_base="https://api.stripe.com", post_data="type=eu_vat&value=DE123456789", ) def test_disputes_close_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.Dispute.close("dp_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/disputes/dp_xxxxxxxxxxxxx/close", query_string="", ) def test_disputes_close_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/disputes/dp_xxxxxxxxxxxxx/close", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.disputes.close("dp_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/disputes/dp_xxxxxxxxxxxxx/close", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_disputes_close_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Dispute.close_async("dp_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/disputes/dp_xxxxxxxxxxxxx/close", query_string="", ) @pytest.mark.anyio async def test_disputes_close_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/disputes/dp_xxxxxxxxxxxxx/close", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.disputes.close_async("dp_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/disputes/dp_xxxxxxxxxxxxx/close", query_string="", api_base="https://api.stripe.com", ) def test_disputes_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Dispute.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/disputes", query_string="limit=3", ) def test_disputes_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/disputes", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.disputes.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/disputes", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_disputes_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Dispute.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/disputes", query_string="limit=3", ) @pytest.mark.anyio async def test_disputes_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/disputes", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.disputes.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/disputes", query_string="limit=3", api_base="https://api.stripe.com", ) def test_disputes_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Dispute.retrieve("dp_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/disputes/dp_xxxxxxxxxxxxx", query_string="", ) def test_disputes_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/disputes/dp_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.disputes.retrieve("dp_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/disputes/dp_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_disputes_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Dispute.retrieve_async("dp_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/disputes/dp_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_disputes_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/disputes/dp_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.disputes.retrieve_async("dp_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/disputes/dp_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_disputes_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Dispute.modify( "dp_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/disputes/dp_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) def test_disputes_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/disputes/dp_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.disputes.update( "dp_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/disputes/dp_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_disputes_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Dispute.modify_async( "dp_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/disputes/dp_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_disputes_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/disputes/dp_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.disputes.update_async( "dp_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/disputes/dp_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) def test_events_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Event.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/events", query_string="limit=3", ) def test_events_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/events", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.events.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/events", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_events_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Event.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/events", query_string="limit=3", ) @pytest.mark.anyio async def test_events_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/events", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.events.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/events", query_string="limit=3", api_base="https://api.stripe.com", ) def test_events_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Event.retrieve("evt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/events/evt_xxxxxxxxxxxxx", query_string="", ) def test_events_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/events/evt_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.events.retrieve("evt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/events/evt_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_events_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Event.retrieve_async("evt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/events/evt_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_events_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/events/evt_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.events.retrieve_async("evt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/events/evt_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_file_links_get(self, http_client_mock: HTTPClientMock) -> None: stripe.FileLink.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/file_links", query_string="limit=3", ) def test_file_links_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/file_links", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.file_links.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/file_links", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_file_links_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.FileLink.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/file_links", query_string="limit=3", ) @pytest.mark.anyio async def test_file_links_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/file_links", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.file_links.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/file_links", query_string="limit=3", api_base="https://api.stripe.com", ) def test_file_links_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.FileLink.retrieve("link_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/file_links/link_xxxxxxxxxxxxx", query_string="", ) def test_file_links_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/file_links/link_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.file_links.retrieve("link_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/file_links/link_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_file_links_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.FileLink.retrieve_async("link_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/file_links/link_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_file_links_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/file_links/link_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.file_links.retrieve_async("link_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/file_links/link_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_file_links_post(self, http_client_mock: HTTPClientMock) -> None: stripe.FileLink.create(file="file_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/file_links", query_string="", post_data="file=file_xxxxxxxxxxxxx", ) def test_file_links_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/file_links", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.file_links.create({"file": "file_xxxxxxxxxxxxx"}) http_client_mock.assert_requested( "post", path="/v1/file_links", query_string="", api_base="https://api.stripe.com", post_data="file=file_xxxxxxxxxxxxx", ) @pytest.mark.anyio async def test_file_links_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.FileLink.create_async(file="file_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/file_links", query_string="", post_data="file=file_xxxxxxxxxxxxx", ) @pytest.mark.anyio async def test_file_links_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/file_links", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.file_links.create_async({"file": "file_xxxxxxxxxxxxx"}) http_client_mock.assert_requested( "post", path="/v1/file_links", query_string="", api_base="https://api.stripe.com", post_data="file=file_xxxxxxxxxxxxx", ) def test_file_links_post_2(self, http_client_mock: HTTPClientMock) -> None: stripe.FileLink.modify( "link_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/file_links/link_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) def test_file_links_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/file_links/link_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.file_links.update( "link_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/file_links/link_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_file_links_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.FileLink.modify_async( "link_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/file_links/link_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_file_links_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/file_links/link_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.file_links.update_async( "link_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/file_links/link_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) def test_files_get(self, http_client_mock: HTTPClientMock) -> None: stripe.File.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/files", query_string="limit=3", ) def test_files_get_service(self, http_client_mock: HTTPClientMock) -> None: http_client_mock.stub_request( "get", "/v1/files", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.files.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/files", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_files_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.File.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/files", query_string="limit=3", ) @pytest.mark.anyio async def test_files_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/files", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.files.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/files", query_string="limit=3", api_base="https://api.stripe.com", ) def test_files_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.File.retrieve("file_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/files/file_xxxxxxxxxxxxx", query_string="", ) def test_files_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/files/file_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.files.retrieve("file_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/files/file_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_files_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.File.retrieve_async("file_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/files/file_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_files_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/files/file_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.files.retrieve_async("file_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/files/file_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_files_post(self, http_client_mock: HTTPClientMock) -> None: stripe.File.create( purpose="account_requirement", file=io.StringIO("foo"), ) http_client_mock.assert_requested( "post", path="/v1/files", query_string="", ) def test_files_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/files", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.files.create( { "purpose": "account_requirement", "file": io.StringIO("foo"), } ) http_client_mock.assert_requested( "post", path="/v1/files", query_string="", api_base="https://files.stripe.com", ) @pytest.mark.anyio async def test_files_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.File.create_async( purpose="account_requirement", file=io.StringIO("foo"), ) http_client_mock.assert_requested( "post", path="/v1/files", query_string="", ) @pytest.mark.anyio async def test_files_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/files", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.files.create_async( { "purpose": "account_requirement", "file": io.StringIO("foo"), } ) http_client_mock.assert_requested( "post", path="/v1/files", query_string="", api_base="https://files.stripe.com", ) def test_financial_connections_accounts_disconnect_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.financial_connections.Account.disconnect("fca_xyz") http_client_mock.assert_requested( "post", path="/v1/financial_connections/accounts/fca_xyz/disconnect", query_string="", ) def test_financial_connections_accounts_disconnect_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/financial_connections/accounts/fca_xyz/disconnect", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.financial_connections.accounts.disconnect("fca_xyz") http_client_mock.assert_requested( "post", path="/v1/financial_connections/accounts/fca_xyz/disconnect", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_financial_connections_accounts_disconnect_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.financial_connections.Account.disconnect_async("fca_xyz") http_client_mock.assert_requested( "post", path="/v1/financial_connections/accounts/fca_xyz/disconnect", query_string="", ) @pytest.mark.anyio async def test_financial_connections_accounts_disconnect_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/financial_connections/accounts/fca_xyz/disconnect", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.financial_connections.accounts.disconnect_async("fca_xyz") http_client_mock.assert_requested( "post", path="/v1/financial_connections/accounts/fca_xyz/disconnect", query_string="", api_base="https://api.stripe.com", ) def test_financial_connections_accounts_disconnect_post_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.financial_connections.Account.disconnect("fca_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx/disconnect", query_string="", ) def test_financial_connections_accounts_disconnect_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx/disconnect", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.financial_connections.accounts.disconnect("fca_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx/disconnect", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_financial_connections_accounts_disconnect_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.financial_connections.Account.disconnect_async( "fca_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", path="/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx/disconnect", query_string="", ) @pytest.mark.anyio async def test_financial_connections_accounts_disconnect_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx/disconnect", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.financial_connections.accounts.disconnect_async( "fca_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", path="/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx/disconnect", query_string="", api_base="https://api.stripe.com", ) def test_financial_connections_accounts_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.financial_connections.Account.list() http_client_mock.assert_requested( "get", path="/v1/financial_connections/accounts", query_string="", ) def test_financial_connections_accounts_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/financial_connections/accounts", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.financial_connections.accounts.list() http_client_mock.assert_requested( "get", path="/v1/financial_connections/accounts", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_financial_connections_accounts_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.financial_connections.Account.list_async() http_client_mock.assert_requested( "get", path="/v1/financial_connections/accounts", query_string="", ) @pytest.mark.anyio async def test_financial_connections_accounts_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/financial_connections/accounts", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.financial_connections.accounts.list_async() http_client_mock.assert_requested( "get", path="/v1/financial_connections/accounts", query_string="", api_base="https://api.stripe.com", ) def test_financial_connections_accounts_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.financial_connections.Account.retrieve("fca_xyz") http_client_mock.assert_requested( "get", path="/v1/financial_connections/accounts/fca_xyz", query_string="", ) def test_financial_connections_accounts_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/financial_connections/accounts/fca_xyz", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.financial_connections.accounts.retrieve("fca_xyz") http_client_mock.assert_requested( "get", path="/v1/financial_connections/accounts/fca_xyz", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_financial_connections_accounts_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.financial_connections.Account.retrieve_async("fca_xyz") http_client_mock.assert_requested( "get", path="/v1/financial_connections/accounts/fca_xyz", query_string="", ) @pytest.mark.anyio async def test_financial_connections_accounts_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/financial_connections/accounts/fca_xyz", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.financial_connections.accounts.retrieve_async("fca_xyz") http_client_mock.assert_requested( "get", path="/v1/financial_connections/accounts/fca_xyz", query_string="", api_base="https://api.stripe.com", ) def test_financial_connections_accounts_get_3( self, http_client_mock: HTTPClientMock ) -> None: stripe.financial_connections.Account.list( account_holder={"customer": "cus_xxxxxxxxxxxxx"}, ) http_client_mock.assert_requested( "get", path="/v1/financial_connections/accounts", query_string="account_holder[customer]=cus_xxxxxxxxxxxxx", ) def test_financial_connections_accounts_get_3_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/financial_connections/accounts", "account_holder[customer]=cus_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.financial_connections.accounts.list( { "account_holder": {"customer": "cus_xxxxxxxxxxxxx"}, } ) http_client_mock.assert_requested( "get", path="/v1/financial_connections/accounts", query_string="account_holder[customer]=cus_xxxxxxxxxxxxx", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_financial_connections_accounts_get_3_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.financial_connections.Account.list_async( account_holder={"customer": "cus_xxxxxxxxxxxxx"}, ) http_client_mock.assert_requested( "get", path="/v1/financial_connections/accounts", query_string="account_holder[customer]=cus_xxxxxxxxxxxxx", ) @pytest.mark.anyio async def test_financial_connections_accounts_get_3_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/financial_connections/accounts", "account_holder[customer]=cus_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.financial_connections.accounts.list_async( { "account_holder": {"customer": "cus_xxxxxxxxxxxxx"}, } ) http_client_mock.assert_requested( "get", path="/v1/financial_connections/accounts", query_string="account_holder[customer]=cus_xxxxxxxxxxxxx", api_base="https://api.stripe.com", ) def test_financial_connections_accounts_get_4( self, http_client_mock: HTTPClientMock ) -> None: stripe.financial_connections.Account.retrieve("fca_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx", query_string="", ) def test_financial_connections_accounts_get_4_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.financial_connections.accounts.retrieve("fca_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_financial_connections_accounts_get_4_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.financial_connections.Account.retrieve_async( "fca_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_financial_connections_accounts_get_4_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.financial_connections.accounts.retrieve_async( "fca_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_financial_connections_accounts_owners_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.financial_connections.Account.list_owners( "fca_xyz", ownership="fcaowns_xyz", ) http_client_mock.assert_requested( "get", path="/v1/financial_connections/accounts/fca_xyz/owners", query_string="ownership=fcaowns_xyz", ) def test_financial_connections_accounts_owners_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/financial_connections/accounts/fca_xyz/owners", "ownership=fcaowns_xyz", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.financial_connections.accounts.owners.list( "fca_xyz", {"ownership": "fcaowns_xyz"}, ) http_client_mock.assert_requested( "get", path="/v1/financial_connections/accounts/fca_xyz/owners", query_string="ownership=fcaowns_xyz", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_financial_connections_accounts_owners_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.financial_connections.Account.list_owners_async( "fca_xyz", ownership="fcaowns_xyz", ) http_client_mock.assert_requested( "get", path="/v1/financial_connections/accounts/fca_xyz/owners", query_string="ownership=fcaowns_xyz", ) @pytest.mark.anyio async def test_financial_connections_accounts_owners_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/financial_connections/accounts/fca_xyz/owners", "ownership=fcaowns_xyz", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.financial_connections.accounts.owners.list_async( "fca_xyz", {"ownership": "fcaowns_xyz"}, ) http_client_mock.assert_requested( "get", path="/v1/financial_connections/accounts/fca_xyz/owners", query_string="ownership=fcaowns_xyz", api_base="https://api.stripe.com", ) def test_financial_connections_accounts_owners_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.financial_connections.Account.list_owners( "fca_xxxxxxxxxxxxx", limit=3, ownership="fcaowns_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx/owners", query_string="limit=3&ownership=fcaowns_xxxxxxxxxxxxx", ) def test_financial_connections_accounts_owners_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx/owners", "limit=3&ownership=fcaowns_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.financial_connections.accounts.owners.list( "fca_xxxxxxxxxxxxx", {"limit": 3, "ownership": "fcaowns_xxxxxxxxxxxxx"}, ) http_client_mock.assert_requested( "get", path="/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx/owners", query_string="limit=3&ownership=fcaowns_xxxxxxxxxxxxx", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_financial_connections_accounts_owners_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.financial_connections.Account.list_owners_async( "fca_xxxxxxxxxxxxx", limit=3, ownership="fcaowns_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx/owners", query_string="limit=3&ownership=fcaowns_xxxxxxxxxxxxx", ) @pytest.mark.anyio async def test_financial_connections_accounts_owners_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx/owners", "limit=3&ownership=fcaowns_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.financial_connections.accounts.owners.list_async( "fca_xxxxxxxxxxxxx", {"limit": 3, "ownership": "fcaowns_xxxxxxxxxxxxx"}, ) http_client_mock.assert_requested( "get", path="/v1/financial_connections/accounts/fca_xxxxxxxxxxxxx/owners", query_string="limit=3&ownership=fcaowns_xxxxxxxxxxxxx", api_base="https://api.stripe.com", ) def test_financial_connections_accounts_refresh_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.financial_connections.Account.refresh_account( "fca_xyz", features=["balance"], ) http_client_mock.assert_requested( "post", path="/v1/financial_connections/accounts/fca_xyz/refresh", query_string="", post_data="features[0]=balance", ) def test_financial_connections_accounts_refresh_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/financial_connections/accounts/fca_xyz/refresh", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.financial_connections.accounts.refresh( "fca_xyz", {"features": ["balance"]}, ) http_client_mock.assert_requested( "post", path="/v1/financial_connections/accounts/fca_xyz/refresh", query_string="", api_base="https://api.stripe.com", post_data="features[0]=balance", ) @pytest.mark.anyio async def test_financial_connections_accounts_refresh_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.financial_connections.Account.refresh_account_async( "fca_xyz", features=["balance"], ) http_client_mock.assert_requested( "post", path="/v1/financial_connections/accounts/fca_xyz/refresh", query_string="", post_data="features[0]=balance", ) @pytest.mark.anyio async def test_financial_connections_accounts_refresh_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/financial_connections/accounts/fca_xyz/refresh", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.financial_connections.accounts.refresh_async( "fca_xyz", {"features": ["balance"]}, ) http_client_mock.assert_requested( "post", path="/v1/financial_connections/accounts/fca_xyz/refresh", query_string="", api_base="https://api.stripe.com", post_data="features[0]=balance", ) def test_financial_connections_accounts_subscribe_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.financial_connections.Account.subscribe( "fa_123", features=["transactions"], ) http_client_mock.assert_requested( "post", path="/v1/financial_connections/accounts/fa_123/subscribe", query_string="", post_data="features[0]=transactions", ) def test_financial_connections_accounts_subscribe_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/financial_connections/accounts/fa_123/subscribe", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.financial_connections.accounts.subscribe( "fa_123", {"features": ["transactions"]}, ) http_client_mock.assert_requested( "post", path="/v1/financial_connections/accounts/fa_123/subscribe", query_string="", api_base="https://api.stripe.com", post_data="features[0]=transactions", ) @pytest.mark.anyio async def test_financial_connections_accounts_subscribe_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.financial_connections.Account.subscribe_async( "fa_123", features=["transactions"], ) http_client_mock.assert_requested( "post", path="/v1/financial_connections/accounts/fa_123/subscribe", query_string="", post_data="features[0]=transactions", ) @pytest.mark.anyio async def test_financial_connections_accounts_subscribe_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/financial_connections/accounts/fa_123/subscribe", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.financial_connections.accounts.subscribe_async( "fa_123", {"features": ["transactions"]}, ) http_client_mock.assert_requested( "post", path="/v1/financial_connections/accounts/fa_123/subscribe", query_string="", api_base="https://api.stripe.com", post_data="features[0]=transactions", ) def test_financial_connections_accounts_unsubscribe_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.financial_connections.Account.unsubscribe( "fa_123", features=["transactions"], ) http_client_mock.assert_requested( "post", path="/v1/financial_connections/accounts/fa_123/unsubscribe", query_string="", post_data="features[0]=transactions", ) def test_financial_connections_accounts_unsubscribe_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/financial_connections/accounts/fa_123/unsubscribe", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.financial_connections.accounts.unsubscribe( "fa_123", {"features": ["transactions"]}, ) http_client_mock.assert_requested( "post", path="/v1/financial_connections/accounts/fa_123/unsubscribe", query_string="", api_base="https://api.stripe.com", post_data="features[0]=transactions", ) @pytest.mark.anyio async def test_financial_connections_accounts_unsubscribe_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.financial_connections.Account.unsubscribe_async( "fa_123", features=["transactions"], ) http_client_mock.assert_requested( "post", path="/v1/financial_connections/accounts/fa_123/unsubscribe", query_string="", post_data="features[0]=transactions", ) @pytest.mark.anyio async def test_financial_connections_accounts_unsubscribe_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/financial_connections/accounts/fa_123/unsubscribe", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.financial_connections.accounts.unsubscribe_async( "fa_123", {"features": ["transactions"]}, ) http_client_mock.assert_requested( "post", path="/v1/financial_connections/accounts/fa_123/unsubscribe", query_string="", api_base="https://api.stripe.com", post_data="features[0]=transactions", ) def test_financial_connections_sessions_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.financial_connections.Session.retrieve("fcsess_xyz") http_client_mock.assert_requested( "get", path="/v1/financial_connections/sessions/fcsess_xyz", query_string="", ) def test_financial_connections_sessions_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/financial_connections/sessions/fcsess_xyz", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.financial_connections.sessions.retrieve("fcsess_xyz") http_client_mock.assert_requested( "get", path="/v1/financial_connections/sessions/fcsess_xyz", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_financial_connections_sessions_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.financial_connections.Session.retrieve_async("fcsess_xyz") http_client_mock.assert_requested( "get", path="/v1/financial_connections/sessions/fcsess_xyz", query_string="", ) @pytest.mark.anyio async def test_financial_connections_sessions_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/financial_connections/sessions/fcsess_xyz", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.financial_connections.sessions.retrieve_async( "fcsess_xyz" ) http_client_mock.assert_requested( "get", path="/v1/financial_connections/sessions/fcsess_xyz", query_string="", api_base="https://api.stripe.com", ) def test_financial_connections_sessions_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.financial_connections.Session.retrieve("fcsess_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/financial_connections/sessions/fcsess_xxxxxxxxxxxxx", query_string="", ) def test_financial_connections_sessions_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/financial_connections/sessions/fcsess_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.financial_connections.sessions.retrieve("fcsess_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/financial_connections/sessions/fcsess_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_financial_connections_sessions_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.financial_connections.Session.retrieve_async( "fcsess_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/financial_connections/sessions/fcsess_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_financial_connections_sessions_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/financial_connections/sessions/fcsess_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.financial_connections.sessions.retrieve_async( "fcsess_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/financial_connections/sessions/fcsess_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_financial_connections_sessions_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.financial_connections.Session.create( account_holder={"type": "customer", "customer": "cus_123"}, permissions=["balances"], ) http_client_mock.assert_requested( "post", path="/v1/financial_connections/sessions", query_string="", post_data="account_holder[type]=customer&account_holder[customer]=cus_123&permissions[0]=balances", ) def test_financial_connections_sessions_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/financial_connections/sessions", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.financial_connections.sessions.create( { "account_holder": {"type": "customer", "customer": "cus_123"}, "permissions": ["balances"], } ) http_client_mock.assert_requested( "post", path="/v1/financial_connections/sessions", query_string="", api_base="https://api.stripe.com", post_data="account_holder[type]=customer&account_holder[customer]=cus_123&permissions[0]=balances", ) @pytest.mark.anyio async def test_financial_connections_sessions_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.financial_connections.Session.create_async( account_holder={"type": "customer", "customer": "cus_123"}, permissions=["balances"], ) http_client_mock.assert_requested( "post", path="/v1/financial_connections/sessions", query_string="", post_data="account_holder[type]=customer&account_holder[customer]=cus_123&permissions[0]=balances", ) @pytest.mark.anyio async def test_financial_connections_sessions_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/financial_connections/sessions", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.financial_connections.sessions.create_async( { "account_holder": {"type": "customer", "customer": "cus_123"}, "permissions": ["balances"], } ) http_client_mock.assert_requested( "post", path="/v1/financial_connections/sessions", query_string="", api_base="https://api.stripe.com", post_data="account_holder[type]=customer&account_holder[customer]=cus_123&permissions[0]=balances", ) def test_financial_connections_sessions_post_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.financial_connections.Session.create( account_holder={ "type": "customer", "customer": "cus_xxxxxxxxxxxxx", }, permissions=["payment_method", "balances"], filters={"countries": ["US"]}, ) http_client_mock.assert_requested( "post", path="/v1/financial_connections/sessions", query_string="", post_data="account_holder[type]=customer&account_holder[customer]=cus_xxxxxxxxxxxxx&permissions[0]=payment_method&permissions[1]=balances&filters[countries][0]=US", ) def test_financial_connections_sessions_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/financial_connections/sessions", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.financial_connections.sessions.create( { "account_holder": { "type": "customer", "customer": "cus_xxxxxxxxxxxxx", }, "permissions": ["payment_method", "balances"], "filters": {"countries": ["US"]}, } ) http_client_mock.assert_requested( "post", path="/v1/financial_connections/sessions", query_string="", api_base="https://api.stripe.com", post_data="account_holder[type]=customer&account_holder[customer]=cus_xxxxxxxxxxxxx&permissions[0]=payment_method&permissions[1]=balances&filters[countries][0]=US", ) @pytest.mark.anyio async def test_financial_connections_sessions_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.financial_connections.Session.create_async( account_holder={ "type": "customer", "customer": "cus_xxxxxxxxxxxxx", }, permissions=["payment_method", "balances"], filters={"countries": ["US"]}, ) http_client_mock.assert_requested( "post", path="/v1/financial_connections/sessions", query_string="", post_data="account_holder[type]=customer&account_holder[customer]=cus_xxxxxxxxxxxxx&permissions[0]=payment_method&permissions[1]=balances&filters[countries][0]=US", ) @pytest.mark.anyio async def test_financial_connections_sessions_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/financial_connections/sessions", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.financial_connections.sessions.create_async( { "account_holder": { "type": "customer", "customer": "cus_xxxxxxxxxxxxx", }, "permissions": ["payment_method", "balances"], "filters": {"countries": ["US"]}, } ) http_client_mock.assert_requested( "post", path="/v1/financial_connections/sessions", query_string="", api_base="https://api.stripe.com", post_data="account_holder[type]=customer&account_holder[customer]=cus_xxxxxxxxxxxxx&permissions[0]=payment_method&permissions[1]=balances&filters[countries][0]=US", ) def test_financial_connections_transactions_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.financial_connections.Transaction.retrieve("tr_123") http_client_mock.assert_requested( "get", path="/v1/financial_connections/transactions/tr_123", query_string="", ) def test_financial_connections_transactions_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/financial_connections/transactions/tr_123", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.financial_connections.transactions.retrieve("tr_123") http_client_mock.assert_requested( "get", path="/v1/financial_connections/transactions/tr_123", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_financial_connections_transactions_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.financial_connections.Transaction.retrieve_async("tr_123") http_client_mock.assert_requested( "get", path="/v1/financial_connections/transactions/tr_123", query_string="", ) @pytest.mark.anyio async def test_financial_connections_transactions_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/financial_connections/transactions/tr_123", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.financial_connections.transactions.retrieve_async( "tr_123" ) http_client_mock.assert_requested( "get", path="/v1/financial_connections/transactions/tr_123", query_string="", api_base="https://api.stripe.com", ) def test_financial_connections_transactions_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.financial_connections.Transaction.list(account="fca_xyz") http_client_mock.assert_requested( "get", path="/v1/financial_connections/transactions", query_string="account=fca_xyz", ) def test_financial_connections_transactions_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/financial_connections/transactions", "account=fca_xyz", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.financial_connections.transactions.list({"account": "fca_xyz"}) http_client_mock.assert_requested( "get", path="/v1/financial_connections/transactions", query_string="account=fca_xyz", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_financial_connections_transactions_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.financial_connections.Transaction.list_async( account="fca_xyz", ) http_client_mock.assert_requested( "get", path="/v1/financial_connections/transactions", query_string="account=fca_xyz", ) @pytest.mark.anyio async def test_financial_connections_transactions_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/financial_connections/transactions", "account=fca_xyz", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.financial_connections.transactions.list_async( { "account": "fca_xyz", } ) http_client_mock.assert_requested( "get", path="/v1/financial_connections/transactions", query_string="account=fca_xyz", api_base="https://api.stripe.com", ) def test_identity_verification_reports_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.identity.VerificationReport.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/identity/verification_reports", query_string="limit=3", ) def test_identity_verification_reports_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/identity/verification_reports", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.identity.verification_reports.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/identity/verification_reports", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_identity_verification_reports_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.identity.VerificationReport.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/identity/verification_reports", query_string="limit=3", ) @pytest.mark.anyio async def test_identity_verification_reports_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/identity/verification_reports", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.identity.verification_reports.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/identity/verification_reports", query_string="limit=3", api_base="https://api.stripe.com", ) def test_identity_verification_reports_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.identity.VerificationReport.retrieve("vr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/identity/verification_reports/vr_xxxxxxxxxxxxx", query_string="", ) def test_identity_verification_reports_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/identity/verification_reports/vr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.identity.verification_reports.retrieve("vr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/identity/verification_reports/vr_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_identity_verification_reports_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.identity.VerificationReport.retrieve_async( "vr_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/identity/verification_reports/vr_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_identity_verification_reports_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/identity/verification_reports/vr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.identity.verification_reports.retrieve_async( "vr_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/identity/verification_reports/vr_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_identity_verification_sessions_cancel_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.identity.VerificationSession.cancel("vs_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/cancel", query_string="", ) def test_identity_verification_sessions_cancel_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/cancel", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.identity.verification_sessions.cancel("vs_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/cancel", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_identity_verification_sessions_cancel_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.identity.VerificationSession.cancel_async( "vs_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/cancel", query_string="", ) @pytest.mark.anyio async def test_identity_verification_sessions_cancel_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/cancel", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.identity.verification_sessions.cancel_async( "vs_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/cancel", query_string="", api_base="https://api.stripe.com", ) def test_identity_verification_sessions_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.identity.VerificationSession.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/identity/verification_sessions", query_string="limit=3", ) def test_identity_verification_sessions_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/identity/verification_sessions", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.identity.verification_sessions.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/identity/verification_sessions", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_identity_verification_sessions_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.identity.VerificationSession.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/identity/verification_sessions", query_string="limit=3", ) @pytest.mark.anyio async def test_identity_verification_sessions_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/identity/verification_sessions", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.identity.verification_sessions.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/identity/verification_sessions", query_string="limit=3", api_base="https://api.stripe.com", ) def test_identity_verification_sessions_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.identity.VerificationSession.retrieve("vs_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx", query_string="", ) def test_identity_verification_sessions_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.identity.verification_sessions.retrieve("vs_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_identity_verification_sessions_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.identity.VerificationSession.retrieve_async( "vs_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_identity_verification_sessions_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.identity.verification_sessions.retrieve_async( "vs_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_identity_verification_sessions_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.identity.VerificationSession.create(type="document") http_client_mock.assert_requested( "post", path="/v1/identity/verification_sessions", query_string="", post_data="type=document", ) def test_identity_verification_sessions_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/identity/verification_sessions", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.identity.verification_sessions.create({"type": "document"}) http_client_mock.assert_requested( "post", path="/v1/identity/verification_sessions", query_string="", api_base="https://api.stripe.com", post_data="type=document", ) @pytest.mark.anyio async def test_identity_verification_sessions_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.identity.VerificationSession.create_async(type="document") http_client_mock.assert_requested( "post", path="/v1/identity/verification_sessions", query_string="", post_data="type=document", ) @pytest.mark.anyio async def test_identity_verification_sessions_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/identity/verification_sessions", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.identity.verification_sessions.create_async( { "type": "document", } ) http_client_mock.assert_requested( "post", path="/v1/identity/verification_sessions", query_string="", api_base="https://api.stripe.com", post_data="type=document", ) def test_identity_verification_sessions_post_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.identity.VerificationSession.modify( "vs_xxxxxxxxxxxxx", type="id_number", ) http_client_mock.assert_requested( "post", path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx", query_string="", post_data="type=id_number", ) def test_identity_verification_sessions_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.identity.verification_sessions.update( "vs_xxxxxxxxxxxxx", {"type": "id_number"}, ) http_client_mock.assert_requested( "post", path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="type=id_number", ) @pytest.mark.anyio async def test_identity_verification_sessions_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.identity.VerificationSession.modify_async( "vs_xxxxxxxxxxxxx", type="id_number", ) http_client_mock.assert_requested( "post", path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx", query_string="", post_data="type=id_number", ) @pytest.mark.anyio async def test_identity_verification_sessions_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.identity.verification_sessions.update_async( "vs_xxxxxxxxxxxxx", {"type": "id_number"}, ) http_client_mock.assert_requested( "post", path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="type=id_number", ) def test_identity_verification_sessions_redact_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.identity.VerificationSession.redact("vs_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/redact", query_string="", ) def test_identity_verification_sessions_redact_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/redact", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.identity.verification_sessions.redact("vs_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/redact", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_identity_verification_sessions_redact_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.identity.VerificationSession.redact_async( "vs_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/redact", query_string="", ) @pytest.mark.anyio async def test_identity_verification_sessions_redact_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/redact", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.identity.verification_sessions.redact_async( "vs_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", path="/v1/identity/verification_sessions/vs_xxxxxxxxxxxxx/redact", query_string="", api_base="https://api.stripe.com", ) def test_invoiceitems_delete( self, http_client_mock: HTTPClientMock ) -> None: stripe.InvoiceItem.delete("ii_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/invoiceitems/ii_xxxxxxxxxxxxx", query_string="", ) def test_invoiceitems_delete_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/invoiceitems/ii_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.invoice_items.delete("ii_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/invoiceitems/ii_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_invoiceitems_delete_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.InvoiceItem.delete_async("ii_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/invoiceitems/ii_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_invoiceitems_delete_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/invoiceitems/ii_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.invoice_items.delete_async("ii_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/invoiceitems/ii_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_invoiceitems_get(self, http_client_mock: HTTPClientMock) -> None: stripe.InvoiceItem.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/invoiceitems", query_string="limit=3", ) def test_invoiceitems_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/invoiceitems", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.invoice_items.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/invoiceitems", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_invoiceitems_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.InvoiceItem.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/invoiceitems", query_string="limit=3", ) @pytest.mark.anyio async def test_invoiceitems_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/invoiceitems", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.invoice_items.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/invoiceitems", query_string="limit=3", api_base="https://api.stripe.com", ) def test_invoiceitems_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.InvoiceItem.retrieve("ii_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/invoiceitems/ii_xxxxxxxxxxxxx", query_string="", ) def test_invoiceitems_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/invoiceitems/ii_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.invoice_items.retrieve("ii_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/invoiceitems/ii_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_invoiceitems_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.InvoiceItem.retrieve_async("ii_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/invoiceitems/ii_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_invoiceitems_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/invoiceitems/ii_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.invoice_items.retrieve_async("ii_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/invoiceitems/ii_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_invoiceitems_post(self, http_client_mock: HTTPClientMock) -> None: stripe.InvoiceItem.create( customer="cus_xxxxxxxxxxxxx", price="price_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", path="/v1/invoiceitems", query_string="", post_data="customer=cus_xxxxxxxxxxxxx&price=price_xxxxxxxxxxxxx", ) def test_invoiceitems_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/invoiceitems", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.invoice_items.create( { "customer": "cus_xxxxxxxxxxxxx", "price": "price_xxxxxxxxxxxxx", } ) http_client_mock.assert_requested( "post", path="/v1/invoiceitems", query_string="", api_base="https://api.stripe.com", post_data="customer=cus_xxxxxxxxxxxxx&price=price_xxxxxxxxxxxxx", ) @pytest.mark.anyio async def test_invoiceitems_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.InvoiceItem.create_async( customer="cus_xxxxxxxxxxxxx", price="price_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", path="/v1/invoiceitems", query_string="", post_data="customer=cus_xxxxxxxxxxxxx&price=price_xxxxxxxxxxxxx", ) @pytest.mark.anyio async def test_invoiceitems_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/invoiceitems", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.invoice_items.create_async( { "customer": "cus_xxxxxxxxxxxxx", "price": "price_xxxxxxxxxxxxx", } ) http_client_mock.assert_requested( "post", path="/v1/invoiceitems", query_string="", api_base="https://api.stripe.com", post_data="customer=cus_xxxxxxxxxxxxx&price=price_xxxxxxxxxxxxx", ) def test_invoiceitems_post_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.InvoiceItem.modify( "ii_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/invoiceitems/ii_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) def test_invoiceitems_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/invoiceitems/ii_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.invoice_items.update( "ii_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/invoiceitems/ii_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_invoiceitems_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.InvoiceItem.modify_async( "ii_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/invoiceitems/ii_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_invoiceitems_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/invoiceitems/ii_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.invoice_items.update_async( "ii_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/invoiceitems/ii_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) def test_invoices_delete(self, http_client_mock: HTTPClientMock) -> None: stripe.Invoice.delete("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/invoices/in_xxxxxxxxxxxxx", query_string="", ) def test_invoices_delete_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/invoices/in_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.invoices.delete("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/invoices/in_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_invoices_delete_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Invoice.delete_async("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/invoices/in_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_invoices_delete_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/invoices/in_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.invoices.delete_async("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/invoices/in_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_invoices_finalize_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.Invoice.finalize_invoice("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/invoices/in_xxxxxxxxxxxxx/finalize", query_string="", ) def test_invoices_finalize_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/invoices/in_xxxxxxxxxxxxx/finalize", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.invoices.finalize_invoice("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/invoices/in_xxxxxxxxxxxxx/finalize", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_invoices_finalize_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Invoice.finalize_invoice_async("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/invoices/in_xxxxxxxxxxxxx/finalize", query_string="", ) @pytest.mark.anyio async def test_invoices_finalize_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/invoices/in_xxxxxxxxxxxxx/finalize", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.invoices.finalize_invoice_async("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/invoices/in_xxxxxxxxxxxxx/finalize", query_string="", api_base="https://api.stripe.com", ) def test_invoices_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Invoice.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/invoices", query_string="limit=3", ) def test_invoices_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/invoices", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.invoices.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/invoices", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_invoices_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Invoice.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/invoices", query_string="limit=3", ) @pytest.mark.anyio async def test_invoices_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/invoices", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.invoices.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/invoices", query_string="limit=3", api_base="https://api.stripe.com", ) def test_invoices_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Invoice.retrieve("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/invoices/in_xxxxxxxxxxxxx", query_string="", ) def test_invoices_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/invoices/in_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.invoices.retrieve("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/invoices/in_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_invoices_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Invoice.retrieve_async("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/invoices/in_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_invoices_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/invoices/in_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.invoices.retrieve_async("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/invoices/in_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_invoices_get_3(self, http_client_mock: HTTPClientMock) -> None: stripe.Invoice.retrieve( "in_xxxxxxxxxxxxx", expand=["customer"], ) http_client_mock.assert_requested( "get", path="/v1/invoices/in_xxxxxxxxxxxxx", query_string="expand[0]=customer", ) def test_invoices_get_3_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/invoices/in_xxxxxxxxxxxxx", "expand[0]=customer", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.invoices.retrieve( "in_xxxxxxxxxxxxx", {"expand": ["customer"]}, ) http_client_mock.assert_requested( "get", path="/v1/invoices/in_xxxxxxxxxxxxx", query_string="expand[0]=customer", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_invoices_get_3_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Invoice.retrieve_async( "in_xxxxxxxxxxxxx", expand=["customer"], ) http_client_mock.assert_requested( "get", path="/v1/invoices/in_xxxxxxxxxxxxx", query_string="expand[0]=customer", ) @pytest.mark.anyio async def test_invoices_get_3_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/invoices/in_xxxxxxxxxxxxx", "expand[0]=customer", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.invoices.retrieve_async( "in_xxxxxxxxxxxxx", {"expand": ["customer"]}, ) http_client_mock.assert_requested( "get", path="/v1/invoices/in_xxxxxxxxxxxxx", query_string="expand[0]=customer", api_base="https://api.stripe.com", ) def test_invoices_mark_uncollectible_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.Invoice.mark_uncollectible("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/invoices/in_xxxxxxxxxxxxx/mark_uncollectible", query_string="", ) def test_invoices_mark_uncollectible_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/invoices/in_xxxxxxxxxxxxx/mark_uncollectible", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.invoices.mark_uncollectible("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/invoices/in_xxxxxxxxxxxxx/mark_uncollectible", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_invoices_mark_uncollectible_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Invoice.mark_uncollectible_async("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/invoices/in_xxxxxxxxxxxxx/mark_uncollectible", query_string="", ) @pytest.mark.anyio async def test_invoices_mark_uncollectible_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/invoices/in_xxxxxxxxxxxxx/mark_uncollectible", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.invoices.mark_uncollectible_async("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/invoices/in_xxxxxxxxxxxxx/mark_uncollectible", query_string="", api_base="https://api.stripe.com", ) def test_invoices_pay_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Invoice.pay("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/invoices/in_xxxxxxxxxxxxx/pay", query_string="", ) def test_invoices_pay_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/invoices/in_xxxxxxxxxxxxx/pay", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.invoices.pay("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/invoices/in_xxxxxxxxxxxxx/pay", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_invoices_pay_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Invoice.pay_async("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/invoices/in_xxxxxxxxxxxxx/pay", query_string="", ) @pytest.mark.anyio async def test_invoices_pay_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/invoices/in_xxxxxxxxxxxxx/pay", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.invoices.pay_async("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/invoices/in_xxxxxxxxxxxxx/pay", query_string="", api_base="https://api.stripe.com", ) def test_invoices_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Invoice.create(customer="cus_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/invoices", query_string="", post_data="customer=cus_xxxxxxxxxxxxx", ) def test_invoices_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/invoices", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.invoices.create({"customer": "cus_xxxxxxxxxxxxx"}) http_client_mock.assert_requested( "post", path="/v1/invoices", query_string="", api_base="https://api.stripe.com", post_data="customer=cus_xxxxxxxxxxxxx", ) @pytest.mark.anyio async def test_invoices_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Invoice.create_async(customer="cus_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/invoices", query_string="", post_data="customer=cus_xxxxxxxxxxxxx", ) @pytest.mark.anyio async def test_invoices_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/invoices", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.invoices.create_async({"customer": "cus_xxxxxxxxxxxxx"}) http_client_mock.assert_requested( "post", path="/v1/invoices", query_string="", api_base="https://api.stripe.com", post_data="customer=cus_xxxxxxxxxxxxx", ) def test_invoices_post_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Invoice.modify( "in_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/invoices/in_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) def test_invoices_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/invoices/in_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.invoices.update( "in_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/invoices/in_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_invoices_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Invoice.modify_async( "in_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/invoices/in_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_invoices_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/invoices/in_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.invoices.update_async( "in_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/invoices/in_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) def test_invoices_search_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.Invoice.search( query="total>999 AND metadata['order_id']:'6735'" ) http_client_mock.assert_requested( "get", path="/v1/invoices/search", query_string="query=total%3E999%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", ) def test_invoices_search_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/invoices/search", "query=total%3E999%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.invoices.search( { "query": "total>999 AND metadata['order_id']:'6735'", } ) http_client_mock.assert_requested( "get", path="/v1/invoices/search", query_string="query=total%3E999%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_invoices_search_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Invoice.search_async( query="total>999 AND metadata['order_id']:'6735'", ) http_client_mock.assert_requested( "get", path="/v1/invoices/search", query_string="query=total%3E999%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", ) @pytest.mark.anyio async def test_invoices_search_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/invoices/search", "query=total%3E999%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.invoices.search_async( { "query": "total>999 AND metadata['order_id']:'6735'", } ) http_client_mock.assert_requested( "get", path="/v1/invoices/search", query_string="query=total%3E999%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", api_base="https://api.stripe.com", ) def test_invoices_send_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.Invoice.send_invoice("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/invoices/in_xxxxxxxxxxxxx/send", query_string="", ) def test_invoices_send_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/invoices/in_xxxxxxxxxxxxx/send", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.invoices.send_invoice("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/invoices/in_xxxxxxxxxxxxx/send", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_invoices_send_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Invoice.send_invoice_async("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/invoices/in_xxxxxxxxxxxxx/send", query_string="", ) @pytest.mark.anyio async def test_invoices_send_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/invoices/in_xxxxxxxxxxxxx/send", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.invoices.send_invoice_async("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/invoices/in_xxxxxxxxxxxxx/send", query_string="", api_base="https://api.stripe.com", ) def test_invoices_upcoming_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.Invoice.upcoming(customer="cus_9utnxg47pWjV1e") http_client_mock.assert_requested( "get", path="/v1/invoices/upcoming", query_string="customer=cus_9utnxg47pWjV1e", ) def test_invoices_upcoming_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/invoices/upcoming", "customer=cus_9utnxg47pWjV1e", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.invoices.upcoming({"customer": "cus_9utnxg47pWjV1e"}) http_client_mock.assert_requested( "get", path="/v1/invoices/upcoming", query_string="customer=cus_9utnxg47pWjV1e", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_invoices_upcoming_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Invoice.upcoming_async(customer="cus_9utnxg47pWjV1e") http_client_mock.assert_requested( "get", path="/v1/invoices/upcoming", query_string="customer=cus_9utnxg47pWjV1e", ) @pytest.mark.anyio async def test_invoices_upcoming_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/invoices/upcoming", "customer=cus_9utnxg47pWjV1e", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.invoices.upcoming_async( {"customer": "cus_9utnxg47pWjV1e"} ) http_client_mock.assert_requested( "get", path="/v1/invoices/upcoming", query_string="customer=cus_9utnxg47pWjV1e", api_base="https://api.stripe.com", ) def test_invoices_void_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.Invoice.void_invoice("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/invoices/in_xxxxxxxxxxxxx/void", query_string="", ) def test_invoices_void_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/invoices/in_xxxxxxxxxxxxx/void", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.invoices.void_invoice("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/invoices/in_xxxxxxxxxxxxx/void", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_invoices_void_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Invoice.void_invoice_async("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/invoices/in_xxxxxxxxxxxxx/void", query_string="", ) @pytest.mark.anyio async def test_invoices_void_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/invoices/in_xxxxxxxxxxxxx/void", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.invoices.void_invoice_async("in_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/invoices/in_xxxxxxxxxxxxx/void", query_string="", api_base="https://api.stripe.com", ) def test_issuing_authorizations_approve_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.issuing.Authorization.approve("iauth_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/approve", query_string="", ) def test_issuing_authorizations_approve_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/approve", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.issuing.authorizations.approve("iauth_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/approve", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_issuing_authorizations_approve_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.issuing.Authorization.approve_async("iauth_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/approve", query_string="", ) @pytest.mark.anyio async def test_issuing_authorizations_approve_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/approve", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.issuing.authorizations.approve_async( "iauth_xxxxxxxxxxxxx" ) http_client_mock.assert_requested( "post", path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/approve", query_string="", api_base="https://api.stripe.com", ) def test_issuing_authorizations_decline_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.issuing.Authorization.decline("iauth_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/decline", query_string="", ) def test_issuing_authorizations_decline_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/decline", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.issuing.authorizations.decline("iauth_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/decline", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_issuing_authorizations_decline_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.issuing.Authorization.decline_async("iauth_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/decline", query_string="", ) @pytest.mark.anyio async def test_issuing_authorizations_decline_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/decline", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.issuing.authorizations.decline_async( "iauth_xxxxxxxxxxxxx" ) http_client_mock.assert_requested( "post", path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx/decline", query_string="", api_base="https://api.stripe.com", ) def test_issuing_authorizations_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.issuing.Authorization.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/issuing/authorizations", query_string="limit=3", ) def test_issuing_authorizations_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/issuing/authorizations", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.issuing.authorizations.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/issuing/authorizations", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_issuing_authorizations_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.issuing.Authorization.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/issuing/authorizations", query_string="limit=3", ) @pytest.mark.anyio async def test_issuing_authorizations_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/issuing/authorizations", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.issuing.authorizations.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/issuing/authorizations", query_string="limit=3", api_base="https://api.stripe.com", ) def test_issuing_authorizations_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.issuing.Authorization.retrieve("iauth_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx", query_string="", ) def test_issuing_authorizations_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.issuing.authorizations.retrieve("iauth_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_issuing_authorizations_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.issuing.Authorization.retrieve_async( "iauth_xxxxxxxxxxxxx" ) http_client_mock.assert_requested( "get", path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_issuing_authorizations_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.issuing.authorizations.retrieve_async( "iauth_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_issuing_authorizations_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.issuing.Authorization.modify( "iauth_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) def test_issuing_authorizations_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.issuing.authorizations.update( "iauth_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_issuing_authorizations_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.issuing.Authorization.modify_async( "iauth_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_issuing_authorizations_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.issuing.authorizations.update_async( "iauth_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/issuing/authorizations/iauth_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) def test_issuing_cardholders_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.issuing.Cardholder.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/issuing/cardholders", query_string="limit=3", ) def test_issuing_cardholders_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/issuing/cardholders", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.issuing.cardholders.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/issuing/cardholders", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_issuing_cardholders_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.issuing.Cardholder.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/issuing/cardholders", query_string="limit=3", ) @pytest.mark.anyio async def test_issuing_cardholders_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/issuing/cardholders", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.issuing.cardholders.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/issuing/cardholders", query_string="limit=3", api_base="https://api.stripe.com", ) def test_issuing_cardholders_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.issuing.Cardholder.retrieve("ich_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/issuing/cardholders/ich_xxxxxxxxxxxxx", query_string="", ) def test_issuing_cardholders_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/issuing/cardholders/ich_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.issuing.cardholders.retrieve("ich_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/issuing/cardholders/ich_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_issuing_cardholders_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.issuing.Cardholder.retrieve_async("ich_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/issuing/cardholders/ich_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_issuing_cardholders_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/issuing/cardholders/ich_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.issuing.cardholders.retrieve_async("ich_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/issuing/cardholders/ich_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_issuing_cardholders_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.issuing.Cardholder.create( type="individual", name="Jenny Rosen", email="jenny.rosen@example.com", phone_number="+18888675309", billing={ "address": { "line1": "1234 Main Street", "city": "San Francisco", "state": "CA", "country": "US", "postal_code": "94111", }, }, ) http_client_mock.assert_requested( "post", path="/v1/issuing/cardholders", query_string="", post_data="type=individual&name=Jenny%20Rosen&email=jenny.rosen%40example.com&phone_number=%2B18888675309&billing[address][line1]=1234%20Main%20Street&billing[address][city]=San%20Francisco&billing[address][state]=CA&billing[address][country]=US&billing[address][postal_code]=94111", ) def test_issuing_cardholders_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/issuing/cardholders", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.issuing.cardholders.create( { "type": "individual", "name": "Jenny Rosen", "email": "jenny.rosen@example.com", "phone_number": "+18888675309", "billing": { "address": { "line1": "1234 Main Street", "city": "San Francisco", "state": "CA", "country": "US", "postal_code": "94111", }, }, } ) http_client_mock.assert_requested( "post", path="/v1/issuing/cardholders", query_string="", api_base="https://api.stripe.com", post_data="type=individual&name=Jenny%20Rosen&email=jenny.rosen%40example.com&phone_number=%2B18888675309&billing[address][line1]=1234%20Main%20Street&billing[address][city]=San%20Francisco&billing[address][state]=CA&billing[address][country]=US&billing[address][postal_code]=94111", ) @pytest.mark.anyio async def test_issuing_cardholders_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.issuing.Cardholder.create_async( type="individual", name="Jenny Rosen", email="jenny.rosen@example.com", phone_number="+18888675309", billing={ "address": { "line1": "1234 Main Street", "city": "San Francisco", "state": "CA", "country": "US", "postal_code": "94111", }, }, ) http_client_mock.assert_requested( "post", path="/v1/issuing/cardholders", query_string="", post_data="type=individual&name=Jenny%20Rosen&email=jenny.rosen%40example.com&phone_number=%2B18888675309&billing[address][line1]=1234%20Main%20Street&billing[address][city]=San%20Francisco&billing[address][state]=CA&billing[address][country]=US&billing[address][postal_code]=94111", ) @pytest.mark.anyio async def test_issuing_cardholders_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/issuing/cardholders", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.issuing.cardholders.create_async( { "type": "individual", "name": "Jenny Rosen", "email": "jenny.rosen@example.com", "phone_number": "+18888675309", "billing": { "address": { "line1": "1234 Main Street", "city": "San Francisco", "state": "CA", "country": "US", "postal_code": "94111", }, }, } ) http_client_mock.assert_requested( "post", path="/v1/issuing/cardholders", query_string="", api_base="https://api.stripe.com", post_data="type=individual&name=Jenny%20Rosen&email=jenny.rosen%40example.com&phone_number=%2B18888675309&billing[address][line1]=1234%20Main%20Street&billing[address][city]=San%20Francisco&billing[address][state]=CA&billing[address][country]=US&billing[address][postal_code]=94111", ) def test_issuing_cardholders_post_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.issuing.Cardholder.modify( "ich_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/issuing/cardholders/ich_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) def test_issuing_cardholders_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/issuing/cardholders/ich_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.issuing.cardholders.update( "ich_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/issuing/cardholders/ich_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_issuing_cardholders_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.issuing.Cardholder.modify_async( "ich_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/issuing/cardholders/ich_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_issuing_cardholders_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/issuing/cardholders/ich_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.issuing.cardholders.update_async( "ich_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/issuing/cardholders/ich_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) def test_issuing_cards_get(self, http_client_mock: HTTPClientMock) -> None: stripe.issuing.Card.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/issuing/cards", query_string="limit=3", ) def test_issuing_cards_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/issuing/cards", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.issuing.cards.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/issuing/cards", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_issuing_cards_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.issuing.Card.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/issuing/cards", query_string="limit=3", ) @pytest.mark.anyio async def test_issuing_cards_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/issuing/cards", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.issuing.cards.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/issuing/cards", query_string="limit=3", api_base="https://api.stripe.com", ) def test_issuing_cards_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.issuing.Card.retrieve("ic_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/issuing/cards/ic_xxxxxxxxxxxxx", query_string="", ) def test_issuing_cards_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/issuing/cards/ic_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.issuing.cards.retrieve("ic_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/issuing/cards/ic_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_issuing_cards_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.issuing.Card.retrieve_async("ic_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/issuing/cards/ic_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_issuing_cards_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/issuing/cards/ic_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.issuing.cards.retrieve_async("ic_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/issuing/cards/ic_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_issuing_cards_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.issuing.Card.create( cardholder="ich_xxxxxxxxxxxxx", currency="usd", type="virtual", ) http_client_mock.assert_requested( "post", path="/v1/issuing/cards", query_string="", post_data="cardholder=ich_xxxxxxxxxxxxx¤cy=usd&type=virtual", ) def test_issuing_cards_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/issuing/cards", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.issuing.cards.create( { "cardholder": "ich_xxxxxxxxxxxxx", "currency": "usd", "type": "virtual", } ) http_client_mock.assert_requested( "post", path="/v1/issuing/cards", query_string="", api_base="https://api.stripe.com", post_data="cardholder=ich_xxxxxxxxxxxxx¤cy=usd&type=virtual", ) @pytest.mark.anyio async def test_issuing_cards_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.issuing.Card.create_async( cardholder="ich_xxxxxxxxxxxxx", currency="usd", type="virtual", ) http_client_mock.assert_requested( "post", path="/v1/issuing/cards", query_string="", post_data="cardholder=ich_xxxxxxxxxxxxx¤cy=usd&type=virtual", ) @pytest.mark.anyio async def test_issuing_cards_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/issuing/cards", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.issuing.cards.create_async( { "cardholder": "ich_xxxxxxxxxxxxx", "currency": "usd", "type": "virtual", } ) http_client_mock.assert_requested( "post", path="/v1/issuing/cards", query_string="", api_base="https://api.stripe.com", post_data="cardholder=ich_xxxxxxxxxxxxx¤cy=usd&type=virtual", ) def test_issuing_cards_post_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.issuing.Card.modify( "ic_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/issuing/cards/ic_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) def test_issuing_cards_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/issuing/cards/ic_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.issuing.cards.update( "ic_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/issuing/cards/ic_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_issuing_cards_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.issuing.Card.modify_async( "ic_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/issuing/cards/ic_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_issuing_cards_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/issuing/cards/ic_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.issuing.cards.update_async( "ic_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/issuing/cards/ic_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) def test_issuing_disputes_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.issuing.Dispute.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/issuing/disputes", query_string="limit=3", ) def test_issuing_disputes_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/issuing/disputes", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.issuing.disputes.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/issuing/disputes", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_issuing_disputes_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.issuing.Dispute.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/issuing/disputes", query_string="limit=3", ) @pytest.mark.anyio async def test_issuing_disputes_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/issuing/disputes", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.issuing.disputes.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/issuing/disputes", query_string="limit=3", api_base="https://api.stripe.com", ) def test_issuing_disputes_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.issuing.Dispute.retrieve("idp_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/issuing/disputes/idp_xxxxxxxxxxxxx", query_string="", ) def test_issuing_disputes_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/issuing/disputes/idp_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.issuing.disputes.retrieve("idp_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/issuing/disputes/idp_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_issuing_disputes_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.issuing.Dispute.retrieve_async("idp_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/issuing/disputes/idp_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_issuing_disputes_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/issuing/disputes/idp_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.issuing.disputes.retrieve_async("idp_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/issuing/disputes/idp_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_issuing_disputes_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.issuing.Dispute.create( transaction="ipi_xxxxxxxxxxxxx", evidence={ "reason": "fraudulent", "fraudulent": {"explanation": "Purchase was unrecognized."}, }, ) http_client_mock.assert_requested( "post", path="/v1/issuing/disputes", query_string="", post_data="transaction=ipi_xxxxxxxxxxxxx&evidence[reason]=fraudulent&evidence[fraudulent][explanation]=Purchase%20was%20unrecognized.", ) def test_issuing_disputes_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/issuing/disputes", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.issuing.disputes.create( { "transaction": "ipi_xxxxxxxxxxxxx", "evidence": { "reason": "fraudulent", "fraudulent": { "explanation": "Purchase was unrecognized." }, }, } ) http_client_mock.assert_requested( "post", path="/v1/issuing/disputes", query_string="", api_base="https://api.stripe.com", post_data="transaction=ipi_xxxxxxxxxxxxx&evidence[reason]=fraudulent&evidence[fraudulent][explanation]=Purchase%20was%20unrecognized.", ) @pytest.mark.anyio async def test_issuing_disputes_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.issuing.Dispute.create_async( transaction="ipi_xxxxxxxxxxxxx", evidence={ "reason": "fraudulent", "fraudulent": {"explanation": "Purchase was unrecognized."}, }, ) http_client_mock.assert_requested( "post", path="/v1/issuing/disputes", query_string="", post_data="transaction=ipi_xxxxxxxxxxxxx&evidence[reason]=fraudulent&evidence[fraudulent][explanation]=Purchase%20was%20unrecognized.", ) @pytest.mark.anyio async def test_issuing_disputes_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/issuing/disputes", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.issuing.disputes.create_async( { "transaction": "ipi_xxxxxxxxxxxxx", "evidence": { "reason": "fraudulent", "fraudulent": { "explanation": "Purchase was unrecognized." }, }, } ) http_client_mock.assert_requested( "post", path="/v1/issuing/disputes", query_string="", api_base="https://api.stripe.com", post_data="transaction=ipi_xxxxxxxxxxxxx&evidence[reason]=fraudulent&evidence[fraudulent][explanation]=Purchase%20was%20unrecognized.", ) def test_issuing_disputes_submit_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.issuing.Dispute.submit("idp_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/issuing/disputes/idp_xxxxxxxxxxxxx/submit", query_string="", ) def test_issuing_disputes_submit_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/issuing/disputes/idp_xxxxxxxxxxxxx/submit", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.issuing.disputes.submit("idp_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/issuing/disputes/idp_xxxxxxxxxxxxx/submit", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_issuing_disputes_submit_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.issuing.Dispute.submit_async("idp_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/issuing/disputes/idp_xxxxxxxxxxxxx/submit", query_string="", ) @pytest.mark.anyio async def test_issuing_disputes_submit_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/issuing/disputes/idp_xxxxxxxxxxxxx/submit", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.issuing.disputes.submit_async("idp_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/issuing/disputes/idp_xxxxxxxxxxxxx/submit", query_string="", api_base="https://api.stripe.com", ) def test_issuing_personalization_designs_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.issuing.PersonalizationDesign.list() http_client_mock.assert_requested( "get", path="/v1/issuing/personalization_designs", query_string="", ) def test_issuing_personalization_designs_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/issuing/personalization_designs", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.issuing.personalization_designs.list() http_client_mock.assert_requested( "get", path="/v1/issuing/personalization_designs", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_issuing_personalization_designs_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.issuing.PersonalizationDesign.list_async() http_client_mock.assert_requested( "get", path="/v1/issuing/personalization_designs", query_string="", ) @pytest.mark.anyio async def test_issuing_personalization_designs_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/issuing/personalization_designs", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.issuing.personalization_designs.list_async() http_client_mock.assert_requested( "get", path="/v1/issuing/personalization_designs", query_string="", api_base="https://api.stripe.com", ) def test_issuing_personalization_designs_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.issuing.PersonalizationDesign.retrieve("pd_xyz") http_client_mock.assert_requested( "get", path="/v1/issuing/personalization_designs/pd_xyz", query_string="", ) def test_issuing_personalization_designs_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/issuing/personalization_designs/pd_xyz", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.issuing.personalization_designs.retrieve("pd_xyz") http_client_mock.assert_requested( "get", path="/v1/issuing/personalization_designs/pd_xyz", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_issuing_personalization_designs_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.issuing.PersonalizationDesign.retrieve_async("pd_xyz") http_client_mock.assert_requested( "get", path="/v1/issuing/personalization_designs/pd_xyz", query_string="", ) @pytest.mark.anyio async def test_issuing_personalization_designs_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/issuing/personalization_designs/pd_xyz", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.issuing.personalization_designs.retrieve_async("pd_xyz") http_client_mock.assert_requested( "get", path="/v1/issuing/personalization_designs/pd_xyz", query_string="", api_base="https://api.stripe.com", ) def test_issuing_personalization_designs_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.issuing.PersonalizationDesign.create(physical_bundle="pb_xyz") http_client_mock.assert_requested( "post", path="/v1/issuing/personalization_designs", query_string="", post_data="physical_bundle=pb_xyz", ) def test_issuing_personalization_designs_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/issuing/personalization_designs", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.issuing.personalization_designs.create( { "physical_bundle": "pb_xyz", } ) http_client_mock.assert_requested( "post", path="/v1/issuing/personalization_designs", query_string="", api_base="https://api.stripe.com", post_data="physical_bundle=pb_xyz", ) @pytest.mark.anyio async def test_issuing_personalization_designs_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.issuing.PersonalizationDesign.create_async( physical_bundle="pb_xyz", ) http_client_mock.assert_requested( "post", path="/v1/issuing/personalization_designs", query_string="", post_data="physical_bundle=pb_xyz", ) @pytest.mark.anyio async def test_issuing_personalization_designs_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/issuing/personalization_designs", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.issuing.personalization_designs.create_async( { "physical_bundle": "pb_xyz", } ) http_client_mock.assert_requested( "post", path="/v1/issuing/personalization_designs", query_string="", api_base="https://api.stripe.com", post_data="physical_bundle=pb_xyz", ) def test_issuing_personalization_designs_post_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.issuing.PersonalizationDesign.modify("pd_xyz") http_client_mock.assert_requested( "post", path="/v1/issuing/personalization_designs/pd_xyz", query_string="", ) def test_issuing_personalization_designs_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/issuing/personalization_designs/pd_xyz", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.issuing.personalization_designs.update("pd_xyz") http_client_mock.assert_requested( "post", path="/v1/issuing/personalization_designs/pd_xyz", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_issuing_personalization_designs_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.issuing.PersonalizationDesign.modify_async("pd_xyz") http_client_mock.assert_requested( "post", path="/v1/issuing/personalization_designs/pd_xyz", query_string="", ) @pytest.mark.anyio async def test_issuing_personalization_designs_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/issuing/personalization_designs/pd_xyz", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.issuing.personalization_designs.update_async("pd_xyz") http_client_mock.assert_requested( "post", path="/v1/issuing/personalization_designs/pd_xyz", query_string="", api_base="https://api.stripe.com", ) def test_issuing_physical_bundles_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.issuing.PhysicalBundle.list() http_client_mock.assert_requested( "get", path="/v1/issuing/physical_bundles", query_string="", ) def test_issuing_physical_bundles_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/issuing/physical_bundles", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.issuing.physical_bundles.list() http_client_mock.assert_requested( "get", path="/v1/issuing/physical_bundles", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_issuing_physical_bundles_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.issuing.PhysicalBundle.list_async() http_client_mock.assert_requested( "get", path="/v1/issuing/physical_bundles", query_string="", ) @pytest.mark.anyio async def test_issuing_physical_bundles_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/issuing/physical_bundles", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.issuing.physical_bundles.list_async() http_client_mock.assert_requested( "get", path="/v1/issuing/physical_bundles", query_string="", api_base="https://api.stripe.com", ) def test_issuing_physical_bundles_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.issuing.PhysicalBundle.retrieve("pb_xyz") http_client_mock.assert_requested( "get", path="/v1/issuing/physical_bundles/pb_xyz", query_string="", ) def test_issuing_physical_bundles_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/issuing/physical_bundles/pb_xyz", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.issuing.physical_bundles.retrieve("pb_xyz") http_client_mock.assert_requested( "get", path="/v1/issuing/physical_bundles/pb_xyz", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_issuing_physical_bundles_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.issuing.PhysicalBundle.retrieve_async("pb_xyz") http_client_mock.assert_requested( "get", path="/v1/issuing/physical_bundles/pb_xyz", query_string="", ) @pytest.mark.anyio async def test_issuing_physical_bundles_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/issuing/physical_bundles/pb_xyz", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.issuing.physical_bundles.retrieve_async("pb_xyz") http_client_mock.assert_requested( "get", path="/v1/issuing/physical_bundles/pb_xyz", query_string="", api_base="https://api.stripe.com", ) def test_issuing_transactions_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.issuing.Transaction.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/issuing/transactions", query_string="limit=3", ) def test_issuing_transactions_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/issuing/transactions", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.issuing.transactions.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/issuing/transactions", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_issuing_transactions_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.issuing.Transaction.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/issuing/transactions", query_string="limit=3", ) @pytest.mark.anyio async def test_issuing_transactions_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/issuing/transactions", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.issuing.transactions.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/issuing/transactions", query_string="limit=3", api_base="https://api.stripe.com", ) def test_issuing_transactions_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.issuing.Transaction.retrieve("ipi_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/issuing/transactions/ipi_xxxxxxxxxxxxx", query_string="", ) def test_issuing_transactions_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/issuing/transactions/ipi_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.issuing.transactions.retrieve("ipi_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/issuing/transactions/ipi_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_issuing_transactions_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.issuing.Transaction.retrieve_async("ipi_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/issuing/transactions/ipi_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_issuing_transactions_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/issuing/transactions/ipi_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.issuing.transactions.retrieve_async("ipi_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/issuing/transactions/ipi_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_issuing_transactions_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.issuing.Transaction.modify( "ipi_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/issuing/transactions/ipi_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) def test_issuing_transactions_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/issuing/transactions/ipi_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.issuing.transactions.update( "ipi_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/issuing/transactions/ipi_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_issuing_transactions_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.issuing.Transaction.modify_async( "ipi_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/issuing/transactions/ipi_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_issuing_transactions_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/issuing/transactions/ipi_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.issuing.transactions.update_async( "ipi_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/issuing/transactions/ipi_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) def test_mandates_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Mandate.retrieve("mandate_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/mandates/mandate_xxxxxxxxxxxxx", query_string="", ) def test_mandates_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/mandates/mandate_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.mandates.retrieve("mandate_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/mandates/mandate_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_mandates_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Mandate.retrieve_async("mandate_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/mandates/mandate_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_mandates_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/mandates/mandate_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.mandates.retrieve_async("mandate_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/mandates/mandate_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_payment_intents_apply_customer_balance_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.PaymentIntent.apply_customer_balance("pi_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payment_intents/pi_xxxxxxxxxxxxx/apply_customer_balance", query_string="", ) def test_payment_intents_apply_customer_balance_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payment_intents/pi_xxxxxxxxxxxxx/apply_customer_balance", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.payment_intents.apply_customer_balance("pi_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payment_intents/pi_xxxxxxxxxxxxx/apply_customer_balance", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_payment_intents_apply_customer_balance_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.PaymentIntent.apply_customer_balance_async( "pi_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", path="/v1/payment_intents/pi_xxxxxxxxxxxxx/apply_customer_balance", query_string="", ) @pytest.mark.anyio async def test_payment_intents_apply_customer_balance_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payment_intents/pi_xxxxxxxxxxxxx/apply_customer_balance", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.payment_intents.apply_customer_balance_async( "pi_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", path="/v1/payment_intents/pi_xxxxxxxxxxxxx/apply_customer_balance", query_string="", api_base="https://api.stripe.com", ) def test_payment_intents_cancel_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.PaymentIntent.cancel("pi_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payment_intents/pi_xxxxxxxxxxxxx/cancel", query_string="", ) def test_payment_intents_cancel_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payment_intents/pi_xxxxxxxxxxxxx/cancel", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.payment_intents.cancel("pi_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payment_intents/pi_xxxxxxxxxxxxx/cancel", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_payment_intents_cancel_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.PaymentIntent.cancel_async("pi_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payment_intents/pi_xxxxxxxxxxxxx/cancel", query_string="", ) @pytest.mark.anyio async def test_payment_intents_cancel_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payment_intents/pi_xxxxxxxxxxxxx/cancel", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.payment_intents.cancel_async("pi_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payment_intents/pi_xxxxxxxxxxxxx/cancel", query_string="", api_base="https://api.stripe.com", ) def test_payment_intents_capture_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.PaymentIntent.capture("pi_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payment_intents/pi_xxxxxxxxxxxxx/capture", query_string="", ) def test_payment_intents_capture_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payment_intents/pi_xxxxxxxxxxxxx/capture", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.payment_intents.capture("pi_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payment_intents/pi_xxxxxxxxxxxxx/capture", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_payment_intents_capture_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.PaymentIntent.capture_async("pi_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payment_intents/pi_xxxxxxxxxxxxx/capture", query_string="", ) @pytest.mark.anyio async def test_payment_intents_capture_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payment_intents/pi_xxxxxxxxxxxxx/capture", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.payment_intents.capture_async("pi_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payment_intents/pi_xxxxxxxxxxxxx/capture", query_string="", api_base="https://api.stripe.com", ) def test_payment_intents_confirm_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.PaymentIntent.confirm( "pi_xxxxxxxxxxxxx", payment_method="pm_card_visa", ) http_client_mock.assert_requested( "post", path="/v1/payment_intents/pi_xxxxxxxxxxxxx/confirm", query_string="", post_data="payment_method=pm_card_visa", ) def test_payment_intents_confirm_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payment_intents/pi_xxxxxxxxxxxxx/confirm", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.payment_intents.confirm( "pi_xxxxxxxxxxxxx", {"payment_method": "pm_card_visa"}, ) http_client_mock.assert_requested( "post", path="/v1/payment_intents/pi_xxxxxxxxxxxxx/confirm", query_string="", api_base="https://api.stripe.com", post_data="payment_method=pm_card_visa", ) @pytest.mark.anyio async def test_payment_intents_confirm_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.PaymentIntent.confirm_async( "pi_xxxxxxxxxxxxx", payment_method="pm_card_visa", ) http_client_mock.assert_requested( "post", path="/v1/payment_intents/pi_xxxxxxxxxxxxx/confirm", query_string="", post_data="payment_method=pm_card_visa", ) @pytest.mark.anyio async def test_payment_intents_confirm_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payment_intents/pi_xxxxxxxxxxxxx/confirm", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.payment_intents.confirm_async( "pi_xxxxxxxxxxxxx", {"payment_method": "pm_card_visa"}, ) http_client_mock.assert_requested( "post", path="/v1/payment_intents/pi_xxxxxxxxxxxxx/confirm", query_string="", api_base="https://api.stripe.com", post_data="payment_method=pm_card_visa", ) def test_payment_intents_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.PaymentIntent.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/payment_intents", query_string="limit=3", ) def test_payment_intents_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/payment_intents", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.payment_intents.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/payment_intents", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_payment_intents_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.PaymentIntent.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/payment_intents", query_string="limit=3", ) @pytest.mark.anyio async def test_payment_intents_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/payment_intents", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.payment_intents.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/payment_intents", query_string="limit=3", api_base="https://api.stripe.com", ) def test_payment_intents_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.PaymentIntent.retrieve("pi_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/payment_intents/pi_xxxxxxxxxxxxx", query_string="", ) def test_payment_intents_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/payment_intents/pi_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.payment_intents.retrieve("pi_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/payment_intents/pi_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_payment_intents_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.PaymentIntent.retrieve_async("pi_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/payment_intents/pi_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_payment_intents_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/payment_intents/pi_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.payment_intents.retrieve_async("pi_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/payment_intents/pi_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_payment_intents_increment_authorization_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.PaymentIntent.increment_authorization( "pi_xxxxxxxxxxxxx", amount=2099, ) http_client_mock.assert_requested( "post", path="/v1/payment_intents/pi_xxxxxxxxxxxxx/increment_authorization", query_string="", post_data="amount=2099", ) def test_payment_intents_increment_authorization_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payment_intents/pi_xxxxxxxxxxxxx/increment_authorization", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.payment_intents.increment_authorization( "pi_xxxxxxxxxxxxx", {"amount": 2099}, ) http_client_mock.assert_requested( "post", path="/v1/payment_intents/pi_xxxxxxxxxxxxx/increment_authorization", query_string="", api_base="https://api.stripe.com", post_data="amount=2099", ) @pytest.mark.anyio async def test_payment_intents_increment_authorization_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.PaymentIntent.increment_authorization_async( "pi_xxxxxxxxxxxxx", amount=2099, ) http_client_mock.assert_requested( "post", path="/v1/payment_intents/pi_xxxxxxxxxxxxx/increment_authorization", query_string="", post_data="amount=2099", ) @pytest.mark.anyio async def test_payment_intents_increment_authorization_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payment_intents/pi_xxxxxxxxxxxxx/increment_authorization", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.payment_intents.increment_authorization_async( "pi_xxxxxxxxxxxxx", {"amount": 2099}, ) http_client_mock.assert_requested( "post", path="/v1/payment_intents/pi_xxxxxxxxxxxxx/increment_authorization", query_string="", api_base="https://api.stripe.com", post_data="amount=2099", ) def test_payment_intents_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.PaymentIntent.create( amount=1099, currency="eur", automatic_payment_methods={"enabled": True}, ) http_client_mock.assert_requested( "post", path="/v1/payment_intents", query_string="", post_data="amount=1099¤cy=eur&automatic_payment_methods[enabled]=True", ) def test_payment_intents_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payment_intents", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.payment_intents.create( { "amount": 1099, "currency": "eur", "automatic_payment_methods": {"enabled": True}, } ) http_client_mock.assert_requested( "post", path="/v1/payment_intents", query_string="", api_base="https://api.stripe.com", post_data="amount=1099¤cy=eur&automatic_payment_methods[enabled]=True", ) @pytest.mark.anyio async def test_payment_intents_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.PaymentIntent.create_async( amount=1099, currency="eur", automatic_payment_methods={"enabled": True}, ) http_client_mock.assert_requested( "post", path="/v1/payment_intents", query_string="", post_data="amount=1099¤cy=eur&automatic_payment_methods[enabled]=True", ) @pytest.mark.anyio async def test_payment_intents_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payment_intents", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.payment_intents.create_async( { "amount": 1099, "currency": "eur", "automatic_payment_methods": {"enabled": True}, } ) http_client_mock.assert_requested( "post", path="/v1/payment_intents", query_string="", api_base="https://api.stripe.com", post_data="amount=1099¤cy=eur&automatic_payment_methods[enabled]=True", ) def test_payment_intents_post_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.PaymentIntent.create( amount=2000, currency="usd", automatic_payment_methods={"enabled": True}, ) http_client_mock.assert_requested( "post", path="/v1/payment_intents", query_string="", post_data="amount=2000¤cy=usd&automatic_payment_methods[enabled]=True", ) def test_payment_intents_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payment_intents", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.payment_intents.create( { "amount": 2000, "currency": "usd", "automatic_payment_methods": {"enabled": True}, } ) http_client_mock.assert_requested( "post", path="/v1/payment_intents", query_string="", api_base="https://api.stripe.com", post_data="amount=2000¤cy=usd&automatic_payment_methods[enabled]=True", ) @pytest.mark.anyio async def test_payment_intents_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.PaymentIntent.create_async( amount=2000, currency="usd", automatic_payment_methods={"enabled": True}, ) http_client_mock.assert_requested( "post", path="/v1/payment_intents", query_string="", post_data="amount=2000¤cy=usd&automatic_payment_methods[enabled]=True", ) @pytest.mark.anyio async def test_payment_intents_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payment_intents", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.payment_intents.create_async( { "amount": 2000, "currency": "usd", "automatic_payment_methods": {"enabled": True}, } ) http_client_mock.assert_requested( "post", path="/v1/payment_intents", query_string="", api_base="https://api.stripe.com", post_data="amount=2000¤cy=usd&automatic_payment_methods[enabled]=True", ) def test_payment_intents_post_3( self, http_client_mock: HTTPClientMock ) -> None: stripe.PaymentIntent.modify( "pi_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/payment_intents/pi_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) def test_payment_intents_post_3_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payment_intents/pi_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.payment_intents.update( "pi_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/payment_intents/pi_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_payment_intents_post_3_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.PaymentIntent.modify_async( "pi_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/payment_intents/pi_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_payment_intents_post_3_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payment_intents/pi_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.payment_intents.update_async( "pi_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/payment_intents/pi_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) def test_payment_intents_post_4( self, http_client_mock: HTTPClientMock ) -> None: stripe.PaymentIntent.create( amount=200, currency="usd", payment_method_data={"type": "p24", "p24": {"bank": "blik"}}, ) http_client_mock.assert_requested( "post", path="/v1/payment_intents", query_string="", post_data="amount=200¤cy=usd&payment_method_data[type]=p24&payment_method_data[p24][bank]=blik", ) def test_payment_intents_post_4_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payment_intents", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.payment_intents.create( { "amount": 200, "currency": "usd", "payment_method_data": { "type": "p24", "p24": {"bank": "blik"}, }, } ) http_client_mock.assert_requested( "post", path="/v1/payment_intents", query_string="", api_base="https://api.stripe.com", post_data="amount=200¤cy=usd&payment_method_data[type]=p24&payment_method_data[p24][bank]=blik", ) @pytest.mark.anyio async def test_payment_intents_post_4_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.PaymentIntent.create_async( amount=200, currency="usd", payment_method_data={"type": "p24", "p24": {"bank": "blik"}}, ) http_client_mock.assert_requested( "post", path="/v1/payment_intents", query_string="", post_data="amount=200¤cy=usd&payment_method_data[type]=p24&payment_method_data[p24][bank]=blik", ) @pytest.mark.anyio async def test_payment_intents_post_4_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payment_intents", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.payment_intents.create_async( { "amount": 200, "currency": "usd", "payment_method_data": { "type": "p24", "p24": {"bank": "blik"}, }, } ) http_client_mock.assert_requested( "post", path="/v1/payment_intents", query_string="", api_base="https://api.stripe.com", post_data="amount=200¤cy=usd&payment_method_data[type]=p24&payment_method_data[p24][bank]=blik", ) def test_payment_intents_search_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.PaymentIntent.search( query="status:'succeeded' AND metadata['order_id']:'6735'", ) http_client_mock.assert_requested( "get", path="/v1/payment_intents/search", query_string="query=status%3A%27succeeded%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", ) def test_payment_intents_search_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/payment_intents/search", "query=status%3A%27succeeded%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.payment_intents.search( { "query": "status:'succeeded' AND metadata['order_id']:'6735'", } ) http_client_mock.assert_requested( "get", path="/v1/payment_intents/search", query_string="query=status%3A%27succeeded%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_payment_intents_search_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.PaymentIntent.search_async( query="status:'succeeded' AND metadata['order_id']:'6735'", ) http_client_mock.assert_requested( "get", path="/v1/payment_intents/search", query_string="query=status%3A%27succeeded%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", ) @pytest.mark.anyio async def test_payment_intents_search_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/payment_intents/search", "query=status%3A%27succeeded%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.payment_intents.search_async( { "query": "status:'succeeded' AND metadata['order_id']:'6735'", } ) http_client_mock.assert_requested( "get", path="/v1/payment_intents/search", query_string="query=status%3A%27succeeded%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", api_base="https://api.stripe.com", ) def test_payment_intents_verify_microdeposits_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.PaymentIntent.verify_microdeposits("pi_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits", query_string="", ) def test_payment_intents_verify_microdeposits_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.payment_intents.verify_microdeposits("pi_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_payment_intents_verify_microdeposits_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.PaymentIntent.verify_microdeposits_async( "pi_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", path="/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits", query_string="", ) @pytest.mark.anyio async def test_payment_intents_verify_microdeposits_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.payment_intents.verify_microdeposits_async( "pi_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", path="/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits", query_string="", api_base="https://api.stripe.com", ) def test_payment_intents_verify_microdeposits_post_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.PaymentIntent.verify_microdeposits( "pi_xxxxxxxxxxxxx", amounts=[32, 45], ) http_client_mock.assert_requested( "post", path="/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits", query_string="", post_data="amounts[0]=32&amounts[1]=45", ) def test_payment_intents_verify_microdeposits_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.payment_intents.verify_microdeposits( "pi_xxxxxxxxxxxxx", {"amounts": [32, 45]}, ) http_client_mock.assert_requested( "post", path="/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits", query_string="", api_base="https://api.stripe.com", post_data="amounts[0]=32&amounts[1]=45", ) @pytest.mark.anyio async def test_payment_intents_verify_microdeposits_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.PaymentIntent.verify_microdeposits_async( "pi_xxxxxxxxxxxxx", amounts=[32, 45], ) http_client_mock.assert_requested( "post", path="/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits", query_string="", post_data="amounts[0]=32&amounts[1]=45", ) @pytest.mark.anyio async def test_payment_intents_verify_microdeposits_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.payment_intents.verify_microdeposits_async( "pi_xxxxxxxxxxxxx", {"amounts": [32, 45]}, ) http_client_mock.assert_requested( "post", path="/v1/payment_intents/pi_xxxxxxxxxxxxx/verify_microdeposits", query_string="", api_base="https://api.stripe.com", post_data="amounts[0]=32&amounts[1]=45", ) def test_payment_links_get(self, http_client_mock: HTTPClientMock) -> None: stripe.PaymentLink.retrieve("pl_xyz") http_client_mock.assert_requested( "get", path="/v1/payment_links/pl_xyz", query_string="", ) def test_payment_links_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/payment_links/pl_xyz", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.payment_links.retrieve("pl_xyz") http_client_mock.assert_requested( "get", path="/v1/payment_links/pl_xyz", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_payment_links_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.PaymentLink.retrieve_async("pl_xyz") http_client_mock.assert_requested( "get", path="/v1/payment_links/pl_xyz", query_string="", ) @pytest.mark.anyio async def test_payment_links_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/payment_links/pl_xyz", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.payment_links.retrieve_async("pl_xyz") http_client_mock.assert_requested( "get", path="/v1/payment_links/pl_xyz", query_string="", api_base="https://api.stripe.com", ) def test_payment_links_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.PaymentLink.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/payment_links", query_string="limit=3", ) def test_payment_links_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/payment_links", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.payment_links.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/payment_links", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_payment_links_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.PaymentLink.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/payment_links", query_string="limit=3", ) @pytest.mark.anyio async def test_payment_links_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/payment_links", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.payment_links.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/payment_links", query_string="limit=3", api_base="https://api.stripe.com", ) def test_payment_links_get_3( self, http_client_mock: HTTPClientMock ) -> None: stripe.PaymentLink.retrieve("plink_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/payment_links/plink_xxxxxxxxxxxxx", query_string="", ) def test_payment_links_get_3_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/payment_links/plink_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.payment_links.retrieve("plink_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/payment_links/plink_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_payment_links_get_3_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.PaymentLink.retrieve_async("plink_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/payment_links/plink_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_payment_links_get_3_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/payment_links/plink_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.payment_links.retrieve_async("plink_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/payment_links/plink_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_payment_links_line_items_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.PaymentLink.list_line_items("pl_xyz") http_client_mock.assert_requested( "get", path="/v1/payment_links/pl_xyz/line_items", query_string="", ) def test_payment_links_line_items_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/payment_links/pl_xyz/line_items", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.payment_links.line_items.list("pl_xyz") http_client_mock.assert_requested( "get", path="/v1/payment_links/pl_xyz/line_items", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_payment_links_line_items_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.PaymentLink.list_line_items_async("pl_xyz") http_client_mock.assert_requested( "get", path="/v1/payment_links/pl_xyz/line_items", query_string="", ) @pytest.mark.anyio async def test_payment_links_line_items_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/payment_links/pl_xyz/line_items", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.payment_links.line_items.list_async("pl_xyz") http_client_mock.assert_requested( "get", path="/v1/payment_links/pl_xyz/line_items", query_string="", api_base="https://api.stripe.com", ) def test_payment_links_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.PaymentLink.create( line_items=[{"price": "price_xxxxxxxxxxxxx", "quantity": 1}], ) http_client_mock.assert_requested( "post", path="/v1/payment_links", query_string="", post_data="line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=1", ) def test_payment_links_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payment_links", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.payment_links.create( { "line_items": [ {"price": "price_xxxxxxxxxxxxx", "quantity": 1} ], } ) http_client_mock.assert_requested( "post", path="/v1/payment_links", query_string="", api_base="https://api.stripe.com", post_data="line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=1", ) @pytest.mark.anyio async def test_payment_links_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.PaymentLink.create_async( line_items=[{"price": "price_xxxxxxxxxxxxx", "quantity": 1}], ) http_client_mock.assert_requested( "post", path="/v1/payment_links", query_string="", post_data="line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=1", ) @pytest.mark.anyio async def test_payment_links_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payment_links", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.payment_links.create_async( { "line_items": [ {"price": "price_xxxxxxxxxxxxx", "quantity": 1} ], } ) http_client_mock.assert_requested( "post", path="/v1/payment_links", query_string="", api_base="https://api.stripe.com", post_data="line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=1", ) def test_payment_links_post_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.PaymentLink.create( line_items=[{"price": "price_xxxxxxxxxxxxx", "quantity": 1}], ) http_client_mock.assert_requested( "post", path="/v1/payment_links", query_string="", post_data="line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=1", ) def test_payment_links_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payment_links", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.payment_links.create( { "line_items": [ {"price": "price_xxxxxxxxxxxxx", "quantity": 1} ], } ) http_client_mock.assert_requested( "post", path="/v1/payment_links", query_string="", api_base="https://api.stripe.com", post_data="line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=1", ) @pytest.mark.anyio async def test_payment_links_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.PaymentLink.create_async( line_items=[{"price": "price_xxxxxxxxxxxxx", "quantity": 1}], ) http_client_mock.assert_requested( "post", path="/v1/payment_links", query_string="", post_data="line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=1", ) @pytest.mark.anyio async def test_payment_links_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payment_links", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.payment_links.create_async( { "line_items": [ {"price": "price_xxxxxxxxxxxxx", "quantity": 1} ], } ) http_client_mock.assert_requested( "post", path="/v1/payment_links", query_string="", api_base="https://api.stripe.com", post_data="line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=1", ) def test_payment_links_post_3( self, http_client_mock: HTTPClientMock ) -> None: stripe.PaymentLink.modify( "plink_xxxxxxxxxxxxx", active=False, ) http_client_mock.assert_requested( "post", path="/v1/payment_links/plink_xxxxxxxxxxxxx", query_string="", post_data="active=False", ) def test_payment_links_post_3_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payment_links/plink_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.payment_links.update( "plink_xxxxxxxxxxxxx", {"active": False}, ) http_client_mock.assert_requested( "post", path="/v1/payment_links/plink_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="active=False", ) @pytest.mark.anyio async def test_payment_links_post_3_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.PaymentLink.modify_async( "plink_xxxxxxxxxxxxx", active=False, ) http_client_mock.assert_requested( "post", path="/v1/payment_links/plink_xxxxxxxxxxxxx", query_string="", post_data="active=False", ) @pytest.mark.anyio async def test_payment_links_post_3_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payment_links/plink_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.payment_links.update_async( "plink_xxxxxxxxxxxxx", {"active": False}, ) http_client_mock.assert_requested( "post", path="/v1/payment_links/plink_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="active=False", ) def test_payment_method_configurations_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.PaymentMethodConfiguration.list(application="foo") http_client_mock.assert_requested( "get", path="/v1/payment_method_configurations", query_string="application=foo", ) def test_payment_method_configurations_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/payment_method_configurations", "application=foo", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.payment_method_configurations.list({"application": "foo"}) http_client_mock.assert_requested( "get", path="/v1/payment_method_configurations", query_string="application=foo", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_payment_method_configurations_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.PaymentMethodConfiguration.list_async(application="foo") http_client_mock.assert_requested( "get", path="/v1/payment_method_configurations", query_string="application=foo", ) @pytest.mark.anyio async def test_payment_method_configurations_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/payment_method_configurations", "application=foo", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.payment_method_configurations.list_async( { "application": "foo", } ) http_client_mock.assert_requested( "get", path="/v1/payment_method_configurations", query_string="application=foo", api_base="https://api.stripe.com", ) def test_payment_method_configurations_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.PaymentMethodConfiguration.retrieve("foo") http_client_mock.assert_requested( "get", path="/v1/payment_method_configurations/foo", query_string="", ) def test_payment_method_configurations_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/payment_method_configurations/foo", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.payment_method_configurations.retrieve("foo") http_client_mock.assert_requested( "get", path="/v1/payment_method_configurations/foo", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_payment_method_configurations_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.PaymentMethodConfiguration.retrieve_async("foo") http_client_mock.assert_requested( "get", path="/v1/payment_method_configurations/foo", query_string="", ) @pytest.mark.anyio async def test_payment_method_configurations_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/payment_method_configurations/foo", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.payment_method_configurations.retrieve_async("foo") http_client_mock.assert_requested( "get", path="/v1/payment_method_configurations/foo", query_string="", api_base="https://api.stripe.com", ) def test_payment_method_configurations_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.PaymentMethodConfiguration.create( acss_debit={"display_preference": {"preference": "none"}}, affirm={"display_preference": {"preference": "none"}}, ) http_client_mock.assert_requested( "post", path="/v1/payment_method_configurations", query_string="", post_data="acss_debit[display_preference][preference]=none&affirm[display_preference][preference]=none", ) def test_payment_method_configurations_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payment_method_configurations", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.payment_method_configurations.create( { "acss_debit": {"display_preference": {"preference": "none"}}, "affirm": {"display_preference": {"preference": "none"}}, } ) http_client_mock.assert_requested( "post", path="/v1/payment_method_configurations", query_string="", api_base="https://api.stripe.com", post_data="acss_debit[display_preference][preference]=none&affirm[display_preference][preference]=none", ) @pytest.mark.anyio async def test_payment_method_configurations_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.PaymentMethodConfiguration.create_async( acss_debit={"display_preference": {"preference": "none"}}, affirm={"display_preference": {"preference": "none"}}, ) http_client_mock.assert_requested( "post", path="/v1/payment_method_configurations", query_string="", post_data="acss_debit[display_preference][preference]=none&affirm[display_preference][preference]=none", ) @pytest.mark.anyio async def test_payment_method_configurations_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payment_method_configurations", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.payment_method_configurations.create_async( { "acss_debit": {"display_preference": {"preference": "none"}}, "affirm": {"display_preference": {"preference": "none"}}, } ) http_client_mock.assert_requested( "post", path="/v1/payment_method_configurations", query_string="", api_base="https://api.stripe.com", post_data="acss_debit[display_preference][preference]=none&affirm[display_preference][preference]=none", ) def test_payment_method_configurations_post_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.PaymentMethodConfiguration.modify( "foo", acss_debit={"display_preference": {"preference": "on"}}, ) http_client_mock.assert_requested( "post", path="/v1/payment_method_configurations/foo", query_string="", post_data="acss_debit[display_preference][preference]=on", ) def test_payment_method_configurations_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payment_method_configurations/foo", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.payment_method_configurations.update( "foo", {"acss_debit": {"display_preference": {"preference": "on"}}}, ) http_client_mock.assert_requested( "post", path="/v1/payment_method_configurations/foo", query_string="", api_base="https://api.stripe.com", post_data="acss_debit[display_preference][preference]=on", ) @pytest.mark.anyio async def test_payment_method_configurations_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.PaymentMethodConfiguration.modify_async( "foo", acss_debit={"display_preference": {"preference": "on"}}, ) http_client_mock.assert_requested( "post", path="/v1/payment_method_configurations/foo", query_string="", post_data="acss_debit[display_preference][preference]=on", ) @pytest.mark.anyio async def test_payment_method_configurations_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payment_method_configurations/foo", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.payment_method_configurations.update_async( "foo", {"acss_debit": {"display_preference": {"preference": "on"}}}, ) http_client_mock.assert_requested( "post", path="/v1/payment_method_configurations/foo", query_string="", api_base="https://api.stripe.com", post_data="acss_debit[display_preference][preference]=on", ) def test_payment_methods_attach_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.PaymentMethod.attach( "pm_xxxxxxxxxxxxx", customer="cus_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", path="/v1/payment_methods/pm_xxxxxxxxxxxxx/attach", query_string="", post_data="customer=cus_xxxxxxxxxxxxx", ) def test_payment_methods_attach_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payment_methods/pm_xxxxxxxxxxxxx/attach", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.payment_methods.attach( "pm_xxxxxxxxxxxxx", {"customer": "cus_xxxxxxxxxxxxx"}, ) http_client_mock.assert_requested( "post", path="/v1/payment_methods/pm_xxxxxxxxxxxxx/attach", query_string="", api_base="https://api.stripe.com", post_data="customer=cus_xxxxxxxxxxxxx", ) @pytest.mark.anyio async def test_payment_methods_attach_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.PaymentMethod.attach_async( "pm_xxxxxxxxxxxxx", customer="cus_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", path="/v1/payment_methods/pm_xxxxxxxxxxxxx/attach", query_string="", post_data="customer=cus_xxxxxxxxxxxxx", ) @pytest.mark.anyio async def test_payment_methods_attach_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payment_methods/pm_xxxxxxxxxxxxx/attach", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.payment_methods.attach_async( "pm_xxxxxxxxxxxxx", {"customer": "cus_xxxxxxxxxxxxx"}, ) http_client_mock.assert_requested( "post", path="/v1/payment_methods/pm_xxxxxxxxxxxxx/attach", query_string="", api_base="https://api.stripe.com", post_data="customer=cus_xxxxxxxxxxxxx", ) def test_payment_methods_detach_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.PaymentMethod.detach("pm_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payment_methods/pm_xxxxxxxxxxxxx/detach", query_string="", ) def test_payment_methods_detach_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payment_methods/pm_xxxxxxxxxxxxx/detach", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.payment_methods.detach("pm_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payment_methods/pm_xxxxxxxxxxxxx/detach", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_payment_methods_detach_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.PaymentMethod.detach_async("pm_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payment_methods/pm_xxxxxxxxxxxxx/detach", query_string="", ) @pytest.mark.anyio async def test_payment_methods_detach_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payment_methods/pm_xxxxxxxxxxxxx/detach", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.payment_methods.detach_async("pm_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payment_methods/pm_xxxxxxxxxxxxx/detach", query_string="", api_base="https://api.stripe.com", ) def test_payment_methods_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.PaymentMethod.list( customer="cus_xxxxxxxxxxxxx", type="card", ) http_client_mock.assert_requested( "get", path="/v1/payment_methods", query_string="customer=cus_xxxxxxxxxxxxx&type=card", ) def test_payment_methods_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/payment_methods", "customer=cus_xxxxxxxxxxxxx&type=card", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.payment_methods.list( { "customer": "cus_xxxxxxxxxxxxx", "type": "card", } ) http_client_mock.assert_requested( "get", path="/v1/payment_methods", query_string="customer=cus_xxxxxxxxxxxxx&type=card", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_payment_methods_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.PaymentMethod.list_async( customer="cus_xxxxxxxxxxxxx", type="card", ) http_client_mock.assert_requested( "get", path="/v1/payment_methods", query_string="customer=cus_xxxxxxxxxxxxx&type=card", ) @pytest.mark.anyio async def test_payment_methods_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/payment_methods", "customer=cus_xxxxxxxxxxxxx&type=card", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.payment_methods.list_async( { "customer": "cus_xxxxxxxxxxxxx", "type": "card", } ) http_client_mock.assert_requested( "get", path="/v1/payment_methods", query_string="customer=cus_xxxxxxxxxxxxx&type=card", api_base="https://api.stripe.com", ) def test_payment_methods_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.PaymentMethod.retrieve("pm_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/payment_methods/pm_xxxxxxxxxxxxx", query_string="", ) def test_payment_methods_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/payment_methods/pm_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.payment_methods.retrieve("pm_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/payment_methods/pm_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_payment_methods_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.PaymentMethod.retrieve_async("pm_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/payment_methods/pm_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_payment_methods_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/payment_methods/pm_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.payment_methods.retrieve_async("pm_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/payment_methods/pm_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_payment_methods_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.PaymentMethod.create( type="card", card={ "number": "4242424242424242", "exp_month": 8, "exp_year": 2024, "cvc": "314", }, ) http_client_mock.assert_requested( "post", path="/v1/payment_methods", query_string="", post_data="type=card&card[number]=4242424242424242&card[exp_month]=8&card[exp_year]=2024&card[cvc]=314", ) def test_payment_methods_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payment_methods", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.payment_methods.create( { "type": "card", "card": { "number": "4242424242424242", "exp_month": 8, "exp_year": 2024, "cvc": "314", }, } ) http_client_mock.assert_requested( "post", path="/v1/payment_methods", query_string="", api_base="https://api.stripe.com", post_data="type=card&card[number]=4242424242424242&card[exp_month]=8&card[exp_year]=2024&card[cvc]=314", ) @pytest.mark.anyio async def test_payment_methods_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.PaymentMethod.create_async( type="card", card={ "number": "4242424242424242", "exp_month": 8, "exp_year": 2024, "cvc": "314", }, ) http_client_mock.assert_requested( "post", path="/v1/payment_methods", query_string="", post_data="type=card&card[number]=4242424242424242&card[exp_month]=8&card[exp_year]=2024&card[cvc]=314", ) @pytest.mark.anyio async def test_payment_methods_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payment_methods", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.payment_methods.create_async( { "type": "card", "card": { "number": "4242424242424242", "exp_month": 8, "exp_year": 2024, "cvc": "314", }, } ) http_client_mock.assert_requested( "post", path="/v1/payment_methods", query_string="", api_base="https://api.stripe.com", post_data="type=card&card[number]=4242424242424242&card[exp_month]=8&card[exp_year]=2024&card[cvc]=314", ) def test_payment_methods_post_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.PaymentMethod.modify( "pm_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/payment_methods/pm_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) def test_payment_methods_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payment_methods/pm_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.payment_methods.update( "pm_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/payment_methods/pm_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_payment_methods_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.PaymentMethod.modify_async( "pm_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/payment_methods/pm_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_payment_methods_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payment_methods/pm_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.payment_methods.update_async( "pm_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/payment_methods/pm_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) def test_payouts_cancel_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.Payout.cancel("po_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payouts/po_xxxxxxxxxxxxx/cancel", query_string="", ) def test_payouts_cancel_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payouts/po_xxxxxxxxxxxxx/cancel", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.payouts.cancel("po_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payouts/po_xxxxxxxxxxxxx/cancel", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_payouts_cancel_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Payout.cancel_async("po_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payouts/po_xxxxxxxxxxxxx/cancel", query_string="", ) @pytest.mark.anyio async def test_payouts_cancel_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payouts/po_xxxxxxxxxxxxx/cancel", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.payouts.cancel_async("po_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payouts/po_xxxxxxxxxxxxx/cancel", query_string="", api_base="https://api.stripe.com", ) def test_payouts_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Payout.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/payouts", query_string="limit=3", ) def test_payouts_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/payouts", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.payouts.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/payouts", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_payouts_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Payout.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/payouts", query_string="limit=3", ) @pytest.mark.anyio async def test_payouts_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/payouts", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.payouts.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/payouts", query_string="limit=3", api_base="https://api.stripe.com", ) def test_payouts_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Payout.retrieve("po_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/payouts/po_xxxxxxxxxxxxx", query_string="", ) def test_payouts_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/payouts/po_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.payouts.retrieve("po_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/payouts/po_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_payouts_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Payout.retrieve_async("po_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/payouts/po_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_payouts_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/payouts/po_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.payouts.retrieve_async("po_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/payouts/po_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_payouts_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Payout.create( amount=1100, currency="usd", ) http_client_mock.assert_requested( "post", path="/v1/payouts", query_string="", post_data="amount=1100¤cy=usd", ) def test_payouts_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payouts", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.payouts.create({"amount": 1100, "currency": "usd"}) http_client_mock.assert_requested( "post", path="/v1/payouts", query_string="", api_base="https://api.stripe.com", post_data="amount=1100¤cy=usd", ) @pytest.mark.anyio async def test_payouts_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Payout.create_async( amount=1100, currency="usd", ) http_client_mock.assert_requested( "post", path="/v1/payouts", query_string="", post_data="amount=1100¤cy=usd", ) @pytest.mark.anyio async def test_payouts_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payouts", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.payouts.create_async({"amount": 1100, "currency": "usd"}) http_client_mock.assert_requested( "post", path="/v1/payouts", query_string="", api_base="https://api.stripe.com", post_data="amount=1100¤cy=usd", ) def test_payouts_post_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Payout.modify( "po_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/payouts/po_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) def test_payouts_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payouts/po_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.payouts.update( "po_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/payouts/po_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_payouts_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Payout.modify_async( "po_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/payouts/po_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_payouts_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payouts/po_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.payouts.update_async( "po_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/payouts/po_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) def test_payouts_reverse_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.Payout.reverse("po_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payouts/po_xxxxxxxxxxxxx/reverse", query_string="", ) def test_payouts_reverse_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payouts/po_xxxxxxxxxxxxx/reverse", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.payouts.reverse("po_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payouts/po_xxxxxxxxxxxxx/reverse", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_payouts_reverse_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Payout.reverse_async("po_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payouts/po_xxxxxxxxxxxxx/reverse", query_string="", ) @pytest.mark.anyio async def test_payouts_reverse_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/payouts/po_xxxxxxxxxxxxx/reverse", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.payouts.reverse_async("po_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/payouts/po_xxxxxxxxxxxxx/reverse", query_string="", api_base="https://api.stripe.com", ) def test_plans_delete(self, http_client_mock: HTTPClientMock) -> None: stripe.Plan.delete("price_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/plans/price_xxxxxxxxxxxxx", query_string="", ) def test_plans_delete_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/plans/price_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.plans.delete("price_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/plans/price_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_plans_delete_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Plan.delete_async("price_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/plans/price_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_plans_delete_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/plans/price_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.plans.delete_async("price_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/plans/price_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_plans_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Plan.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/plans", query_string="limit=3", ) def test_plans_get_service(self, http_client_mock: HTTPClientMock) -> None: http_client_mock.stub_request( "get", "/v1/plans", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.plans.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/plans", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_plans_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Plan.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/plans", query_string="limit=3", ) @pytest.mark.anyio async def test_plans_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/plans", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.plans.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/plans", query_string="limit=3", api_base="https://api.stripe.com", ) def test_plans_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Plan.retrieve("price_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/plans/price_xxxxxxxxxxxxx", query_string="", ) def test_plans_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/plans/price_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.plans.retrieve("price_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/plans/price_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_plans_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Plan.retrieve_async("price_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/plans/price_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_plans_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/plans/price_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.plans.retrieve_async("price_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/plans/price_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_plans_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Plan.create( amount=2000, currency="usd", interval="month", product="prod_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", path="/v1/plans", query_string="", post_data="amount=2000¤cy=usd&interval=month&product=prod_xxxxxxxxxxxxx", ) def test_plans_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/plans", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.plans.create( { "amount": 2000, "currency": "usd", "interval": "month", "product": "prod_xxxxxxxxxxxxx", } ) http_client_mock.assert_requested( "post", path="/v1/plans", query_string="", api_base="https://api.stripe.com", post_data="amount=2000¤cy=usd&interval=month&product=prod_xxxxxxxxxxxxx", ) @pytest.mark.anyio async def test_plans_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Plan.create_async( amount=2000, currency="usd", interval="month", product="prod_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", path="/v1/plans", query_string="", post_data="amount=2000¤cy=usd&interval=month&product=prod_xxxxxxxxxxxxx", ) @pytest.mark.anyio async def test_plans_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/plans", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.plans.create_async( { "amount": 2000, "currency": "usd", "interval": "month", "product": "prod_xxxxxxxxxxxxx", } ) http_client_mock.assert_requested( "post", path="/v1/plans", query_string="", api_base="https://api.stripe.com", post_data="amount=2000¤cy=usd&interval=month&product=prod_xxxxxxxxxxxxx", ) def test_plans_post_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Plan.create( amount=2000, currency="usd", interval="month", product={"name": "My product"}, ) http_client_mock.assert_requested( "post", path="/v1/plans", query_string="", post_data="amount=2000¤cy=usd&interval=month&product[name]=My%20product", ) def test_plans_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/plans", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.plans.create( { "amount": 2000, "currency": "usd", "interval": "month", "product": {"name": "My product"}, } ) http_client_mock.assert_requested( "post", path="/v1/plans", query_string="", api_base="https://api.stripe.com", post_data="amount=2000¤cy=usd&interval=month&product[name]=My%20product", ) @pytest.mark.anyio async def test_plans_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Plan.create_async( amount=2000, currency="usd", interval="month", product={"name": "My product"}, ) http_client_mock.assert_requested( "post", path="/v1/plans", query_string="", post_data="amount=2000¤cy=usd&interval=month&product[name]=My%20product", ) @pytest.mark.anyio async def test_plans_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/plans", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.plans.create_async( { "amount": 2000, "currency": "usd", "interval": "month", "product": {"name": "My product"}, } ) http_client_mock.assert_requested( "post", path="/v1/plans", query_string="", api_base="https://api.stripe.com", post_data="amount=2000¤cy=usd&interval=month&product[name]=My%20product", ) def test_plans_post_3(self, http_client_mock: HTTPClientMock) -> None: stripe.Plan.modify( "price_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/plans/price_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) def test_plans_post_3_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/plans/price_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.plans.update( "price_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/plans/price_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_plans_post_3_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Plan.modify_async( "price_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/plans/price_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_plans_post_3_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/plans/price_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.plans.update_async( "price_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/plans/price_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) def test_prices_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Price.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/prices", query_string="limit=3", ) def test_prices_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/prices", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.prices.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/prices", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_prices_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Price.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/prices", query_string="limit=3", ) @pytest.mark.anyio async def test_prices_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/prices", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.prices.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/prices", query_string="limit=3", api_base="https://api.stripe.com", ) def test_prices_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Price.retrieve("price_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/prices/price_xxxxxxxxxxxxx", query_string="", ) def test_prices_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/prices/price_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.prices.retrieve("price_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/prices/price_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_prices_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Price.retrieve_async("price_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/prices/price_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_prices_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/prices/price_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.prices.retrieve_async("price_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/prices/price_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_prices_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Price.create( unit_amount=2000, currency="usd", currency_options={ "uah": {"unit_amount": 5000}, "eur": {"unit_amount": 1800}, }, recurring={"interval": "month"}, product="prod_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", path="/v1/prices", query_string="", post_data="unit_amount=2000¤cy=usd¤cy_options[uah][unit_amount]=5000¤cy_options[eur][unit_amount]=1800&recurring[interval]=month&product=prod_xxxxxxxxxxxxx", ) def test_prices_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/prices", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.prices.create( { "unit_amount": 2000, "currency": "usd", "currency_options": { "uah": {"unit_amount": 5000}, "eur": {"unit_amount": 1800}, }, "recurring": {"interval": "month"}, "product": "prod_xxxxxxxxxxxxx", } ) http_client_mock.assert_requested( "post", path="/v1/prices", query_string="", api_base="https://api.stripe.com", post_data="unit_amount=2000¤cy=usd¤cy_options[uah][unit_amount]=5000¤cy_options[eur][unit_amount]=1800&recurring[interval]=month&product=prod_xxxxxxxxxxxxx", ) @pytest.mark.anyio async def test_prices_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Price.create_async( unit_amount=2000, currency="usd", currency_options={ "uah": {"unit_amount": 5000}, "eur": {"unit_amount": 1800}, }, recurring={"interval": "month"}, product="prod_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", path="/v1/prices", query_string="", post_data="unit_amount=2000¤cy=usd¤cy_options[uah][unit_amount]=5000¤cy_options[eur][unit_amount]=1800&recurring[interval]=month&product=prod_xxxxxxxxxxxxx", ) @pytest.mark.anyio async def test_prices_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/prices", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.prices.create_async( { "unit_amount": 2000, "currency": "usd", "currency_options": { "uah": {"unit_amount": 5000}, "eur": {"unit_amount": 1800}, }, "recurring": {"interval": "month"}, "product": "prod_xxxxxxxxxxxxx", } ) http_client_mock.assert_requested( "post", path="/v1/prices", query_string="", api_base="https://api.stripe.com", post_data="unit_amount=2000¤cy=usd¤cy_options[uah][unit_amount]=5000¤cy_options[eur][unit_amount]=1800&recurring[interval]=month&product=prod_xxxxxxxxxxxxx", ) def test_prices_post_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Price.create( unit_amount=2000, currency="usd", recurring={"interval": "month"}, product="prod_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", path="/v1/prices", query_string="", post_data="unit_amount=2000¤cy=usd&recurring[interval]=month&product=prod_xxxxxxxxxxxxx", ) def test_prices_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/prices", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.prices.create( { "unit_amount": 2000, "currency": "usd", "recurring": {"interval": "month"}, "product": "prod_xxxxxxxxxxxxx", } ) http_client_mock.assert_requested( "post", path="/v1/prices", query_string="", api_base="https://api.stripe.com", post_data="unit_amount=2000¤cy=usd&recurring[interval]=month&product=prod_xxxxxxxxxxxxx", ) @pytest.mark.anyio async def test_prices_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Price.create_async( unit_amount=2000, currency="usd", recurring={"interval": "month"}, product="prod_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", path="/v1/prices", query_string="", post_data="unit_amount=2000¤cy=usd&recurring[interval]=month&product=prod_xxxxxxxxxxxxx", ) @pytest.mark.anyio async def test_prices_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/prices", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.prices.create_async( { "unit_amount": 2000, "currency": "usd", "recurring": {"interval": "month"}, "product": "prod_xxxxxxxxxxxxx", } ) http_client_mock.assert_requested( "post", path="/v1/prices", query_string="", api_base="https://api.stripe.com", post_data="unit_amount=2000¤cy=usd&recurring[interval]=month&product=prod_xxxxxxxxxxxxx", ) def test_prices_post_3(self, http_client_mock: HTTPClientMock) -> None: stripe.Price.modify( "price_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/prices/price_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) def test_prices_post_3_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/prices/price_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.prices.update( "price_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/prices/price_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_prices_post_3_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Price.modify_async( "price_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/prices/price_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_prices_post_3_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/prices/price_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.prices.update_async( "price_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/prices/price_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) def test_prices_search_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Price.search( query="active:'true' AND metadata['order_id']:'6735'", ) http_client_mock.assert_requested( "get", path="/v1/prices/search", query_string="query=active%3A%27true%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", ) def test_prices_search_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/prices/search", "query=active%3A%27true%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.prices.search( { "query": "active:'true' AND metadata['order_id']:'6735'", } ) http_client_mock.assert_requested( "get", path="/v1/prices/search", query_string="query=active%3A%27true%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_prices_search_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Price.search_async( query="active:'true' AND metadata['order_id']:'6735'", ) http_client_mock.assert_requested( "get", path="/v1/prices/search", query_string="query=active%3A%27true%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", ) @pytest.mark.anyio async def test_prices_search_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/prices/search", "query=active%3A%27true%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.prices.search_async( { "query": "active:'true' AND metadata['order_id']:'6735'", } ) http_client_mock.assert_requested( "get", path="/v1/prices/search", query_string="query=active%3A%27true%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", api_base="https://api.stripe.com", ) def test_products_delete(self, http_client_mock: HTTPClientMock) -> None: stripe.Product.delete("prod_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/products/prod_xxxxxxxxxxxxx", query_string="", ) def test_products_delete_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/products/prod_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.products.delete("prod_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/products/prod_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_products_delete_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Product.delete_async("prod_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/products/prod_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_products_delete_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/products/prod_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.products.delete_async("prod_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/products/prod_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_products_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Product.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/products", query_string="limit=3", ) def test_products_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/products", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.products.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/products", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_products_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Product.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/products", query_string="limit=3", ) @pytest.mark.anyio async def test_products_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/products", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.products.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/products", query_string="limit=3", api_base="https://api.stripe.com", ) def test_products_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Product.retrieve("prod_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/products/prod_xxxxxxxxxxxxx", query_string="", ) def test_products_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/products/prod_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.products.retrieve("prod_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/products/prod_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_products_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Product.retrieve_async("prod_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/products/prod_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_products_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/products/prod_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.products.retrieve_async("prod_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/products/prod_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_products_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Product.create(name="Gold Special") http_client_mock.assert_requested( "post", path="/v1/products", query_string="", post_data="name=Gold%20Special", ) def test_products_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/products", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.products.create({"name": "Gold Special"}) http_client_mock.assert_requested( "post", path="/v1/products", query_string="", api_base="https://api.stripe.com", post_data="name=Gold%20Special", ) @pytest.mark.anyio async def test_products_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Product.create_async(name="Gold Special") http_client_mock.assert_requested( "post", path="/v1/products", query_string="", post_data="name=Gold%20Special", ) @pytest.mark.anyio async def test_products_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/products", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.products.create_async({"name": "Gold Special"}) http_client_mock.assert_requested( "post", path="/v1/products", query_string="", api_base="https://api.stripe.com", post_data="name=Gold%20Special", ) def test_products_post_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Product.modify( "prod_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/products/prod_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) def test_products_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/products/prod_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.products.update( "prod_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/products/prod_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_products_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Product.modify_async( "prod_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/products/prod_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_products_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/products/prod_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.products.update_async( "prod_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/products/prod_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) def test_products_search_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.Product.search( query="active:'true' AND metadata['order_id']:'6735'", ) http_client_mock.assert_requested( "get", path="/v1/products/search", query_string="query=active%3A%27true%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", ) def test_products_search_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/products/search", "query=active%3A%27true%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.products.search( { "query": "active:'true' AND metadata['order_id']:'6735'", } ) http_client_mock.assert_requested( "get", path="/v1/products/search", query_string="query=active%3A%27true%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_products_search_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Product.search_async( query="active:'true' AND metadata['order_id']:'6735'", ) http_client_mock.assert_requested( "get", path="/v1/products/search", query_string="query=active%3A%27true%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", ) @pytest.mark.anyio async def test_products_search_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/products/search", "query=active%3A%27true%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.products.search_async( { "query": "active:'true' AND metadata['order_id']:'6735'", } ) http_client_mock.assert_requested( "get", path="/v1/products/search", query_string="query=active%3A%27true%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", api_base="https://api.stripe.com", ) def test_promotion_codes_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.PromotionCode.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/promotion_codes", query_string="limit=3", ) def test_promotion_codes_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/promotion_codes", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.promotion_codes.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/promotion_codes", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_promotion_codes_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.PromotionCode.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/promotion_codes", query_string="limit=3", ) @pytest.mark.anyio async def test_promotion_codes_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/promotion_codes", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.promotion_codes.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/promotion_codes", query_string="limit=3", api_base="https://api.stripe.com", ) def test_promotion_codes_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.PromotionCode.retrieve("promo_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/promotion_codes/promo_xxxxxxxxxxxxx", query_string="", ) def test_promotion_codes_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/promotion_codes/promo_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.promotion_codes.retrieve("promo_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/promotion_codes/promo_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_promotion_codes_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.PromotionCode.retrieve_async("promo_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/promotion_codes/promo_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_promotion_codes_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/promotion_codes/promo_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.promotion_codes.retrieve_async("promo_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/promotion_codes/promo_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_promotion_codes_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.PromotionCode.create(coupon="Z4OV52SU") http_client_mock.assert_requested( "post", path="/v1/promotion_codes", query_string="", post_data="coupon=Z4OV52SU", ) def test_promotion_codes_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/promotion_codes", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.promotion_codes.create({"coupon": "Z4OV52SU"}) http_client_mock.assert_requested( "post", path="/v1/promotion_codes", query_string="", api_base="https://api.stripe.com", post_data="coupon=Z4OV52SU", ) @pytest.mark.anyio async def test_promotion_codes_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.PromotionCode.create_async(coupon="Z4OV52SU") http_client_mock.assert_requested( "post", path="/v1/promotion_codes", query_string="", post_data="coupon=Z4OV52SU", ) @pytest.mark.anyio async def test_promotion_codes_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/promotion_codes", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.promotion_codes.create_async({"coupon": "Z4OV52SU"}) http_client_mock.assert_requested( "post", path="/v1/promotion_codes", query_string="", api_base="https://api.stripe.com", post_data="coupon=Z4OV52SU", ) def test_promotion_codes_post_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.PromotionCode.modify( "promo_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/promotion_codes/promo_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) def test_promotion_codes_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/promotion_codes/promo_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.promotion_codes.update( "promo_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/promotion_codes/promo_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_promotion_codes_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.PromotionCode.modify_async( "promo_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/promotion_codes/promo_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_promotion_codes_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/promotion_codes/promo_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.promotion_codes.update_async( "promo_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/promotion_codes/promo_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) def test_quotes_accept_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.Quote.accept("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/quotes/qt_xxxxxxxxxxxxx/accept", query_string="", ) def test_quotes_accept_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/quotes/qt_xxxxxxxxxxxxx/accept", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.quotes.accept("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/quotes/qt_xxxxxxxxxxxxx/accept", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_quotes_accept_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Quote.accept_async("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/quotes/qt_xxxxxxxxxxxxx/accept", query_string="", ) @pytest.mark.anyio async def test_quotes_accept_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/quotes/qt_xxxxxxxxxxxxx/accept", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.quotes.accept_async("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/quotes/qt_xxxxxxxxxxxxx/accept", query_string="", api_base="https://api.stripe.com", ) def test_quotes_cancel_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.Quote.cancel("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/quotes/qt_xxxxxxxxxxxxx/cancel", query_string="", ) def test_quotes_cancel_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/quotes/qt_xxxxxxxxxxxxx/cancel", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.quotes.cancel("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/quotes/qt_xxxxxxxxxxxxx/cancel", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_quotes_cancel_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Quote.cancel_async("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/quotes/qt_xxxxxxxxxxxxx/cancel", query_string="", ) @pytest.mark.anyio async def test_quotes_cancel_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/quotes/qt_xxxxxxxxxxxxx/cancel", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.quotes.cancel_async("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/quotes/qt_xxxxxxxxxxxxx/cancel", query_string="", api_base="https://api.stripe.com", ) def test_quotes_finalize_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.Quote.finalize_quote("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/quotes/qt_xxxxxxxxxxxxx/finalize", query_string="", ) def test_quotes_finalize_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/quotes/qt_xxxxxxxxxxxxx/finalize", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.quotes.finalize_quote("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/quotes/qt_xxxxxxxxxxxxx/finalize", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_quotes_finalize_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Quote.finalize_quote_async("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/quotes/qt_xxxxxxxxxxxxx/finalize", query_string="", ) @pytest.mark.anyio async def test_quotes_finalize_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/quotes/qt_xxxxxxxxxxxxx/finalize", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.quotes.finalize_quote_async("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/quotes/qt_xxxxxxxxxxxxx/finalize", query_string="", api_base="https://api.stripe.com", ) def test_quotes_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Quote.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/quotes", query_string="limit=3", ) def test_quotes_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/quotes", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.quotes.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/quotes", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_quotes_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Quote.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/quotes", query_string="limit=3", ) @pytest.mark.anyio async def test_quotes_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/quotes", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.quotes.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/quotes", query_string="limit=3", api_base="https://api.stripe.com", ) def test_quotes_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Quote.retrieve("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/quotes/qt_xxxxxxxxxxxxx", query_string="", ) def test_quotes_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/quotes/qt_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.quotes.retrieve("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/quotes/qt_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_quotes_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Quote.retrieve_async("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/quotes/qt_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_quotes_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/quotes/qt_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.quotes.retrieve_async("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/quotes/qt_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_quotes_line_items_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.Quote.list_line_items("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/quotes/qt_xxxxxxxxxxxxx/line_items", query_string="", ) def test_quotes_line_items_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/quotes/qt_xxxxxxxxxxxxx/line_items", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.quotes.line_items.list("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/quotes/qt_xxxxxxxxxxxxx/line_items", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_quotes_line_items_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Quote.list_line_items_async("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/quotes/qt_xxxxxxxxxxxxx/line_items", query_string="", ) @pytest.mark.anyio async def test_quotes_line_items_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/quotes/qt_xxxxxxxxxxxxx/line_items", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.quotes.line_items.list_async("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/quotes/qt_xxxxxxxxxxxxx/line_items", query_string="", api_base="https://api.stripe.com", ) def test_quotes_pdf_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Quote.pdf("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/quotes/qt_xxxxxxxxxxxxx/pdf", query_string="", ) def test_quotes_pdf_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/quotes/qt_xxxxxxxxxxxxx/pdf", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.quotes.pdf("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/quotes/qt_xxxxxxxxxxxxx/pdf", query_string="", api_base="https://files.stripe.com", ) @pytest.mark.anyio async def test_quotes_pdf_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Quote.pdf_async("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/quotes/qt_xxxxxxxxxxxxx/pdf", query_string="", ) @pytest.mark.anyio async def test_quotes_pdf_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/quotes/qt_xxxxxxxxxxxxx/pdf", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.quotes.pdf_async("qt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/quotes/qt_xxxxxxxxxxxxx/pdf", query_string="", api_base="https://files.stripe.com", ) def test_quotes_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Quote.create( customer="cus_xxxxxxxxxxxxx", line_items=[{"price": "price_xxxxxxxxxxxxx", "quantity": 2}], ) http_client_mock.assert_requested( "post", path="/v1/quotes", query_string="", post_data="customer=cus_xxxxxxxxxxxxx&line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=2", ) def test_quotes_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/quotes", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.quotes.create( { "customer": "cus_xxxxxxxxxxxxx", "line_items": [ {"price": "price_xxxxxxxxxxxxx", "quantity": 2} ], } ) http_client_mock.assert_requested( "post", path="/v1/quotes", query_string="", api_base="https://api.stripe.com", post_data="customer=cus_xxxxxxxxxxxxx&line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=2", ) @pytest.mark.anyio async def test_quotes_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Quote.create_async( customer="cus_xxxxxxxxxxxxx", line_items=[{"price": "price_xxxxxxxxxxxxx", "quantity": 2}], ) http_client_mock.assert_requested( "post", path="/v1/quotes", query_string="", post_data="customer=cus_xxxxxxxxxxxxx&line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=2", ) @pytest.mark.anyio async def test_quotes_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/quotes", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.quotes.create_async( { "customer": "cus_xxxxxxxxxxxxx", "line_items": [ {"price": "price_xxxxxxxxxxxxx", "quantity": 2} ], } ) http_client_mock.assert_requested( "post", path="/v1/quotes", query_string="", api_base="https://api.stripe.com", post_data="customer=cus_xxxxxxxxxxxxx&line_items[0][price]=price_xxxxxxxxxxxxx&line_items[0][quantity]=2", ) def test_quotes_post_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Quote.modify( "qt_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/quotes/qt_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) def test_quotes_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/quotes/qt_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.quotes.update( "qt_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/quotes/qt_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_quotes_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Quote.modify_async( "qt_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/quotes/qt_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_quotes_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/quotes/qt_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.quotes.update_async( "qt_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/quotes/qt_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) def test_radar_early_fraud_warnings_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.radar.EarlyFraudWarning.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/radar/early_fraud_warnings", query_string="limit=3", ) def test_radar_early_fraud_warnings_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/radar/early_fraud_warnings", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.radar.early_fraud_warnings.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/radar/early_fraud_warnings", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_radar_early_fraud_warnings_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.radar.EarlyFraudWarning.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/radar/early_fraud_warnings", query_string="limit=3", ) @pytest.mark.anyio async def test_radar_early_fraud_warnings_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/radar/early_fraud_warnings", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.radar.early_fraud_warnings.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/radar/early_fraud_warnings", query_string="limit=3", api_base="https://api.stripe.com", ) def test_radar_early_fraud_warnings_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.radar.EarlyFraudWarning.retrieve("issfr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/radar/early_fraud_warnings/issfr_xxxxxxxxxxxxx", query_string="", ) def test_radar_early_fraud_warnings_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/radar/early_fraud_warnings/issfr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.radar.early_fraud_warnings.retrieve("issfr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/radar/early_fraud_warnings/issfr_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_radar_early_fraud_warnings_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.radar.EarlyFraudWarning.retrieve_async( "issfr_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/radar/early_fraud_warnings/issfr_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_radar_early_fraud_warnings_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/radar/early_fraud_warnings/issfr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.radar.early_fraud_warnings.retrieve_async( "issfr_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/radar/early_fraud_warnings/issfr_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_radar_value_list_items_delete( self, http_client_mock: HTTPClientMock ) -> None: stripe.radar.ValueListItem.delete("rsli_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx", query_string="", ) def test_radar_value_list_items_delete_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.radar.value_list_items.delete("rsli_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_radar_value_list_items_delete_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.radar.ValueListItem.delete_async("rsli_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_radar_value_list_items_delete_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.radar.value_list_items.delete_async("rsli_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_radar_value_list_items_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.radar.ValueListItem.list( limit=3, value_list="rsl_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/radar/value_list_items", query_string="limit=3&value_list=rsl_xxxxxxxxxxxxx", ) def test_radar_value_list_items_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/radar/value_list_items", "limit=3&value_list=rsl_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.radar.value_list_items.list( { "limit": 3, "value_list": "rsl_xxxxxxxxxxxxx", } ) http_client_mock.assert_requested( "get", path="/v1/radar/value_list_items", query_string="limit=3&value_list=rsl_xxxxxxxxxxxxx", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_radar_value_list_items_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.radar.ValueListItem.list_async( limit=3, value_list="rsl_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/radar/value_list_items", query_string="limit=3&value_list=rsl_xxxxxxxxxxxxx", ) @pytest.mark.anyio async def test_radar_value_list_items_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/radar/value_list_items", "limit=3&value_list=rsl_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.radar.value_list_items.list_async( { "limit": 3, "value_list": "rsl_xxxxxxxxxxxxx", } ) http_client_mock.assert_requested( "get", path="/v1/radar/value_list_items", query_string="limit=3&value_list=rsl_xxxxxxxxxxxxx", api_base="https://api.stripe.com", ) def test_radar_value_list_items_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.radar.ValueListItem.retrieve("rsli_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx", query_string="", ) def test_radar_value_list_items_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.radar.value_list_items.retrieve("rsli_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_radar_value_list_items_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.radar.ValueListItem.retrieve_async("rsli_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_radar_value_list_items_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.radar.value_list_items.retrieve_async( "rsli_xxxxxxxxxxxxx" ) http_client_mock.assert_requested( "get", path="/v1/radar/value_list_items/rsli_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_radar_value_list_items_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.radar.ValueListItem.create( value_list="rsl_xxxxxxxxxxxxx", value="1.2.3.4", ) http_client_mock.assert_requested( "post", path="/v1/radar/value_list_items", query_string="", post_data="value_list=rsl_xxxxxxxxxxxxx&value=1.2.3.4", ) def test_radar_value_list_items_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/radar/value_list_items", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.radar.value_list_items.create( { "value_list": "rsl_xxxxxxxxxxxxx", "value": "1.2.3.4", } ) http_client_mock.assert_requested( "post", path="/v1/radar/value_list_items", query_string="", api_base="https://api.stripe.com", post_data="value_list=rsl_xxxxxxxxxxxxx&value=1.2.3.4", ) @pytest.mark.anyio async def test_radar_value_list_items_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.radar.ValueListItem.create_async( value_list="rsl_xxxxxxxxxxxxx", value="1.2.3.4", ) http_client_mock.assert_requested( "post", path="/v1/radar/value_list_items", query_string="", post_data="value_list=rsl_xxxxxxxxxxxxx&value=1.2.3.4", ) @pytest.mark.anyio async def test_radar_value_list_items_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/radar/value_list_items", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.radar.value_list_items.create_async( { "value_list": "rsl_xxxxxxxxxxxxx", "value": "1.2.3.4", } ) http_client_mock.assert_requested( "post", path="/v1/radar/value_list_items", query_string="", api_base="https://api.stripe.com", post_data="value_list=rsl_xxxxxxxxxxxxx&value=1.2.3.4", ) def test_radar_value_lists_delete( self, http_client_mock: HTTPClientMock ) -> None: stripe.radar.ValueList.delete("rsl_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", query_string="", ) def test_radar_value_lists_delete_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.radar.value_lists.delete("rsl_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_radar_value_lists_delete_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.radar.ValueList.delete_async("rsl_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_radar_value_lists_delete_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.radar.value_lists.delete_async("rsl_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_radar_value_lists_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.radar.ValueList.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/radar/value_lists", query_string="limit=3", ) def test_radar_value_lists_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/radar/value_lists", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.radar.value_lists.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/radar/value_lists", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_radar_value_lists_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.radar.ValueList.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/radar/value_lists", query_string="limit=3", ) @pytest.mark.anyio async def test_radar_value_lists_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/radar/value_lists", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.radar.value_lists.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/radar/value_lists", query_string="limit=3", api_base="https://api.stripe.com", ) def test_radar_value_lists_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.radar.ValueList.retrieve("rsl_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", query_string="", ) def test_radar_value_lists_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.radar.value_lists.retrieve("rsl_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_radar_value_lists_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.radar.ValueList.retrieve_async("rsl_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_radar_value_lists_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.radar.value_lists.retrieve_async("rsl_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_radar_value_lists_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.radar.ValueList.create( alias="custom_ip_xxxxxxxxxxxxx", name="Custom IP Blocklist", item_type="ip_address", ) http_client_mock.assert_requested( "post", path="/v1/radar/value_lists", query_string="", post_data="alias=custom_ip_xxxxxxxxxxxxx&name=Custom%20IP%20Blocklist&item_type=ip_address", ) def test_radar_value_lists_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/radar/value_lists", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.radar.value_lists.create( { "alias": "custom_ip_xxxxxxxxxxxxx", "name": "Custom IP Blocklist", "item_type": "ip_address", } ) http_client_mock.assert_requested( "post", path="/v1/radar/value_lists", query_string="", api_base="https://api.stripe.com", post_data="alias=custom_ip_xxxxxxxxxxxxx&name=Custom%20IP%20Blocklist&item_type=ip_address", ) @pytest.mark.anyio async def test_radar_value_lists_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.radar.ValueList.create_async( alias="custom_ip_xxxxxxxxxxxxx", name="Custom IP Blocklist", item_type="ip_address", ) http_client_mock.assert_requested( "post", path="/v1/radar/value_lists", query_string="", post_data="alias=custom_ip_xxxxxxxxxxxxx&name=Custom%20IP%20Blocklist&item_type=ip_address", ) @pytest.mark.anyio async def test_radar_value_lists_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/radar/value_lists", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.radar.value_lists.create_async( { "alias": "custom_ip_xxxxxxxxxxxxx", "name": "Custom IP Blocklist", "item_type": "ip_address", } ) http_client_mock.assert_requested( "post", path="/v1/radar/value_lists", query_string="", api_base="https://api.stripe.com", post_data="alias=custom_ip_xxxxxxxxxxxxx&name=Custom%20IP%20Blocklist&item_type=ip_address", ) def test_radar_value_lists_post_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.radar.ValueList.modify( "rsl_xxxxxxxxxxxxx", name="Updated IP Block List", ) http_client_mock.assert_requested( "post", path="/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", query_string="", post_data="name=Updated%20IP%20Block%20List", ) def test_radar_value_lists_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.radar.value_lists.update( "rsl_xxxxxxxxxxxxx", {"name": "Updated IP Block List"}, ) http_client_mock.assert_requested( "post", path="/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="name=Updated%20IP%20Block%20List", ) @pytest.mark.anyio async def test_radar_value_lists_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.radar.ValueList.modify_async( "rsl_xxxxxxxxxxxxx", name="Updated IP Block List", ) http_client_mock.assert_requested( "post", path="/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", query_string="", post_data="name=Updated%20IP%20Block%20List", ) @pytest.mark.anyio async def test_radar_value_lists_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.radar.value_lists.update_async( "rsl_xxxxxxxxxxxxx", {"name": "Updated IP Block List"}, ) http_client_mock.assert_requested( "post", path="/v1/radar/value_lists/rsl_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="name=Updated%20IP%20Block%20List", ) def test_refunds_cancel_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.Refund.cancel("re_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/refunds/re_xxxxxxxxxxxxx/cancel", query_string="", ) def test_refunds_cancel_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/refunds/re_xxxxxxxxxxxxx/cancel", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.refunds.cancel("re_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/refunds/re_xxxxxxxxxxxxx/cancel", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_refunds_cancel_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Refund.cancel_async("re_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/refunds/re_xxxxxxxxxxxxx/cancel", query_string="", ) @pytest.mark.anyio async def test_refunds_cancel_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/refunds/re_xxxxxxxxxxxxx/cancel", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.refunds.cancel_async("re_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/refunds/re_xxxxxxxxxxxxx/cancel", query_string="", api_base="https://api.stripe.com", ) def test_refunds_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Refund.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/refunds", query_string="limit=3", ) def test_refunds_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/refunds", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.refunds.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/refunds", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_refunds_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Refund.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/refunds", query_string="limit=3", ) @pytest.mark.anyio async def test_refunds_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/refunds", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.refunds.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/refunds", query_string="limit=3", api_base="https://api.stripe.com", ) def test_refunds_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Refund.retrieve("re_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/refunds/re_xxxxxxxxxxxxx", query_string="", ) def test_refunds_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/refunds/re_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.refunds.retrieve("re_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/refunds/re_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_refunds_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Refund.retrieve_async("re_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/refunds/re_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_refunds_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/refunds/re_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.refunds.retrieve_async("re_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/refunds/re_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_refunds_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Refund.create(charge="ch_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/refunds", query_string="", post_data="charge=ch_xxxxxxxxxxxxx", ) def test_refunds_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/refunds", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.refunds.create({"charge": "ch_xxxxxxxxxxxxx"}) http_client_mock.assert_requested( "post", path="/v1/refunds", query_string="", api_base="https://api.stripe.com", post_data="charge=ch_xxxxxxxxxxxxx", ) @pytest.mark.anyio async def test_refunds_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Refund.create_async(charge="ch_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/refunds", query_string="", post_data="charge=ch_xxxxxxxxxxxxx", ) @pytest.mark.anyio async def test_refunds_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/refunds", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.refunds.create_async({"charge": "ch_xxxxxxxxxxxxx"}) http_client_mock.assert_requested( "post", path="/v1/refunds", query_string="", api_base="https://api.stripe.com", post_data="charge=ch_xxxxxxxxxxxxx", ) def test_refunds_post_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Refund.modify( "re_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/refunds/re_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) def test_refunds_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/refunds/re_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.refunds.update( "re_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/refunds/re_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_refunds_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Refund.modify_async( "re_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/refunds/re_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_refunds_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/refunds/re_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.refunds.update_async( "re_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/refunds/re_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) def test_reporting_report_runs_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.reporting.ReportRun.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/reporting/report_runs", query_string="limit=3", ) def test_reporting_report_runs_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/reporting/report_runs", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.reporting.report_runs.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/reporting/report_runs", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_reporting_report_runs_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.reporting.ReportRun.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/reporting/report_runs", query_string="limit=3", ) @pytest.mark.anyio async def test_reporting_report_runs_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/reporting/report_runs", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.reporting.report_runs.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/reporting/report_runs", query_string="limit=3", api_base="https://api.stripe.com", ) def test_reporting_report_runs_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.reporting.ReportRun.retrieve("frr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/reporting/report_runs/frr_xxxxxxxxxxxxx", query_string="", ) def test_reporting_report_runs_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/reporting/report_runs/frr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.reporting.report_runs.retrieve("frr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/reporting/report_runs/frr_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_reporting_report_runs_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.reporting.ReportRun.retrieve_async("frr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/reporting/report_runs/frr_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_reporting_report_runs_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/reporting/report_runs/frr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.reporting.report_runs.retrieve_async("frr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/reporting/report_runs/frr_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_reporting_report_runs_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.reporting.ReportRun.create( report_type="balance.summary.1", parameters={ "interval_start": 1522540800, "interval_end": 1525132800, }, ) http_client_mock.assert_requested( "post", path="/v1/reporting/report_runs", query_string="", post_data="report_type=balance.summary.1¶meters[interval_start]=1522540800¶meters[interval_end]=1525132800", ) def test_reporting_report_runs_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/reporting/report_runs", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.reporting.report_runs.create( { "report_type": "balance.summary.1", "parameters": { "interval_start": 1522540800, "interval_end": 1525132800, }, } ) http_client_mock.assert_requested( "post", path="/v1/reporting/report_runs", query_string="", api_base="https://api.stripe.com", post_data="report_type=balance.summary.1¶meters[interval_start]=1522540800¶meters[interval_end]=1525132800", ) @pytest.mark.anyio async def test_reporting_report_runs_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.reporting.ReportRun.create_async( report_type="balance.summary.1", parameters={ "interval_start": 1522540800, "interval_end": 1525132800, }, ) http_client_mock.assert_requested( "post", path="/v1/reporting/report_runs", query_string="", post_data="report_type=balance.summary.1¶meters[interval_start]=1522540800¶meters[interval_end]=1525132800", ) @pytest.mark.anyio async def test_reporting_report_runs_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/reporting/report_runs", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.reporting.report_runs.create_async( { "report_type": "balance.summary.1", "parameters": { "interval_start": 1522540800, "interval_end": 1525132800, }, } ) http_client_mock.assert_requested( "post", path="/v1/reporting/report_runs", query_string="", api_base="https://api.stripe.com", post_data="report_type=balance.summary.1¶meters[interval_start]=1522540800¶meters[interval_end]=1525132800", ) def test_reporting_report_types_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.reporting.ReportType.list() http_client_mock.assert_requested( "get", path="/v1/reporting/report_types", query_string="", ) def test_reporting_report_types_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/reporting/report_types", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.reporting.report_types.list() http_client_mock.assert_requested( "get", path="/v1/reporting/report_types", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_reporting_report_types_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.reporting.ReportType.list_async() http_client_mock.assert_requested( "get", path="/v1/reporting/report_types", query_string="", ) @pytest.mark.anyio async def test_reporting_report_types_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/reporting/report_types", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.reporting.report_types.list_async() http_client_mock.assert_requested( "get", path="/v1/reporting/report_types", query_string="", api_base="https://api.stripe.com", ) def test_reporting_report_types_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.reporting.ReportType.retrieve("balance.summary.1") http_client_mock.assert_requested( "get", path="/v1/reporting/report_types/balance.summary.1", query_string="", ) def test_reporting_report_types_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/reporting/report_types/balance.summary.1", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.reporting.report_types.retrieve("balance.summary.1") http_client_mock.assert_requested( "get", path="/v1/reporting/report_types/balance.summary.1", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_reporting_report_types_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.reporting.ReportType.retrieve_async("balance.summary.1") http_client_mock.assert_requested( "get", path="/v1/reporting/report_types/balance.summary.1", query_string="", ) @pytest.mark.anyio async def test_reporting_report_types_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/reporting/report_types/balance.summary.1", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.reporting.report_types.retrieve_async("balance.summary.1") http_client_mock.assert_requested( "get", path="/v1/reporting/report_types/balance.summary.1", query_string="", api_base="https://api.stripe.com", ) def test_reviews_approve_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.Review.approve("prv_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/reviews/prv_xxxxxxxxxxxxx/approve", query_string="", ) def test_reviews_approve_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/reviews/prv_xxxxxxxxxxxxx/approve", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.reviews.approve("prv_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/reviews/prv_xxxxxxxxxxxxx/approve", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_reviews_approve_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Review.approve_async("prv_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/reviews/prv_xxxxxxxxxxxxx/approve", query_string="", ) @pytest.mark.anyio async def test_reviews_approve_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/reviews/prv_xxxxxxxxxxxxx/approve", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.reviews.approve_async("prv_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/reviews/prv_xxxxxxxxxxxxx/approve", query_string="", api_base="https://api.stripe.com", ) def test_reviews_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Review.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/reviews", query_string="limit=3", ) def test_reviews_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/reviews", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.reviews.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/reviews", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_reviews_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Review.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/reviews", query_string="limit=3", ) @pytest.mark.anyio async def test_reviews_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/reviews", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.reviews.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/reviews", query_string="limit=3", api_base="https://api.stripe.com", ) def test_reviews_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Review.retrieve("prv_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/reviews/prv_xxxxxxxxxxxxx", query_string="", ) def test_reviews_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/reviews/prv_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.reviews.retrieve("prv_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/reviews/prv_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_reviews_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Review.retrieve_async("prv_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/reviews/prv_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_reviews_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/reviews/prv_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.reviews.retrieve_async("prv_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/reviews/prv_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_setup_attempts_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.SetupAttempt.list( limit=3, setup_intent="si_xyz", ) http_client_mock.assert_requested( "get", path="/v1/setup_attempts", query_string="limit=3&setup_intent=si_xyz", ) def test_setup_attempts_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/setup_attempts", "limit=3&setup_intent=si_xyz", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.setup_attempts.list({"limit": 3, "setup_intent": "si_xyz"}) http_client_mock.assert_requested( "get", path="/v1/setup_attempts", query_string="limit=3&setup_intent=si_xyz", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_setup_attempts_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.SetupAttempt.list_async( limit=3, setup_intent="si_xyz", ) http_client_mock.assert_requested( "get", path="/v1/setup_attempts", query_string="limit=3&setup_intent=si_xyz", ) @pytest.mark.anyio async def test_setup_attempts_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/setup_attempts", "limit=3&setup_intent=si_xyz", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.setup_attempts.list_async( { "limit": 3, "setup_intent": "si_xyz", } ) http_client_mock.assert_requested( "get", path="/v1/setup_attempts", query_string="limit=3&setup_intent=si_xyz", api_base="https://api.stripe.com", ) def test_setup_intents_cancel_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.SetupIntent.cancel("seti_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/setup_intents/seti_xxxxxxxxxxxxx/cancel", query_string="", ) def test_setup_intents_cancel_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/setup_intents/seti_xxxxxxxxxxxxx/cancel", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.setup_intents.cancel("seti_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/setup_intents/seti_xxxxxxxxxxxxx/cancel", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_setup_intents_cancel_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.SetupIntent.cancel_async("seti_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/setup_intents/seti_xxxxxxxxxxxxx/cancel", query_string="", ) @pytest.mark.anyio async def test_setup_intents_cancel_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/setup_intents/seti_xxxxxxxxxxxxx/cancel", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.setup_intents.cancel_async("seti_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/setup_intents/seti_xxxxxxxxxxxxx/cancel", query_string="", api_base="https://api.stripe.com", ) def test_setup_intents_confirm_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.SetupIntent.confirm( "seti_xxxxxxxxxxxxx", payment_method="pm_card_visa", ) http_client_mock.assert_requested( "post", path="/v1/setup_intents/seti_xxxxxxxxxxxxx/confirm", query_string="", post_data="payment_method=pm_card_visa", ) def test_setup_intents_confirm_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/setup_intents/seti_xxxxxxxxxxxxx/confirm", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.setup_intents.confirm( "seti_xxxxxxxxxxxxx", {"payment_method": "pm_card_visa"}, ) http_client_mock.assert_requested( "post", path="/v1/setup_intents/seti_xxxxxxxxxxxxx/confirm", query_string="", api_base="https://api.stripe.com", post_data="payment_method=pm_card_visa", ) @pytest.mark.anyio async def test_setup_intents_confirm_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.SetupIntent.confirm_async( "seti_xxxxxxxxxxxxx", payment_method="pm_card_visa", ) http_client_mock.assert_requested( "post", path="/v1/setup_intents/seti_xxxxxxxxxxxxx/confirm", query_string="", post_data="payment_method=pm_card_visa", ) @pytest.mark.anyio async def test_setup_intents_confirm_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/setup_intents/seti_xxxxxxxxxxxxx/confirm", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.setup_intents.confirm_async( "seti_xxxxxxxxxxxxx", {"payment_method": "pm_card_visa"}, ) http_client_mock.assert_requested( "post", path="/v1/setup_intents/seti_xxxxxxxxxxxxx/confirm", query_string="", api_base="https://api.stripe.com", post_data="payment_method=pm_card_visa", ) def test_setup_intents_get(self, http_client_mock: HTTPClientMock) -> None: stripe.SetupIntent.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/setup_intents", query_string="limit=3", ) def test_setup_intents_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/setup_intents", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.setup_intents.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/setup_intents", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_setup_intents_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.SetupIntent.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/setup_intents", query_string="limit=3", ) @pytest.mark.anyio async def test_setup_intents_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/setup_intents", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.setup_intents.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/setup_intents", query_string="limit=3", api_base="https://api.stripe.com", ) def test_setup_intents_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.SetupIntent.retrieve("seti_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/setup_intents/seti_xxxxxxxxxxxxx", query_string="", ) def test_setup_intents_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/setup_intents/seti_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.setup_intents.retrieve("seti_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/setup_intents/seti_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_setup_intents_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.SetupIntent.retrieve_async("seti_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/setup_intents/seti_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_setup_intents_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/setup_intents/seti_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.setup_intents.retrieve_async("seti_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/setup_intents/seti_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_setup_intents_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.SetupIntent.create(payment_method_types=["card"]) http_client_mock.assert_requested( "post", path="/v1/setup_intents", query_string="", post_data="payment_method_types[0]=card", ) def test_setup_intents_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/setup_intents", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.setup_intents.create({"payment_method_types": ["card"]}) http_client_mock.assert_requested( "post", path="/v1/setup_intents", query_string="", api_base="https://api.stripe.com", post_data="payment_method_types[0]=card", ) @pytest.mark.anyio async def test_setup_intents_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.SetupIntent.create_async(payment_method_types=["card"]) http_client_mock.assert_requested( "post", path="/v1/setup_intents", query_string="", post_data="payment_method_types[0]=card", ) @pytest.mark.anyio async def test_setup_intents_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/setup_intents", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.setup_intents.create_async( { "payment_method_types": ["card"], } ) http_client_mock.assert_requested( "post", path="/v1/setup_intents", query_string="", api_base="https://api.stripe.com", post_data="payment_method_types[0]=card", ) def test_setup_intents_post_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.SetupIntent.modify( "seti_xxxxxxxxxxxxx", metadata={"user_id": "3435453"}, ) http_client_mock.assert_requested( "post", path="/v1/setup_intents/seti_xxxxxxxxxxxxx", query_string="", post_data="metadata[user_id]=3435453", ) def test_setup_intents_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/setup_intents/seti_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.setup_intents.update( "seti_xxxxxxxxxxxxx", {"metadata": {"user_id": "3435453"}}, ) http_client_mock.assert_requested( "post", path="/v1/setup_intents/seti_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[user_id]=3435453", ) @pytest.mark.anyio async def test_setup_intents_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.SetupIntent.modify_async( "seti_xxxxxxxxxxxxx", metadata={"user_id": "3435453"}, ) http_client_mock.assert_requested( "post", path="/v1/setup_intents/seti_xxxxxxxxxxxxx", query_string="", post_data="metadata[user_id]=3435453", ) @pytest.mark.anyio async def test_setup_intents_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/setup_intents/seti_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.setup_intents.update_async( "seti_xxxxxxxxxxxxx", {"metadata": {"user_id": "3435453"}}, ) http_client_mock.assert_requested( "post", path="/v1/setup_intents/seti_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[user_id]=3435453", ) def test_setup_intents_verify_microdeposits_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.SetupIntent.verify_microdeposits("seti_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits", query_string="", ) def test_setup_intents_verify_microdeposits_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.setup_intents.verify_microdeposits("seti_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_setup_intents_verify_microdeposits_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.SetupIntent.verify_microdeposits_async( "seti_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", path="/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits", query_string="", ) @pytest.mark.anyio async def test_setup_intents_verify_microdeposits_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.setup_intents.verify_microdeposits_async( "seti_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", path="/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits", query_string="", api_base="https://api.stripe.com", ) def test_setup_intents_verify_microdeposits_post_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.SetupIntent.verify_microdeposits( "seti_xxxxxxxxxxxxx", amounts=[32, 45], ) http_client_mock.assert_requested( "post", path="/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits", query_string="", post_data="amounts[0]=32&amounts[1]=45", ) def test_setup_intents_verify_microdeposits_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.setup_intents.verify_microdeposits( "seti_xxxxxxxxxxxxx", {"amounts": [32, 45]}, ) http_client_mock.assert_requested( "post", path="/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits", query_string="", api_base="https://api.stripe.com", post_data="amounts[0]=32&amounts[1]=45", ) @pytest.mark.anyio async def test_setup_intents_verify_microdeposits_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.SetupIntent.verify_microdeposits_async( "seti_xxxxxxxxxxxxx", amounts=[32, 45], ) http_client_mock.assert_requested( "post", path="/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits", query_string="", post_data="amounts[0]=32&amounts[1]=45", ) @pytest.mark.anyio async def test_setup_intents_verify_microdeposits_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.setup_intents.verify_microdeposits_async( "seti_xxxxxxxxxxxxx", {"amounts": [32, 45]}, ) http_client_mock.assert_requested( "post", path="/v1/setup_intents/seti_xxxxxxxxxxxxx/verify_microdeposits", query_string="", api_base="https://api.stripe.com", post_data="amounts[0]=32&amounts[1]=45", ) def test_shipping_rates_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.ShippingRate.list() http_client_mock.assert_requested( "get", path="/v1/shipping_rates", query_string="", ) def test_shipping_rates_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/shipping_rates", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.shipping_rates.list() http_client_mock.assert_requested( "get", path="/v1/shipping_rates", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_shipping_rates_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.ShippingRate.list_async() http_client_mock.assert_requested( "get", path="/v1/shipping_rates", query_string="", ) @pytest.mark.anyio async def test_shipping_rates_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/shipping_rates", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.shipping_rates.list_async() http_client_mock.assert_requested( "get", path="/v1/shipping_rates", query_string="", api_base="https://api.stripe.com", ) def test_shipping_rates_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.ShippingRate.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/shipping_rates", query_string="limit=3", ) def test_shipping_rates_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/shipping_rates", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.shipping_rates.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/shipping_rates", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_shipping_rates_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.ShippingRate.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/shipping_rates", query_string="limit=3", ) @pytest.mark.anyio async def test_shipping_rates_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/shipping_rates", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.shipping_rates.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/shipping_rates", query_string="limit=3", api_base="https://api.stripe.com", ) def test_shipping_rates_get_3( self, http_client_mock: HTTPClientMock ) -> None: stripe.ShippingRate.retrieve("shr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/shipping_rates/shr_xxxxxxxxxxxxx", query_string="", ) def test_shipping_rates_get_3_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/shipping_rates/shr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.shipping_rates.retrieve("shr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/shipping_rates/shr_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_shipping_rates_get_3_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.ShippingRate.retrieve_async("shr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/shipping_rates/shr_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_shipping_rates_get_3_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/shipping_rates/shr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.shipping_rates.retrieve_async("shr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/shipping_rates/shr_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_shipping_rates_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.ShippingRate.create( display_name="Sample Shipper", fixed_amount={"currency": "usd", "amount": 400}, type="fixed_amount", ) http_client_mock.assert_requested( "post", path="/v1/shipping_rates", query_string="", post_data="display_name=Sample%20Shipper&fixed_amount[currency]=usd&fixed_amount[amount]=400&type=fixed_amount", ) def test_shipping_rates_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/shipping_rates", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.shipping_rates.create( { "display_name": "Sample Shipper", "fixed_amount": {"currency": "usd", "amount": 400}, "type": "fixed_amount", } ) http_client_mock.assert_requested( "post", path="/v1/shipping_rates", query_string="", api_base="https://api.stripe.com", post_data="display_name=Sample%20Shipper&fixed_amount[currency]=usd&fixed_amount[amount]=400&type=fixed_amount", ) @pytest.mark.anyio async def test_shipping_rates_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.ShippingRate.create_async( display_name="Sample Shipper", fixed_amount={"currency": "usd", "amount": 400}, type="fixed_amount", ) http_client_mock.assert_requested( "post", path="/v1/shipping_rates", query_string="", post_data="display_name=Sample%20Shipper&fixed_amount[currency]=usd&fixed_amount[amount]=400&type=fixed_amount", ) @pytest.mark.anyio async def test_shipping_rates_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/shipping_rates", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.shipping_rates.create_async( { "display_name": "Sample Shipper", "fixed_amount": {"currency": "usd", "amount": 400}, "type": "fixed_amount", } ) http_client_mock.assert_requested( "post", path="/v1/shipping_rates", query_string="", api_base="https://api.stripe.com", post_data="display_name=Sample%20Shipper&fixed_amount[currency]=usd&fixed_amount[amount]=400&type=fixed_amount", ) def test_shipping_rates_post_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.ShippingRate.create( display_name="Ground shipping", type="fixed_amount", fixed_amount={"amount": 500, "currency": "usd"}, ) http_client_mock.assert_requested( "post", path="/v1/shipping_rates", query_string="", post_data="display_name=Ground%20shipping&type=fixed_amount&fixed_amount[amount]=500&fixed_amount[currency]=usd", ) def test_shipping_rates_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/shipping_rates", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.shipping_rates.create( { "display_name": "Ground shipping", "type": "fixed_amount", "fixed_amount": {"amount": 500, "currency": "usd"}, } ) http_client_mock.assert_requested( "post", path="/v1/shipping_rates", query_string="", api_base="https://api.stripe.com", post_data="display_name=Ground%20shipping&type=fixed_amount&fixed_amount[amount]=500&fixed_amount[currency]=usd", ) @pytest.mark.anyio async def test_shipping_rates_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.ShippingRate.create_async( display_name="Ground shipping", type="fixed_amount", fixed_amount={"amount": 500, "currency": "usd"}, ) http_client_mock.assert_requested( "post", path="/v1/shipping_rates", query_string="", post_data="display_name=Ground%20shipping&type=fixed_amount&fixed_amount[amount]=500&fixed_amount[currency]=usd", ) @pytest.mark.anyio async def test_shipping_rates_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/shipping_rates", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.shipping_rates.create_async( { "display_name": "Ground shipping", "type": "fixed_amount", "fixed_amount": {"amount": 500, "currency": "usd"}, } ) http_client_mock.assert_requested( "post", path="/v1/shipping_rates", query_string="", api_base="https://api.stripe.com", post_data="display_name=Ground%20shipping&type=fixed_amount&fixed_amount[amount]=500&fixed_amount[currency]=usd", ) def test_shipping_rates_post_3( self, http_client_mock: HTTPClientMock ) -> None: stripe.ShippingRate.modify( "shr_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/shipping_rates/shr_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) def test_shipping_rates_post_3_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/shipping_rates/shr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.shipping_rates.update( "shr_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/shipping_rates/shr_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_shipping_rates_post_3_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.ShippingRate.modify_async( "shr_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/shipping_rates/shr_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_shipping_rates_post_3_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/shipping_rates/shr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.shipping_rates.update_async( "shr_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/shipping_rates/shr_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) def test_sigma_scheduled_query_runs_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.sigma.ScheduledQueryRun.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/sigma/scheduled_query_runs", query_string="limit=3", ) def test_sigma_scheduled_query_runs_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/sigma/scheduled_query_runs", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.sigma.scheduled_query_runs.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/sigma/scheduled_query_runs", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_sigma_scheduled_query_runs_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.sigma.ScheduledQueryRun.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/sigma/scheduled_query_runs", query_string="limit=3", ) @pytest.mark.anyio async def test_sigma_scheduled_query_runs_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/sigma/scheduled_query_runs", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.sigma.scheduled_query_runs.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/sigma/scheduled_query_runs", query_string="limit=3", api_base="https://api.stripe.com", ) def test_sigma_scheduled_query_runs_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.sigma.ScheduledQueryRun.retrieve("sqr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/sigma/scheduled_query_runs/sqr_xxxxxxxxxxxxx", query_string="", ) def test_sigma_scheduled_query_runs_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/sigma/scheduled_query_runs/sqr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.sigma.scheduled_query_runs.retrieve("sqr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/sigma/scheduled_query_runs/sqr_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_sigma_scheduled_query_runs_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.sigma.ScheduledQueryRun.retrieve_async( "sqr_xxxxxxxxxxxxx" ) http_client_mock.assert_requested( "get", path="/v1/sigma/scheduled_query_runs/sqr_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_sigma_scheduled_query_runs_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/sigma/scheduled_query_runs/sqr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.sigma.scheduled_query_runs.retrieve_async( "sqr_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/sigma/scheduled_query_runs/sqr_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_sources_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Source.retrieve("src_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/sources/src_xxxxxxxxxxxxx", query_string="", ) def test_sources_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/sources/src_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.sources.retrieve("src_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/sources/src_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_sources_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Source.retrieve_async("src_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/sources/src_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_sources_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/sources/src_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.sources.retrieve_async("src_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/sources/src_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_sources_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Source.retrieve("src_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/sources/src_xxxxxxxxxxxxx", query_string="", ) def test_sources_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/sources/src_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.sources.retrieve("src_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/sources/src_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_sources_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Source.retrieve_async("src_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/sources/src_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_sources_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/sources/src_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.sources.retrieve_async("src_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/sources/src_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_sources_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Source.modify( "src_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/sources/src_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) def test_sources_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/sources/src_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.sources.update( "src_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/sources/src_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_sources_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Source.modify_async( "src_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/sources/src_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_sources_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/sources/src_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.sources.update_async( "src_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/sources/src_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) def test_subscription_items_delete( self, http_client_mock: HTTPClientMock ) -> None: stripe.SubscriptionItem.delete("si_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/subscription_items/si_xxxxxxxxxxxxx", query_string="", ) def test_subscription_items_delete_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/subscription_items/si_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.subscription_items.delete("si_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/subscription_items/si_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_subscription_items_delete_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.SubscriptionItem.delete_async("si_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/subscription_items/si_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_subscription_items_delete_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/subscription_items/si_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.subscription_items.delete_async("si_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/subscription_items/si_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_subscription_items_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.SubscriptionItem.list(subscription="sub_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/subscription_items", query_string="subscription=sub_xxxxxxxxxxxxx", ) def test_subscription_items_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/subscription_items", "subscription=sub_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.subscription_items.list({"subscription": "sub_xxxxxxxxxxxxx"}) http_client_mock.assert_requested( "get", path="/v1/subscription_items", query_string="subscription=sub_xxxxxxxxxxxxx", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_subscription_items_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.SubscriptionItem.list_async( subscription="sub_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/subscription_items", query_string="subscription=sub_xxxxxxxxxxxxx", ) @pytest.mark.anyio async def test_subscription_items_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/subscription_items", "subscription=sub_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.subscription_items.list_async( { "subscription": "sub_xxxxxxxxxxxxx", } ) http_client_mock.assert_requested( "get", path="/v1/subscription_items", query_string="subscription=sub_xxxxxxxxxxxxx", api_base="https://api.stripe.com", ) def test_subscription_items_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.SubscriptionItem.retrieve("si_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/subscription_items/si_xxxxxxxxxxxxx", query_string="", ) def test_subscription_items_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/subscription_items/si_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.subscription_items.retrieve("si_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/subscription_items/si_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_subscription_items_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.SubscriptionItem.retrieve_async("si_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/subscription_items/si_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_subscription_items_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/subscription_items/si_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.subscription_items.retrieve_async("si_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/subscription_items/si_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_subscription_items_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.SubscriptionItem.create( subscription="sub_xxxxxxxxxxxxx", price="price_xxxxxxxxxxxxx", quantity=2, ) http_client_mock.assert_requested( "post", path="/v1/subscription_items", query_string="", post_data="subscription=sub_xxxxxxxxxxxxx&price=price_xxxxxxxxxxxxx&quantity=2", ) def test_subscription_items_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/subscription_items", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.subscription_items.create( { "subscription": "sub_xxxxxxxxxxxxx", "price": "price_xxxxxxxxxxxxx", "quantity": 2, } ) http_client_mock.assert_requested( "post", path="/v1/subscription_items", query_string="", api_base="https://api.stripe.com", post_data="subscription=sub_xxxxxxxxxxxxx&price=price_xxxxxxxxxxxxx&quantity=2", ) @pytest.mark.anyio async def test_subscription_items_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.SubscriptionItem.create_async( subscription="sub_xxxxxxxxxxxxx", price="price_xxxxxxxxxxxxx", quantity=2, ) http_client_mock.assert_requested( "post", path="/v1/subscription_items", query_string="", post_data="subscription=sub_xxxxxxxxxxxxx&price=price_xxxxxxxxxxxxx&quantity=2", ) @pytest.mark.anyio async def test_subscription_items_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/subscription_items", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.subscription_items.create_async( { "subscription": "sub_xxxxxxxxxxxxx", "price": "price_xxxxxxxxxxxxx", "quantity": 2, } ) http_client_mock.assert_requested( "post", path="/v1/subscription_items", query_string="", api_base="https://api.stripe.com", post_data="subscription=sub_xxxxxxxxxxxxx&price=price_xxxxxxxxxxxxx&quantity=2", ) def test_subscription_items_post_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.SubscriptionItem.modify( "si_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/subscription_items/si_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) def test_subscription_items_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/subscription_items/si_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.subscription_items.update( "si_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/subscription_items/si_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_subscription_items_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.SubscriptionItem.modify_async( "si_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/subscription_items/si_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_subscription_items_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/subscription_items/si_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.subscription_items.update_async( "si_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/subscription_items/si_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) def test_subscription_items_usage_record_summaries_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.SubscriptionItem.list_usage_record_summaries( "si_xxxxxxxxxxxxx", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/subscription_items/si_xxxxxxxxxxxxx/usage_record_summaries", query_string="limit=3", ) def test_subscription_items_usage_record_summaries_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/subscription_items/si_xxxxxxxxxxxxx/usage_record_summaries", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.subscription_items.usage_record_summaries.list( "si_xxxxxxxxxxxxx", {"limit": 3}, ) http_client_mock.assert_requested( "get", path="/v1/subscription_items/si_xxxxxxxxxxxxx/usage_record_summaries", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_subscription_items_usage_record_summaries_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.SubscriptionItem.list_usage_record_summaries_async( "si_xxxxxxxxxxxxx", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/subscription_items/si_xxxxxxxxxxxxx/usage_record_summaries", query_string="limit=3", ) @pytest.mark.anyio async def test_subscription_items_usage_record_summaries_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/subscription_items/si_xxxxxxxxxxxxx/usage_record_summaries", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.subscription_items.usage_record_summaries.list_async( "si_xxxxxxxxxxxxx", {"limit": 3}, ) http_client_mock.assert_requested( "get", path="/v1/subscription_items/si_xxxxxxxxxxxxx/usage_record_summaries", query_string="limit=3", api_base="https://api.stripe.com", ) def test_subscription_items_usage_records_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.SubscriptionItem.create_usage_record( "si_xxxxxxxxxxxxx", quantity=100, timestamp=1571252444, ) http_client_mock.assert_requested( "post", path="/v1/subscription_items/si_xxxxxxxxxxxxx/usage_records", query_string="", post_data="quantity=100×tamp=1571252444", ) def test_subscription_items_usage_records_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/subscription_items/si_xxxxxxxxxxxxx/usage_records", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.subscription_items.usage_records.create( "si_xxxxxxxxxxxxx", {"quantity": 100, "timestamp": 1571252444}, ) http_client_mock.assert_requested( "post", path="/v1/subscription_items/si_xxxxxxxxxxxxx/usage_records", query_string="", api_base="https://api.stripe.com", post_data="quantity=100×tamp=1571252444", ) @pytest.mark.anyio async def test_subscription_items_usage_records_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.SubscriptionItem.create_usage_record_async( "si_xxxxxxxxxxxxx", quantity=100, timestamp=1571252444, ) http_client_mock.assert_requested( "post", path="/v1/subscription_items/si_xxxxxxxxxxxxx/usage_records", query_string="", post_data="quantity=100×tamp=1571252444", ) @pytest.mark.anyio async def test_subscription_items_usage_records_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/subscription_items/si_xxxxxxxxxxxxx/usage_records", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.subscription_items.usage_records.create_async( "si_xxxxxxxxxxxxx", {"quantity": 100, "timestamp": 1571252444}, ) http_client_mock.assert_requested( "post", path="/v1/subscription_items/si_xxxxxxxxxxxxx/usage_records", query_string="", api_base="https://api.stripe.com", post_data="quantity=100×tamp=1571252444", ) def test_subscription_schedules_cancel_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.SubscriptionSchedule.cancel("sub_sched_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/cancel", query_string="", ) def test_subscription_schedules_cancel_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/cancel", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.subscription_schedules.cancel("sub_sched_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/cancel", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_subscription_schedules_cancel_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.SubscriptionSchedule.cancel_async( "sub_sched_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/cancel", query_string="", ) @pytest.mark.anyio async def test_subscription_schedules_cancel_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/cancel", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.subscription_schedules.cancel_async( "sub_sched_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/cancel", query_string="", api_base="https://api.stripe.com", ) def test_subscription_schedules_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.SubscriptionSchedule.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/subscription_schedules", query_string="limit=3", ) def test_subscription_schedules_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/subscription_schedules", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.subscription_schedules.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/subscription_schedules", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_subscription_schedules_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.SubscriptionSchedule.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/subscription_schedules", query_string="limit=3", ) @pytest.mark.anyio async def test_subscription_schedules_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/subscription_schedules", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.subscription_schedules.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/subscription_schedules", query_string="limit=3", api_base="https://api.stripe.com", ) def test_subscription_schedules_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.SubscriptionSchedule.retrieve("sub_sched_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx", query_string="", ) def test_subscription_schedules_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.subscription_schedules.retrieve("sub_sched_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_subscription_schedules_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.SubscriptionSchedule.retrieve_async( "sub_sched_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_subscription_schedules_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.subscription_schedules.retrieve_async( "sub_sched_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_subscription_schedules_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.SubscriptionSchedule.create( customer="cus_xxxxxxxxxxxxx", start_date=1676070661, end_behavior="release", phases=[ { "items": [{"price": "price_xxxxxxxxxxxxx", "quantity": 1}], "iterations": 12, }, ], ) http_client_mock.assert_requested( "post", path="/v1/subscription_schedules", query_string="", post_data="customer=cus_xxxxxxxxxxxxx&start_date=1676070661&end_behavior=release&phases[0][items][0][price]=price_xxxxxxxxxxxxx&phases[0][items][0][quantity]=1&phases[0][iterations]=12", ) def test_subscription_schedules_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/subscription_schedules", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.subscription_schedules.create( { "customer": "cus_xxxxxxxxxxxxx", "start_date": 1676070661, "end_behavior": "release", "phases": [ { "items": [ {"price": "price_xxxxxxxxxxxxx", "quantity": 1} ], "iterations": 12, }, ], } ) http_client_mock.assert_requested( "post", path="/v1/subscription_schedules", query_string="", api_base="https://api.stripe.com", post_data="customer=cus_xxxxxxxxxxxxx&start_date=1676070661&end_behavior=release&phases[0][items][0][price]=price_xxxxxxxxxxxxx&phases[0][items][0][quantity]=1&phases[0][iterations]=12", ) @pytest.mark.anyio async def test_subscription_schedules_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.SubscriptionSchedule.create_async( customer="cus_xxxxxxxxxxxxx", start_date=1676070661, end_behavior="release", phases=[ { "items": [{"price": "price_xxxxxxxxxxxxx", "quantity": 1}], "iterations": 12, }, ], ) http_client_mock.assert_requested( "post", path="/v1/subscription_schedules", query_string="", post_data="customer=cus_xxxxxxxxxxxxx&start_date=1676070661&end_behavior=release&phases[0][items][0][price]=price_xxxxxxxxxxxxx&phases[0][items][0][quantity]=1&phases[0][iterations]=12", ) @pytest.mark.anyio async def test_subscription_schedules_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/subscription_schedules", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.subscription_schedules.create_async( { "customer": "cus_xxxxxxxxxxxxx", "start_date": 1676070661, "end_behavior": "release", "phases": [ { "items": [ {"price": "price_xxxxxxxxxxxxx", "quantity": 1} ], "iterations": 12, }, ], } ) http_client_mock.assert_requested( "post", path="/v1/subscription_schedules", query_string="", api_base="https://api.stripe.com", post_data="customer=cus_xxxxxxxxxxxxx&start_date=1676070661&end_behavior=release&phases[0][items][0][price]=price_xxxxxxxxxxxxx&phases[0][items][0][quantity]=1&phases[0][iterations]=12", ) def test_subscription_schedules_post_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.SubscriptionSchedule.modify( "sub_sched_xxxxxxxxxxxxx", end_behavior="release", ) http_client_mock.assert_requested( "post", path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx", query_string="", post_data="end_behavior=release", ) def test_subscription_schedules_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.subscription_schedules.update( "sub_sched_xxxxxxxxxxxxx", {"end_behavior": "release"}, ) http_client_mock.assert_requested( "post", path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="end_behavior=release", ) @pytest.mark.anyio async def test_subscription_schedules_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.SubscriptionSchedule.modify_async( "sub_sched_xxxxxxxxxxxxx", end_behavior="release", ) http_client_mock.assert_requested( "post", path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx", query_string="", post_data="end_behavior=release", ) @pytest.mark.anyio async def test_subscription_schedules_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.subscription_schedules.update_async( "sub_sched_xxxxxxxxxxxxx", {"end_behavior": "release"}, ) http_client_mock.assert_requested( "post", path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="end_behavior=release", ) def test_subscription_schedules_release_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.SubscriptionSchedule.release("sub_sched_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/release", query_string="", ) def test_subscription_schedules_release_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/release", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.subscription_schedules.release("sub_sched_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/release", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_subscription_schedules_release_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.SubscriptionSchedule.release_async( "sub_sched_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/release", query_string="", ) @pytest.mark.anyio async def test_subscription_schedules_release_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/release", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.subscription_schedules.release_async( "sub_sched_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", path="/v1/subscription_schedules/sub_sched_xxxxxxxxxxxxx/release", query_string="", api_base="https://api.stripe.com", ) def test_subscriptions_delete( self, http_client_mock: HTTPClientMock ) -> None: stripe.Subscription.cancel("sub_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/subscriptions/sub_xxxxxxxxxxxxx", query_string="", ) def test_subscriptions_delete_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/subscriptions/sub_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.subscriptions.cancel("sub_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/subscriptions/sub_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_subscriptions_delete_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Subscription.cancel_async("sub_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/subscriptions/sub_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_subscriptions_delete_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/subscriptions/sub_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.subscriptions.cancel_async("sub_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/subscriptions/sub_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_subscriptions_discount_delete( self, http_client_mock: HTTPClientMock ) -> None: stripe.Subscription.delete_discount("sub_xyz") http_client_mock.assert_requested( "delete", path="/v1/subscriptions/sub_xyz/discount", query_string="", ) def test_subscriptions_discount_delete_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/subscriptions/sub_xyz/discount", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.subscriptions.delete_discount("sub_xyz") http_client_mock.assert_requested( "delete", path="/v1/subscriptions/sub_xyz/discount", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_subscriptions_discount_delete_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Subscription.delete_discount_async("sub_xyz") http_client_mock.assert_requested( "delete", path="/v1/subscriptions/sub_xyz/discount", query_string="", ) @pytest.mark.anyio async def test_subscriptions_discount_delete_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/subscriptions/sub_xyz/discount", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.subscriptions.delete_discount_async("sub_xyz") http_client_mock.assert_requested( "delete", path="/v1/subscriptions/sub_xyz/discount", query_string="", api_base="https://api.stripe.com", ) def test_subscriptions_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Subscription.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/subscriptions", query_string="limit=3", ) def test_subscriptions_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/subscriptions", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.subscriptions.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/subscriptions", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_subscriptions_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Subscription.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/subscriptions", query_string="limit=3", ) @pytest.mark.anyio async def test_subscriptions_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/subscriptions", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.subscriptions.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/subscriptions", query_string="limit=3", api_base="https://api.stripe.com", ) def test_subscriptions_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.Subscription.retrieve("sub_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/subscriptions/sub_xxxxxxxxxxxxx", query_string="", ) def test_subscriptions_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/subscriptions/sub_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.subscriptions.retrieve("sub_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/subscriptions/sub_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_subscriptions_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Subscription.retrieve_async("sub_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/subscriptions/sub_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_subscriptions_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/subscriptions/sub_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.subscriptions.retrieve_async("sub_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/subscriptions/sub_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_subscriptions_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.Subscription.create( customer="cus_xxxxxxxxxxxxx", items=[{"price": "price_xxxxxxxxxxxxx"}], ) http_client_mock.assert_requested( "post", path="/v1/subscriptions", query_string="", post_data="customer=cus_xxxxxxxxxxxxx&items[0][price]=price_xxxxxxxxxxxxx", ) def test_subscriptions_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/subscriptions", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.subscriptions.create( { "customer": "cus_xxxxxxxxxxxxx", "items": [{"price": "price_xxxxxxxxxxxxx"}], } ) http_client_mock.assert_requested( "post", path="/v1/subscriptions", query_string="", api_base="https://api.stripe.com", post_data="customer=cus_xxxxxxxxxxxxx&items[0][price]=price_xxxxxxxxxxxxx", ) @pytest.mark.anyio async def test_subscriptions_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Subscription.create_async( customer="cus_xxxxxxxxxxxxx", items=[{"price": "price_xxxxxxxxxxxxx"}], ) http_client_mock.assert_requested( "post", path="/v1/subscriptions", query_string="", post_data="customer=cus_xxxxxxxxxxxxx&items[0][price]=price_xxxxxxxxxxxxx", ) @pytest.mark.anyio async def test_subscriptions_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/subscriptions", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.subscriptions.create_async( { "customer": "cus_xxxxxxxxxxxxx", "items": [{"price": "price_xxxxxxxxxxxxx"}], } ) http_client_mock.assert_requested( "post", path="/v1/subscriptions", query_string="", api_base="https://api.stripe.com", post_data="customer=cus_xxxxxxxxxxxxx&items[0][price]=price_xxxxxxxxxxxxx", ) def test_subscriptions_post_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.Subscription.modify( "sub_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/subscriptions/sub_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) def test_subscriptions_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/subscriptions/sub_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.subscriptions.update( "sub_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/subscriptions/sub_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_subscriptions_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Subscription.modify_async( "sub_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/subscriptions/sub_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_subscriptions_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/subscriptions/sub_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.subscriptions.update_async( "sub_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/subscriptions/sub_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) def test_subscriptions_search_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.Subscription.search( query="status:'active' AND metadata['order_id']:'6735'", ) http_client_mock.assert_requested( "get", path="/v1/subscriptions/search", query_string="query=status%3A%27active%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", ) def test_subscriptions_search_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/subscriptions/search", "query=status%3A%27active%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.subscriptions.search( { "query": "status:'active' AND metadata['order_id']:'6735'", } ) http_client_mock.assert_requested( "get", path="/v1/subscriptions/search", query_string="query=status%3A%27active%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_subscriptions_search_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Subscription.search_async( query="status:'active' AND metadata['order_id']:'6735'", ) http_client_mock.assert_requested( "get", path="/v1/subscriptions/search", query_string="query=status%3A%27active%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", ) @pytest.mark.anyio async def test_subscriptions_search_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/subscriptions/search", "query=status%3A%27active%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.subscriptions.search_async( { "query": "status:'active' AND metadata['order_id']:'6735'", } ) http_client_mock.assert_requested( "get", path="/v1/subscriptions/search", query_string="query=status%3A%27active%27%20AND%20metadata%5B%27order_id%27%5D%3A%276735%27", api_base="https://api.stripe.com", ) def test_tax_calculations_line_items_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.tax.Calculation.list_line_items("xxx") http_client_mock.assert_requested( "get", path="/v1/tax/calculations/xxx/line_items", query_string="", ) def test_tax_calculations_line_items_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/tax/calculations/xxx/line_items", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.tax.calculations.line_items.list("xxx") http_client_mock.assert_requested( "get", path="/v1/tax/calculations/xxx/line_items", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_tax_calculations_line_items_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.tax.Calculation.list_line_items_async("xxx") http_client_mock.assert_requested( "get", path="/v1/tax/calculations/xxx/line_items", query_string="", ) @pytest.mark.anyio async def test_tax_calculations_line_items_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/tax/calculations/xxx/line_items", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.tax.calculations.line_items.list_async("xxx") http_client_mock.assert_requested( "get", path="/v1/tax/calculations/xxx/line_items", query_string="", api_base="https://api.stripe.com", ) def test_tax_calculations_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.tax.Calculation.create( currency="usd", line_items=[{"amount": 1000, "reference": "L1"}], customer_details={ "address": { "line1": "354 Oyster Point Blvd", "city": "South San Francisco", "state": "CA", "postal_code": "94080", "country": "US", }, "address_source": "shipping", }, ) http_client_mock.assert_requested( "post", path="/v1/tax/calculations", query_string="", post_data="currency=usd&line_items[0][amount]=1000&line_items[0][reference]=L1&customer_details[address][line1]=354%20Oyster%20Point%20Blvd&customer_details[address][city]=South%20San%20Francisco&customer_details[address][state]=CA&customer_details[address][postal_code]=94080&customer_details[address][country]=US&customer_details[address_source]=shipping", ) def test_tax_calculations_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/tax/calculations", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.tax.calculations.create( { "currency": "usd", "line_items": [{"amount": 1000, "reference": "L1"}], "customer_details": { "address": { "line1": "354 Oyster Point Blvd", "city": "South San Francisco", "state": "CA", "postal_code": "94080", "country": "US", }, "address_source": "shipping", }, } ) http_client_mock.assert_requested( "post", path="/v1/tax/calculations", query_string="", api_base="https://api.stripe.com", post_data="currency=usd&line_items[0][amount]=1000&line_items[0][reference]=L1&customer_details[address][line1]=354%20Oyster%20Point%20Blvd&customer_details[address][city]=South%20San%20Francisco&customer_details[address][state]=CA&customer_details[address][postal_code]=94080&customer_details[address][country]=US&customer_details[address_source]=shipping", ) @pytest.mark.anyio async def test_tax_calculations_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.tax.Calculation.create_async( currency="usd", line_items=[{"amount": 1000, "reference": "L1"}], customer_details={ "address": { "line1": "354 Oyster Point Blvd", "city": "South San Francisco", "state": "CA", "postal_code": "94080", "country": "US", }, "address_source": "shipping", }, ) http_client_mock.assert_requested( "post", path="/v1/tax/calculations", query_string="", post_data="currency=usd&line_items[0][amount]=1000&line_items[0][reference]=L1&customer_details[address][line1]=354%20Oyster%20Point%20Blvd&customer_details[address][city]=South%20San%20Francisco&customer_details[address][state]=CA&customer_details[address][postal_code]=94080&customer_details[address][country]=US&customer_details[address_source]=shipping", ) @pytest.mark.anyio async def test_tax_calculations_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/tax/calculations", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.tax.calculations.create_async( { "currency": "usd", "line_items": [{"amount": 1000, "reference": "L1"}], "customer_details": { "address": { "line1": "354 Oyster Point Blvd", "city": "South San Francisco", "state": "CA", "postal_code": "94080", "country": "US", }, "address_source": "shipping", }, } ) http_client_mock.assert_requested( "post", path="/v1/tax/calculations", query_string="", api_base="https://api.stripe.com", post_data="currency=usd&line_items[0][amount]=1000&line_items[0][reference]=L1&customer_details[address][line1]=354%20Oyster%20Point%20Blvd&customer_details[address][city]=South%20San%20Francisco&customer_details[address][state]=CA&customer_details[address][postal_code]=94080&customer_details[address][country]=US&customer_details[address_source]=shipping", ) def test_tax_codes_get(self, http_client_mock: HTTPClientMock) -> None: stripe.TaxCode.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/tax_codes", query_string="limit=3", ) def test_tax_codes_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/tax_codes", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.tax_codes.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/tax_codes", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_tax_codes_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.TaxCode.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/tax_codes", query_string="limit=3", ) @pytest.mark.anyio async def test_tax_codes_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/tax_codes", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.tax_codes.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/tax_codes", query_string="limit=3", api_base="https://api.stripe.com", ) def test_tax_codes_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.TaxCode.retrieve("txcd_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/tax_codes/txcd_xxxxxxxxxxxxx", query_string="", ) def test_tax_codes_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/tax_codes/txcd_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.tax_codes.retrieve("txcd_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/tax_codes/txcd_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_tax_codes_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.TaxCode.retrieve_async("txcd_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/tax_codes/txcd_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_tax_codes_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/tax_codes/txcd_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.tax_codes.retrieve_async("txcd_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/tax_codes/txcd_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_tax_ids_delete(self, http_client_mock: HTTPClientMock) -> None: stripe.TaxId.delete("taxid_123") http_client_mock.assert_requested( "delete", path="/v1/tax_ids/taxid_123", query_string="", ) def test_tax_ids_delete_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/tax_ids/taxid_123", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.tax_ids.delete("taxid_123") http_client_mock.assert_requested( "delete", path="/v1/tax_ids/taxid_123", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_tax_ids_delete_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.TaxId.delete_async("taxid_123") http_client_mock.assert_requested( "delete", path="/v1/tax_ids/taxid_123", query_string="", ) @pytest.mark.anyio async def test_tax_ids_delete_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/tax_ids/taxid_123", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.tax_ids.delete_async("taxid_123") http_client_mock.assert_requested( "delete", path="/v1/tax_ids/taxid_123", query_string="", api_base="https://api.stripe.com", ) def test_tax_ids_get(self, http_client_mock: HTTPClientMock) -> None: stripe.TaxId.list() http_client_mock.assert_requested( "get", path="/v1/tax_ids", query_string="", ) def test_tax_ids_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/tax_ids", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.tax_ids.list() http_client_mock.assert_requested( "get", path="/v1/tax_ids", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_tax_ids_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.TaxId.list_async() http_client_mock.assert_requested( "get", path="/v1/tax_ids", query_string="", ) @pytest.mark.anyio async def test_tax_ids_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/tax_ids", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.tax_ids.list_async() http_client_mock.assert_requested( "get", path="/v1/tax_ids", query_string="", api_base="https://api.stripe.com", ) def test_tax_ids_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.TaxId.retrieve("taxid_123") http_client_mock.assert_requested( "get", path="/v1/tax_ids/taxid_123", query_string="", ) def test_tax_ids_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/tax_ids/taxid_123", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.tax_ids.retrieve("taxid_123") http_client_mock.assert_requested( "get", path="/v1/tax_ids/taxid_123", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_tax_ids_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.TaxId.retrieve_async("taxid_123") http_client_mock.assert_requested( "get", path="/v1/tax_ids/taxid_123", query_string="", ) @pytest.mark.anyio async def test_tax_ids_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/tax_ids/taxid_123", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.tax_ids.retrieve_async("taxid_123") http_client_mock.assert_requested( "get", path="/v1/tax_ids/taxid_123", query_string="", api_base="https://api.stripe.com", ) def test_tax_ids_post(self, http_client_mock: HTTPClientMock) -> None: stripe.TaxId.create( type="eu_vat", value="123", ) http_client_mock.assert_requested( "post", path="/v1/tax_ids", query_string="", post_data="type=eu_vat&value=123", ) def test_tax_ids_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/tax_ids", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.tax_ids.create({"type": "eu_vat", "value": "123"}) http_client_mock.assert_requested( "post", path="/v1/tax_ids", query_string="", api_base="https://api.stripe.com", post_data="type=eu_vat&value=123", ) @pytest.mark.anyio async def test_tax_ids_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.TaxId.create_async( type="eu_vat", value="123", ) http_client_mock.assert_requested( "post", path="/v1/tax_ids", query_string="", post_data="type=eu_vat&value=123", ) @pytest.mark.anyio async def test_tax_ids_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/tax_ids", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.tax_ids.create_async({"type": "eu_vat", "value": "123"}) http_client_mock.assert_requested( "post", path="/v1/tax_ids", query_string="", api_base="https://api.stripe.com", post_data="type=eu_vat&value=123", ) def test_tax_rates_get(self, http_client_mock: HTTPClientMock) -> None: stripe.TaxRate.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/tax_rates", query_string="limit=3", ) def test_tax_rates_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/tax_rates", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.tax_rates.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/tax_rates", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_tax_rates_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.TaxRate.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/tax_rates", query_string="limit=3", ) @pytest.mark.anyio async def test_tax_rates_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/tax_rates", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.tax_rates.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/tax_rates", query_string="limit=3", api_base="https://api.stripe.com", ) def test_tax_rates_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.TaxRate.retrieve("txr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/tax_rates/txr_xxxxxxxxxxxxx", query_string="", ) def test_tax_rates_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/tax_rates/txr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.tax_rates.retrieve("txr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/tax_rates/txr_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_tax_rates_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.TaxRate.retrieve_async("txr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/tax_rates/txr_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_tax_rates_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/tax_rates/txr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.tax_rates.retrieve_async("txr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/tax_rates/txr_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_tax_rates_post(self, http_client_mock: HTTPClientMock) -> None: stripe.TaxRate.create( display_name="VAT", description="VAT Germany", jurisdiction="DE", percentage=16, inclusive=False, ) http_client_mock.assert_requested( "post", path="/v1/tax_rates", query_string="", post_data="display_name=VAT&description=VAT%20Germany&jurisdiction=DE&percentage=16&inclusive=False", ) def test_tax_rates_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/tax_rates", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.tax_rates.create( { "display_name": "VAT", "description": "VAT Germany", "jurisdiction": "DE", "percentage": 16, "inclusive": False, } ) http_client_mock.assert_requested( "post", path="/v1/tax_rates", query_string="", api_base="https://api.stripe.com", post_data="display_name=VAT&description=VAT%20Germany&jurisdiction=DE&percentage=16&inclusive=False", ) @pytest.mark.anyio async def test_tax_rates_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.TaxRate.create_async( display_name="VAT", description="VAT Germany", jurisdiction="DE", percentage=16, inclusive=False, ) http_client_mock.assert_requested( "post", path="/v1/tax_rates", query_string="", post_data="display_name=VAT&description=VAT%20Germany&jurisdiction=DE&percentage=16&inclusive=False", ) @pytest.mark.anyio async def test_tax_rates_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/tax_rates", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.tax_rates.create_async( { "display_name": "VAT", "description": "VAT Germany", "jurisdiction": "DE", "percentage": 16, "inclusive": False, } ) http_client_mock.assert_requested( "post", path="/v1/tax_rates", query_string="", api_base="https://api.stripe.com", post_data="display_name=VAT&description=VAT%20Germany&jurisdiction=DE&percentage=16&inclusive=False", ) def test_tax_rates_post_2(self, http_client_mock: HTTPClientMock) -> None: stripe.TaxRate.modify( "txr_xxxxxxxxxxxxx", active=False, ) http_client_mock.assert_requested( "post", path="/v1/tax_rates/txr_xxxxxxxxxxxxx", query_string="", post_data="active=False", ) def test_tax_rates_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/tax_rates/txr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.tax_rates.update( "txr_xxxxxxxxxxxxx", {"active": False}, ) http_client_mock.assert_requested( "post", path="/v1/tax_rates/txr_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="active=False", ) @pytest.mark.anyio async def test_tax_rates_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.TaxRate.modify_async( "txr_xxxxxxxxxxxxx", active=False, ) http_client_mock.assert_requested( "post", path="/v1/tax_rates/txr_xxxxxxxxxxxxx", query_string="", post_data="active=False", ) @pytest.mark.anyio async def test_tax_rates_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/tax_rates/txr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.tax_rates.update_async( "txr_xxxxxxxxxxxxx", {"active": False}, ) http_client_mock.assert_requested( "post", path="/v1/tax_rates/txr_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="active=False", ) def test_tax_registrations_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.tax.Registration.list(status="all") http_client_mock.assert_requested( "get", path="/v1/tax/registrations", query_string="status=all", ) def test_tax_registrations_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/tax/registrations", "status=all", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.tax.registrations.list({"status": "all"}) http_client_mock.assert_requested( "get", path="/v1/tax/registrations", query_string="status=all", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_tax_registrations_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.tax.Registration.list_async(status="all") http_client_mock.assert_requested( "get", path="/v1/tax/registrations", query_string="status=all", ) @pytest.mark.anyio async def test_tax_registrations_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/tax/registrations", "status=all", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.tax.registrations.list_async({"status": "all"}) http_client_mock.assert_requested( "get", path="/v1/tax/registrations", query_string="status=all", api_base="https://api.stripe.com", ) def test_tax_registrations_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.tax.Registration.create( country="IE", country_options={"ie": {"type": "oss_union"}}, active_from="now", ) http_client_mock.assert_requested( "post", path="/v1/tax/registrations", query_string="", post_data="country=IE&country_options[ie][type]=oss_union&active_from=now", ) def test_tax_registrations_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/tax/registrations", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.tax.registrations.create( { "country": "IE", "country_options": {"ie": {"type": "oss_union"}}, "active_from": "now", } ) http_client_mock.assert_requested( "post", path="/v1/tax/registrations", query_string="", api_base="https://api.stripe.com", post_data="country=IE&country_options[ie][type]=oss_union&active_from=now", ) @pytest.mark.anyio async def test_tax_registrations_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.tax.Registration.create_async( country="IE", country_options={"ie": {"type": "oss_union"}}, active_from="now", ) http_client_mock.assert_requested( "post", path="/v1/tax/registrations", query_string="", post_data="country=IE&country_options[ie][type]=oss_union&active_from=now", ) @pytest.mark.anyio async def test_tax_registrations_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/tax/registrations", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.tax.registrations.create_async( { "country": "IE", "country_options": {"ie": {"type": "oss_union"}}, "active_from": "now", } ) http_client_mock.assert_requested( "post", path="/v1/tax/registrations", query_string="", api_base="https://api.stripe.com", post_data="country=IE&country_options[ie][type]=oss_union&active_from=now", ) def test_tax_registrations_post_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.tax.Registration.modify( "taxreg_xxxxxxxxxxxxx", expires_at="now", ) http_client_mock.assert_requested( "post", path="/v1/tax/registrations/taxreg_xxxxxxxxxxxxx", query_string="", post_data="expires_at=now", ) def test_tax_registrations_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/tax/registrations/taxreg_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.tax.registrations.update( "taxreg_xxxxxxxxxxxxx", {"expires_at": "now"}, ) http_client_mock.assert_requested( "post", path="/v1/tax/registrations/taxreg_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="expires_at=now", ) @pytest.mark.anyio async def test_tax_registrations_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.tax.Registration.modify_async( "taxreg_xxxxxxxxxxxxx", expires_at="now", ) http_client_mock.assert_requested( "post", path="/v1/tax/registrations/taxreg_xxxxxxxxxxxxx", query_string="", post_data="expires_at=now", ) @pytest.mark.anyio async def test_tax_registrations_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/tax/registrations/taxreg_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.tax.registrations.update_async( "taxreg_xxxxxxxxxxxxx", {"expires_at": "now"}, ) http_client_mock.assert_requested( "post", path="/v1/tax/registrations/taxreg_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="expires_at=now", ) def test_tax_settings_get(self, http_client_mock: HTTPClientMock) -> None: stripe.tax.Settings.retrieve() http_client_mock.assert_requested( "get", path="/v1/tax/settings", query_string="", ) def test_tax_settings_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/tax/settings", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.tax.settings.retrieve() http_client_mock.assert_requested( "get", path="/v1/tax/settings", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_tax_settings_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.tax.Settings.retrieve_async() http_client_mock.assert_requested( "get", path="/v1/tax/settings", query_string="", ) @pytest.mark.anyio async def test_tax_settings_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/tax/settings", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.tax.settings.retrieve_async() http_client_mock.assert_requested( "get", path="/v1/tax/settings", query_string="", api_base="https://api.stripe.com", ) def test_tax_settings_post(self, http_client_mock: HTTPClientMock) -> None: stripe.tax.Settings.modify(defaults={"tax_code": "txcd_10000000"}) http_client_mock.assert_requested( "post", path="/v1/tax/settings", query_string="", post_data="defaults[tax_code]=txcd_10000000", ) def test_tax_settings_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/tax/settings", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.tax.settings.update({"defaults": {"tax_code": "txcd_10000000"}}) http_client_mock.assert_requested( "post", path="/v1/tax/settings", query_string="", api_base="https://api.stripe.com", post_data="defaults[tax_code]=txcd_10000000", ) @pytest.mark.anyio async def test_tax_settings_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.tax.Settings.modify_async( defaults={"tax_code": "txcd_10000000"}, ) http_client_mock.assert_requested( "post", path="/v1/tax/settings", query_string="", post_data="defaults[tax_code]=txcd_10000000", ) @pytest.mark.anyio async def test_tax_settings_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/tax/settings", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.tax.settings.update_async( { "defaults": {"tax_code": "txcd_10000000"}, } ) http_client_mock.assert_requested( "post", path="/v1/tax/settings", query_string="", api_base="https://api.stripe.com", post_data="defaults[tax_code]=txcd_10000000", ) def test_tax_transactions_create_from_calculation_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.tax.Transaction.create_from_calculation( calculation="xxx", reference="yyy", ) http_client_mock.assert_requested( "post", path="/v1/tax/transactions/create_from_calculation", query_string="", post_data="calculation=xxx&reference=yyy", ) def test_tax_transactions_create_from_calculation_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/tax/transactions/create_from_calculation", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.tax.transactions.create_from_calculation( { "calculation": "xxx", "reference": "yyy", } ) http_client_mock.assert_requested( "post", path="/v1/tax/transactions/create_from_calculation", query_string="", api_base="https://api.stripe.com", post_data="calculation=xxx&reference=yyy", ) @pytest.mark.anyio async def test_tax_transactions_create_from_calculation_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.tax.Transaction.create_from_calculation_async( calculation="xxx", reference="yyy", ) http_client_mock.assert_requested( "post", path="/v1/tax/transactions/create_from_calculation", query_string="", post_data="calculation=xxx&reference=yyy", ) @pytest.mark.anyio async def test_tax_transactions_create_from_calculation_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/tax/transactions/create_from_calculation", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.tax.transactions.create_from_calculation_async( { "calculation": "xxx", "reference": "yyy", } ) http_client_mock.assert_requested( "post", path="/v1/tax/transactions/create_from_calculation", query_string="", api_base="https://api.stripe.com", post_data="calculation=xxx&reference=yyy", ) def test_terminal_configurations_delete( self, http_client_mock: HTTPClientMock ) -> None: stripe.terminal.Configuration.delete("uc_123") http_client_mock.assert_requested( "delete", path="/v1/terminal/configurations/uc_123", query_string="", ) def test_terminal_configurations_delete_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/terminal/configurations/uc_123", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.terminal.configurations.delete("uc_123") http_client_mock.assert_requested( "delete", path="/v1/terminal/configurations/uc_123", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_terminal_configurations_delete_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.terminal.Configuration.delete_async("uc_123") http_client_mock.assert_requested( "delete", path="/v1/terminal/configurations/uc_123", query_string="", ) @pytest.mark.anyio async def test_terminal_configurations_delete_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/terminal/configurations/uc_123", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.terminal.configurations.delete_async("uc_123") http_client_mock.assert_requested( "delete", path="/v1/terminal/configurations/uc_123", query_string="", api_base="https://api.stripe.com", ) def test_terminal_configurations_delete_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.terminal.Configuration.delete("tmc_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", query_string="", ) def test_terminal_configurations_delete_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.terminal.configurations.delete("tmc_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_terminal_configurations_delete_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.terminal.Configuration.delete_async("tmc_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_terminal_configurations_delete_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.terminal.configurations.delete_async("tmc_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_terminal_configurations_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.terminal.Configuration.list() http_client_mock.assert_requested( "get", path="/v1/terminal/configurations", query_string="", ) def test_terminal_configurations_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/terminal/configurations", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.terminal.configurations.list() http_client_mock.assert_requested( "get", path="/v1/terminal/configurations", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_terminal_configurations_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.terminal.Configuration.list_async() http_client_mock.assert_requested( "get", path="/v1/terminal/configurations", query_string="", ) @pytest.mark.anyio async def test_terminal_configurations_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/terminal/configurations", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.terminal.configurations.list_async() http_client_mock.assert_requested( "get", path="/v1/terminal/configurations", query_string="", api_base="https://api.stripe.com", ) def test_terminal_configurations_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.terminal.Configuration.retrieve("uc_123") http_client_mock.assert_requested( "get", path="/v1/terminal/configurations/uc_123", query_string="", ) def test_terminal_configurations_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/terminal/configurations/uc_123", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.terminal.configurations.retrieve("uc_123") http_client_mock.assert_requested( "get", path="/v1/terminal/configurations/uc_123", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_terminal_configurations_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.terminal.Configuration.retrieve_async("uc_123") http_client_mock.assert_requested( "get", path="/v1/terminal/configurations/uc_123", query_string="", ) @pytest.mark.anyio async def test_terminal_configurations_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/terminal/configurations/uc_123", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.terminal.configurations.retrieve_async("uc_123") http_client_mock.assert_requested( "get", path="/v1/terminal/configurations/uc_123", query_string="", api_base="https://api.stripe.com", ) def test_terminal_configurations_get_3( self, http_client_mock: HTTPClientMock ) -> None: stripe.terminal.Configuration.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/terminal/configurations", query_string="limit=3", ) def test_terminal_configurations_get_3_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/terminal/configurations", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.terminal.configurations.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/terminal/configurations", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_terminal_configurations_get_3_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.terminal.Configuration.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/terminal/configurations", query_string="limit=3", ) @pytest.mark.anyio async def test_terminal_configurations_get_3_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/terminal/configurations", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.terminal.configurations.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/terminal/configurations", query_string="limit=3", api_base="https://api.stripe.com", ) def test_terminal_configurations_get_4( self, http_client_mock: HTTPClientMock ) -> None: stripe.terminal.Configuration.retrieve("tmc_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", query_string="", ) def test_terminal_configurations_get_4_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.terminal.configurations.retrieve("tmc_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_terminal_configurations_get_4_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.terminal.Configuration.retrieve_async("tmc_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_terminal_configurations_get_4_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.terminal.configurations.retrieve_async( "tmc_xxxxxxxxxxxxx" ) http_client_mock.assert_requested( "get", path="/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_terminal_configurations_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.terminal.Configuration.create() http_client_mock.assert_requested( "post", path="/v1/terminal/configurations", query_string="", ) def test_terminal_configurations_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/terminal/configurations", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.terminal.configurations.create() http_client_mock.assert_requested( "post", path="/v1/terminal/configurations", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_terminal_configurations_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.terminal.Configuration.create_async() http_client_mock.assert_requested( "post", path="/v1/terminal/configurations", query_string="", ) @pytest.mark.anyio async def test_terminal_configurations_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/terminal/configurations", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.terminal.configurations.create_async() http_client_mock.assert_requested( "post", path="/v1/terminal/configurations", query_string="", api_base="https://api.stripe.com", ) def test_terminal_configurations_post_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.terminal.Configuration.modify( "uc_123", tipping={"usd": {"fixed_amounts": [10]}}, ) http_client_mock.assert_requested( "post", path="/v1/terminal/configurations/uc_123", query_string="", post_data="tipping[usd][fixed_amounts][0]=10", ) def test_terminal_configurations_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/terminal/configurations/uc_123", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.terminal.configurations.update( "uc_123", {"tipping": {"usd": {"fixed_amounts": [10]}}}, ) http_client_mock.assert_requested( "post", path="/v1/terminal/configurations/uc_123", query_string="", api_base="https://api.stripe.com", post_data="tipping[usd][fixed_amounts][0]=10", ) @pytest.mark.anyio async def test_terminal_configurations_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.terminal.Configuration.modify_async( "uc_123", tipping={"usd": {"fixed_amounts": [10]}}, ) http_client_mock.assert_requested( "post", path="/v1/terminal/configurations/uc_123", query_string="", post_data="tipping[usd][fixed_amounts][0]=10", ) @pytest.mark.anyio async def test_terminal_configurations_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/terminal/configurations/uc_123", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.terminal.configurations.update_async( "uc_123", {"tipping": {"usd": {"fixed_amounts": [10]}}}, ) http_client_mock.assert_requested( "post", path="/v1/terminal/configurations/uc_123", query_string="", api_base="https://api.stripe.com", post_data="tipping[usd][fixed_amounts][0]=10", ) def test_terminal_configurations_post_3( self, http_client_mock: HTTPClientMock ) -> None: stripe.terminal.Configuration.create( bbpos_wisepos_e={"splashscreen": "file_xxxxxxxxxxxxx"}, ) http_client_mock.assert_requested( "post", path="/v1/terminal/configurations", query_string="", post_data="bbpos_wisepos_e[splashscreen]=file_xxxxxxxxxxxxx", ) def test_terminal_configurations_post_3_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/terminal/configurations", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.terminal.configurations.create( { "bbpos_wisepos_e": {"splashscreen": "file_xxxxxxxxxxxxx"}, } ) http_client_mock.assert_requested( "post", path="/v1/terminal/configurations", query_string="", api_base="https://api.stripe.com", post_data="bbpos_wisepos_e[splashscreen]=file_xxxxxxxxxxxxx", ) @pytest.mark.anyio async def test_terminal_configurations_post_3_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.terminal.Configuration.create_async( bbpos_wisepos_e={"splashscreen": "file_xxxxxxxxxxxxx"}, ) http_client_mock.assert_requested( "post", path="/v1/terminal/configurations", query_string="", post_data="bbpos_wisepos_e[splashscreen]=file_xxxxxxxxxxxxx", ) @pytest.mark.anyio async def test_terminal_configurations_post_3_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/terminal/configurations", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.terminal.configurations.create_async( { "bbpos_wisepos_e": {"splashscreen": "file_xxxxxxxxxxxxx"}, } ) http_client_mock.assert_requested( "post", path="/v1/terminal/configurations", query_string="", api_base="https://api.stripe.com", post_data="bbpos_wisepos_e[splashscreen]=file_xxxxxxxxxxxxx", ) def test_terminal_configurations_post_4( self, http_client_mock: HTTPClientMock ) -> None: stripe.terminal.Configuration.modify( "tmc_xxxxxxxxxxxxx", bbpos_wisepos_e={"splashscreen": "file_xxxxxxxxxxxxx"}, ) http_client_mock.assert_requested( "post", path="/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", query_string="", post_data="bbpos_wisepos_e[splashscreen]=file_xxxxxxxxxxxxx", ) def test_terminal_configurations_post_4_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.terminal.configurations.update( "tmc_xxxxxxxxxxxxx", {"bbpos_wisepos_e": {"splashscreen": "file_xxxxxxxxxxxxx"}}, ) http_client_mock.assert_requested( "post", path="/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="bbpos_wisepos_e[splashscreen]=file_xxxxxxxxxxxxx", ) @pytest.mark.anyio async def test_terminal_configurations_post_4_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.terminal.Configuration.modify_async( "tmc_xxxxxxxxxxxxx", bbpos_wisepos_e={"splashscreen": "file_xxxxxxxxxxxxx"}, ) http_client_mock.assert_requested( "post", path="/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", query_string="", post_data="bbpos_wisepos_e[splashscreen]=file_xxxxxxxxxxxxx", ) @pytest.mark.anyio async def test_terminal_configurations_post_4_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.terminal.configurations.update_async( "tmc_xxxxxxxxxxxxx", {"bbpos_wisepos_e": {"splashscreen": "file_xxxxxxxxxxxxx"}}, ) http_client_mock.assert_requested( "post", path="/v1/terminal/configurations/tmc_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="bbpos_wisepos_e[splashscreen]=file_xxxxxxxxxxxxx", ) def test_terminal_connection_tokens_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.terminal.ConnectionToken.create() http_client_mock.assert_requested( "post", path="/v1/terminal/connection_tokens", query_string="", ) def test_terminal_connection_tokens_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/terminal/connection_tokens", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.terminal.connection_tokens.create() http_client_mock.assert_requested( "post", path="/v1/terminal/connection_tokens", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_terminal_connection_tokens_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.terminal.ConnectionToken.create_async() http_client_mock.assert_requested( "post", path="/v1/terminal/connection_tokens", query_string="", ) @pytest.mark.anyio async def test_terminal_connection_tokens_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/terminal/connection_tokens", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.terminal.connection_tokens.create_async() http_client_mock.assert_requested( "post", path="/v1/terminal/connection_tokens", query_string="", api_base="https://api.stripe.com", ) def test_terminal_locations_delete( self, http_client_mock: HTTPClientMock ) -> None: stripe.terminal.Location.delete("tml_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/terminal/locations/tml_xxxxxxxxxxxxx", query_string="", ) def test_terminal_locations_delete_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/terminal/locations/tml_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.terminal.locations.delete("tml_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/terminal/locations/tml_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_terminal_locations_delete_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.terminal.Location.delete_async("tml_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/terminal/locations/tml_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_terminal_locations_delete_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/terminal/locations/tml_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.terminal.locations.delete_async("tml_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/terminal/locations/tml_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_terminal_locations_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.terminal.Location.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/terminal/locations", query_string="limit=3", ) def test_terminal_locations_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/terminal/locations", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.terminal.locations.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/terminal/locations", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_terminal_locations_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.terminal.Location.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/terminal/locations", query_string="limit=3", ) @pytest.mark.anyio async def test_terminal_locations_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/terminal/locations", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.terminal.locations.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/terminal/locations", query_string="limit=3", api_base="https://api.stripe.com", ) def test_terminal_locations_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.terminal.Location.retrieve("tml_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/terminal/locations/tml_xxxxxxxxxxxxx", query_string="", ) def test_terminal_locations_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/terminal/locations/tml_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.terminal.locations.retrieve("tml_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/terminal/locations/tml_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_terminal_locations_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.terminal.Location.retrieve_async("tml_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/terminal/locations/tml_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_terminal_locations_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/terminal/locations/tml_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.terminal.locations.retrieve_async("tml_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/terminal/locations/tml_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_terminal_locations_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.terminal.Location.create( display_name="My First Store", address={ "line1": "1234 Main Street", "city": "San Francisco", "postal_code": "94111", "state": "CA", "country": "US", }, ) http_client_mock.assert_requested( "post", path="/v1/terminal/locations", query_string="", post_data="display_name=My%20First%20Store&address[line1]=1234%20Main%20Street&address[city]=San%20Francisco&address[postal_code]=94111&address[state]=CA&address[country]=US", ) def test_terminal_locations_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/terminal/locations", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.terminal.locations.create( { "display_name": "My First Store", "address": { "line1": "1234 Main Street", "city": "San Francisco", "postal_code": "94111", "state": "CA", "country": "US", }, } ) http_client_mock.assert_requested( "post", path="/v1/terminal/locations", query_string="", api_base="https://api.stripe.com", post_data="display_name=My%20First%20Store&address[line1]=1234%20Main%20Street&address[city]=San%20Francisco&address[postal_code]=94111&address[state]=CA&address[country]=US", ) @pytest.mark.anyio async def test_terminal_locations_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.terminal.Location.create_async( display_name="My First Store", address={ "line1": "1234 Main Street", "city": "San Francisco", "postal_code": "94111", "state": "CA", "country": "US", }, ) http_client_mock.assert_requested( "post", path="/v1/terminal/locations", query_string="", post_data="display_name=My%20First%20Store&address[line1]=1234%20Main%20Street&address[city]=San%20Francisco&address[postal_code]=94111&address[state]=CA&address[country]=US", ) @pytest.mark.anyio async def test_terminal_locations_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/terminal/locations", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.terminal.locations.create_async( { "display_name": "My First Store", "address": { "line1": "1234 Main Street", "city": "San Francisco", "postal_code": "94111", "state": "CA", "country": "US", }, } ) http_client_mock.assert_requested( "post", path="/v1/terminal/locations", query_string="", api_base="https://api.stripe.com", post_data="display_name=My%20First%20Store&address[line1]=1234%20Main%20Street&address[city]=San%20Francisco&address[postal_code]=94111&address[state]=CA&address[country]=US", ) def test_terminal_locations_post_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.terminal.Location.modify( "tml_xxxxxxxxxxxxx", display_name="My First Store", ) http_client_mock.assert_requested( "post", path="/v1/terminal/locations/tml_xxxxxxxxxxxxx", query_string="", post_data="display_name=My%20First%20Store", ) def test_terminal_locations_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/terminal/locations/tml_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.terminal.locations.update( "tml_xxxxxxxxxxxxx", {"display_name": "My First Store"}, ) http_client_mock.assert_requested( "post", path="/v1/terminal/locations/tml_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="display_name=My%20First%20Store", ) @pytest.mark.anyio async def test_terminal_locations_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.terminal.Location.modify_async( "tml_xxxxxxxxxxxxx", display_name="My First Store", ) http_client_mock.assert_requested( "post", path="/v1/terminal/locations/tml_xxxxxxxxxxxxx", query_string="", post_data="display_name=My%20First%20Store", ) @pytest.mark.anyio async def test_terminal_locations_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/terminal/locations/tml_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.terminal.locations.update_async( "tml_xxxxxxxxxxxxx", {"display_name": "My First Store"}, ) http_client_mock.assert_requested( "post", path="/v1/terminal/locations/tml_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="display_name=My%20First%20Store", ) def test_terminal_readers_cancel_action_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.terminal.Reader.cancel_action("tmr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/cancel_action", query_string="", ) def test_terminal_readers_cancel_action_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/terminal/readers/tmr_xxxxxxxxxxxxx/cancel_action", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.terminal.readers.cancel_action("tmr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/cancel_action", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_terminal_readers_cancel_action_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.terminal.Reader.cancel_action_async("tmr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/cancel_action", query_string="", ) @pytest.mark.anyio async def test_terminal_readers_cancel_action_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/terminal/readers/tmr_xxxxxxxxxxxxx/cancel_action", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.terminal.readers.cancel_action_async("tmr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/cancel_action", query_string="", api_base="https://api.stripe.com", ) def test_terminal_readers_delete( self, http_client_mock: HTTPClientMock ) -> None: stripe.terminal.Reader.delete("tmr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", query_string="", ) def test_terminal_readers_delete_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/terminal/readers/tmr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.terminal.readers.delete("tmr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_terminal_readers_delete_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.terminal.Reader.delete_async("tmr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_terminal_readers_delete_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/terminal/readers/tmr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.terminal.readers.delete_async("tmr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_terminal_readers_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.terminal.Reader.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/terminal/readers", query_string="limit=3", ) def test_terminal_readers_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/terminal/readers", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.terminal.readers.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/terminal/readers", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_terminal_readers_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.terminal.Reader.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/terminal/readers", query_string="limit=3", ) @pytest.mark.anyio async def test_terminal_readers_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/terminal/readers", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.terminal.readers.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/terminal/readers", query_string="limit=3", api_base="https://api.stripe.com", ) def test_terminal_readers_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.terminal.Reader.retrieve("tmr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", query_string="", ) def test_terminal_readers_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/terminal/readers/tmr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.terminal.readers.retrieve("tmr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_terminal_readers_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.terminal.Reader.retrieve_async("tmr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_terminal_readers_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/terminal/readers/tmr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.terminal.readers.retrieve_async("tmr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_terminal_readers_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.terminal.Reader.create( registration_code="puppies-plug-could", label="Blue Rabbit", location="tml_1234", ) http_client_mock.assert_requested( "post", path="/v1/terminal/readers", query_string="", post_data="registration_code=puppies-plug-could&label=Blue%20Rabbit&location=tml_1234", ) def test_terminal_readers_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/terminal/readers", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.terminal.readers.create( { "registration_code": "puppies-plug-could", "label": "Blue Rabbit", "location": "tml_1234", } ) http_client_mock.assert_requested( "post", path="/v1/terminal/readers", query_string="", api_base="https://api.stripe.com", post_data="registration_code=puppies-plug-could&label=Blue%20Rabbit&location=tml_1234", ) @pytest.mark.anyio async def test_terminal_readers_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.terminal.Reader.create_async( registration_code="puppies-plug-could", label="Blue Rabbit", location="tml_1234", ) http_client_mock.assert_requested( "post", path="/v1/terminal/readers", query_string="", post_data="registration_code=puppies-plug-could&label=Blue%20Rabbit&location=tml_1234", ) @pytest.mark.anyio async def test_terminal_readers_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/terminal/readers", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.terminal.readers.create_async( { "registration_code": "puppies-plug-could", "label": "Blue Rabbit", "location": "tml_1234", } ) http_client_mock.assert_requested( "post", path="/v1/terminal/readers", query_string="", api_base="https://api.stripe.com", post_data="registration_code=puppies-plug-could&label=Blue%20Rabbit&location=tml_1234", ) def test_terminal_readers_post_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.terminal.Reader.modify( "tmr_xxxxxxxxxxxxx", label="Blue Rabbit", ) http_client_mock.assert_requested( "post", path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", query_string="", post_data="label=Blue%20Rabbit", ) def test_terminal_readers_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/terminal/readers/tmr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.terminal.readers.update( "tmr_xxxxxxxxxxxxx", {"label": "Blue Rabbit"}, ) http_client_mock.assert_requested( "post", path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="label=Blue%20Rabbit", ) @pytest.mark.anyio async def test_terminal_readers_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.terminal.Reader.modify_async( "tmr_xxxxxxxxxxxxx", label="Blue Rabbit", ) http_client_mock.assert_requested( "post", path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", query_string="", post_data="label=Blue%20Rabbit", ) @pytest.mark.anyio async def test_terminal_readers_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/terminal/readers/tmr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.terminal.readers.update_async( "tmr_xxxxxxxxxxxxx", {"label": "Blue Rabbit"}, ) http_client_mock.assert_requested( "post", path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="label=Blue%20Rabbit", ) def test_terminal_readers_process_payment_intent_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.terminal.Reader.process_payment_intent( "tmr_xxxxxxxxxxxxx", payment_intent="pi_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_payment_intent", query_string="", post_data="payment_intent=pi_xxxxxxxxxxxxx", ) def test_terminal_readers_process_payment_intent_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_payment_intent", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.terminal.readers.process_payment_intent( "tmr_xxxxxxxxxxxxx", {"payment_intent": "pi_xxxxxxxxxxxxx"}, ) http_client_mock.assert_requested( "post", path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_payment_intent", query_string="", api_base="https://api.stripe.com", post_data="payment_intent=pi_xxxxxxxxxxxxx", ) @pytest.mark.anyio async def test_terminal_readers_process_payment_intent_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.terminal.Reader.process_payment_intent_async( "tmr_xxxxxxxxxxxxx", payment_intent="pi_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_payment_intent", query_string="", post_data="payment_intent=pi_xxxxxxxxxxxxx", ) @pytest.mark.anyio async def test_terminal_readers_process_payment_intent_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_payment_intent", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.terminal.readers.process_payment_intent_async( "tmr_xxxxxxxxxxxxx", {"payment_intent": "pi_xxxxxxxxxxxxx"}, ) http_client_mock.assert_requested( "post", path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_payment_intent", query_string="", api_base="https://api.stripe.com", post_data="payment_intent=pi_xxxxxxxxxxxxx", ) def test_terminal_readers_process_setup_intent_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.terminal.Reader.process_setup_intent( "tmr_xxxxxxxxxxxxx", setup_intent="seti_xxxxxxxxxxxxx", customer_consent_collected=True, ) http_client_mock.assert_requested( "post", path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_setup_intent", query_string="", post_data="setup_intent=seti_xxxxxxxxxxxxx&customer_consent_collected=True", ) def test_terminal_readers_process_setup_intent_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_setup_intent", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.terminal.readers.process_setup_intent( "tmr_xxxxxxxxxxxxx", { "setup_intent": "seti_xxxxxxxxxxxxx", "customer_consent_collected": True, }, ) http_client_mock.assert_requested( "post", path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_setup_intent", query_string="", api_base="https://api.stripe.com", post_data="setup_intent=seti_xxxxxxxxxxxxx&customer_consent_collected=True", ) @pytest.mark.anyio async def test_terminal_readers_process_setup_intent_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.terminal.Reader.process_setup_intent_async( "tmr_xxxxxxxxxxxxx", setup_intent="seti_xxxxxxxxxxxxx", customer_consent_collected=True, ) http_client_mock.assert_requested( "post", path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_setup_intent", query_string="", post_data="setup_intent=seti_xxxxxxxxxxxxx&customer_consent_collected=True", ) @pytest.mark.anyio async def test_terminal_readers_process_setup_intent_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_setup_intent", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.terminal.readers.process_setup_intent_async( "tmr_xxxxxxxxxxxxx", { "setup_intent": "seti_xxxxxxxxxxxxx", "customer_consent_collected": True, }, ) http_client_mock.assert_requested( "post", path="/v1/terminal/readers/tmr_xxxxxxxxxxxxx/process_setup_intent", query_string="", api_base="https://api.stripe.com", post_data="setup_intent=seti_xxxxxxxxxxxxx&customer_consent_collected=True", ) def test_test_helpers_customers_fund_cash_balance_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.Customer.TestHelpers.fund_cash_balance( "cus_123", amount=30, currency="eur", ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/customers/cus_123/fund_cash_balance", query_string="", post_data="amount=30¤cy=eur", ) def test_test_helpers_customers_fund_cash_balance_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/customers/cus_123/fund_cash_balance", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.test_helpers.customers.fund_cash_balance( "cus_123", {"amount": 30, "currency": "eur"}, ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/customers/cus_123/fund_cash_balance", query_string="", api_base="https://api.stripe.com", post_data="amount=30¤cy=eur", ) @pytest.mark.anyio async def test_test_helpers_customers_fund_cash_balance_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Customer.TestHelpers.fund_cash_balance_async( "cus_123", amount=30, currency="eur", ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/customers/cus_123/fund_cash_balance", query_string="", post_data="amount=30¤cy=eur", ) @pytest.mark.anyio async def test_test_helpers_customers_fund_cash_balance_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/customers/cus_123/fund_cash_balance", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.test_helpers.customers.fund_cash_balance_async( "cus_123", {"amount": 30, "currency": "eur"}, ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/customers/cus_123/fund_cash_balance", query_string="", api_base="https://api.stripe.com", post_data="amount=30¤cy=eur", ) def test_test_helpers_issuing_authorizations_capture_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.issuing.Authorization.TestHelpers.capture( "example_authorization", capture_amount=100, close_authorization=True, purchase_details={ "flight": { "departure_at": 1633651200, "passenger_name": "John Doe", "refundable": True, "segments": [ { "arrival_airport_code": "SFO", "carrier": "Delta", "departure_airport_code": "LAX", "flight_number": "DL100", "service_class": "Economy", "stopover_allowed": True, }, ], "travel_agency": "Orbitz", }, "fuel": { "type": "diesel", "unit": "liter", "unit_cost_decimal": "3.5", "quantity_decimal": "10", }, "lodging": {"check_in_at": 1633651200, "nights": 2}, "receipt": [ { "description": "Room charge", "quantity": "1", "total": 200, "unit_cost": 200, }, ], "reference": "foo", }, ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/authorizations/example_authorization/capture", query_string="", post_data="capture_amount=100&close_authorization=True&purchase_details[flight][departure_at]=1633651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][quantity_decimal]=10&purchase_details[lodging][check_in_at]=1633651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", ) def test_test_helpers_issuing_authorizations_capture_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/issuing/authorizations/example_authorization/capture", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.test_helpers.issuing.authorizations.capture( "example_authorization", { "capture_amount": 100, "close_authorization": True, "purchase_details": { "flight": { "departure_at": 1633651200, "passenger_name": "John Doe", "refundable": True, "segments": [ { "arrival_airport_code": "SFO", "carrier": "Delta", "departure_airport_code": "LAX", "flight_number": "DL100", "service_class": "Economy", "stopover_allowed": True, }, ], "travel_agency": "Orbitz", }, "fuel": { "type": "diesel", "unit": "liter", "unit_cost_decimal": "3.5", "quantity_decimal": "10", }, "lodging": {"check_in_at": 1633651200, "nights": 2}, "receipt": [ { "description": "Room charge", "quantity": "1", "total": 200, "unit_cost": 200, }, ], "reference": "foo", }, }, ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/authorizations/example_authorization/capture", query_string="", api_base="https://api.stripe.com", post_data="capture_amount=100&close_authorization=True&purchase_details[flight][departure_at]=1633651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][quantity_decimal]=10&purchase_details[lodging][check_in_at]=1633651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", ) @pytest.mark.anyio async def test_test_helpers_issuing_authorizations_capture_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.issuing.Authorization.TestHelpers.capture_async( "example_authorization", capture_amount=100, close_authorization=True, purchase_details={ "flight": { "departure_at": 1633651200, "passenger_name": "John Doe", "refundable": True, "segments": [ { "arrival_airport_code": "SFO", "carrier": "Delta", "departure_airport_code": "LAX", "flight_number": "DL100", "service_class": "Economy", "stopover_allowed": True, }, ], "travel_agency": "Orbitz", }, "fuel": { "type": "diesel", "unit": "liter", "unit_cost_decimal": "3.5", "quantity_decimal": "10", }, "lodging": {"check_in_at": 1633651200, "nights": 2}, "receipt": [ { "description": "Room charge", "quantity": "1", "total": 200, "unit_cost": 200, }, ], "reference": "foo", }, ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/authorizations/example_authorization/capture", query_string="", post_data="capture_amount=100&close_authorization=True&purchase_details[flight][departure_at]=1633651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][quantity_decimal]=10&purchase_details[lodging][check_in_at]=1633651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", ) @pytest.mark.anyio async def test_test_helpers_issuing_authorizations_capture_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/issuing/authorizations/example_authorization/capture", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.test_helpers.issuing.authorizations.capture_async( "example_authorization", { "capture_amount": 100, "close_authorization": True, "purchase_details": { "flight": { "departure_at": 1633651200, "passenger_name": "John Doe", "refundable": True, "segments": [ { "arrival_airport_code": "SFO", "carrier": "Delta", "departure_airport_code": "LAX", "flight_number": "DL100", "service_class": "Economy", "stopover_allowed": True, }, ], "travel_agency": "Orbitz", }, "fuel": { "type": "diesel", "unit": "liter", "unit_cost_decimal": "3.5", "quantity_decimal": "10", }, "lodging": {"check_in_at": 1633651200, "nights": 2}, "receipt": [ { "description": "Room charge", "quantity": "1", "total": 200, "unit_cost": 200, }, ], "reference": "foo", }, }, ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/authorizations/example_authorization/capture", query_string="", api_base="https://api.stripe.com", post_data="capture_amount=100&close_authorization=True&purchase_details[flight][departure_at]=1633651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][quantity_decimal]=10&purchase_details[lodging][check_in_at]=1633651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", ) def test_test_helpers_issuing_authorizations_expire_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.issuing.Authorization.TestHelpers.expire( "example_authorization" ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/authorizations/example_authorization/expire", query_string="", ) def test_test_helpers_issuing_authorizations_expire_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/issuing/authorizations/example_authorization/expire", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.test_helpers.issuing.authorizations.expire( "example_authorization", ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/authorizations/example_authorization/expire", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_test_helpers_issuing_authorizations_expire_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.issuing.Authorization.TestHelpers.expire_async( "example_authorization", ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/authorizations/example_authorization/expire", query_string="", ) @pytest.mark.anyio async def test_test_helpers_issuing_authorizations_expire_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/issuing/authorizations/example_authorization/expire", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.test_helpers.issuing.authorizations.expire_async( "example_authorization", ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/authorizations/example_authorization/expire", query_string="", api_base="https://api.stripe.com", ) def test_test_helpers_issuing_authorizations_increment_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.issuing.Authorization.TestHelpers.increment( "example_authorization", increment_amount=50, is_amount_controllable=True, ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/authorizations/example_authorization/increment", query_string="", post_data="increment_amount=50&is_amount_controllable=True", ) def test_test_helpers_issuing_authorizations_increment_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/issuing/authorizations/example_authorization/increment", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.test_helpers.issuing.authorizations.increment( "example_authorization", {"increment_amount": 50, "is_amount_controllable": True}, ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/authorizations/example_authorization/increment", query_string="", api_base="https://api.stripe.com", post_data="increment_amount=50&is_amount_controllable=True", ) @pytest.mark.anyio async def test_test_helpers_issuing_authorizations_increment_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.issuing.Authorization.TestHelpers.increment_async( "example_authorization", increment_amount=50, is_amount_controllable=True, ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/authorizations/example_authorization/increment", query_string="", post_data="increment_amount=50&is_amount_controllable=True", ) @pytest.mark.anyio async def test_test_helpers_issuing_authorizations_increment_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/issuing/authorizations/example_authorization/increment", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.test_helpers.issuing.authorizations.increment_async( "example_authorization", {"increment_amount": 50, "is_amount_controllable": True}, ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/authorizations/example_authorization/increment", query_string="", api_base="https://api.stripe.com", post_data="increment_amount=50&is_amount_controllable=True", ) def test_test_helpers_issuing_authorizations_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.issuing.Authorization.TestHelpers.create( amount=100, amount_details={"atm_fee": 10, "cashback_amount": 5}, authorization_method="chip", card="foo", currency="usd", is_amount_controllable=True, merchant_data={ "category": "ac_refrigeration_repair", "city": "foo", "country": "bar", "name": "foo", "network_id": "bar", "postal_code": "foo", "state": "bar", "terminal_id": "foo", }, network_data={"acquiring_institution_id": "foo"}, verification_data={ "address_line1_check": "mismatch", "address_postal_code_check": "match", "cvc_check": "match", "expiry_check": "mismatch", }, wallet="apple_pay", ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/authorizations", query_string="", post_data="amount=100&amount_details[atm_fee]=10&amount_details[cashback_amount]=5&authorization_method=chip&card=foo¤cy=usd&is_amount_controllable=True&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=bar&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=foo&merchant_data[state]=bar&merchant_data[terminal_id]=foo&network_data[acquiring_institution_id]=foo&verification_data[address_line1_check]=mismatch&verification_data[address_postal_code_check]=match&verification_data[cvc_check]=match&verification_data[expiry_check]=mismatch&wallet=apple_pay", ) def test_test_helpers_issuing_authorizations_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/issuing/authorizations", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.test_helpers.issuing.authorizations.create( { "amount": 100, "amount_details": {"atm_fee": 10, "cashback_amount": 5}, "authorization_method": "chip", "card": "foo", "currency": "usd", "is_amount_controllable": True, "merchant_data": { "category": "ac_refrigeration_repair", "city": "foo", "country": "bar", "name": "foo", "network_id": "bar", "postal_code": "foo", "state": "bar", "terminal_id": "foo", }, "network_data": {"acquiring_institution_id": "foo"}, "verification_data": { "address_line1_check": "mismatch", "address_postal_code_check": "match", "cvc_check": "match", "expiry_check": "mismatch", }, "wallet": "apple_pay", } ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/authorizations", query_string="", api_base="https://api.stripe.com", post_data="amount=100&amount_details[atm_fee]=10&amount_details[cashback_amount]=5&authorization_method=chip&card=foo¤cy=usd&is_amount_controllable=True&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=bar&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=foo&merchant_data[state]=bar&merchant_data[terminal_id]=foo&network_data[acquiring_institution_id]=foo&verification_data[address_line1_check]=mismatch&verification_data[address_postal_code_check]=match&verification_data[cvc_check]=match&verification_data[expiry_check]=mismatch&wallet=apple_pay", ) @pytest.mark.anyio async def test_test_helpers_issuing_authorizations_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.issuing.Authorization.TestHelpers.create_async( amount=100, amount_details={"atm_fee": 10, "cashback_amount": 5}, authorization_method="chip", card="foo", currency="usd", is_amount_controllable=True, merchant_data={ "category": "ac_refrigeration_repair", "city": "foo", "country": "bar", "name": "foo", "network_id": "bar", "postal_code": "foo", "state": "bar", "terminal_id": "foo", }, network_data={"acquiring_institution_id": "foo"}, verification_data={ "address_line1_check": "mismatch", "address_postal_code_check": "match", "cvc_check": "match", "expiry_check": "mismatch", }, wallet="apple_pay", ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/authorizations", query_string="", post_data="amount=100&amount_details[atm_fee]=10&amount_details[cashback_amount]=5&authorization_method=chip&card=foo¤cy=usd&is_amount_controllable=True&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=bar&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=foo&merchant_data[state]=bar&merchant_data[terminal_id]=foo&network_data[acquiring_institution_id]=foo&verification_data[address_line1_check]=mismatch&verification_data[address_postal_code_check]=match&verification_data[cvc_check]=match&verification_data[expiry_check]=mismatch&wallet=apple_pay", ) @pytest.mark.anyio async def test_test_helpers_issuing_authorizations_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/issuing/authorizations", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.test_helpers.issuing.authorizations.create_async( { "amount": 100, "amount_details": {"atm_fee": 10, "cashback_amount": 5}, "authorization_method": "chip", "card": "foo", "currency": "usd", "is_amount_controllable": True, "merchant_data": { "category": "ac_refrigeration_repair", "city": "foo", "country": "bar", "name": "foo", "network_id": "bar", "postal_code": "foo", "state": "bar", "terminal_id": "foo", }, "network_data": {"acquiring_institution_id": "foo"}, "verification_data": { "address_line1_check": "mismatch", "address_postal_code_check": "match", "cvc_check": "match", "expiry_check": "mismatch", }, "wallet": "apple_pay", } ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/authorizations", query_string="", api_base="https://api.stripe.com", post_data="amount=100&amount_details[atm_fee]=10&amount_details[cashback_amount]=5&authorization_method=chip&card=foo¤cy=usd&is_amount_controllable=True&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=bar&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=foo&merchant_data[state]=bar&merchant_data[terminal_id]=foo&network_data[acquiring_institution_id]=foo&verification_data[address_line1_check]=mismatch&verification_data[address_postal_code_check]=match&verification_data[cvc_check]=match&verification_data[expiry_check]=mismatch&wallet=apple_pay", ) def test_test_helpers_issuing_authorizations_reverse_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.issuing.Authorization.TestHelpers.reverse( "example_authorization", reverse_amount=20, ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/authorizations/example_authorization/reverse", query_string="", post_data="reverse_amount=20", ) def test_test_helpers_issuing_authorizations_reverse_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/issuing/authorizations/example_authorization/reverse", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.test_helpers.issuing.authorizations.reverse( "example_authorization", {"reverse_amount": 20}, ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/authorizations/example_authorization/reverse", query_string="", api_base="https://api.stripe.com", post_data="reverse_amount=20", ) @pytest.mark.anyio async def test_test_helpers_issuing_authorizations_reverse_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.issuing.Authorization.TestHelpers.reverse_async( "example_authorization", reverse_amount=20, ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/authorizations/example_authorization/reverse", query_string="", post_data="reverse_amount=20", ) @pytest.mark.anyio async def test_test_helpers_issuing_authorizations_reverse_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/issuing/authorizations/example_authorization/reverse", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.test_helpers.issuing.authorizations.reverse_async( "example_authorization", {"reverse_amount": 20}, ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/authorizations/example_authorization/reverse", query_string="", api_base="https://api.stripe.com", post_data="reverse_amount=20", ) def test_test_helpers_issuing_cards_shipping_deliver_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.issuing.Card.TestHelpers.deliver_card("card_123") http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/cards/card_123/shipping/deliver", query_string="", ) def test_test_helpers_issuing_cards_shipping_deliver_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/issuing/cards/card_123/shipping/deliver", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.test_helpers.issuing.cards.deliver_card("card_123") http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/cards/card_123/shipping/deliver", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_test_helpers_issuing_cards_shipping_deliver_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.issuing.Card.TestHelpers.deliver_card_async("card_123") http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/cards/card_123/shipping/deliver", query_string="", ) @pytest.mark.anyio async def test_test_helpers_issuing_cards_shipping_deliver_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/issuing/cards/card_123/shipping/deliver", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.test_helpers.issuing.cards.deliver_card_async("card_123") http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/cards/card_123/shipping/deliver", query_string="", api_base="https://api.stripe.com", ) def test_test_helpers_issuing_cards_shipping_fail_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.issuing.Card.TestHelpers.fail_card("card_123") http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/cards/card_123/shipping/fail", query_string="", ) def test_test_helpers_issuing_cards_shipping_fail_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/issuing/cards/card_123/shipping/fail", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.test_helpers.issuing.cards.fail_card("card_123") http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/cards/card_123/shipping/fail", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_test_helpers_issuing_cards_shipping_fail_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.issuing.Card.TestHelpers.fail_card_async("card_123") http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/cards/card_123/shipping/fail", query_string="", ) @pytest.mark.anyio async def test_test_helpers_issuing_cards_shipping_fail_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/issuing/cards/card_123/shipping/fail", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.test_helpers.issuing.cards.fail_card_async("card_123") http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/cards/card_123/shipping/fail", query_string="", api_base="https://api.stripe.com", ) def test_test_helpers_issuing_cards_shipping_return_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.issuing.Card.TestHelpers.return_card("card_123") http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/cards/card_123/shipping/return", query_string="", ) def test_test_helpers_issuing_cards_shipping_return_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/issuing/cards/card_123/shipping/return", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.test_helpers.issuing.cards.return_card("card_123") http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/cards/card_123/shipping/return", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_test_helpers_issuing_cards_shipping_return_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.issuing.Card.TestHelpers.return_card_async("card_123") http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/cards/card_123/shipping/return", query_string="", ) @pytest.mark.anyio async def test_test_helpers_issuing_cards_shipping_return_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/issuing/cards/card_123/shipping/return", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.test_helpers.issuing.cards.return_card_async("card_123") http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/cards/card_123/shipping/return", query_string="", api_base="https://api.stripe.com", ) def test_test_helpers_issuing_cards_shipping_ship_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.issuing.Card.TestHelpers.ship_card("card_123") http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/cards/card_123/shipping/ship", query_string="", ) def test_test_helpers_issuing_cards_shipping_ship_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/issuing/cards/card_123/shipping/ship", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.test_helpers.issuing.cards.ship_card("card_123") http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/cards/card_123/shipping/ship", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_test_helpers_issuing_cards_shipping_ship_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.issuing.Card.TestHelpers.ship_card_async("card_123") http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/cards/card_123/shipping/ship", query_string="", ) @pytest.mark.anyio async def test_test_helpers_issuing_cards_shipping_ship_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/issuing/cards/card_123/shipping/ship", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.test_helpers.issuing.cards.ship_card_async("card_123") http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/cards/card_123/shipping/ship", query_string="", api_base="https://api.stripe.com", ) def test_test_helpers_issuing_personalization_designs_activate_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.issuing.PersonalizationDesign.TestHelpers.activate("pd_xyz") http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/personalization_designs/pd_xyz/activate", query_string="", ) def test_test_helpers_issuing_personalization_designs_activate_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/issuing/personalization_designs/pd_xyz/activate", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.test_helpers.issuing.personalization_designs.activate("pd_xyz") http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/personalization_designs/pd_xyz/activate", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_test_helpers_issuing_personalization_designs_activate_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.issuing.PersonalizationDesign.TestHelpers.activate_async( "pd_xyz", ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/personalization_designs/pd_xyz/activate", query_string="", ) @pytest.mark.anyio async def test_test_helpers_issuing_personalization_designs_activate_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/issuing/personalization_designs/pd_xyz/activate", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await ( client.test_helpers.issuing.personalization_designs.activate_async( "pd_xyz" ) ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/personalization_designs/pd_xyz/activate", query_string="", api_base="https://api.stripe.com", ) def test_test_helpers_issuing_personalization_designs_deactivate_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.issuing.PersonalizationDesign.TestHelpers.deactivate("pd_xyz") http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/personalization_designs/pd_xyz/deactivate", query_string="", ) def test_test_helpers_issuing_personalization_designs_deactivate_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/issuing/personalization_designs/pd_xyz/deactivate", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.test_helpers.issuing.personalization_designs.deactivate( "pd_xyz" ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/personalization_designs/pd_xyz/deactivate", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_test_helpers_issuing_personalization_designs_deactivate_post_async( self, http_client_mock: HTTPClientMock ) -> None: await ( stripe.issuing.PersonalizationDesign.TestHelpers.deactivate_async( "pd_xyz", ) ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/personalization_designs/pd_xyz/deactivate", query_string="", ) @pytest.mark.anyio async def test_test_helpers_issuing_personalization_designs_deactivate_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/issuing/personalization_designs/pd_xyz/deactivate", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.test_helpers.issuing.personalization_designs.deactivate_async( "pd_xyz" ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/personalization_designs/pd_xyz/deactivate", query_string="", api_base="https://api.stripe.com", ) def test_test_helpers_issuing_personalization_designs_reject_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.issuing.PersonalizationDesign.TestHelpers.reject( "pd_xyz", rejection_reasons={"card_logo": ["geographic_location"]}, ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/personalization_designs/pd_xyz/reject", query_string="", post_data="rejection_reasons[card_logo][0]=geographic_location", ) def test_test_helpers_issuing_personalization_designs_reject_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/issuing/personalization_designs/pd_xyz/reject", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.test_helpers.issuing.personalization_designs.reject( "pd_xyz", {"rejection_reasons": {"card_logo": ["geographic_location"]}}, ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/personalization_designs/pd_xyz/reject", query_string="", api_base="https://api.stripe.com", post_data="rejection_reasons[card_logo][0]=geographic_location", ) @pytest.mark.anyio async def test_test_helpers_issuing_personalization_designs_reject_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.issuing.PersonalizationDesign.TestHelpers.reject_async( "pd_xyz", rejection_reasons={"card_logo": ["geographic_location"]}, ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/personalization_designs/pd_xyz/reject", query_string="", post_data="rejection_reasons[card_logo][0]=geographic_location", ) @pytest.mark.anyio async def test_test_helpers_issuing_personalization_designs_reject_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/issuing/personalization_designs/pd_xyz/reject", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.test_helpers.issuing.personalization_designs.reject_async( "pd_xyz", {"rejection_reasons": {"card_logo": ["geographic_location"]}}, ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/personalization_designs/pd_xyz/reject", query_string="", api_base="https://api.stripe.com", post_data="rejection_reasons[card_logo][0]=geographic_location", ) def test_test_helpers_issuing_transactions_create_force_capture_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.issuing.Transaction.TestHelpers.create_force_capture( amount=100, card="foo", currency="usd", merchant_data={ "category": "ac_refrigeration_repair", "city": "foo", "country": "US", "name": "foo", "network_id": "bar", "postal_code": "10001", "state": "NY", "terminal_id": "foo", }, purchase_details={ "flight": { "departure_at": 1633651200, "passenger_name": "John Doe", "refundable": True, "segments": [ { "arrival_airport_code": "SFO", "carrier": "Delta", "departure_airport_code": "LAX", "flight_number": "DL100", "service_class": "Economy", "stopover_allowed": True, }, ], "travel_agency": "Orbitz", }, "fuel": { "type": "diesel", "unit": "liter", "unit_cost_decimal": "3.5", "quantity_decimal": "10", }, "lodging": {"check_in_at": 1533651200, "nights": 2}, "receipt": [ { "description": "Room charge", "quantity": "1", "total": 200, "unit_cost": 200, }, ], "reference": "foo", }, ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/transactions/create_force_capture", query_string="", post_data="amount=100&card=foo¤cy=usd&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=US&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=10001&merchant_data[state]=NY&merchant_data[terminal_id]=foo&purchase_details[flight][departure_at]=1633651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][quantity_decimal]=10&purchase_details[lodging][check_in_at]=1533651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", ) def test_test_helpers_issuing_transactions_create_force_capture_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/issuing/transactions/create_force_capture", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.test_helpers.issuing.transactions.create_force_capture( { "amount": 100, "card": "foo", "currency": "usd", "merchant_data": { "category": "ac_refrigeration_repair", "city": "foo", "country": "US", "name": "foo", "network_id": "bar", "postal_code": "10001", "state": "NY", "terminal_id": "foo", }, "purchase_details": { "flight": { "departure_at": 1633651200, "passenger_name": "John Doe", "refundable": True, "segments": [ { "arrival_airport_code": "SFO", "carrier": "Delta", "departure_airport_code": "LAX", "flight_number": "DL100", "service_class": "Economy", "stopover_allowed": True, }, ], "travel_agency": "Orbitz", }, "fuel": { "type": "diesel", "unit": "liter", "unit_cost_decimal": "3.5", "quantity_decimal": "10", }, "lodging": {"check_in_at": 1533651200, "nights": 2}, "receipt": [ { "description": "Room charge", "quantity": "1", "total": 200, "unit_cost": 200, }, ], "reference": "foo", }, } ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/transactions/create_force_capture", query_string="", api_base="https://api.stripe.com", post_data="amount=100&card=foo¤cy=usd&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=US&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=10001&merchant_data[state]=NY&merchant_data[terminal_id]=foo&purchase_details[flight][departure_at]=1633651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][quantity_decimal]=10&purchase_details[lodging][check_in_at]=1533651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", ) @pytest.mark.anyio async def test_test_helpers_issuing_transactions_create_force_capture_post_async( self, http_client_mock: HTTPClientMock ) -> None: await ( stripe.issuing.Transaction.TestHelpers.create_force_capture_async( amount=100, card="foo", currency="usd", merchant_data={ "category": "ac_refrigeration_repair", "city": "foo", "country": "US", "name": "foo", "network_id": "bar", "postal_code": "10001", "state": "NY", "terminal_id": "foo", }, purchase_details={ "flight": { "departure_at": 1633651200, "passenger_name": "John Doe", "refundable": True, "segments": [ { "arrival_airport_code": "SFO", "carrier": "Delta", "departure_airport_code": "LAX", "flight_number": "DL100", "service_class": "Economy", "stopover_allowed": True, }, ], "travel_agency": "Orbitz", }, "fuel": { "type": "diesel", "unit": "liter", "unit_cost_decimal": "3.5", "quantity_decimal": "10", }, "lodging": {"check_in_at": 1533651200, "nights": 2}, "receipt": [ { "description": "Room charge", "quantity": "1", "total": 200, "unit_cost": 200, }, ], "reference": "foo", }, ) ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/transactions/create_force_capture", query_string="", post_data="amount=100&card=foo¤cy=usd&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=US&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=10001&merchant_data[state]=NY&merchant_data[terminal_id]=foo&purchase_details[flight][departure_at]=1633651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][quantity_decimal]=10&purchase_details[lodging][check_in_at]=1533651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", ) @pytest.mark.anyio async def test_test_helpers_issuing_transactions_create_force_capture_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/issuing/transactions/create_force_capture", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.test_helpers.issuing.transactions.create_force_capture_async( { "amount": 100, "card": "foo", "currency": "usd", "merchant_data": { "category": "ac_refrigeration_repair", "city": "foo", "country": "US", "name": "foo", "network_id": "bar", "postal_code": "10001", "state": "NY", "terminal_id": "foo", }, "purchase_details": { "flight": { "departure_at": 1633651200, "passenger_name": "John Doe", "refundable": True, "segments": [ { "arrival_airport_code": "SFO", "carrier": "Delta", "departure_airport_code": "LAX", "flight_number": "DL100", "service_class": "Economy", "stopover_allowed": True, }, ], "travel_agency": "Orbitz", }, "fuel": { "type": "diesel", "unit": "liter", "unit_cost_decimal": "3.5", "quantity_decimal": "10", }, "lodging": {"check_in_at": 1533651200, "nights": 2}, "receipt": [ { "description": "Room charge", "quantity": "1", "total": 200, "unit_cost": 200, }, ], "reference": "foo", }, } ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/transactions/create_force_capture", query_string="", api_base="https://api.stripe.com", post_data="amount=100&card=foo¤cy=usd&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=US&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=10001&merchant_data[state]=NY&merchant_data[terminal_id]=foo&purchase_details[flight][departure_at]=1633651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][quantity_decimal]=10&purchase_details[lodging][check_in_at]=1533651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", ) def test_test_helpers_issuing_transactions_create_unlinked_refund_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.issuing.Transaction.TestHelpers.create_unlinked_refund( amount=100, card="foo", currency="usd", merchant_data={ "category": "ac_refrigeration_repair", "city": "foo", "country": "bar", "name": "foo", "network_id": "bar", "postal_code": "foo", "state": "bar", "terminal_id": "foo", }, purchase_details={ "flight": { "departure_at": 1533651200, "passenger_name": "John Doe", "refundable": True, "segments": [ { "arrival_airport_code": "SFO", "carrier": "Delta", "departure_airport_code": "LAX", "flight_number": "DL100", "service_class": "Economy", "stopover_allowed": True, }, ], "travel_agency": "Orbitz", }, "fuel": { "type": "diesel", "unit": "liter", "unit_cost_decimal": "3.5", "quantity_decimal": "10", }, "lodging": {"check_in_at": 1533651200, "nights": 2}, "receipt": [ { "description": "Room charge", "quantity": "1", "total": 200, "unit_cost": 200, }, ], "reference": "foo", }, ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/transactions/create_unlinked_refund", query_string="", post_data="amount=100&card=foo¤cy=usd&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=bar&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=foo&merchant_data[state]=bar&merchant_data[terminal_id]=foo&purchase_details[flight][departure_at]=1533651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][quantity_decimal]=10&purchase_details[lodging][check_in_at]=1533651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", ) def test_test_helpers_issuing_transactions_create_unlinked_refund_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/issuing/transactions/create_unlinked_refund", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.test_helpers.issuing.transactions.create_unlinked_refund( { "amount": 100, "card": "foo", "currency": "usd", "merchant_data": { "category": "ac_refrigeration_repair", "city": "foo", "country": "bar", "name": "foo", "network_id": "bar", "postal_code": "foo", "state": "bar", "terminal_id": "foo", }, "purchase_details": { "flight": { "departure_at": 1533651200, "passenger_name": "John Doe", "refundable": True, "segments": [ { "arrival_airport_code": "SFO", "carrier": "Delta", "departure_airport_code": "LAX", "flight_number": "DL100", "service_class": "Economy", "stopover_allowed": True, }, ], "travel_agency": "Orbitz", }, "fuel": { "type": "diesel", "unit": "liter", "unit_cost_decimal": "3.5", "quantity_decimal": "10", }, "lodging": {"check_in_at": 1533651200, "nights": 2}, "receipt": [ { "description": "Room charge", "quantity": "1", "total": 200, "unit_cost": 200, }, ], "reference": "foo", }, } ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/transactions/create_unlinked_refund", query_string="", api_base="https://api.stripe.com", post_data="amount=100&card=foo¤cy=usd&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=bar&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=foo&merchant_data[state]=bar&merchant_data[terminal_id]=foo&purchase_details[flight][departure_at]=1533651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][quantity_decimal]=10&purchase_details[lodging][check_in_at]=1533651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", ) @pytest.mark.anyio async def test_test_helpers_issuing_transactions_create_unlinked_refund_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.issuing.Transaction.TestHelpers.create_unlinked_refund_async( amount=100, card="foo", currency="usd", merchant_data={ "category": "ac_refrigeration_repair", "city": "foo", "country": "bar", "name": "foo", "network_id": "bar", "postal_code": "foo", "state": "bar", "terminal_id": "foo", }, purchase_details={ "flight": { "departure_at": 1533651200, "passenger_name": "John Doe", "refundable": True, "segments": [ { "arrival_airport_code": "SFO", "carrier": "Delta", "departure_airport_code": "LAX", "flight_number": "DL100", "service_class": "Economy", "stopover_allowed": True, }, ], "travel_agency": "Orbitz", }, "fuel": { "type": "diesel", "unit": "liter", "unit_cost_decimal": "3.5", "quantity_decimal": "10", }, "lodging": {"check_in_at": 1533651200, "nights": 2}, "receipt": [ { "description": "Room charge", "quantity": "1", "total": 200, "unit_cost": 200, }, ], "reference": "foo", }, ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/transactions/create_unlinked_refund", query_string="", post_data="amount=100&card=foo¤cy=usd&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=bar&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=foo&merchant_data[state]=bar&merchant_data[terminal_id]=foo&purchase_details[flight][departure_at]=1533651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][quantity_decimal]=10&purchase_details[lodging][check_in_at]=1533651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", ) @pytest.mark.anyio async def test_test_helpers_issuing_transactions_create_unlinked_refund_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/issuing/transactions/create_unlinked_refund", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.test_helpers.issuing.transactions.create_unlinked_refund_async( { "amount": 100, "card": "foo", "currency": "usd", "merchant_data": { "category": "ac_refrigeration_repair", "city": "foo", "country": "bar", "name": "foo", "network_id": "bar", "postal_code": "foo", "state": "bar", "terminal_id": "foo", }, "purchase_details": { "flight": { "departure_at": 1533651200, "passenger_name": "John Doe", "refundable": True, "segments": [ { "arrival_airport_code": "SFO", "carrier": "Delta", "departure_airport_code": "LAX", "flight_number": "DL100", "service_class": "Economy", "stopover_allowed": True, }, ], "travel_agency": "Orbitz", }, "fuel": { "type": "diesel", "unit": "liter", "unit_cost_decimal": "3.5", "quantity_decimal": "10", }, "lodging": {"check_in_at": 1533651200, "nights": 2}, "receipt": [ { "description": "Room charge", "quantity": "1", "total": 200, "unit_cost": 200, }, ], "reference": "foo", }, } ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/transactions/create_unlinked_refund", query_string="", api_base="https://api.stripe.com", post_data="amount=100&card=foo¤cy=usd&merchant_data[category]=ac_refrigeration_repair&merchant_data[city]=foo&merchant_data[country]=bar&merchant_data[name]=foo&merchant_data[network_id]=bar&merchant_data[postal_code]=foo&merchant_data[state]=bar&merchant_data[terminal_id]=foo&purchase_details[flight][departure_at]=1533651200&purchase_details[flight][passenger_name]=John%20Doe&purchase_details[flight][refundable]=True&purchase_details[flight][segments][0][arrival_airport_code]=SFO&purchase_details[flight][segments][0][carrier]=Delta&purchase_details[flight][segments][0][departure_airport_code]=LAX&purchase_details[flight][segments][0][flight_number]=DL100&purchase_details[flight][segments][0][service_class]=Economy&purchase_details[flight][segments][0][stopover_allowed]=True&purchase_details[flight][travel_agency]=Orbitz&purchase_details[fuel][type]=diesel&purchase_details[fuel][unit]=liter&purchase_details[fuel][unit_cost_decimal]=3.5&purchase_details[fuel][quantity_decimal]=10&purchase_details[lodging][check_in_at]=1533651200&purchase_details[lodging][nights]=2&purchase_details[receipt][0][description]=Room%20charge&purchase_details[receipt][0][quantity]=1&purchase_details[receipt][0][total]=200&purchase_details[receipt][0][unit_cost]=200&purchase_details[reference]=foo", ) def test_test_helpers_issuing_transactions_refund_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.issuing.Transaction.TestHelpers.refund( "example_transaction", refund_amount=50, ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/transactions/example_transaction/refund", query_string="", post_data="refund_amount=50", ) def test_test_helpers_issuing_transactions_refund_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/issuing/transactions/example_transaction/refund", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.test_helpers.issuing.transactions.refund( "example_transaction", {"refund_amount": 50}, ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/transactions/example_transaction/refund", query_string="", api_base="https://api.stripe.com", post_data="refund_amount=50", ) @pytest.mark.anyio async def test_test_helpers_issuing_transactions_refund_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.issuing.Transaction.TestHelpers.refund_async( "example_transaction", refund_amount=50, ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/transactions/example_transaction/refund", query_string="", post_data="refund_amount=50", ) @pytest.mark.anyio async def test_test_helpers_issuing_transactions_refund_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/issuing/transactions/example_transaction/refund", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.test_helpers.issuing.transactions.refund_async( "example_transaction", {"refund_amount": 50}, ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/issuing/transactions/example_transaction/refund", query_string="", api_base="https://api.stripe.com", post_data="refund_amount=50", ) def test_test_helpers_refunds_expire_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.Refund.TestHelpers.expire("re_123") http_client_mock.assert_requested( "post", path="/v1/test_helpers/refunds/re_123/expire", query_string="", ) def test_test_helpers_refunds_expire_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/refunds/re_123/expire", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.test_helpers.refunds.expire("re_123") http_client_mock.assert_requested( "post", path="/v1/test_helpers/refunds/re_123/expire", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_test_helpers_refunds_expire_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Refund.TestHelpers.expire_async("re_123") http_client_mock.assert_requested( "post", path="/v1/test_helpers/refunds/re_123/expire", query_string="", ) @pytest.mark.anyio async def test_test_helpers_refunds_expire_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/refunds/re_123/expire", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.test_helpers.refunds.expire_async("re_123") http_client_mock.assert_requested( "post", path="/v1/test_helpers/refunds/re_123/expire", query_string="", api_base="https://api.stripe.com", ) def test_test_helpers_test_clocks_advance_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.test_helpers.TestClock.advance( "clock_xyz", frozen_time=142, ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/test_clocks/clock_xyz/advance", query_string="", post_data="frozen_time=142", ) def test_test_helpers_test_clocks_advance_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/test_clocks/clock_xyz/advance", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.test_helpers.test_clocks.advance( "clock_xyz", {"frozen_time": 142}, ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/test_clocks/clock_xyz/advance", query_string="", api_base="https://api.stripe.com", post_data="frozen_time=142", ) @pytest.mark.anyio async def test_test_helpers_test_clocks_advance_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.test_helpers.TestClock.advance_async( "clock_xyz", frozen_time=142, ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/test_clocks/clock_xyz/advance", query_string="", post_data="frozen_time=142", ) @pytest.mark.anyio async def test_test_helpers_test_clocks_advance_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/test_clocks/clock_xyz/advance", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.test_helpers.test_clocks.advance_async( "clock_xyz", {"frozen_time": 142}, ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/test_clocks/clock_xyz/advance", query_string="", api_base="https://api.stripe.com", post_data="frozen_time=142", ) def test_test_helpers_test_clocks_advance_post_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.test_helpers.TestClock.advance( "clock_xxxxxxxxxxxxx", frozen_time=1675552261, ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx/advance", query_string="", post_data="frozen_time=1675552261", ) def test_test_helpers_test_clocks_advance_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx/advance", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.test_helpers.test_clocks.advance( "clock_xxxxxxxxxxxxx", {"frozen_time": 1675552261}, ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx/advance", query_string="", api_base="https://api.stripe.com", post_data="frozen_time=1675552261", ) @pytest.mark.anyio async def test_test_helpers_test_clocks_advance_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.test_helpers.TestClock.advance_async( "clock_xxxxxxxxxxxxx", frozen_time=1675552261, ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx/advance", query_string="", post_data="frozen_time=1675552261", ) @pytest.mark.anyio async def test_test_helpers_test_clocks_advance_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx/advance", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.test_helpers.test_clocks.advance_async( "clock_xxxxxxxxxxxxx", {"frozen_time": 1675552261}, ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx/advance", query_string="", api_base="https://api.stripe.com", post_data="frozen_time=1675552261", ) def test_test_helpers_test_clocks_delete( self, http_client_mock: HTTPClientMock ) -> None: stripe.test_helpers.TestClock.delete("clock_xyz") http_client_mock.assert_requested( "delete", path="/v1/test_helpers/test_clocks/clock_xyz", query_string="", ) def test_test_helpers_test_clocks_delete_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/test_helpers/test_clocks/clock_xyz", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.test_helpers.test_clocks.delete("clock_xyz") http_client_mock.assert_requested( "delete", path="/v1/test_helpers/test_clocks/clock_xyz", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_test_helpers_test_clocks_delete_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.test_helpers.TestClock.delete_async("clock_xyz") http_client_mock.assert_requested( "delete", path="/v1/test_helpers/test_clocks/clock_xyz", query_string="", ) @pytest.mark.anyio async def test_test_helpers_test_clocks_delete_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/test_helpers/test_clocks/clock_xyz", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.test_helpers.test_clocks.delete_async("clock_xyz") http_client_mock.assert_requested( "delete", path="/v1/test_helpers/test_clocks/clock_xyz", query_string="", api_base="https://api.stripe.com", ) def test_test_helpers_test_clocks_delete_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.test_helpers.TestClock.delete("clock_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx", query_string="", ) def test_test_helpers_test_clocks_delete_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.test_helpers.test_clocks.delete("clock_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_test_helpers_test_clocks_delete_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.test_helpers.TestClock.delete_async("clock_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_test_helpers_test_clocks_delete_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.test_helpers.test_clocks.delete_async( "clock_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "delete", path="/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_test_helpers_test_clocks_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.test_helpers.TestClock.list() http_client_mock.assert_requested( "get", path="/v1/test_helpers/test_clocks", query_string="", ) def test_test_helpers_test_clocks_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/test_helpers/test_clocks", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.test_helpers.test_clocks.list() http_client_mock.assert_requested( "get", path="/v1/test_helpers/test_clocks", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_test_helpers_test_clocks_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.test_helpers.TestClock.list_async() http_client_mock.assert_requested( "get", path="/v1/test_helpers/test_clocks", query_string="", ) @pytest.mark.anyio async def test_test_helpers_test_clocks_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/test_helpers/test_clocks", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.test_helpers.test_clocks.list_async() http_client_mock.assert_requested( "get", path="/v1/test_helpers/test_clocks", query_string="", api_base="https://api.stripe.com", ) def test_test_helpers_test_clocks_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.test_helpers.TestClock.retrieve("clock_xyz") http_client_mock.assert_requested( "get", path="/v1/test_helpers/test_clocks/clock_xyz", query_string="", ) def test_test_helpers_test_clocks_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/test_helpers/test_clocks/clock_xyz", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.test_helpers.test_clocks.retrieve("clock_xyz") http_client_mock.assert_requested( "get", path="/v1/test_helpers/test_clocks/clock_xyz", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_test_helpers_test_clocks_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.test_helpers.TestClock.retrieve_async("clock_xyz") http_client_mock.assert_requested( "get", path="/v1/test_helpers/test_clocks/clock_xyz", query_string="", ) @pytest.mark.anyio async def test_test_helpers_test_clocks_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/test_helpers/test_clocks/clock_xyz", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.test_helpers.test_clocks.retrieve_async("clock_xyz") http_client_mock.assert_requested( "get", path="/v1/test_helpers/test_clocks/clock_xyz", query_string="", api_base="https://api.stripe.com", ) def test_test_helpers_test_clocks_get_3( self, http_client_mock: HTTPClientMock ) -> None: stripe.test_helpers.TestClock.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/test_helpers/test_clocks", query_string="limit=3", ) def test_test_helpers_test_clocks_get_3_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/test_helpers/test_clocks", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.test_helpers.test_clocks.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/test_helpers/test_clocks", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_test_helpers_test_clocks_get_3_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.test_helpers.TestClock.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/test_helpers/test_clocks", query_string="limit=3", ) @pytest.mark.anyio async def test_test_helpers_test_clocks_get_3_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/test_helpers/test_clocks", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.test_helpers.test_clocks.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/test_helpers/test_clocks", query_string="limit=3", api_base="https://api.stripe.com", ) def test_test_helpers_test_clocks_get_4( self, http_client_mock: HTTPClientMock ) -> None: stripe.test_helpers.TestClock.retrieve("clock_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx", query_string="", ) def test_test_helpers_test_clocks_get_4_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.test_helpers.test_clocks.retrieve("clock_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_test_helpers_test_clocks_get_4_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.test_helpers.TestClock.retrieve_async( "clock_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_test_helpers_test_clocks_get_4_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.test_helpers.test_clocks.retrieve_async( "clock_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/test_helpers/test_clocks/clock_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_test_helpers_test_clocks_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.test_helpers.TestClock.create( frozen_time=123, name="cogsworth", ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/test_clocks", query_string="", post_data="frozen_time=123&name=cogsworth", ) def test_test_helpers_test_clocks_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/test_clocks", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.test_helpers.test_clocks.create( { "frozen_time": 123, "name": "cogsworth", } ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/test_clocks", query_string="", api_base="https://api.stripe.com", post_data="frozen_time=123&name=cogsworth", ) @pytest.mark.anyio async def test_test_helpers_test_clocks_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.test_helpers.TestClock.create_async( frozen_time=123, name="cogsworth", ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/test_clocks", query_string="", post_data="frozen_time=123&name=cogsworth", ) @pytest.mark.anyio async def test_test_helpers_test_clocks_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/test_clocks", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.test_helpers.test_clocks.create_async( { "frozen_time": 123, "name": "cogsworth", } ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/test_clocks", query_string="", api_base="https://api.stripe.com", post_data="frozen_time=123&name=cogsworth", ) def test_test_helpers_test_clocks_post_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.test_helpers.TestClock.create(frozen_time=1577836800) http_client_mock.assert_requested( "post", path="/v1/test_helpers/test_clocks", query_string="", post_data="frozen_time=1577836800", ) def test_test_helpers_test_clocks_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/test_clocks", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.test_helpers.test_clocks.create({"frozen_time": 1577836800}) http_client_mock.assert_requested( "post", path="/v1/test_helpers/test_clocks", query_string="", api_base="https://api.stripe.com", post_data="frozen_time=1577836800", ) @pytest.mark.anyio async def test_test_helpers_test_clocks_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.test_helpers.TestClock.create_async( frozen_time=1577836800 ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/test_clocks", query_string="", post_data="frozen_time=1577836800", ) @pytest.mark.anyio async def test_test_helpers_test_clocks_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/test_clocks", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.test_helpers.test_clocks.create_async( { "frozen_time": 1577836800, } ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/test_clocks", query_string="", api_base="https://api.stripe.com", post_data="frozen_time=1577836800", ) def test_test_helpers_treasury_inbound_transfers_fail_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.treasury.InboundTransfer.TestHelpers.fail( "ibt_123", failure_details={"code": "account_closed"}, ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/treasury/inbound_transfers/ibt_123/fail", query_string="", post_data="failure_details[code]=account_closed", ) def test_test_helpers_treasury_inbound_transfers_fail_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/treasury/inbound_transfers/ibt_123/fail", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.test_helpers.treasury.inbound_transfers.fail( "ibt_123", {"failure_details": {"code": "account_closed"}}, ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/treasury/inbound_transfers/ibt_123/fail", query_string="", api_base="https://api.stripe.com", post_data="failure_details[code]=account_closed", ) @pytest.mark.anyio async def test_test_helpers_treasury_inbound_transfers_fail_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.treasury.InboundTransfer.TestHelpers.fail_async( "ibt_123", failure_details={"code": "account_closed"}, ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/treasury/inbound_transfers/ibt_123/fail", query_string="", post_data="failure_details[code]=account_closed", ) @pytest.mark.anyio async def test_test_helpers_treasury_inbound_transfers_fail_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/treasury/inbound_transfers/ibt_123/fail", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.test_helpers.treasury.inbound_transfers.fail_async( "ibt_123", {"failure_details": {"code": "account_closed"}}, ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/treasury/inbound_transfers/ibt_123/fail", query_string="", api_base="https://api.stripe.com", post_data="failure_details[code]=account_closed", ) def test_test_helpers_treasury_inbound_transfers_return_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.treasury.InboundTransfer.TestHelpers.return_inbound_transfer( "ibt_123", ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/treasury/inbound_transfers/ibt_123/return", query_string="", ) def test_test_helpers_treasury_inbound_transfers_return_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/treasury/inbound_transfers/ibt_123/return", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.test_helpers.treasury.inbound_transfers.return_inbound_transfer( "ibt_123", ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/treasury/inbound_transfers/ibt_123/return", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_test_helpers_treasury_inbound_transfers_return_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.treasury.InboundTransfer.TestHelpers.return_inbound_transfer_async( "ibt_123", ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/treasury/inbound_transfers/ibt_123/return", query_string="", ) @pytest.mark.anyio async def test_test_helpers_treasury_inbound_transfers_return_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/treasury/inbound_transfers/ibt_123/return", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.test_helpers.treasury.inbound_transfers.return_inbound_transfer_async( "ibt_123" ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/treasury/inbound_transfers/ibt_123/return", query_string="", api_base="https://api.stripe.com", ) def test_test_helpers_treasury_inbound_transfers_succeed_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.treasury.InboundTransfer.TestHelpers.succeed("ibt_123") http_client_mock.assert_requested( "post", path="/v1/test_helpers/treasury/inbound_transfers/ibt_123/succeed", query_string="", ) def test_test_helpers_treasury_inbound_transfers_succeed_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/treasury/inbound_transfers/ibt_123/succeed", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.test_helpers.treasury.inbound_transfers.succeed("ibt_123") http_client_mock.assert_requested( "post", path="/v1/test_helpers/treasury/inbound_transfers/ibt_123/succeed", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_test_helpers_treasury_inbound_transfers_succeed_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.treasury.InboundTransfer.TestHelpers.succeed_async( "ibt_123", ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/treasury/inbound_transfers/ibt_123/succeed", query_string="", ) @pytest.mark.anyio async def test_test_helpers_treasury_inbound_transfers_succeed_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/treasury/inbound_transfers/ibt_123/succeed", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.test_helpers.treasury.inbound_transfers.succeed_async( "ibt_123", ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/treasury/inbound_transfers/ibt_123/succeed", query_string="", api_base="https://api.stripe.com", ) def test_test_helpers_treasury_outbound_transfers_fail_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.treasury.OutboundTransfer.TestHelpers.fail("obt_123") http_client_mock.assert_requested( "post", path="/v1/test_helpers/treasury/outbound_transfers/obt_123/fail", query_string="", ) def test_test_helpers_treasury_outbound_transfers_fail_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/treasury/outbound_transfers/obt_123/fail", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.test_helpers.treasury.outbound_transfers.fail("obt_123") http_client_mock.assert_requested( "post", path="/v1/test_helpers/treasury/outbound_transfers/obt_123/fail", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_test_helpers_treasury_outbound_transfers_fail_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.treasury.OutboundTransfer.TestHelpers.fail_async( "obt_123" ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/treasury/outbound_transfers/obt_123/fail", query_string="", ) @pytest.mark.anyio async def test_test_helpers_treasury_outbound_transfers_fail_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/treasury/outbound_transfers/obt_123/fail", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.test_helpers.treasury.outbound_transfers.fail_async( "obt_123", ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/treasury/outbound_transfers/obt_123/fail", query_string="", api_base="https://api.stripe.com", ) def test_test_helpers_treasury_outbound_transfers_post_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.treasury.OutboundTransfer.TestHelpers.post("obt_123") http_client_mock.assert_requested( "post", path="/v1/test_helpers/treasury/outbound_transfers/obt_123/post", query_string="", ) def test_test_helpers_treasury_outbound_transfers_post_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/treasury/outbound_transfers/obt_123/post", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.test_helpers.treasury.outbound_transfers.post("obt_123") http_client_mock.assert_requested( "post", path="/v1/test_helpers/treasury/outbound_transfers/obt_123/post", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_test_helpers_treasury_outbound_transfers_post_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.treasury.OutboundTransfer.TestHelpers.post_async( "obt_123" ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/treasury/outbound_transfers/obt_123/post", query_string="", ) @pytest.mark.anyio async def test_test_helpers_treasury_outbound_transfers_post_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/treasury/outbound_transfers/obt_123/post", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.test_helpers.treasury.outbound_transfers.post_async( "obt_123", ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/treasury/outbound_transfers/obt_123/post", query_string="", api_base="https://api.stripe.com", ) def test_test_helpers_treasury_outbound_transfers_return_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.treasury.OutboundTransfer.TestHelpers.return_outbound_transfer( "obt_123", returned_details={"code": "account_closed"}, ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/treasury/outbound_transfers/obt_123/return", query_string="", post_data="returned_details[code]=account_closed", ) def test_test_helpers_treasury_outbound_transfers_return_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/treasury/outbound_transfers/obt_123/return", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.test_helpers.treasury.outbound_transfers.return_outbound_transfer( "obt_123", {"returned_details": {"code": "account_closed"}}, ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/treasury/outbound_transfers/obt_123/return", query_string="", api_base="https://api.stripe.com", post_data="returned_details[code]=account_closed", ) @pytest.mark.anyio async def test_test_helpers_treasury_outbound_transfers_return_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.treasury.OutboundTransfer.TestHelpers.return_outbound_transfer_async( "obt_123", returned_details={"code": "account_closed"}, ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/treasury/outbound_transfers/obt_123/return", query_string="", post_data="returned_details[code]=account_closed", ) @pytest.mark.anyio async def test_test_helpers_treasury_outbound_transfers_return_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/treasury/outbound_transfers/obt_123/return", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.test_helpers.treasury.outbound_transfers.return_outbound_transfer_async( "obt_123", {"returned_details": {"code": "account_closed"}}, ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/treasury/outbound_transfers/obt_123/return", query_string="", api_base="https://api.stripe.com", post_data="returned_details[code]=account_closed", ) def test_test_helpers_treasury_received_credits_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.treasury.ReceivedCredit.TestHelpers.create( financial_account="fa_123", network="ach", amount=1234, currency="usd", ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/treasury/received_credits", query_string="", post_data="financial_account=fa_123&network=ach&amount=1234¤cy=usd", ) def test_test_helpers_treasury_received_credits_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/treasury/received_credits", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.test_helpers.treasury.received_credits.create( { "financial_account": "fa_123", "network": "ach", "amount": 1234, "currency": "usd", } ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/treasury/received_credits", query_string="", api_base="https://api.stripe.com", post_data="financial_account=fa_123&network=ach&amount=1234¤cy=usd", ) @pytest.mark.anyio async def test_test_helpers_treasury_received_credits_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.treasury.ReceivedCredit.TestHelpers.create_async( financial_account="fa_123", network="ach", amount=1234, currency="usd", ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/treasury/received_credits", query_string="", post_data="financial_account=fa_123&network=ach&amount=1234¤cy=usd", ) @pytest.mark.anyio async def test_test_helpers_treasury_received_credits_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/treasury/received_credits", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.test_helpers.treasury.received_credits.create_async( { "financial_account": "fa_123", "network": "ach", "amount": 1234, "currency": "usd", } ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/treasury/received_credits", query_string="", api_base="https://api.stripe.com", post_data="financial_account=fa_123&network=ach&amount=1234¤cy=usd", ) def test_test_helpers_treasury_received_debits_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.treasury.ReceivedDebit.TestHelpers.create( financial_account="fa_123", network="ach", amount=1234, currency="usd", ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/treasury/received_debits", query_string="", post_data="financial_account=fa_123&network=ach&amount=1234¤cy=usd", ) def test_test_helpers_treasury_received_debits_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/treasury/received_debits", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.test_helpers.treasury.received_debits.create( { "financial_account": "fa_123", "network": "ach", "amount": 1234, "currency": "usd", } ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/treasury/received_debits", query_string="", api_base="https://api.stripe.com", post_data="financial_account=fa_123&network=ach&amount=1234¤cy=usd", ) @pytest.mark.anyio async def test_test_helpers_treasury_received_debits_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.treasury.ReceivedDebit.TestHelpers.create_async( financial_account="fa_123", network="ach", amount=1234, currency="usd", ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/treasury/received_debits", query_string="", post_data="financial_account=fa_123&network=ach&amount=1234¤cy=usd", ) @pytest.mark.anyio async def test_test_helpers_treasury_received_debits_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/test_helpers/treasury/received_debits", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.test_helpers.treasury.received_debits.create_async( { "financial_account": "fa_123", "network": "ach", "amount": 1234, "currency": "usd", } ) http_client_mock.assert_requested( "post", path="/v1/test_helpers/treasury/received_debits", query_string="", api_base="https://api.stripe.com", post_data="financial_account=fa_123&network=ach&amount=1234¤cy=usd", ) def test_tokens_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Token.retrieve("tok_xxxx") http_client_mock.assert_requested( "get", path="/v1/tokens/tok_xxxx", query_string="", ) def test_tokens_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/tokens/tok_xxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.tokens.retrieve("tok_xxxx") http_client_mock.assert_requested( "get", path="/v1/tokens/tok_xxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_tokens_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Token.retrieve_async("tok_xxxx") http_client_mock.assert_requested( "get", path="/v1/tokens/tok_xxxx", query_string="", ) @pytest.mark.anyio async def test_tokens_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/tokens/tok_xxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.tokens.retrieve_async("tok_xxxx") http_client_mock.assert_requested( "get", path="/v1/tokens/tok_xxxx", query_string="", api_base="https://api.stripe.com", ) def test_tokens_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Token.create( card={ "number": "4242424242424242", "exp_month": "5", "exp_year": "2023", "cvc": "314", }, ) http_client_mock.assert_requested( "post", path="/v1/tokens", query_string="", post_data="card[number]=4242424242424242&card[exp_month]=5&card[exp_year]=2023&card[cvc]=314", ) def test_tokens_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/tokens", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.tokens.create( { "card": { "number": "4242424242424242", "exp_month": "5", "exp_year": "2023", "cvc": "314", }, } ) http_client_mock.assert_requested( "post", path="/v1/tokens", query_string="", api_base="https://api.stripe.com", post_data="card[number]=4242424242424242&card[exp_month]=5&card[exp_year]=2023&card[cvc]=314", ) @pytest.mark.anyio async def test_tokens_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Token.create_async( card={ "number": "4242424242424242", "exp_month": "5", "exp_year": "2023", "cvc": "314", }, ) http_client_mock.assert_requested( "post", path="/v1/tokens", query_string="", post_data="card[number]=4242424242424242&card[exp_month]=5&card[exp_year]=2023&card[cvc]=314", ) @pytest.mark.anyio async def test_tokens_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/tokens", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.tokens.create_async( { "card": { "number": "4242424242424242", "exp_month": "5", "exp_year": "2023", "cvc": "314", }, } ) http_client_mock.assert_requested( "post", path="/v1/tokens", query_string="", api_base="https://api.stripe.com", post_data="card[number]=4242424242424242&card[exp_month]=5&card[exp_year]=2023&card[cvc]=314", ) def test_tokens_post_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Token.create( bank_account={ "country": "US", "currency": "usd", "account_holder_name": "Jenny Rosen", "account_holder_type": "individual", "routing_number": "110000000", "account_number": "000123456789", }, ) http_client_mock.assert_requested( "post", path="/v1/tokens", query_string="", post_data="bank_account[country]=US&bank_account[currency]=usd&bank_account[account_holder_name]=Jenny%20Rosen&bank_account[account_holder_type]=individual&bank_account[routing_number]=110000000&bank_account[account_number]=000123456789", ) def test_tokens_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/tokens", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.tokens.create( { "bank_account": { "country": "US", "currency": "usd", "account_holder_name": "Jenny Rosen", "account_holder_type": "individual", "routing_number": "110000000", "account_number": "000123456789", }, } ) http_client_mock.assert_requested( "post", path="/v1/tokens", query_string="", api_base="https://api.stripe.com", post_data="bank_account[country]=US&bank_account[currency]=usd&bank_account[account_holder_name]=Jenny%20Rosen&bank_account[account_holder_type]=individual&bank_account[routing_number]=110000000&bank_account[account_number]=000123456789", ) @pytest.mark.anyio async def test_tokens_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Token.create_async( bank_account={ "country": "US", "currency": "usd", "account_holder_name": "Jenny Rosen", "account_holder_type": "individual", "routing_number": "110000000", "account_number": "000123456789", }, ) http_client_mock.assert_requested( "post", path="/v1/tokens", query_string="", post_data="bank_account[country]=US&bank_account[currency]=usd&bank_account[account_holder_name]=Jenny%20Rosen&bank_account[account_holder_type]=individual&bank_account[routing_number]=110000000&bank_account[account_number]=000123456789", ) @pytest.mark.anyio async def test_tokens_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/tokens", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.tokens.create_async( { "bank_account": { "country": "US", "currency": "usd", "account_holder_name": "Jenny Rosen", "account_holder_type": "individual", "routing_number": "110000000", "account_number": "000123456789", }, } ) http_client_mock.assert_requested( "post", path="/v1/tokens", query_string="", api_base="https://api.stripe.com", post_data="bank_account[country]=US&bank_account[currency]=usd&bank_account[account_holder_name]=Jenny%20Rosen&bank_account[account_holder_type]=individual&bank_account[routing_number]=110000000&bank_account[account_number]=000123456789", ) def test_tokens_post_3(self, http_client_mock: HTTPClientMock) -> None: stripe.Token.create(pii={"id_number": "000000000"}) http_client_mock.assert_requested( "post", path="/v1/tokens", query_string="", post_data="pii[id_number]=000000000", ) def test_tokens_post_3_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/tokens", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.tokens.create({"pii": {"id_number": "000000000"}}) http_client_mock.assert_requested( "post", path="/v1/tokens", query_string="", api_base="https://api.stripe.com", post_data="pii[id_number]=000000000", ) @pytest.mark.anyio async def test_tokens_post_3_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Token.create_async(pii={"id_number": "000000000"}) http_client_mock.assert_requested( "post", path="/v1/tokens", query_string="", post_data="pii[id_number]=000000000", ) @pytest.mark.anyio async def test_tokens_post_3_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/tokens", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.tokens.create_async({"pii": {"id_number": "000000000"}}) http_client_mock.assert_requested( "post", path="/v1/tokens", query_string="", api_base="https://api.stripe.com", post_data="pii[id_number]=000000000", ) def test_tokens_post_4(self, http_client_mock: HTTPClientMock) -> None: stripe.Token.create( account={ "individual": {"first_name": "Jane", "last_name": "Doe"}, "tos_shown_and_accepted": True, }, ) http_client_mock.assert_requested( "post", path="/v1/tokens", query_string="", post_data="account[individual][first_name]=Jane&account[individual][last_name]=Doe&account[tos_shown_and_accepted]=True", ) def test_tokens_post_4_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/tokens", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.tokens.create( { "account": { "individual": {"first_name": "Jane", "last_name": "Doe"}, "tos_shown_and_accepted": True, }, } ) http_client_mock.assert_requested( "post", path="/v1/tokens", query_string="", api_base="https://api.stripe.com", post_data="account[individual][first_name]=Jane&account[individual][last_name]=Doe&account[tos_shown_and_accepted]=True", ) @pytest.mark.anyio async def test_tokens_post_4_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Token.create_async( account={ "individual": {"first_name": "Jane", "last_name": "Doe"}, "tos_shown_and_accepted": True, }, ) http_client_mock.assert_requested( "post", path="/v1/tokens", query_string="", post_data="account[individual][first_name]=Jane&account[individual][last_name]=Doe&account[tos_shown_and_accepted]=True", ) @pytest.mark.anyio async def test_tokens_post_4_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/tokens", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.tokens.create_async( { "account": { "individual": {"first_name": "Jane", "last_name": "Doe"}, "tos_shown_and_accepted": True, }, } ) http_client_mock.assert_requested( "post", path="/v1/tokens", query_string="", api_base="https://api.stripe.com", post_data="account[individual][first_name]=Jane&account[individual][last_name]=Doe&account[tos_shown_and_accepted]=True", ) def test_tokens_post_5(self, http_client_mock: HTTPClientMock) -> None: stripe.Token.create( person={ "first_name": "Jane", "last_name": "Doe", "relationship": {"owner": True}, }, ) http_client_mock.assert_requested( "post", path="/v1/tokens", query_string="", post_data="person[first_name]=Jane&person[last_name]=Doe&person[relationship][owner]=True", ) def test_tokens_post_5_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/tokens", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.tokens.create( { "person": { "first_name": "Jane", "last_name": "Doe", "relationship": {"owner": True}, }, } ) http_client_mock.assert_requested( "post", path="/v1/tokens", query_string="", api_base="https://api.stripe.com", post_data="person[first_name]=Jane&person[last_name]=Doe&person[relationship][owner]=True", ) @pytest.mark.anyio async def test_tokens_post_5_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Token.create_async( person={ "first_name": "Jane", "last_name": "Doe", "relationship": {"owner": True}, }, ) http_client_mock.assert_requested( "post", path="/v1/tokens", query_string="", post_data="person[first_name]=Jane&person[last_name]=Doe&person[relationship][owner]=True", ) @pytest.mark.anyio async def test_tokens_post_5_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/tokens", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.tokens.create_async( { "person": { "first_name": "Jane", "last_name": "Doe", "relationship": {"owner": True}, }, } ) http_client_mock.assert_requested( "post", path="/v1/tokens", query_string="", api_base="https://api.stripe.com", post_data="person[first_name]=Jane&person[last_name]=Doe&person[relationship][owner]=True", ) def test_tokens_post_6(self, http_client_mock: HTTPClientMock) -> None: stripe.Token.create(cvc_update={"cvc": "123"}) http_client_mock.assert_requested( "post", path="/v1/tokens", query_string="", post_data="cvc_update[cvc]=123", ) def test_tokens_post_6_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/tokens", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.tokens.create({"cvc_update": {"cvc": "123"}}) http_client_mock.assert_requested( "post", path="/v1/tokens", query_string="", api_base="https://api.stripe.com", post_data="cvc_update[cvc]=123", ) @pytest.mark.anyio async def test_tokens_post_6_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Token.create_async(cvc_update={"cvc": "123"}) http_client_mock.assert_requested( "post", path="/v1/tokens", query_string="", post_data="cvc_update[cvc]=123", ) @pytest.mark.anyio async def test_tokens_post_6_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/tokens", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.tokens.create_async({"cvc_update": {"cvc": "123"}}) http_client_mock.assert_requested( "post", path="/v1/tokens", query_string="", api_base="https://api.stripe.com", post_data="cvc_update[cvc]=123", ) def test_topups_cancel_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.Topup.cancel("tu_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/topups/tu_xxxxxxxxxxxxx/cancel", query_string="", ) def test_topups_cancel_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/topups/tu_xxxxxxxxxxxxx/cancel", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.topups.cancel("tu_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/topups/tu_xxxxxxxxxxxxx/cancel", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_topups_cancel_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Topup.cancel_async("tu_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/topups/tu_xxxxxxxxxxxxx/cancel", query_string="", ) @pytest.mark.anyio async def test_topups_cancel_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/topups/tu_xxxxxxxxxxxxx/cancel", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.topups.cancel_async("tu_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/topups/tu_xxxxxxxxxxxxx/cancel", query_string="", api_base="https://api.stripe.com", ) def test_topups_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Topup.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/topups", query_string="limit=3", ) def test_topups_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/topups", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.topups.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/topups", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_topups_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Topup.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/topups", query_string="limit=3", ) @pytest.mark.anyio async def test_topups_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/topups", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.topups.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/topups", query_string="limit=3", api_base="https://api.stripe.com", ) def test_topups_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Topup.retrieve("tu_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/topups/tu_xxxxxxxxxxxxx", query_string="", ) def test_topups_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/topups/tu_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.topups.retrieve("tu_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/topups/tu_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_topups_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Topup.retrieve_async("tu_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/topups/tu_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_topups_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/topups/tu_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.topups.retrieve_async("tu_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/topups/tu_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_topups_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Topup.create( amount=2000, currency="usd", description="Top-up for Jenny Rosen", statement_descriptor="Top-up", ) http_client_mock.assert_requested( "post", path="/v1/topups", query_string="", post_data="amount=2000¤cy=usd&description=Top-up%20for%20Jenny%20Rosen&statement_descriptor=Top-up", ) def test_topups_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/topups", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.topups.create( { "amount": 2000, "currency": "usd", "description": "Top-up for Jenny Rosen", "statement_descriptor": "Top-up", } ) http_client_mock.assert_requested( "post", path="/v1/topups", query_string="", api_base="https://api.stripe.com", post_data="amount=2000¤cy=usd&description=Top-up%20for%20Jenny%20Rosen&statement_descriptor=Top-up", ) @pytest.mark.anyio async def test_topups_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Topup.create_async( amount=2000, currency="usd", description="Top-up for Jenny Rosen", statement_descriptor="Top-up", ) http_client_mock.assert_requested( "post", path="/v1/topups", query_string="", post_data="amount=2000¤cy=usd&description=Top-up%20for%20Jenny%20Rosen&statement_descriptor=Top-up", ) @pytest.mark.anyio async def test_topups_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/topups", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.topups.create_async( { "amount": 2000, "currency": "usd", "description": "Top-up for Jenny Rosen", "statement_descriptor": "Top-up", } ) http_client_mock.assert_requested( "post", path="/v1/topups", query_string="", api_base="https://api.stripe.com", post_data="amount=2000¤cy=usd&description=Top-up%20for%20Jenny%20Rosen&statement_descriptor=Top-up", ) def test_topups_post_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Topup.modify( "tu_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/topups/tu_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) def test_topups_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/topups/tu_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.topups.update( "tu_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/topups/tu_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_topups_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Topup.modify_async( "tu_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/topups/tu_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_topups_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/topups/tu_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.topups.update_async( "tu_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/topups/tu_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) def test_transfers_get(self, http_client_mock: HTTPClientMock) -> None: stripe.Transfer.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/transfers", query_string="limit=3", ) def test_transfers_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/transfers", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.transfers.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/transfers", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_transfers_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Transfer.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/transfers", query_string="limit=3", ) @pytest.mark.anyio async def test_transfers_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/transfers", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.transfers.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/transfers", query_string="limit=3", api_base="https://api.stripe.com", ) def test_transfers_get_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Transfer.retrieve("tr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/transfers/tr_xxxxxxxxxxxxx", query_string="", ) def test_transfers_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/transfers/tr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.transfers.retrieve("tr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/transfers/tr_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_transfers_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Transfer.retrieve_async("tr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/transfers/tr_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_transfers_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/transfers/tr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.transfers.retrieve_async("tr_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/transfers/tr_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_transfers_post(self, http_client_mock: HTTPClientMock) -> None: stripe.Transfer.create( amount=400, currency="usd", destination="acct_xxxxxxxxxxxxx", transfer_group="ORDER_95", ) http_client_mock.assert_requested( "post", path="/v1/transfers", query_string="", post_data="amount=400¤cy=usd&destination=acct_xxxxxxxxxxxxx&transfer_group=ORDER_95", ) def test_transfers_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/transfers", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.transfers.create( { "amount": 400, "currency": "usd", "destination": "acct_xxxxxxxxxxxxx", "transfer_group": "ORDER_95", } ) http_client_mock.assert_requested( "post", path="/v1/transfers", query_string="", api_base="https://api.stripe.com", post_data="amount=400¤cy=usd&destination=acct_xxxxxxxxxxxxx&transfer_group=ORDER_95", ) @pytest.mark.anyio async def test_transfers_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Transfer.create_async( amount=400, currency="usd", destination="acct_xxxxxxxxxxxxx", transfer_group="ORDER_95", ) http_client_mock.assert_requested( "post", path="/v1/transfers", query_string="", post_data="amount=400¤cy=usd&destination=acct_xxxxxxxxxxxxx&transfer_group=ORDER_95", ) @pytest.mark.anyio async def test_transfers_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/transfers", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.transfers.create_async( { "amount": 400, "currency": "usd", "destination": "acct_xxxxxxxxxxxxx", "transfer_group": "ORDER_95", } ) http_client_mock.assert_requested( "post", path="/v1/transfers", query_string="", api_base="https://api.stripe.com", post_data="amount=400¤cy=usd&destination=acct_xxxxxxxxxxxxx&transfer_group=ORDER_95", ) def test_transfers_post_2(self, http_client_mock: HTTPClientMock) -> None: stripe.Transfer.modify( "tr_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/transfers/tr_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) def test_transfers_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/transfers/tr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.transfers.update( "tr_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/transfers/tr_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_transfers_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Transfer.modify_async( "tr_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/transfers/tr_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_transfers_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/transfers/tr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.transfers.update_async( "tr_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/transfers/tr_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) def test_transfers_reversals_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.Transfer.list_reversals( "tr_xxxxxxxxxxxxx", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals", query_string="limit=3", ) def test_transfers_reversals_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/transfers/tr_xxxxxxxxxxxxx/reversals", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.transfers.reversals.list( "tr_xxxxxxxxxxxxx", {"limit": 3}, ) http_client_mock.assert_requested( "get", path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_transfers_reversals_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Transfer.list_reversals_async( "tr_xxxxxxxxxxxxx", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals", query_string="limit=3", ) @pytest.mark.anyio async def test_transfers_reversals_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/transfers/tr_xxxxxxxxxxxxx/reversals", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.transfers.reversals.list_async( "tr_xxxxxxxxxxxxx", {"limit": 3}, ) http_client_mock.assert_requested( "get", path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals", query_string="limit=3", api_base="https://api.stripe.com", ) def test_transfers_reversals_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.Transfer.retrieve_reversal( "tr_xxxxxxxxxxxxx", "trr_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx", query_string="", ) def test_transfers_reversals_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.transfers.reversals.retrieve( "tr_xxxxxxxxxxxxx", "trr_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_transfers_reversals_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Transfer.retrieve_reversal_async( "tr_xxxxxxxxxxxxx", "trr_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_transfers_reversals_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.transfers.reversals.retrieve_async( "tr_xxxxxxxxxxxxx", "trr_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_transfers_reversals_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.Transfer.create_reversal( "tr_xxxxxxxxxxxxx", amount=100, ) http_client_mock.assert_requested( "post", path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals", query_string="", post_data="amount=100", ) def test_transfers_reversals_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/transfers/tr_xxxxxxxxxxxxx/reversals", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.transfers.reversals.create( "tr_xxxxxxxxxxxxx", {"amount": 100}, ) http_client_mock.assert_requested( "post", path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals", query_string="", api_base="https://api.stripe.com", post_data="amount=100", ) @pytest.mark.anyio async def test_transfers_reversals_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Transfer.create_reversal_async( "tr_xxxxxxxxxxxxx", amount=100, ) http_client_mock.assert_requested( "post", path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals", query_string="", post_data="amount=100", ) @pytest.mark.anyio async def test_transfers_reversals_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/transfers/tr_xxxxxxxxxxxxx/reversals", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.transfers.reversals.create_async( "tr_xxxxxxxxxxxxx", {"amount": 100}, ) http_client_mock.assert_requested( "post", path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals", query_string="", api_base="https://api.stripe.com", post_data="amount=100", ) def test_transfers_reversals_post_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.Transfer.modify_reversal( "tr_xxxxxxxxxxxxx", "trr_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) def test_transfers_reversals_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.transfers.reversals.update( "tr_xxxxxxxxxxxxx", "trr_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_transfers_reversals_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.Transfer.modify_reversal_async( "tr_xxxxxxxxxxxxx", "trr_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_transfers_reversals_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.transfers.reversals.update_async( "tr_xxxxxxxxxxxxx", "trr_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/transfers/tr_xxxxxxxxxxxxx/reversals/trr_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) def test_treasury_credit_reversals_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.treasury.CreditReversal.list( financial_account="fa_xxxxxxxxxxxxx", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/treasury/credit_reversals", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", ) def test_treasury_credit_reversals_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/treasury/credit_reversals", "financial_account=fa_xxxxxxxxxxxxx&limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.treasury.credit_reversals.list( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, } ) http_client_mock.assert_requested( "get", path="/v1/treasury/credit_reversals", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_treasury_credit_reversals_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.treasury.CreditReversal.list_async( financial_account="fa_xxxxxxxxxxxxx", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/treasury/credit_reversals", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", ) @pytest.mark.anyio async def test_treasury_credit_reversals_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/treasury/credit_reversals", "financial_account=fa_xxxxxxxxxxxxx&limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.treasury.credit_reversals.list_async( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, } ) http_client_mock.assert_requested( "get", path="/v1/treasury/credit_reversals", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", api_base="https://api.stripe.com", ) def test_treasury_credit_reversals_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.treasury.CreditReversal.retrieve("credrev_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/credit_reversals/credrev_xxxxxxxxxxxxx", query_string="", ) def test_treasury_credit_reversals_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/treasury/credit_reversals/credrev_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.treasury.credit_reversals.retrieve("credrev_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/credit_reversals/credrev_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_treasury_credit_reversals_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.treasury.CreditReversal.retrieve_async( "credrev_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/treasury/credit_reversals/credrev_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_treasury_credit_reversals_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/treasury/credit_reversals/credrev_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.treasury.credit_reversals.retrieve_async( "credrev_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/treasury/credit_reversals/credrev_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_treasury_credit_reversals_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.treasury.CreditReversal.create( received_credit="rc_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", path="/v1/treasury/credit_reversals", query_string="", post_data="received_credit=rc_xxxxxxxxxxxxx", ) def test_treasury_credit_reversals_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/treasury/credit_reversals", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.treasury.credit_reversals.create( { "received_credit": "rc_xxxxxxxxxxxxx", } ) http_client_mock.assert_requested( "post", path="/v1/treasury/credit_reversals", query_string="", api_base="https://api.stripe.com", post_data="received_credit=rc_xxxxxxxxxxxxx", ) @pytest.mark.anyio async def test_treasury_credit_reversals_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.treasury.CreditReversal.create_async( received_credit="rc_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", path="/v1/treasury/credit_reversals", query_string="", post_data="received_credit=rc_xxxxxxxxxxxxx", ) @pytest.mark.anyio async def test_treasury_credit_reversals_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/treasury/credit_reversals", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.treasury.credit_reversals.create_async( { "received_credit": "rc_xxxxxxxxxxxxx", } ) http_client_mock.assert_requested( "post", path="/v1/treasury/credit_reversals", query_string="", api_base="https://api.stripe.com", post_data="received_credit=rc_xxxxxxxxxxxxx", ) def test_treasury_debit_reversals_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.treasury.DebitReversal.list( financial_account="fa_xxxxxxxxxxxxx", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/treasury/debit_reversals", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", ) def test_treasury_debit_reversals_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/treasury/debit_reversals", "financial_account=fa_xxxxxxxxxxxxx&limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.treasury.debit_reversals.list( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, } ) http_client_mock.assert_requested( "get", path="/v1/treasury/debit_reversals", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_treasury_debit_reversals_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.treasury.DebitReversal.list_async( financial_account="fa_xxxxxxxxxxxxx", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/treasury/debit_reversals", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", ) @pytest.mark.anyio async def test_treasury_debit_reversals_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/treasury/debit_reversals", "financial_account=fa_xxxxxxxxxxxxx&limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.treasury.debit_reversals.list_async( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, } ) http_client_mock.assert_requested( "get", path="/v1/treasury/debit_reversals", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", api_base="https://api.stripe.com", ) def test_treasury_debit_reversals_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.treasury.DebitReversal.retrieve("debrev_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/debit_reversals/debrev_xxxxxxxxxxxxx", query_string="", ) def test_treasury_debit_reversals_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/treasury/debit_reversals/debrev_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.treasury.debit_reversals.retrieve("debrev_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/debit_reversals/debrev_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_treasury_debit_reversals_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.treasury.DebitReversal.retrieve_async( "debrev_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/treasury/debit_reversals/debrev_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_treasury_debit_reversals_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/treasury/debit_reversals/debrev_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.treasury.debit_reversals.retrieve_async( "debrev_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/treasury/debit_reversals/debrev_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_treasury_debit_reversals_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.treasury.DebitReversal.create(received_debit="rd_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/treasury/debit_reversals", query_string="", post_data="received_debit=rd_xxxxxxxxxxxxx", ) def test_treasury_debit_reversals_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/treasury/debit_reversals", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.treasury.debit_reversals.create( { "received_debit": "rd_xxxxxxxxxxxxx", } ) http_client_mock.assert_requested( "post", path="/v1/treasury/debit_reversals", query_string="", api_base="https://api.stripe.com", post_data="received_debit=rd_xxxxxxxxxxxxx", ) @pytest.mark.anyio async def test_treasury_debit_reversals_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.treasury.DebitReversal.create_async( received_debit="rd_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", path="/v1/treasury/debit_reversals", query_string="", post_data="received_debit=rd_xxxxxxxxxxxxx", ) @pytest.mark.anyio async def test_treasury_debit_reversals_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/treasury/debit_reversals", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.treasury.debit_reversals.create_async( { "received_debit": "rd_xxxxxxxxxxxxx", } ) http_client_mock.assert_requested( "post", path="/v1/treasury/debit_reversals", query_string="", api_base="https://api.stripe.com", post_data="received_debit=rd_xxxxxxxxxxxxx", ) def test_treasury_financial_accounts_features_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.treasury.FinancialAccount.retrieve_features("fa_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx/features", query_string="", ) def test_treasury_financial_accounts_features_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx/features", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.treasury.financial_accounts.features.retrieve( "fa_xxxxxxxxxxxxx" ) http_client_mock.assert_requested( "get", path="/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx/features", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_treasury_financial_accounts_features_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.treasury.FinancialAccount.retrieve_features_async( "fa_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx/features", query_string="", ) @pytest.mark.anyio async def test_treasury_financial_accounts_features_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx/features", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.treasury.financial_accounts.features.retrieve_async( "fa_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx/features", query_string="", api_base="https://api.stripe.com", ) def test_treasury_financial_accounts_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.treasury.FinancialAccount.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/treasury/financial_accounts", query_string="limit=3", ) def test_treasury_financial_accounts_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/treasury/financial_accounts", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.treasury.financial_accounts.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/treasury/financial_accounts", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_treasury_financial_accounts_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.treasury.FinancialAccount.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/treasury/financial_accounts", query_string="limit=3", ) @pytest.mark.anyio async def test_treasury_financial_accounts_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/treasury/financial_accounts", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.treasury.financial_accounts.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/treasury/financial_accounts", query_string="limit=3", api_base="https://api.stripe.com", ) def test_treasury_financial_accounts_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.treasury.FinancialAccount.retrieve("fa_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx", query_string="", ) def test_treasury_financial_accounts_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.treasury.financial_accounts.retrieve("fa_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_treasury_financial_accounts_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.treasury.FinancialAccount.retrieve_async( "fa_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_treasury_financial_accounts_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.treasury.financial_accounts.retrieve_async( "fa_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_treasury_financial_accounts_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.treasury.FinancialAccount.create( supported_currencies=["usd"], features={}, ) http_client_mock.assert_requested( "post", path="/v1/treasury/financial_accounts", query_string="", post_data="supported_currencies[0]=usd", ) def test_treasury_financial_accounts_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/treasury/financial_accounts", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.treasury.financial_accounts.create( { "supported_currencies": ["usd"], "features": {}, } ) http_client_mock.assert_requested( "post", path="/v1/treasury/financial_accounts", query_string="", api_base="https://api.stripe.com", post_data="supported_currencies[0]=usd", ) @pytest.mark.anyio async def test_treasury_financial_accounts_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.treasury.FinancialAccount.create_async( supported_currencies=["usd"], features={}, ) http_client_mock.assert_requested( "post", path="/v1/treasury/financial_accounts", query_string="", post_data="supported_currencies[0]=usd", ) @pytest.mark.anyio async def test_treasury_financial_accounts_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/treasury/financial_accounts", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.treasury.financial_accounts.create_async( { "supported_currencies": ["usd"], "features": {}, } ) http_client_mock.assert_requested( "post", path="/v1/treasury/financial_accounts", query_string="", api_base="https://api.stripe.com", post_data="supported_currencies[0]=usd", ) def test_treasury_financial_accounts_post_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.treasury.FinancialAccount.modify( "fa_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) def test_treasury_financial_accounts_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.treasury.financial_accounts.update( "fa_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_treasury_financial_accounts_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.treasury.FinancialAccount.modify_async( "fa_xxxxxxxxxxxxx", metadata={"order_id": "6735"}, ) http_client_mock.assert_requested( "post", path="/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx", query_string="", post_data="metadata[order_id]=6735", ) @pytest.mark.anyio async def test_treasury_financial_accounts_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.treasury.financial_accounts.update_async( "fa_xxxxxxxxxxxxx", {"metadata": {"order_id": "6735"}}, ) http_client_mock.assert_requested( "post", path="/v1/treasury/financial_accounts/fa_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="metadata[order_id]=6735", ) def test_treasury_inbound_transfers_cancel_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.treasury.InboundTransfer.cancel("ibt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx/cancel", query_string="", ) def test_treasury_inbound_transfers_cancel_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx/cancel", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.treasury.inbound_transfers.cancel("ibt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx/cancel", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_treasury_inbound_transfers_cancel_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.treasury.InboundTransfer.cancel_async("ibt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx/cancel", query_string="", ) @pytest.mark.anyio async def test_treasury_inbound_transfers_cancel_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx/cancel", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.treasury.inbound_transfers.cancel_async( "ibt_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", path="/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx/cancel", query_string="", api_base="https://api.stripe.com", ) def test_treasury_inbound_transfers_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.treasury.InboundTransfer.list( financial_account="fa_xxxxxxxxxxxxx", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/treasury/inbound_transfers", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", ) def test_treasury_inbound_transfers_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/treasury/inbound_transfers", "financial_account=fa_xxxxxxxxxxxxx&limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.treasury.inbound_transfers.list( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, } ) http_client_mock.assert_requested( "get", path="/v1/treasury/inbound_transfers", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_treasury_inbound_transfers_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.treasury.InboundTransfer.list_async( financial_account="fa_xxxxxxxxxxxxx", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/treasury/inbound_transfers", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", ) @pytest.mark.anyio async def test_treasury_inbound_transfers_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/treasury/inbound_transfers", "financial_account=fa_xxxxxxxxxxxxx&limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.treasury.inbound_transfers.list_async( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, } ) http_client_mock.assert_requested( "get", path="/v1/treasury/inbound_transfers", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", api_base="https://api.stripe.com", ) def test_treasury_inbound_transfers_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.treasury.InboundTransfer.retrieve("ibt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx", query_string="", ) def test_treasury_inbound_transfers_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.treasury.inbound_transfers.retrieve("ibt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_treasury_inbound_transfers_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.treasury.InboundTransfer.retrieve_async( "ibt_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_treasury_inbound_transfers_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.treasury.inbound_transfers.retrieve_async( "ibt_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/treasury/inbound_transfers/ibt_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_treasury_inbound_transfers_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.treasury.InboundTransfer.create( financial_account="fa_xxxxxxxxxxxxx", amount=10000, currency="usd", origin_payment_method="pm_xxxxxxxxxxxxx", description="InboundTransfer from my bank account", ) http_client_mock.assert_requested( "post", path="/v1/treasury/inbound_transfers", query_string="", post_data="financial_account=fa_xxxxxxxxxxxxx&amount=10000¤cy=usd&origin_payment_method=pm_xxxxxxxxxxxxx&description=InboundTransfer%20from%20my%20bank%20account", ) def test_treasury_inbound_transfers_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/treasury/inbound_transfers", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.treasury.inbound_transfers.create( { "financial_account": "fa_xxxxxxxxxxxxx", "amount": 10000, "currency": "usd", "origin_payment_method": "pm_xxxxxxxxxxxxx", "description": "InboundTransfer from my bank account", } ) http_client_mock.assert_requested( "post", path="/v1/treasury/inbound_transfers", query_string="", api_base="https://api.stripe.com", post_data="financial_account=fa_xxxxxxxxxxxxx&amount=10000¤cy=usd&origin_payment_method=pm_xxxxxxxxxxxxx&description=InboundTransfer%20from%20my%20bank%20account", ) @pytest.mark.anyio async def test_treasury_inbound_transfers_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.treasury.InboundTransfer.create_async( financial_account="fa_xxxxxxxxxxxxx", amount=10000, currency="usd", origin_payment_method="pm_xxxxxxxxxxxxx", description="InboundTransfer from my bank account", ) http_client_mock.assert_requested( "post", path="/v1/treasury/inbound_transfers", query_string="", post_data="financial_account=fa_xxxxxxxxxxxxx&amount=10000¤cy=usd&origin_payment_method=pm_xxxxxxxxxxxxx&description=InboundTransfer%20from%20my%20bank%20account", ) @pytest.mark.anyio async def test_treasury_inbound_transfers_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/treasury/inbound_transfers", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.treasury.inbound_transfers.create_async( { "financial_account": "fa_xxxxxxxxxxxxx", "amount": 10000, "currency": "usd", "origin_payment_method": "pm_xxxxxxxxxxxxx", "description": "InboundTransfer from my bank account", } ) http_client_mock.assert_requested( "post", path="/v1/treasury/inbound_transfers", query_string="", api_base="https://api.stripe.com", post_data="financial_account=fa_xxxxxxxxxxxxx&amount=10000¤cy=usd&origin_payment_method=pm_xxxxxxxxxxxxx&description=InboundTransfer%20from%20my%20bank%20account", ) def test_treasury_outbound_payments_cancel_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.treasury.OutboundPayment.cancel("bot_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/treasury/outbound_payments/bot_xxxxxxxxxxxxx/cancel", query_string="", ) def test_treasury_outbound_payments_cancel_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/treasury/outbound_payments/bot_xxxxxxxxxxxxx/cancel", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.treasury.outbound_payments.cancel("bot_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/treasury/outbound_payments/bot_xxxxxxxxxxxxx/cancel", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_treasury_outbound_payments_cancel_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.treasury.OutboundPayment.cancel_async("bot_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/treasury/outbound_payments/bot_xxxxxxxxxxxxx/cancel", query_string="", ) @pytest.mark.anyio async def test_treasury_outbound_payments_cancel_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/treasury/outbound_payments/bot_xxxxxxxxxxxxx/cancel", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.treasury.outbound_payments.cancel_async( "bot_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", path="/v1/treasury/outbound_payments/bot_xxxxxxxxxxxxx/cancel", query_string="", api_base="https://api.stripe.com", ) def test_treasury_outbound_payments_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.treasury.OutboundPayment.list( financial_account="fa_xxxxxxxxxxxxx", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/treasury/outbound_payments", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", ) def test_treasury_outbound_payments_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/treasury/outbound_payments", "financial_account=fa_xxxxxxxxxxxxx&limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.treasury.outbound_payments.list( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, } ) http_client_mock.assert_requested( "get", path="/v1/treasury/outbound_payments", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_treasury_outbound_payments_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.treasury.OutboundPayment.list_async( financial_account="fa_xxxxxxxxxxxxx", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/treasury/outbound_payments", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", ) @pytest.mark.anyio async def test_treasury_outbound_payments_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/treasury/outbound_payments", "financial_account=fa_xxxxxxxxxxxxx&limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.treasury.outbound_payments.list_async( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, } ) http_client_mock.assert_requested( "get", path="/v1/treasury/outbound_payments", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", api_base="https://api.stripe.com", ) def test_treasury_outbound_payments_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.treasury.OutboundPayment.retrieve("bot_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/outbound_payments/bot_xxxxxxxxxxxxx", query_string="", ) def test_treasury_outbound_payments_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/treasury/outbound_payments/bot_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.treasury.outbound_payments.retrieve("bot_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/outbound_payments/bot_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_treasury_outbound_payments_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.treasury.OutboundPayment.retrieve_async( "bot_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/treasury/outbound_payments/bot_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_treasury_outbound_payments_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/treasury/outbound_payments/bot_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.treasury.outbound_payments.retrieve_async( "bot_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/treasury/outbound_payments/bot_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_treasury_outbound_payments_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.treasury.OutboundPayment.create( financial_account="fa_xxxxxxxxxxxxx", amount=10000, currency="usd", customer="cus_xxxxxxxxxxxxx", destination_payment_method="pm_xxxxxxxxxxxxx", description="OutboundPayment to a 3rd party", ) http_client_mock.assert_requested( "post", path="/v1/treasury/outbound_payments", query_string="", post_data="financial_account=fa_xxxxxxxxxxxxx&amount=10000¤cy=usd&customer=cus_xxxxxxxxxxxxx&destination_payment_method=pm_xxxxxxxxxxxxx&description=OutboundPayment%20to%20a%203rd%20party", ) def test_treasury_outbound_payments_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/treasury/outbound_payments", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.treasury.outbound_payments.create( { "financial_account": "fa_xxxxxxxxxxxxx", "amount": 10000, "currency": "usd", "customer": "cus_xxxxxxxxxxxxx", "destination_payment_method": "pm_xxxxxxxxxxxxx", "description": "OutboundPayment to a 3rd party", } ) http_client_mock.assert_requested( "post", path="/v1/treasury/outbound_payments", query_string="", api_base="https://api.stripe.com", post_data="financial_account=fa_xxxxxxxxxxxxx&amount=10000¤cy=usd&customer=cus_xxxxxxxxxxxxx&destination_payment_method=pm_xxxxxxxxxxxxx&description=OutboundPayment%20to%20a%203rd%20party", ) @pytest.mark.anyio async def test_treasury_outbound_payments_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.treasury.OutboundPayment.create_async( financial_account="fa_xxxxxxxxxxxxx", amount=10000, currency="usd", customer="cus_xxxxxxxxxxxxx", destination_payment_method="pm_xxxxxxxxxxxxx", description="OutboundPayment to a 3rd party", ) http_client_mock.assert_requested( "post", path="/v1/treasury/outbound_payments", query_string="", post_data="financial_account=fa_xxxxxxxxxxxxx&amount=10000¤cy=usd&customer=cus_xxxxxxxxxxxxx&destination_payment_method=pm_xxxxxxxxxxxxx&description=OutboundPayment%20to%20a%203rd%20party", ) @pytest.mark.anyio async def test_treasury_outbound_payments_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/treasury/outbound_payments", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.treasury.outbound_payments.create_async( { "financial_account": "fa_xxxxxxxxxxxxx", "amount": 10000, "currency": "usd", "customer": "cus_xxxxxxxxxxxxx", "destination_payment_method": "pm_xxxxxxxxxxxxx", "description": "OutboundPayment to a 3rd party", } ) http_client_mock.assert_requested( "post", path="/v1/treasury/outbound_payments", query_string="", api_base="https://api.stripe.com", post_data="financial_account=fa_xxxxxxxxxxxxx&amount=10000¤cy=usd&customer=cus_xxxxxxxxxxxxx&destination_payment_method=pm_xxxxxxxxxxxxx&description=OutboundPayment%20to%20a%203rd%20party", ) def test_treasury_outbound_transfers_cancel_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.treasury.OutboundTransfer.cancel("obt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx/cancel", query_string="", ) def test_treasury_outbound_transfers_cancel_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx/cancel", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.treasury.outbound_transfers.cancel("obt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "post", path="/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx/cancel", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_treasury_outbound_transfers_cancel_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.treasury.OutboundTransfer.cancel_async( "obt_xxxxxxxxxxxxx" ) http_client_mock.assert_requested( "post", path="/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx/cancel", query_string="", ) @pytest.mark.anyio async def test_treasury_outbound_transfers_cancel_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx/cancel", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.treasury.outbound_transfers.cancel_async( "obt_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "post", path="/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx/cancel", query_string="", api_base="https://api.stripe.com", ) def test_treasury_outbound_transfers_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.treasury.OutboundTransfer.list( financial_account="fa_xxxxxxxxxxxxx", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/treasury/outbound_transfers", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", ) def test_treasury_outbound_transfers_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/treasury/outbound_transfers", "financial_account=fa_xxxxxxxxxxxxx&limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.treasury.outbound_transfers.list( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, } ) http_client_mock.assert_requested( "get", path="/v1/treasury/outbound_transfers", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_treasury_outbound_transfers_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.treasury.OutboundTransfer.list_async( financial_account="fa_xxxxxxxxxxxxx", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/treasury/outbound_transfers", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", ) @pytest.mark.anyio async def test_treasury_outbound_transfers_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/treasury/outbound_transfers", "financial_account=fa_xxxxxxxxxxxxx&limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.treasury.outbound_transfers.list_async( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, } ) http_client_mock.assert_requested( "get", path="/v1/treasury/outbound_transfers", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", api_base="https://api.stripe.com", ) def test_treasury_outbound_transfers_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.treasury.OutboundTransfer.retrieve("obt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx", query_string="", ) def test_treasury_outbound_transfers_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.treasury.outbound_transfers.retrieve("obt_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_treasury_outbound_transfers_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.treasury.OutboundTransfer.retrieve_async( "obt_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_treasury_outbound_transfers_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.treasury.outbound_transfers.retrieve_async( "obt_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/treasury/outbound_transfers/obt_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_treasury_outbound_transfers_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.treasury.OutboundTransfer.create( financial_account="fa_xxxxxxxxxxxxx", destination_payment_method="pm_xxxxxxxxxxxxx", amount=500, currency="usd", description="OutboundTransfer to my external bank account", ) http_client_mock.assert_requested( "post", path="/v1/treasury/outbound_transfers", query_string="", post_data="financial_account=fa_xxxxxxxxxxxxx&destination_payment_method=pm_xxxxxxxxxxxxx&amount=500¤cy=usd&description=OutboundTransfer%20to%20my%20external%20bank%20account", ) def test_treasury_outbound_transfers_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/treasury/outbound_transfers", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.treasury.outbound_transfers.create( { "financial_account": "fa_xxxxxxxxxxxxx", "destination_payment_method": "pm_xxxxxxxxxxxxx", "amount": 500, "currency": "usd", "description": "OutboundTransfer to my external bank account", } ) http_client_mock.assert_requested( "post", path="/v1/treasury/outbound_transfers", query_string="", api_base="https://api.stripe.com", post_data="financial_account=fa_xxxxxxxxxxxxx&destination_payment_method=pm_xxxxxxxxxxxxx&amount=500¤cy=usd&description=OutboundTransfer%20to%20my%20external%20bank%20account", ) @pytest.mark.anyio async def test_treasury_outbound_transfers_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.treasury.OutboundTransfer.create_async( financial_account="fa_xxxxxxxxxxxxx", destination_payment_method="pm_xxxxxxxxxxxxx", amount=500, currency="usd", description="OutboundTransfer to my external bank account", ) http_client_mock.assert_requested( "post", path="/v1/treasury/outbound_transfers", query_string="", post_data="financial_account=fa_xxxxxxxxxxxxx&destination_payment_method=pm_xxxxxxxxxxxxx&amount=500¤cy=usd&description=OutboundTransfer%20to%20my%20external%20bank%20account", ) @pytest.mark.anyio async def test_treasury_outbound_transfers_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/treasury/outbound_transfers", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.treasury.outbound_transfers.create_async( { "financial_account": "fa_xxxxxxxxxxxxx", "destination_payment_method": "pm_xxxxxxxxxxxxx", "amount": 500, "currency": "usd", "description": "OutboundTransfer to my external bank account", } ) http_client_mock.assert_requested( "post", path="/v1/treasury/outbound_transfers", query_string="", api_base="https://api.stripe.com", post_data="financial_account=fa_xxxxxxxxxxxxx&destination_payment_method=pm_xxxxxxxxxxxxx&amount=500¤cy=usd&description=OutboundTransfer%20to%20my%20external%20bank%20account", ) def test_treasury_received_credits_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.treasury.ReceivedCredit.list( financial_account="fa_xxxxxxxxxxxxx", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/treasury/received_credits", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", ) def test_treasury_received_credits_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/treasury/received_credits", "financial_account=fa_xxxxxxxxxxxxx&limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.treasury.received_credits.list( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, } ) http_client_mock.assert_requested( "get", path="/v1/treasury/received_credits", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_treasury_received_credits_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.treasury.ReceivedCredit.list_async( financial_account="fa_xxxxxxxxxxxxx", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/treasury/received_credits", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", ) @pytest.mark.anyio async def test_treasury_received_credits_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/treasury/received_credits", "financial_account=fa_xxxxxxxxxxxxx&limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.treasury.received_credits.list_async( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, } ) http_client_mock.assert_requested( "get", path="/v1/treasury/received_credits", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", api_base="https://api.stripe.com", ) def test_treasury_received_credits_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.treasury.ReceivedCredit.retrieve("rc_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/received_credits/rc_xxxxxxxxxxxxx", query_string="", ) def test_treasury_received_credits_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/treasury/received_credits/rc_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.treasury.received_credits.retrieve("rc_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/received_credits/rc_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_treasury_received_credits_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.treasury.ReceivedCredit.retrieve_async("rc_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/received_credits/rc_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_treasury_received_credits_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/treasury/received_credits/rc_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.treasury.received_credits.retrieve_async( "rc_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/treasury/received_credits/rc_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_treasury_received_debits_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.treasury.ReceivedDebit.list( financial_account="fa_xxxxxxxxxxxxx", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/treasury/received_debits", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", ) def test_treasury_received_debits_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/treasury/received_debits", "financial_account=fa_xxxxxxxxxxxxx&limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.treasury.received_debits.list( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, } ) http_client_mock.assert_requested( "get", path="/v1/treasury/received_debits", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_treasury_received_debits_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.treasury.ReceivedDebit.list_async( financial_account="fa_xxxxxxxxxxxxx", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/treasury/received_debits", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", ) @pytest.mark.anyio async def test_treasury_received_debits_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/treasury/received_debits", "financial_account=fa_xxxxxxxxxxxxx&limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.treasury.received_debits.list_async( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, } ) http_client_mock.assert_requested( "get", path="/v1/treasury/received_debits", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", api_base="https://api.stripe.com", ) def test_treasury_received_debits_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.treasury.ReceivedDebit.retrieve("rd_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/received_debits/rd_xxxxxxxxxxxxx", query_string="", ) def test_treasury_received_debits_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/treasury/received_debits/rd_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.treasury.received_debits.retrieve("rd_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/received_debits/rd_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_treasury_received_debits_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.treasury.ReceivedDebit.retrieve_async("rd_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/received_debits/rd_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_treasury_received_debits_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/treasury/received_debits/rd_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.treasury.received_debits.retrieve_async( "rd_xxxxxxxxxxxxx" ) http_client_mock.assert_requested( "get", path="/v1/treasury/received_debits/rd_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_treasury_transaction_entries_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.treasury.TransactionEntry.list( financial_account="fa_xxxxxxxxxxxxx", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/treasury/transaction_entries", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", ) def test_treasury_transaction_entries_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/treasury/transaction_entries", "financial_account=fa_xxxxxxxxxxxxx&limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.treasury.transaction_entries.list( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, } ) http_client_mock.assert_requested( "get", path="/v1/treasury/transaction_entries", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_treasury_transaction_entries_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.treasury.TransactionEntry.list_async( financial_account="fa_xxxxxxxxxxxxx", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/treasury/transaction_entries", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", ) @pytest.mark.anyio async def test_treasury_transaction_entries_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/treasury/transaction_entries", "financial_account=fa_xxxxxxxxxxxxx&limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.treasury.transaction_entries.list_async( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, } ) http_client_mock.assert_requested( "get", path="/v1/treasury/transaction_entries", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", api_base="https://api.stripe.com", ) def test_treasury_transaction_entries_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.treasury.TransactionEntry.retrieve("trxne_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/transaction_entries/trxne_xxxxxxxxxxxxx", query_string="", ) def test_treasury_transaction_entries_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/treasury/transaction_entries/trxne_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.treasury.transaction_entries.retrieve("trxne_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/transaction_entries/trxne_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_treasury_transaction_entries_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.treasury.TransactionEntry.retrieve_async( "trxne_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/treasury/transaction_entries/trxne_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_treasury_transaction_entries_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/treasury/transaction_entries/trxne_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.treasury.transaction_entries.retrieve_async( "trxne_xxxxxxxxxxxxx", ) http_client_mock.assert_requested( "get", path="/v1/treasury/transaction_entries/trxne_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_treasury_transactions_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.treasury.Transaction.list( financial_account="fa_xxxxxxxxxxxxx", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/treasury/transactions", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", ) def test_treasury_transactions_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/treasury/transactions", "financial_account=fa_xxxxxxxxxxxxx&limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.treasury.transactions.list( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, } ) http_client_mock.assert_requested( "get", path="/v1/treasury/transactions", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_treasury_transactions_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.treasury.Transaction.list_async( financial_account="fa_xxxxxxxxxxxxx", limit=3, ) http_client_mock.assert_requested( "get", path="/v1/treasury/transactions", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", ) @pytest.mark.anyio async def test_treasury_transactions_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/treasury/transactions", "financial_account=fa_xxxxxxxxxxxxx&limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.treasury.transactions.list_async( { "financial_account": "fa_xxxxxxxxxxxxx", "limit": 3, } ) http_client_mock.assert_requested( "get", path="/v1/treasury/transactions", query_string="financial_account=fa_xxxxxxxxxxxxx&limit=3", api_base="https://api.stripe.com", ) def test_treasury_transactions_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.treasury.Transaction.retrieve("trxn_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/transactions/trxn_xxxxxxxxxxxxx", query_string="", ) def test_treasury_transactions_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/treasury/transactions/trxn_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.treasury.transactions.retrieve("trxn_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/transactions/trxn_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_treasury_transactions_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.treasury.Transaction.retrieve_async("trxn_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/transactions/trxn_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_treasury_transactions_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/treasury/transactions/trxn_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.treasury.transactions.retrieve_async("trxn_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/treasury/transactions/trxn_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_webhook_endpoints_delete( self, http_client_mock: HTTPClientMock ) -> None: stripe.WebhookEndpoint.delete("we_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/webhook_endpoints/we_xxxxxxxxxxxxx", query_string="", ) def test_webhook_endpoints_delete_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/webhook_endpoints/we_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.webhook_endpoints.delete("we_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/webhook_endpoints/we_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_webhook_endpoints_delete_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.WebhookEndpoint.delete_async("we_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/webhook_endpoints/we_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_webhook_endpoints_delete_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "delete", "/v1/webhook_endpoints/we_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.webhook_endpoints.delete_async("we_xxxxxxxxxxxxx") http_client_mock.assert_requested( "delete", path="/v1/webhook_endpoints/we_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_webhook_endpoints_get( self, http_client_mock: HTTPClientMock ) -> None: stripe.WebhookEndpoint.list(limit=3) http_client_mock.assert_requested( "get", path="/v1/webhook_endpoints", query_string="limit=3", ) def test_webhook_endpoints_get_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/webhook_endpoints", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.webhook_endpoints.list({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/webhook_endpoints", query_string="limit=3", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_webhook_endpoints_get_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.WebhookEndpoint.list_async(limit=3) http_client_mock.assert_requested( "get", path="/v1/webhook_endpoints", query_string="limit=3", ) @pytest.mark.anyio async def test_webhook_endpoints_get_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/webhook_endpoints", "limit=3", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.webhook_endpoints.list_async({"limit": 3}) http_client_mock.assert_requested( "get", path="/v1/webhook_endpoints", query_string="limit=3", api_base="https://api.stripe.com", ) def test_webhook_endpoints_get_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.WebhookEndpoint.retrieve("we_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/webhook_endpoints/we_xxxxxxxxxxxxx", query_string="", ) def test_webhook_endpoints_get_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/webhook_endpoints/we_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.webhook_endpoints.retrieve("we_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/webhook_endpoints/we_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) @pytest.mark.anyio async def test_webhook_endpoints_get_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.WebhookEndpoint.retrieve_async("we_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/webhook_endpoints/we_xxxxxxxxxxxxx", query_string="", ) @pytest.mark.anyio async def test_webhook_endpoints_get_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "get", "/v1/webhook_endpoints/we_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.webhook_endpoints.retrieve_async("we_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/webhook_endpoints/we_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", ) def test_webhook_endpoints_post( self, http_client_mock: HTTPClientMock ) -> None: stripe.WebhookEndpoint.create( url="https://example.com/my/webhook/endpoint", enabled_events=["charge.failed", "charge.succeeded"], ) http_client_mock.assert_requested( "post", path="/v1/webhook_endpoints", query_string="", post_data="url=https%3A%2F%2Fexample.com%2Fmy%2Fwebhook%2Fendpoint&enabled_events[0]=charge.failed&enabled_events[1]=charge.succeeded", ) def test_webhook_endpoints_post_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/webhook_endpoints", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.webhook_endpoints.create( { "url": "https://example.com/my/webhook/endpoint", "enabled_events": ["charge.failed", "charge.succeeded"], } ) http_client_mock.assert_requested( "post", path="/v1/webhook_endpoints", query_string="", api_base="https://api.stripe.com", post_data="url=https%3A%2F%2Fexample.com%2Fmy%2Fwebhook%2Fendpoint&enabled_events[0]=charge.failed&enabled_events[1]=charge.succeeded", ) @pytest.mark.anyio async def test_webhook_endpoints_post_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.WebhookEndpoint.create_async( url="https://example.com/my/webhook/endpoint", enabled_events=["charge.failed", "charge.succeeded"], ) http_client_mock.assert_requested( "post", path="/v1/webhook_endpoints", query_string="", post_data="url=https%3A%2F%2Fexample.com%2Fmy%2Fwebhook%2Fendpoint&enabled_events[0]=charge.failed&enabled_events[1]=charge.succeeded", ) @pytest.mark.anyio async def test_webhook_endpoints_post_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/webhook_endpoints", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.webhook_endpoints.create_async( { "url": "https://example.com/my/webhook/endpoint", "enabled_events": ["charge.failed", "charge.succeeded"], } ) http_client_mock.assert_requested( "post", path="/v1/webhook_endpoints", query_string="", api_base="https://api.stripe.com", post_data="url=https%3A%2F%2Fexample.com%2Fmy%2Fwebhook%2Fendpoint&enabled_events[0]=charge.failed&enabled_events[1]=charge.succeeded", ) def test_webhook_endpoints_post_2( self, http_client_mock: HTTPClientMock ) -> None: stripe.WebhookEndpoint.modify( "we_xxxxxxxxxxxxx", url="https://example.com/new_endpoint", ) http_client_mock.assert_requested( "post", path="/v1/webhook_endpoints/we_xxxxxxxxxxxxx", query_string="", post_data="url=https%3A%2F%2Fexample.com%2Fnew_endpoint", ) def test_webhook_endpoints_post_2_service( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/webhook_endpoints/we_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) client.webhook_endpoints.update( "we_xxxxxxxxxxxxx", {"url": "https://example.com/new_endpoint"}, ) http_client_mock.assert_requested( "post", path="/v1/webhook_endpoints/we_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="url=https%3A%2F%2Fexample.com%2Fnew_endpoint", ) @pytest.mark.anyio async def test_webhook_endpoints_post_2_async( self, http_client_mock: HTTPClientMock ) -> None: await stripe.WebhookEndpoint.modify_async( "we_xxxxxxxxxxxxx", url="https://example.com/new_endpoint", ) http_client_mock.assert_requested( "post", path="/v1/webhook_endpoints/we_xxxxxxxxxxxxx", query_string="", post_data="url=https%3A%2F%2Fexample.com%2Fnew_endpoint", ) @pytest.mark.anyio async def test_webhook_endpoints_post_2_service_async( self, http_client_mock: HTTPClientMock ) -> None: http_client_mock.stub_request( "post", "/v1/webhook_endpoints/we_xxxxxxxxxxxxx", ) client = StripeClient( "sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) await client.webhook_endpoints.update_async( "we_xxxxxxxxxxxxx", {"url": "https://example.com/new_endpoint"}, ) http_client_mock.assert_requested( "post", path="/v1/webhook_endpoints/we_xxxxxxxxxxxxx", query_string="", api_base="https://api.stripe.com", post_data="url=https%3A%2F%2Fexample.com%2Fnew_endpoint", ) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/test_http_client.py0000644000175100001770000017546314637354563017634 0ustar00runnerdockerfrom typing import Any from typing_extensions import Type from unittest.mock import call import pytest import json import sys if sys.version_info >= (3, 8): from unittest.mock import AsyncMock else: from mock import AsyncMock import stripe from stripe import _http_client from stripe._encode import _api_encode from stripe import APIConnectionError import urllib3 from stripe import _util VALID_API_METHODS = ("get", "post", "delete") class StripeClientTestCase(object): REQUEST_LIBRARIES = [ ("urlfetch", "stripe._http_client.urlfetch"), ("requests", "stripe._http_client.requests"), ("pycurl", "stripe._http_client.pycurl"), ("urllib.request", "stripe._http_client.urllibrequest"), ("httpx", "stripe._http_client.httpx"), ("aiohttp", "stripe._http_client.aiohttp"), ] @pytest.fixture def request_mocks(self, mocker): request_mocks = {} for lib, mockpath in self.REQUEST_LIBRARIES: request_mocks[lib] = mocker.patch(mockpath) return request_mocks class TestNewDefaultHttpClient(StripeClientTestCase): def check_default(self, none_libs, expected): for lib in none_libs: setattr(_http_client, lib, None) inst = _http_client.new_default_http_client() assert isinstance(inst, expected) def test_new_default_http_client_urlfetch(self, request_mocks): self.check_default((), _http_client.UrlFetchClient) def test_new_default_http_client_requests(self, request_mocks): self.check_default(("urlfetch",), _http_client.RequestsClient) def test_new_default_http_client_pycurl(self, request_mocks): self.check_default(("urlfetch", "requests"), _http_client.PycurlClient) def test_new_default_http_client_urllib2(self, request_mocks): self.check_default( ("urlfetch", "requests", "pycurl"), _http_client.Urllib2Client, ) class TestNewHttpClientAsyncFallback(StripeClientTestCase): def check_default(self, none_libs, expected): for lib in none_libs: setattr(_http_client, lib, None) inst = _http_client.new_http_client_async_fallback() assert isinstance(inst, expected) def test_new_http_client_async_fallback_httpx(self, request_mocks): self.check_default((), _http_client.HTTPXClient) def test_new_http_client_async_fallback_aiohttp(self, request_mocks): self.check_default( (("httpx"),), _http_client.AIOHTTPClient, ) def test_new_http_client_async_fallback_no_import_found( self, request_mocks ): self.check_default( ( ("httpx"), ("aiohttp"), ), _http_client.NoImportFoundAsyncClient, ) class TestRetrySleepTimeDefaultHttpClient(StripeClientTestCase): from contextlib import contextmanager def assert_sleep_times(self, client, expected): until = len(expected) actual = list( map(lambda i: client._sleep_time_seconds(i + 1), range(until)) ) assert expected == actual @contextmanager def mock_max_delay(self, new_value): original_value = _http_client.HTTPClient.MAX_DELAY _http_client.HTTPClient.MAX_DELAY = new_value try: yield self finally: _http_client.HTTPClient.MAX_DELAY = original_value def test_sleep_time_exponential_back_off(self): client = _http_client.new_default_http_client() client._add_jitter_time = lambda sleep_seconds: sleep_seconds with self.mock_max_delay(10): self.assert_sleep_times(client, []) def test_initial_delay_as_minimum(self): client = _http_client.new_default_http_client() client._add_jitter_time = lambda sleep_seconds: sleep_seconds * 0.001 initial_delay = _http_client.HTTPClient.INITIAL_DELAY self.assert_sleep_times(client, [initial_delay] * 5) def test_maximum_delay(self): client = _http_client.new_default_http_client() client._add_jitter_time = lambda sleep_seconds: sleep_seconds max_delay = _http_client.HTTPClient.MAX_DELAY expected = [0.5, 1.0, max_delay, max_delay, max_delay] self.assert_sleep_times(client, expected) def test_retry_after_header(self): client = _http_client.new_default_http_client() client._add_jitter_time = lambda sleep_seconds: sleep_seconds # Prefer retry-after if it's bigger assert 30 == client._sleep_time_seconds( 2, (None, 409, {"retry-after": "30"}) ) # Prefer default if it's bigger assert 2 == client._sleep_time_seconds( 3, (None, 409, {"retry-after": "1"}) ) # Ignore crazy-big values assert 1 == client._sleep_time_seconds( 2, (None, 409, {"retry-after": "300"}) ) def test_randomness_added(self): client = _http_client.new_default_http_client() random_value = 0.8 client._add_jitter_time = ( lambda sleep_seconds: sleep_seconds * random_value ) base_value = _http_client.HTTPClient.INITIAL_DELAY * random_value with self.mock_max_delay(10): expected = [ _http_client.HTTPClient.INITIAL_DELAY, base_value * 2, base_value * 4, base_value * 8, base_value * 16, ] self.assert_sleep_times(client, expected) def test_jitter_has_randomness_but_within_range(self): client = _http_client.new_default_http_client() jittered_ones = set( map(lambda _: client._add_jitter_time(1), list(range(100))) ) assert len(jittered_ones) > 1 assert all(0.5 <= val <= 1 for val in jittered_ones) class TestRetryConditionsDefaultHttpClient(StripeClientTestCase): def test_should_retry_on_codes(self): one_xx = list(range(100, 104)) two_xx = list(range(200, 209)) three_xx = list(range(300, 308)) four_xx = list(range(400, 431)) client = _http_client.new_default_http_client() codes = one_xx + two_xx + three_xx + four_xx codes.remove(409) # These status codes should not be retried by default. for code in codes: assert ( client._should_retry( (None, code, None), None, 0, max_network_retries=1 ) is False ) # These status codes should be retried by default. assert ( client._should_retry( (None, 409, None), None, 0, max_network_retries=1 ) is True ) assert ( client._should_retry( (None, 500, None), None, 0, max_network_retries=1 ) is True ) assert ( client._should_retry( (None, 503, None), None, 0, max_network_retries=1 ) is True ) def test_should_retry_on_error(self, mocker): client = _http_client.new_default_http_client() api_connection_error = mocker.Mock() api_connection_error.should_retry = True assert ( client._should_retry( None, api_connection_error, 0, max_network_retries=1 ) is True ) api_connection_error.should_retry = False assert ( client._should_retry( None, api_connection_error, 0, max_network_retries=1 ) is False ) def test_should_retry_on_stripe_should_retry_true(self, mocker): client = _http_client.new_default_http_client() headers = {"stripe-should-retry": "true"} # Ordinarily, we would not retry a 400, but with the header as true, we would. assert ( client._should_retry( (None, 400, {}), None, 0, max_network_retries=1 ) is False ) assert ( client._should_retry( (None, 400, headers), None, 0, max_network_retries=1 ) is True ) def test_should_retry_on_stripe_should_retry_false(self, mocker): client = _http_client.new_default_http_client() headers = {"stripe-should-retry": "false"} # Ordinarily, we would retry a 500, but with the header as false, we would not. assert ( client._should_retry( (None, 500, {}), None, 0, max_network_retries=1 ) is True ) assert ( client._should_retry( (None, 500, headers), None, 0, max_network_retries=1 ) is False ) def test_should_retry_on_num_retries(self, mocker): client = _http_client.new_default_http_client() max_test_retries = 10 api_connection_error = mocker.Mock() api_connection_error.should_retry = True assert ( client._should_retry( None, api_connection_error, max_test_retries + 1, max_network_retries=max_test_retries, ) is False ) assert ( client._should_retry( (None, 409, None), None, max_test_retries + 1, max_network_retries=max_test_retries, ) is False ) class TestHTTPClient(object): @pytest.fixture(autouse=True) def setup_stripe(self): orig_attrs = {"enable_telemetry": stripe.enable_telemetry} stripe.enable_telemetry = False yield stripe.enable_telemetry = orig_attrs["enable_telemetry"] def test_sends_telemetry_on_second_request(self, mocker): class TestClient(_http_client.HTTPClient): pass stripe.enable_telemetry = True url = "http://fake.url" client = TestClient() client.request = mocker.MagicMock( return_value=["", 200, {"Request-Id": "req_123"}] ) _, code, _ = client.request_with_retries("get", url, {}, None) assert code == 200 client.request.assert_called_with("get", url, {}, None) client.request = mocker.MagicMock( return_value=["", 200, {"Request-Id": "req_234"}] ) _, code, _ = client.request_with_retries("get", url, {}, None) assert code == 200 args, _ = client.request.call_args assert "X-Stripe-Client-Telemetry" in args[2] telemetry = json.loads(args[2]["X-Stripe-Client-Telemetry"]) assert telemetry["last_request_metrics"]["request_id"] == "req_123" class ClientTestBase(object): REQUEST_CLIENT: Type[_http_client.HTTPClient] @pytest.fixture def request_mock(self, request_mocks): return request_mocks[self.REQUEST_CLIENT.name] @property def valid_url(self, path="/foo"): return "https://api.stripe.com%s" % (path,) def make_request(self, method, url, headers, post_data): client = self.REQUEST_CLIENT(verify_ssl_certs=True) return client.request_with_retries(method, url, headers, post_data) def make_request_stream(self, method, url, headers, post_data): client = self.REQUEST_CLIENT(verify_ssl_certs=True) return client.request_stream_with_retries( method, url, headers, post_data ) def make_request_async(self, method, url, headers, post_data): client = self.REQUEST_CLIENT(verify_ssl_certs=True) return client.request_with_retries_async( method, url, headers, post_data ) async def make_request_stream_async(self, method, url, headers, post_data): client = self.REQUEST_CLIENT(verify_ssl_certs=True) return await client.request_stream_with_retries_async( method, url, headers, post_data ) @pytest.fixture def mock_response(self): def mock_response(mock, body, code): raise NotImplementedError( "You must implement this in your test subclass" ) return mock_response @pytest.fixture def mock_error(self): def mock_error(mock, error): raise NotImplementedError( "You must implement this in your test subclass" ) return mock_error @pytest.fixture def check_call(self): def check_call( mock, method, abs_url, headers, params, is_streaming=False ): raise NotImplementedError( "You must implement this in your test subclass" ) return check_call def test_request(self, request_mock, mock_response, check_call): mock_response(request_mock, '{"foo": "baz"}', 200) for method in VALID_API_METHODS: abs_url = self.valid_url data = "" if method != "post": abs_url = "%s?%s" % (abs_url, data) data = None headers = {"my-header": "header val"} body, code, _ = self.make_request(method, abs_url, headers, data) assert code == 200 assert body == '{"foo": "baz"}' check_call(request_mock, method, abs_url, data, headers) def test_request_stream( self, mocker, request_mock, mock_response, check_call ): for method in VALID_API_METHODS: mock_response(request_mock, "some streamed content", 200) abs_url = self.valid_url data = "" if method != "post": abs_url = "%s?%s" % (abs_url, data) data = None headers = {"my-header": "header val"} stream, code, _ = self.make_request_stream( method, abs_url, headers, data ) assert code == 200 body_content = None # Here we need to convert and align all content on one type (string) # as some clients return a string stream others a byte stream. if hasattr(stream, "read"): body_content = stream.read() if hasattr(body_content, "decode"): body_content = body_content.decode("utf-8") elif hasattr(stream, "__iter__"): body_content = "".join( [chunk.decode("utf-8") for chunk in stream] ) assert body_content == "some streamed content" mocker.resetall() def test_exception(self, request_mock, mock_error): mock_error(request_mock) with pytest.raises(APIConnectionError): self.make_request("get", self.valid_url, {}, None) class RequestsVerify(object): def __eq__(self, other): return other and other.endswith("stripe/data/ca-certificates.crt") class TestRequestsClient(StripeClientTestCase, ClientTestBase): REQUEST_CLIENT: Type[_http_client.RequestsClient] = ( _http_client.RequestsClient ) @pytest.fixture def session(self, mocker, request_mocks): return mocker.MagicMock() @pytest.fixture def mock_response(self, mocker, session): def mock_response(mock, body, code): result = mocker.Mock() result.content = body result.status_code = code result.headers = {} result.raw = urllib3.response.HTTPResponse( body=_util.io.BytesIO(str.encode(body)), preload_content=False, status=code, ) session.request = mocker.MagicMock(return_value=result) mock.Session = mocker.MagicMock(return_value=session) return mock_response @pytest.fixture def mock_error(self, mocker, session): def mock_error(mock): # The first kind of request exceptions we catch mock.exceptions.SSLError = Exception session.request.side_effect = mock.exceptions.SSLError() mock.Session = mocker.MagicMock(return_value=session) return mock_error # Note that unlike other modules, we don't use the "mock" argument here # because we need to run the request call against the internal mock # session. @pytest.fixture def check_call(self, session): def check_call( mock, method, url, post_data, headers, is_streaming=False, timeout=80, times=None, ): times = times or 1 pargs = (method, url) kwargs = { "headers": headers, "data": post_data, "verify": RequestsVerify(), "proxies": {"http": "http://slap/", "https": "http://slap/"}, "timeout": timeout, } if is_streaming: kwargs["stream"] = True calls = [call(*pargs, **kwargs) for _ in range(times)] session.request.assert_has_calls(calls) return check_call def make_request(self, method, url, headers, post_data, timeout=80): client = self.REQUEST_CLIENT( verify_ssl_certs=True, timeout=timeout, proxy="http://slap/" ) return client.request_with_retries(method, url, headers, post_data) def make_request_stream(self, method, url, headers, post_data, timeout=80): client = self.REQUEST_CLIENT( verify_ssl_certs=True, timeout=timeout, proxy="http://slap/" ) return client.request_stream_with_retries( method, url, headers, post_data ) def test_timeout(self, request_mock, mock_response, check_call): headers = {"my-header": "header val"} data = "" mock_response(request_mock, '{"foo": "baz"}', 200) self.make_request("POST", self.valid_url, headers, data, timeout=5) check_call(None, "POST", self.valid_url, data, headers, timeout=5) def test_request_stream_forwards_stream_param( self, mocker, request_mock, mock_response, check_call ): mock_response(request_mock, "some streamed content", 200) self.make_request_stream("GET", self.valid_url, {}, None) check_call( None, "GET", self.valid_url, None, {}, is_streaming=True, ) class TestRequestClientRetryBehavior(TestRequestsClient): @pytest.fixture def response(self, mocker): def response(code=200, headers={}): result = mocker.Mock() result.content = "{}" result.status_code = code result.headers = headers result.raw = urllib3.response.HTTPResponse( body=_util.io.BytesIO(str.encode(result.content)), preload_content=False, status=code, ) return result return response @pytest.fixture def mock_retry(self, mocker, session, request_mock): def mock_retry(retry_error_num=0, no_retry_error_num=0, responses=[]): # Mocking classes of exception we catch. Any group of exceptions # with the same inheritance pattern will work request_root_error_class = Exception request_mock.exceptions.RequestException = request_root_error_class no_retry_parent_class = LookupError no_retry_child_class = KeyError request_mock.exceptions.SSLError = no_retry_parent_class no_retry_errors = [no_retry_child_class()] * no_retry_error_num retry_parent_class = EnvironmentError retry_child_class = IOError request_mock.exceptions.Timeout = retry_parent_class request_mock.exceptions.ConnectionError = retry_parent_class retry_errors = [retry_child_class()] * retry_error_num # Include mock responses as possible side-effects # to simulate returning proper results after some exceptions session.request.side_effect = ( retry_errors + no_retry_errors + responses ) request_mock.Session = mocker.MagicMock(return_value=session) return request_mock return mock_retry @pytest.fixture def check_call_numbers(self, check_call): valid_url = self.valid_url def check_call_numbers(times, is_streaming=False): check_call( None, "GET", valid_url, None, {}, times=times, is_streaming=is_streaming, ) return check_call_numbers def max_retries(self): return 3 def make_client(self): client = self.REQUEST_CLIENT( verify_ssl_certs=True, timeout=80, proxy="http://slap/" ) # Override sleep time to speed up tests client._sleep_time_seconds = lambda num_retries, response=None: 0.0001 # Override configured max retries return client def make_request(self, *args, **kwargs): client = self.make_client() return client.request_with_retries( "GET", self.valid_url, {}, None, self.max_retries() ) def make_request_stream(self, *args, **kwargs): client = self.make_client() return client.request_stream_with_retries( "GET", self.valid_url, {}, None, self.max_retries() ) def test_retry_error_until_response( self, mock_retry, response, check_call_numbers ): mock_retry(retry_error_num=1, responses=[response(code=202)]) _, code, _ = self.make_request() assert code == 202 check_call_numbers(2) def test_retry_error_until_exceeded( self, mock_retry, response, check_call_numbers ): mock_retry(retry_error_num=self.max_retries()) with pytest.raises(APIConnectionError): self.make_request() check_call_numbers(self.max_retries()) def test_no_retry_error(self, mock_retry, response, check_call_numbers): mock_retry(no_retry_error_num=self.max_retries()) with pytest.raises(APIConnectionError): self.make_request() check_call_numbers(1) def test_retry_codes(self, mock_retry, response, check_call_numbers): mock_retry(responses=[response(code=409), response(code=202)]) _, code, _ = self.make_request() assert code == 202 check_call_numbers(2) def test_retry_codes_until_exceeded( self, mock_retry, response, check_call_numbers ): mock_retry(responses=[response(code=409)] * (self.max_retries() + 1)) _, code, _ = self.make_request() assert code == 409 check_call_numbers(self.max_retries() + 1) def test_retry_request_stream_error_until_response( self, mock_retry, response, check_call_numbers ): mock_retry(retry_error_num=1, responses=[response(code=202)]) _, code, _ = self.make_request_stream() assert code == 202 check_call_numbers(2, is_streaming=True) def test_retry_request_stream_error_until_exceeded( self, mock_retry, response, check_call_numbers ): mock_retry(retry_error_num=self.max_retries()) with pytest.raises(APIConnectionError): self.make_request_stream() check_call_numbers(self.max_retries(), is_streaming=True) def test_no_retry_request_stream_error( self, mock_retry, response, check_call_numbers ): mock_retry(no_retry_error_num=self.max_retries()) with pytest.raises(APIConnectionError): self.make_request_stream() check_call_numbers(1, is_streaming=True) def test_retry_request_stream_codes( self, mock_retry, response, check_call_numbers ): mock_retry(responses=[response(code=409), response(code=202)]) _, code, _ = self.make_request_stream() assert code == 202 check_call_numbers(2, is_streaming=True) def test_retry_request_stream_codes_until_exceeded( self, mock_retry, response, check_call_numbers ): mock_retry(responses=[response(code=409)] * (self.max_retries() + 1)) _, code, _ = self.make_request_stream() assert code == 409 check_call_numbers(self.max_retries() + 1, is_streaming=True) @pytest.fixture def connection_error(self, session): client = self.REQUEST_CLIENT() def connection_error(given_exception): with pytest.raises(APIConnectionError) as error: client._handle_request_error(given_exception) return error.value return connection_error def test_handle_request_error_should_retry( self, connection_error, mock_retry ): request_mock = mock_retry() error = connection_error(request_mock.exceptions.Timeout()) assert error.should_retry error = connection_error(request_mock.exceptions.ConnectionError()) assert error.should_retry def test_handle_request_error_should_not_retry( self, connection_error, mock_retry ): request_mock = mock_retry() error = connection_error(request_mock.exceptions.SSLError()) assert error.should_retry is False assert "not verify Stripe's SSL certificate" in error.user_message error = connection_error(request_mock.exceptions.RequestException()) assert error.should_retry is False # Mimic non-requests exception as not being children of Exception, # See mock_retry for the exceptions setup error = connection_error(BaseException("")) assert error.should_retry is False assert "configuration issue locally" in error.user_message # Skip inherited basic requests client tests def test_request(self, request_mock, mock_response, check_call): pass def test_exception(self, request_mock, mock_error): pass def test_timeout(self, request_mock, mock_response, check_call): pass class TestUrlFetchClient(StripeClientTestCase, ClientTestBase): REQUEST_CLIENT = _http_client.UrlFetchClient @pytest.fixture def mock_response(self, mocker): def mock_response(mock, body, code): result = mocker.Mock() result.content = body result.status_code = code result.headers = {} mock.fetch = mocker.Mock(return_value=result) return result return mock_response @pytest.fixture def mock_error(self): def mock_error(mock): mock.Error = mock.InvalidURLError = Exception mock.fetch.side_effect = mock.InvalidURLError() return mock_error @pytest.fixture def check_call(self): def check_call( mock, method, url, post_data, headers, is_streaming=False ): mock.fetch.assert_called_with( url=url, method=method, headers=headers, validate_certificate=True, deadline=55, payload=post_data, ) return check_call class TestUrllib2Client(StripeClientTestCase, ClientTestBase): REQUEST_CLIENT: Type[_http_client.Urllib2Client] = ( _http_client.Urllib2Client ) request_object: Any def make_client(self, proxy): self.client = self.REQUEST_CLIENT(verify_ssl_certs=True, proxy=proxy) self.proxy = proxy def make_request(self, method, url, headers, post_data, proxy=None): self.make_client(proxy) return self.client.request_with_retries( method, url, headers, post_data ) def make_request_stream(self, method, url, headers, post_data, proxy=None): self.make_client(proxy) return self.client.request_stream_with_retries( method, url, headers, post_data ) @pytest.fixture def mock_response(self, mocker): def mock_response(mock, body, code): response = mocker.Mock() response.read = mocker.MagicMock(return_value=body) response.code = code response.info = mocker.Mock(return_value={}) self.request_object = mocker.Mock() mock.Request = mocker.Mock(return_value=self.request_object) mock.urlopen = mocker.Mock(return_value=response) opener = mocker.Mock() opener.open = mocker.Mock(return_value=response) mock.build_opener = mocker.Mock(return_value=opener) mock.build_opener.open = opener.open mock.ProxyHandler = mocker.Mock(return_value=opener) mock.urlopen = mocker.Mock(return_value=response) return mock_response @pytest.fixture def mock_error(self): def mock_error(mock): mock.urlopen.side_effect = ValueError mock.build_opener().open.side_effect = ValueError mock.build_opener.reset_mock() return mock_error @pytest.fixture def check_call(self): def check_call( mock, method, url, post_data, headers, is_streaming=False ): if isinstance(post_data, str): post_data = post_data.encode("utf-8") mock.Request.assert_called_with(url, post_data, headers) if self.client._proxy: assert isinstance(self.client._proxy, dict) mock.ProxyHandler.assert_called_with(self.client._proxy) mock.build_opener.open.assert_called_with(self.request_object) assert not mock.urlopen.called if not self.client._proxy: mock.urlopen.assert_called_with(self.request_object) assert not mock.build_opener.called assert not mock.build_opener.open.called return check_call class TestUrllib2ClientHttpsProxy(TestUrllib2Client): def make_request(self, method, url, headers, post_data, proxy=None): return super(TestUrllib2ClientHttpsProxy, self).make_request( method, url, headers, post_data, {"http": "http://slap/", "https": "http://slap/"}, ) def make_request_stream(self, method, url, headers, post_data, proxy=None): return super(TestUrllib2ClientHttpsProxy, self).make_request_stream( method, url, headers, post_data, {"http": "http://slap/", "https": "http://slap/"}, ) class TestUrllib2ClientHttpProxy(TestUrllib2Client): def make_request(self, method, url, headers, post_data, proxy=None): return super(TestUrllib2ClientHttpProxy, self).make_request( method, url, headers, post_data, "http://slap/" ) def make_request_stream(self, method, url, headers, post_data, proxy=None): return super(TestUrllib2ClientHttpProxy, self).make_request_stream( method, url, headers, post_data, "http://slap/" ) class TestPycurlClient(StripeClientTestCase, ClientTestBase): REQUEST_CLIENT: Type[_http_client.PycurlClient] = _http_client.PycurlClient def make_client(self, proxy): self.client = self.REQUEST_CLIENT(verify_ssl_certs=True, proxy=proxy) self.proxy = proxy def make_request(self, method, url, headers, post_data, proxy=None): self.make_client(proxy) return self.client.request_with_retries( method, url, headers, post_data ) def make_request_stream(self, method, url, headers, post_data, proxy=None): self.make_client(proxy) return self.client.request_stream_with_retries( method, url, headers, post_data ) @pytest.fixture def curl_mock(self, mocker): return mocker.Mock() @pytest.fixture def request_mock(self, mocker, request_mocks, curl_mock): lib_mock = request_mocks[self.REQUEST_CLIENT.name] lib_mock.Curl = mocker.Mock(return_value=curl_mock) return curl_mock @pytest.fixture def bio_mock(self, mocker): bio_patcher = mocker.patch("stripe.util.io.BytesIO") bio_mock = mocker.Mock() bio_patcher.return_value = bio_mock return bio_mock @pytest.fixture def mock_response(self, mocker, bio_mock): def mock_response(mock, body, code): bio_mock.getvalue = mocker.MagicMock( return_value=body.encode("utf-8") ) bio_mock.read = mocker.MagicMock(return_value=body.encode("utf-8")) mock.getinfo.return_value = code return mock_response @pytest.fixture def mock_error(self): def mock_error(mock): class FakeException(BaseException): @property def args(self): return ("foo", "bar") _http_client.pycurl.error = FakeException mock.perform.side_effect = _http_client.pycurl.error return mock_error @pytest.fixture def check_call(self, request_mocks): def check_call( mock, method, url, post_data, headers, is_streaming=False ): lib_mock = request_mocks[self.REQUEST_CLIENT.name] if self.client._proxy: proxy = self.client._get_proxy(url) assert proxy is not None if proxy.hostname: mock.setopt.assert_any_call(lib_mock.PROXY, proxy.hostname) if proxy.port: mock.setopt.assert_any_call(lib_mock.PROXYPORT, proxy.port) if proxy.username or proxy.password: mock.setopt.assert_any_call( lib_mock.PROXYUSERPWD, "%s:%s" % (proxy.username, proxy.password), ) # A note on methodology here: we don't necessarily need to verify # _every_ call to setopt, but check a few of them to make sure the # right thing is happening. Keep an eye specifically on conditional # statements where things are more likely to go wrong. mock.setopt.assert_any_call(lib_mock.NOSIGNAL, 1) mock.setopt.assert_any_call(lib_mock.URL, url) if method == "get": mock.setopt.assert_any_call(lib_mock.HTTPGET, 1) elif method == "post": mock.setopt.assert_any_call(lib_mock.POST, 1) else: mock.setopt.assert_any_call( lib_mock.CUSTOMREQUEST, method.upper() ) mock.perform.assert_any_call() return check_call class TestPycurlClientHttpProxy(TestPycurlClient): def make_request(self, method, url, headers, post_data, proxy=None): return super(TestPycurlClientHttpProxy, self).make_request( method, url, headers, post_data, "http://user:withPwd@slap:8888/", ) def make_request_stream(self, method, url, headers, post_data, proxy=None): return super(TestPycurlClientHttpProxy, self).make_request_stream( method, url, headers, post_data, "http://user:withPwd@slap:8888/", ) class TestPycurlClientHttpsProxy(TestPycurlClient): def make_request(self, method, url, headers, post_data, proxy=None): return super(TestPycurlClientHttpsProxy, self).make_request( method, url, headers, post_data, {"http": "http://slap:8888/", "https": "http://slap2:444/"}, ) def make_request_stream(self, method, url, headers, post_data, proxy=None): return super(TestPycurlClientHttpsProxy, self).make_request_stream( method, url, headers, post_data, {"http": "http://slap:8888/", "https": "http://slap2:444/"}, ) class TestAPIEncode(StripeClientTestCase): def test_encode_dict(self): body = {"foo": {"dob": {"month": 1}, "name": "bat"}} values = [t for t in _api_encode(body)] assert ("foo[dob][month]", 1) in values assert ("foo[name]", "bat") in values def test_encode_array(self): body = {"foo": [{"dob": {"month": 1}, "name": "bat"}]} values = [t for t in _api_encode(body)] assert ("foo[0][dob][month]", 1) in values assert ("foo[0][name]", "bat") in values class TestHTTPXClient(StripeClientTestCase, ClientTestBase): REQUEST_CLIENT: Type[_http_client.HTTPXClient] = _http_client.HTTPXClient @pytest.fixture def mock_response(self, mocker, request_mock): def mock_response(mock, body={}, code=200): result = mocker.Mock() result.content = body async def aiter_bytes(): yield bytes(body, "utf-8") def iter_bytes(): yield bytes(body, "utf-8") result.aiter_bytes = aiter_bytes result.iter_bytes = iter_bytes result.status_code = code result.headers = {} async def do_buffered(*args, **kwargs): return result async def do_stream(*args, **kwargs): return result async_mock = AsyncMock(side_effect=do_buffered) async_mock_stream = AsyncMock(side_effect=do_stream) request_mock.Client().send = mocker.Mock(return_value=result) request_mock.Client().request = mocker.Mock(return_value=result) request_mock.AsyncClient().send = async_mock_stream request_mock.AsyncClient().request = async_mock return result return mock_response @pytest.fixture def mock_error(self, mocker, request_mock): def mock_error(mock): # The first kind of request exceptions we catch mock.exceptions.SSLError = Exception request_mock.AsyncClient().request.side_effect = ( mock.exceptions.SSLError() ) return mock_error @pytest.fixture def check_call(self, request_mock, mocker): def check_call( mock, method, url, post_data, headers, is_streaming=False, timeout=80, times=None, ): times = times or 1 args = (method, url) kwargs = { "headers": headers, "data": post_data or {}, "timeout": timeout, "proxies": {"http": "http://slap/", "https": "http://slap/"}, } if is_streaming: kwargs["stream"] = True calls = [mocker.call(*args, **kwargs) for _ in range(times)] request_mock.Client().request.assert_has_calls(calls) return check_call @pytest.fixture def check_call_async(self, request_mock, mocker): def check_call_async( mock, method, url, post_data, headers, is_streaming=False, timeout=80, times=None, ): times = times or 1 args = (method, url) kwargs = { "headers": headers, "data": post_data, "timeout": timeout, "proxies": {"http": "http://slap/", "https": "http://slap/"}, } if is_streaming: kwargs["stream"] = True calls = [mocker.call(*args, **kwargs) for _ in range(times)] request_mock.AsyncClient().request.assert_has_calls(calls) return check_call_async def make_request(self, method, url, headers, post_data, timeout=80): client = self.REQUEST_CLIENT( verify_ssl_certs=True, proxy="http://slap/", timeout=timeout, allow_sync_methods=True, ) return client.request_with_retries(method, url, headers, post_data) def make_request_stream(self, method, url, headers, post_data, timeout=80): client = self.REQUEST_CLIENT( verify_ssl_certs=True, proxy="http://slap/", timeout=timeout, allow_sync_methods=True, ) return client.request_stream_with_retries( method, url, headers, post_data ) async def make_request_async( self, method, url, headers, post_data, timeout=80 ): client = self.REQUEST_CLIENT( verify_ssl_certs=True, proxy="http://slap/", timeout=timeout ) return await client.request_with_retries_async( method, url, headers, post_data ) async def make_request_stream_async( self, method, url, headers, post_data, timeout=80 ): client = self.REQUEST_CLIENT( verify_ssl_certs=True, proxy="http://slap/" ) return await client.request_stream_with_retries_async( method, url, headers, post_data ) @pytest.mark.anyio async def test_request_async( self, request_mock, mock_response, check_call_async ): mock_response(request_mock, '{"foo": "baz"}', 200) for method in VALID_API_METHODS: abs_url = self.valid_url data = {} if method != "post": abs_url = "%s?%s" % (abs_url, data) data = {} headers = {"my-header": "header val"} body, code, _ = await self.make_request_async( method, abs_url, headers, data ) assert code == 200 assert body == '{"foo": "baz"}' check_call_async(request_mock, method, abs_url, data, headers) @pytest.mark.anyio async def test_request_stream_async( self, mocker, request_mock, mock_response, check_call ): for method in VALID_API_METHODS: mock_response(request_mock, "some streamed content", 200) abs_url = self.valid_url data = "" if method != "post": abs_url = "%s?%s" % (abs_url, data) data = None headers = {"my-header": "header val"} stream, code, _ = await self.make_request_stream_async( method, abs_url, headers, data ) assert code == 200 # Here we need to convert and align all content on one type (string) # as some clients return a string stream others a byte stream. body_content = b"".join([x async for x in stream]) if hasattr(body_content, "decode"): body_content = body_content.decode("utf-8") assert body_content == "some streamed content" mocker.resetall() @pytest.mark.anyio async def test_exception(self, request_mock, mock_error): mock_error(request_mock) with pytest.raises(stripe.APIConnectionError): await self.make_request_async("get", self.valid_url, {}, None) @pytest.mark.anyio def test_timeout(self, request_mock, mock_response, check_call): headers = {"my-header": "header val"} data = {} mock_response(request_mock, '{"foo": "baz"}', 200) self.make_request("POST", self.valid_url, headers, data, timeout=5) check_call( request_mock, "POST", self.valid_url, data, headers, timeout=5 ) @pytest.mark.anyio async def test_timeout_async( self, request_mock, mock_response, check_call_async ): headers = {"my-header": "header val"} data = {} mock_response(request_mock, '{"foo": "baz"}', 200) await self.make_request_async( "POST", self.valid_url, headers, data, timeout=5 ) check_call_async( request_mock, "POST", self.valid_url, data, headers, timeout=5 ) @pytest.mark.anyio async def test_request_stream_forwards_stream_param( self, mocker, request_mock, mock_response, check_call ): # TODO pass def test_allow_sync_methods(self, request_mock, mock_response): client = self.REQUEST_CLIENT() assert client._client is None with pytest.raises(RuntimeError): client.request("GET", "http://foo", {}) with pytest.raises(RuntimeError): client.request_stream("GET", "http://foo", {}) client = self.REQUEST_CLIENT(allow_sync_methods=True) assert client._client is not None mock_response(request_mock, '{"foo": "baz"}', 200) client.request("GET", "http://foo", {}) mock_response(request_mock, '{"foo": "baz"}', 200) client.request_stream("GET", "http://foo", {}) class TestHTTPXClientRetryBehavior(TestHTTPXClient): responses = None @pytest.fixture def mock_retry(self, mocker, request_mock): def mock_retry( retry_error_num=0, no_retry_error_num=0, responses=None ): if responses is None: responses = [] # Mocking classes of exception we catch. Any group of exceptions # with the same inheritance pattern will work request_root_error_class = Exception request_mock.exceptions.RequestException = request_root_error_class no_retry_parent_class = LookupError no_retry_child_class = KeyError request_mock.exceptions.SSLError = no_retry_parent_class no_retry_errors = [no_retry_child_class()] * no_retry_error_num retry_parent_class = EnvironmentError retry_child_class = IOError request_mock.exceptions.Timeout = retry_parent_class request_mock.exceptions.ConnectionError = retry_parent_class retry_errors = [retry_child_class()] * retry_error_num # Include mock responses as possible side-effects # to simulate returning proper results after some exceptions results = retry_errors + no_retry_errors + responses request_mock.AsyncClient().request = AsyncMock(side_effect=results) self.responses = results return request_mock return mock_retry @pytest.fixture def check_call_numbers(self, check_call_async): valid_url = self.valid_url def check_call_numbers(times, is_streaming=False): check_call_async( None, "GET", valid_url, {}, {}, times=times, is_streaming=is_streaming, ) return check_call_numbers def max_retries(self): return 3 def make_client(self, **kwargs): client = self.REQUEST_CLIENT( verify_ssl_certs=True, timeout=80, proxy="http://slap/", **kwargs ) # Override sleep time to speed up tests client._sleep_time_seconds = lambda num_retries, response=None: 0.0001 # Override configured max retries return client def make_request(self, *args, **kwargs): client = self.make_client(allow_sync_methods=True) return client.request_with_retries( "GET", self.valid_url, {}, None, self.max_retries() ) def make_request_stream(self, *args, **kwargs): client = self.make_client(allow_sync_methods=True) return client.request_stream_with_retries( "GET", self.valid_url, {}, None, self.max_retries() ) async def make_request_async(self, *args, **kwargs): client = self.make_client() return await client.request_with_retries_async( "GET", self.valid_url, {}, None, self.max_retries() ) async def make_request_stream_async(self, *args, **kwargs): client = self.make_client() return await client.request_stream_with_retries_async( "GET", self.valid_url, {}, None, self.max_retries() ) @pytest.mark.anyio async def test_retry_error_until_response( self, mock_retry, mock_response, check_call_numbers, request_mock, mocker, ): mock_retry( retry_error_num=1, responses=[mock_response(request_mock, code=202)], ) _, code, _ = await self.make_request_async() assert code == 202 check_call_numbers(2) @pytest.mark.anyio async def test_retry_error_until_exceeded( self, mock_retry, mock_response, check_call_numbers ): mock_retry(retry_error_num=self.max_retries()) with pytest.raises(stripe.APIConnectionError): await self.make_request_async() check_call_numbers(self.max_retries()) @pytest.mark.anyio async def test_no_retry_error( self, mock_retry, mock_response, check_call_numbers ): mock_retry(no_retry_error_num=self.max_retries()) with pytest.raises(stripe.APIConnectionError): await self.make_request_async() check_call_numbers(1) @pytest.mark.anyio async def test_retry_codes( self, mock_retry, mock_response, request_mock, check_call_numbers ): mock_retry( responses=[ mock_response(request_mock, code=409), mock_response(request_mock, code=202), ] ) _, code, _ = await self.make_request_async() assert code == 202 check_call_numbers(2) @pytest.mark.anyio async def test_retry_codes_until_exceeded( self, mock_retry, mock_response, request_mock, check_call_numbers ): mock_retry( responses=[mock_response(request_mock, code=409)] * (self.max_retries() + 1) ) _, code, _ = await self.make_request_async() assert code == 409 check_call_numbers(self.max_retries() + 1) @pytest.fixture def connection_error(self): client = self.REQUEST_CLIENT() def connection_error(given_exception): with pytest.raises(stripe.APIConnectionError) as error: client._handle_request_error(given_exception) return error.value return connection_error def test_handle_request_error_should_retry( self, connection_error, mock_retry ): request_mock = mock_retry() error = connection_error(request_mock.exceptions.Timeout()) assert error.should_retry error = connection_error(request_mock.exceptions.ConnectionError()) assert error.should_retry # Skip inherited basic client tests def test_request(self): pass def test_request_async(self): pass def test_timeout(self): pass def test_timeout_async(self): pass class TestAIOHTTPClient(StripeClientTestCase, ClientTestBase): REQUEST_CLIENT: Type[_http_client.AIOHTTPClient] = ( _http_client.AIOHTTPClient ) @pytest.fixture def mock_response(self, mocker, request_mock): def mock_response(mock, body={}, code=200): class Content: def __aiter__(self): async def chunk(): yield ( bytes(body, "utf-8") if isinstance(body, str) else body ) return chunk() async def read(self): return body class Result: def __init__(self): self.content = Content() self.status = code self.headers = {} result = Result() request_mock.ClientSession().request = AsyncMock( return_value=result ) return result return mock_response @pytest.fixture def mock_error(self, mocker, request_mock): def mock_error(mock): # The first kind of request exceptions we catch mock.exceptions.SSLError = Exception request_mock.ClientSession().request.side_effect = ( mock.exceptions.SSLError() ) return mock_error @pytest.fixture def check_call(self, request_mock, mocker): def check_call( mock, method, url, post_data, headers, is_streaming=False, timeout=80, times=None, ): times = times or 1 args = (method, url) kwargs = { "headers": headers, "data": post_data or {}, "timeout": timeout, "proxies": {"http": "http://slap/", "https": "http://slap/"}, } if is_streaming: kwargs["stream"] = True calls = [mocker.call(*args, **kwargs) for _ in range(times)] request_mock.ClientSession().request.assert_has_calls(calls) return check_call @pytest.fixture def check_call_async(self, request_mock, mocker): def check_call_async( mock, method, url, post_data, headers, is_streaming=False, timeout=80, times=None, ): times = times or 1 args = (method, url) kwargs = { "headers": headers, "data": post_data, "timeout": timeout, "proxy": "http://slap/", } calls = [mocker.call(*args, **kwargs) for _ in range(times)] request_mock.ClientSession().request.assert_has_calls(calls) return check_call_async def make_request(self, method, url, headers, post_data, timeout=80): pass async def make_request_async( self, method, url, headers, post_data, timeout=80 ): client = self.REQUEST_CLIENT( verify_ssl_certs=True, proxy="http://slap/", timeout=timeout ) return await client.request_with_retries_async( method, url, headers, post_data ) async def make_request_stream_async( self, method, url, headers, post_data, timeout=80 ): client = self.REQUEST_CLIENT( verify_ssl_certs=True, proxy="http://slap/" ) return await client.request_stream_with_retries_async( method, url, headers, post_data ) def test_request(self): pass def test_request_stream(self): pass @pytest.mark.parametrize("anyio_backend", ["asyncio"]) @pytest.mark.anyio async def test_request_async( self, request_mock, mock_response, check_call_async ): mock_response(request_mock, '{"foo": "baz"}', 200) for method in VALID_API_METHODS: abs_url = self.valid_url data = {} if method != "post": abs_url = "%s?%s" % (abs_url, data) data = {} headers = {"my-header": "header val"} body, code, _ = await self.make_request_async( method, abs_url, headers, data ) assert code == 200 assert body == '{"foo": "baz"}' check_call_async(request_mock, method, abs_url, data, headers) @pytest.mark.parametrize("anyio_backend", ["asyncio"]) @pytest.mark.anyio async def test_request_stream_async( self, mocker, request_mock, mock_response, check_call ): for method in VALID_API_METHODS: mock_response(request_mock, "some streamed content", 200) abs_url = self.valid_url data = "" if method != "post": abs_url = "%s?%s" % (abs_url, data) data = None headers = {"my-header": "header val"} stream, code, _ = await self.make_request_stream_async( method, abs_url, headers, data ) assert code == 200 # Here we need to convert and align all content on one type (string) # as some clients return a string stream others a byte stream. body_content = b"".join([x async for x in stream]) if hasattr(body_content, "decode"): body_content = body_content.decode("utf-8") assert body_content == "some streamed content" mocker.resetall() @pytest.mark.parametrize("anyio_backend", ["asyncio"]) @pytest.mark.anyio async def test_exception(self, request_mock, mock_error): mock_error(request_mock) with pytest.raises(stripe.APIConnectionError): await self.make_request_async("get", self.valid_url, {}, None) def test_timeout( self, request_mock, mock_response, check_call, anyio_backend ): pass @pytest.mark.parametrize("anyio_backend", ["asyncio"]) @pytest.mark.anyio async def test_timeout_async( self, request_mock, mock_response, check_call_async ): headers = {"my-header": "header val"} data = {} mock_response(request_mock, '{"foo": "baz"}', 200) await self.make_request_async( "POST", self.valid_url, headers, data, timeout=5 ) check_call_async( request_mock, "POST", self.valid_url, data, headers, timeout=5 ) @pytest.mark.parametrize("anyio_backend", ["asyncio"]) @pytest.mark.anyio async def test_request_stream_forwards_stream_param( self, mocker, request_mock, mock_response, check_call ): # TODO pass class TestAIOHTTPClientRetryBehavior(TestAIOHTTPClient): responses = None @pytest.fixture def mock_retry(self, mocker, request_mock): def mock_retry( retry_error_num=0, no_retry_error_num=0, responses=None ): if responses is None: responses = [] # Mocking classes of exception we catch. Any group of exceptions # with the same inheritance pattern will work request_root_error_class = Exception request_mock.exceptions.RequestException = request_root_error_class no_retry_parent_class = LookupError no_retry_child_class = KeyError request_mock.exceptions.SSLError = no_retry_parent_class no_retry_errors = [no_retry_child_class()] * no_retry_error_num retry_parent_class = EnvironmentError retry_child_class = IOError request_mock.exceptions.Timeout = retry_parent_class request_mock.exceptions.ConnectionError = retry_parent_class retry_errors = [retry_child_class()] * retry_error_num # Include mock responses as possible side-effects # to simulate returning proper results after some exceptions results = retry_errors + no_retry_errors + responses request_mock.ClientSession().request = AsyncMock( side_effect=results ) self.responses = results return request_mock return mock_retry @pytest.fixture def check_call_numbers(self, check_call_async): valid_url = self.valid_url def check_call_numbers(times, is_streaming=False): check_call_async( None, "GET", valid_url, None, {}, times=times, is_streaming=is_streaming, ) return check_call_numbers def max_retries(self): return 3 def make_client(self): client = self.REQUEST_CLIENT( verify_ssl_certs=True, timeout=80, proxy="http://slap/" ) # Override sleep time to speed up tests client._sleep_time_seconds = lambda num_retries, response=None: 0.0001 # Override configured max retries return client def make_request(self, *args, **kwargs): pass def make_request_stream(self, *args, **kwargs): pass async def make_request_async(self, *args, **kwargs): client = self.make_client() return await client.request_with_retries_async( "GET", self.valid_url, {}, None, self.max_retries() ) async def make_request_stream_async(self, *args, **kwargs): client = self.make_client() return await client.request_stream_with_retries_async( "GET", self.valid_url, {}, None, self.max_retries() ) @pytest.mark.parametrize("anyio_backend", ["asyncio"]) @pytest.mark.anyio async def test_retry_error_until_response( self, mock_retry, mock_response, check_call_numbers, request_mock, mocker, ): mock_retry( retry_error_num=1, responses=[mock_response(request_mock, code=202)], ) _, code, _ = await self.make_request_async() assert code == 202 check_call_numbers(2) @pytest.mark.parametrize("anyio_backend", ["asyncio"]) @pytest.mark.anyio async def test_retry_error_until_exceeded( self, mock_retry, mock_response, check_call_numbers ): mock_retry(retry_error_num=self.max_retries()) with pytest.raises(stripe.APIConnectionError): await self.make_request_async() check_call_numbers(self.max_retries()) @pytest.mark.parametrize("anyio_backend", ["asyncio"]) @pytest.mark.anyio async def test_no_retry_error( self, mock_retry, mock_response, check_call_numbers ): mock_retry(no_retry_error_num=self.max_retries()) with pytest.raises(stripe.APIConnectionError): await self.make_request_async() check_call_numbers(1) @pytest.mark.parametrize("anyio_backend", ["asyncio"]) @pytest.mark.anyio async def test_retry_codes( self, mock_retry, mock_response, request_mock, check_call_numbers ): mock_retry( responses=[ mock_response(request_mock, code=409), mock_response(request_mock, code=202), ] ) _, code, _ = await self.make_request_async() assert code == 202 check_call_numbers(2) @pytest.mark.parametrize("anyio_backend", ["asyncio"]) @pytest.mark.anyio async def test_retry_codes_until_exceeded( self, mock_retry, mock_response, request_mock, check_call_numbers ): mock_retry( responses=[mock_response(request_mock, code=409)] * (self.max_retries() + 1) ) _, code, _ = await self.make_request_async() assert code == 409 check_call_numbers(self.max_retries() + 1) def connection_error(self, client, given_exception): with pytest.raises(stripe.APIConnectionError) as error: client._handle_request_error(given_exception) return error.value @pytest.mark.parametrize("anyio_backend", ["asyncio"]) @pytest.mark.anyio async def test_handle_request_error_should_retry( self, mock_retry, anyio_backend ): client = self.REQUEST_CLIENT() request_mock = mock_retry() error = self.connection_error( client, request_mock.exceptions.Timeout() ) assert error.should_retry error = self.connection_error( client, request_mock.exceptions.ConnectionError() ) assert error.should_retry # Skip inherited basic client tests def test_request(self): pass def test_request_async(self): pass def test_timeout(self): pass def test_timeout_async(self): pass ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/test_integration.py0000644000175100001770000004070314637354563017626 0ustar00runnerdockerimport platform from threading import Thread, Lock import json import warnings import time import httpx import aiohttp import stripe import pytest from queue import Queue from collections import defaultdict from typing import List, Dict, Tuple, Optional if platform.python_implementation() == "PyPy": pytest.skip("skip integration tests with PyPy", allow_module_level=True) from http.server import BaseHTTPRequestHandler, HTTPServer class MyTestHandler(BaseHTTPRequestHandler): num_requests = 0 requests = defaultdict(Queue) @classmethod def _add_request(cls, req): q = cls.requests[id(cls)] q.put(req) @classmethod def get_requests(cls, n) -> List[BaseHTTPRequestHandler]: reqs = [] for _ in range(n): reqs.append(cls.requests[id(cls)].get(False)) assert cls.requests[id(cls)].empty() return reqs def do_GET(self): return self._do_request() def do_POST(self): return self._do_request() def _do_request(self): n = self.__class__.num_requests self.__class__.num_requests += 1 self._add_request(self) provided_status, provided_headers, provided_body = self.do_request(n) status = provided_status or self.default_status headers = provided_headers or self.default_headers body = provided_body or self.default_body content_length = len(body) self.send_response(status) for header_name, header_value in headers.items(): self.send_header(header_name, header_value) self.send_header("Content-Length", str(content_length)) self.end_headers() self.wfile.write(body) return default_status = 200 default_headers = {"Content-Type": "application/json; charset=utf-8"} default_body = json.dumps({}).encode("utf-8") def do_request( self, n: int ) -> Tuple[Optional[int], Optional[Dict[str, str]], Optional[bytes]]: return (self.default_status, self.default_headers, self.default_body) class TestIntegration(object): mock_server = None @pytest.fixture(autouse=True) def close_mock_server(self): yield if self.mock_server: self.mock_server.shutdown() self.mock_server.server_close() self.mock_server_thread.join() @pytest.fixture(autouse=True) def setup_stripe(self): orig_attrs = { "api_base": stripe.api_base, "upload_api_base": stripe.upload_api_base, "api_key": stripe.api_key, "default_http_client": stripe.default_http_client, "enable_telemetry": stripe.enable_telemetry, "max_network_retries": stripe.max_network_retries, "proxy": stripe.proxy, } stripe.api_base = "http://localhost:12111" # stripe-mock stripe.upload_api_base = "http://localhost:12111" # stripe-mock stripe.api_key = "sk_test_123" stripe.default_http_client = None stripe._default_proxy = None stripe.enable_telemetry = False stripe.max_network_retries = 3 stripe.proxy = None yield stripe.api_base = orig_attrs["api_base"] stripe.upload_api_base = orig_attrs["api_base"] stripe.api_key = orig_attrs["api_key"] stripe.default_http_client = orig_attrs["default_http_client"] stripe.enable_telemetry = orig_attrs["enable_telemetry"] stripe.max_network_retries = orig_attrs["max_network_retries"] stripe.proxy = orig_attrs["proxy"] def setup_mock_server(self, handler): # Configure mock server. # Passing 0 as the port will cause a random free port to be chosen. self.mock_server = HTTPServer(("localhost", 0), handler) _, self.mock_server_port = self.mock_server.server_address # Start running mock server in a separate thread. # Daemon threads automatically shut down when the main process exits. self.mock_server_thread = Thread(target=self.mock_server.serve_forever) self.mock_server_thread.daemon = True self.mock_server_thread.start() def test_hits_api_base(self): class MockServerRequestHandler(MyTestHandler): pass self.setup_mock_server(MockServerRequestHandler) stripe.api_base = "http://localhost:%s" % self.mock_server_port stripe.Balance.retrieve() reqs = MockServerRequestHandler.get_requests(1) assert reqs[0].path == "/v1/balance" def test_hits_proxy_through_default_http_client(self): class MockServerRequestHandler(MyTestHandler): pass self.setup_mock_server(MockServerRequestHandler) stripe.proxy = "http://localhost:%s" % self.mock_server_port stripe.Balance.retrieve() assert MockServerRequestHandler.num_requests == 1 stripe.proxy = "http://bad-url" with warnings.catch_warnings(record=True) as w: stripe.Balance.retrieve() assert len(w) == 1 assert "stripe.proxy was updated after sending a request" in str( w[0].message ) assert MockServerRequestHandler.num_requests == 2 def test_hits_proxy_through_custom_client(self): class MockServerRequestHandler(MyTestHandler): pass self.setup_mock_server(MockServerRequestHandler) stripe.default_http_client = stripe.new_default_http_client( proxy="http://localhost:%s" % self.mock_server_port ) stripe.Balance.retrieve() assert MockServerRequestHandler.num_requests == 1 def test_hits_proxy_through_stripe_client_proxy(self): class MockServerRequestHandler(MyTestHandler): pass self.setup_mock_server(MockServerRequestHandler) client = stripe.StripeClient( "sk_test_123", proxy="http://localhost:%s" % self.mock_server_port, base_addresses={"api": "http://localhost:12111"}, ) client.balance.retrieve() assert MockServerRequestHandler.num_requests == 1 def test_hits_proxy_through_stripe_client_http_client(self): class MockServerRequestHandler(MyTestHandler): pass self.setup_mock_server(MockServerRequestHandler) client = stripe.StripeClient( "sk_test_123", http_client=stripe.http_client.new_default_http_client( proxy="http://localhost:%s" % self.mock_server_port ), base_addresses={"api": "http://localhost:12111"}, ) client.balance.retrieve() assert MockServerRequestHandler.num_requests == 1 def test_passes_client_telemetry_when_enabled(self): class MockServerRequestHandler(MyTestHandler): def do_request(self, req_num): if req_num == 0: time.sleep(31 / 1000) # 31 ms return [ 200, { "Content-Type": "application/json; charset=utf-8", "Request-Id": "req_%s" % (req_num + 1), }, None, ] self.setup_mock_server(MockServerRequestHandler) stripe.api_base = "http://localhost:%s" % self.mock_server_port stripe.enable_telemetry = True cus = stripe.Customer("cus_xyz") cus.description = "hello" cus.save() stripe.Customer.retrieve("cus_xyz") stripe.Customer.retrieve("cus_xyz") reqs = MockServerRequestHandler.get_requests(3) # req 1 assert not reqs[0].headers.get("x-stripe-client-telemetry") # req 2 telemetry_raw = reqs[1].headers.get("x-stripe-client-telemetry") assert telemetry_raw is not None telemetry = json.loads(telemetry_raw) assert "last_request_metrics" in telemetry duration_ms = telemetry["last_request_metrics"]["request_duration_ms"] # The first request took 31 ms, so the client perceived # latency shouldn't be outside this range. assert 30 < duration_ms < 300 usage = telemetry["last_request_metrics"]["usage"] assert usage == ["save"] # req 3 telemetry_raw = reqs[2].headers.get("x-stripe-client-telemetry") assert telemetry_raw is not None metrics = json.loads(telemetry_raw)["last_request_metrics"] assert metrics["request_id"] == "req_2" assert "usage" not in metrics def test_uses_thread_local_client_telemetry(self): class MockServerRequestHandler(MyTestHandler): local_num_requests = 0 seen_metrics = set() stats_lock = Lock() def do_request(self, _n): with self.__class__.stats_lock: self.__class__.local_num_requests += 1 req_num = self.__class__.local_num_requests raw_telemetry = self.headers.get("X-Stripe-Client-Telemetry") if raw_telemetry: telemetry = json.loads(raw_telemetry) req_id = telemetry["last_request_metrics"]["request_id"] with self.__class__.stats_lock: self.__class__.seen_metrics.add(req_id) return [ 200, { "Content-Type": "application/json; charset=utf-8", "Request-Id": "req_%s" % (req_num), }, None, ] self.setup_mock_server(MockServerRequestHandler) stripe.api_base = "http://localhost:%s" % self.mock_server_port stripe.enable_telemetry = True stripe.default_http_client = stripe.RequestsClient() def work(): stripe.Balance.retrieve() stripe.Balance.retrieve() threads = [Thread(target=work) for _ in range(10)] for t in threads: t.start() for t in threads: t.join() assert MockServerRequestHandler.num_requests == 20 assert len(MockServerRequestHandler.seen_metrics) == 10 @pytest.mark.anyio async def test_measures_stripe_client_telemetry(self): class MockServerRequestHandler(MyTestHandler): def do_request(self, req_num): return [ 200, { "Content-Type": "application/json; charset=utf-8", "Request-Id": "req_%s" % (req_num + 1), }, None, ] self.setup_mock_server(MockServerRequestHandler) stripe.enable_telemetry = True client = stripe.StripeClient( "sk_test_123", base_addresses={ "api": "http://localhost:%s" % self.mock_server_port }, ) await client.customers.create_async() await client.customers.create_async() reqs = MockServerRequestHandler.get_requests(2) telemetry_raw = reqs[1].headers.get("x-stripe-client-telemetry") assert telemetry_raw is not None telemetry = json.loads(telemetry_raw) assert "last_request_metrics" in telemetry usage = telemetry["last_request_metrics"]["usage"] assert usage == ["stripe_client", "async"] @pytest.mark.anyio @pytest.fixture(params=["aiohttp", "httpx"]) async def async_http_client(self, request, anyio_backend): if request.param == "httpx": return stripe.HTTPXClient() elif request.param == "aiohttp": if anyio_backend != "asyncio": return pytest.skip("aiohttp only works with asyncio") return stripe.AIOHTTPClient() else: raise ValueError(f"Unknown http client name: {request.param}") @pytest.fixture async def set_global_async_http_client(self, async_http_client): stripe.default_http_client = async_http_client async def test_async_success(self, set_global_async_http_client): class MockServerRequestHandler(MyTestHandler): default_body = '{"id": "cus_123", "object": "customer"}'.encode( "utf-8" ) pass self.setup_mock_server(MockServerRequestHandler) stripe.api_base = "http://localhost:%s" % self.mock_server_port cus = await stripe.Customer.create_async( description="My test customer" ) reqs = MockServerRequestHandler.get_requests(1) req = reqs[0] assert req.path == "/v1/customers" assert req.command == "POST" assert isinstance(cus, stripe.Customer) async def test_async_timeout(self, set_global_async_http_client): class MockServerRequestHandler(MyTestHandler): def do_request(self, n): time.sleep(0.02) return super().do_request(n) self.setup_mock_server(MockServerRequestHandler) stripe.api_base = "http://localhost:%s" % self.mock_server_port # If we set HTTPX's generic timeout the test is flaky (sometimes it's a ReadTimeout, sometimes its a ConnectTimeout) # so we set only the read timeout specifically. hc = stripe.default_http_client expected_message = "" if isinstance(hc, stripe.HTTPXClient): hc._timeout = httpx.Timeout(None, read=0.01) expected_message = "A ReadTimeout was raised" elif isinstance(hc, stripe.AIOHTTPClient): hc._timeout = aiohttp.ClientTimeout(sock_read=0.01) expected_message = "A ServerTimeoutError was raised" else: raise ValueError(f"Unknown http client: {hc.name}") stripe.max_network_retries = 0 exception = None try: await stripe.Customer.create_async(description="My test customer") except stripe.APIConnectionError as e: exception = e assert exception is not None assert expected_message in str(exception.user_message) async def test_async_retries(self, set_global_async_http_client): class MockServerRequestHandler(MyTestHandler): def do_request(self, n): if n == 0: return ( 500, {"Request-Id": "req_1"}, b'{"error": {"message": "Internal server error"}}', ) return (200, None, None) pass self.setup_mock_server(MockServerRequestHandler) stripe.api_base = "http://localhost:%s" % self.mock_server_port await stripe.Customer.create_async(description="My test customer") reqs = MockServerRequestHandler.get_requests(2) req = reqs[0] assert req.path == "/v1/customers" async def test_async_unretryable(self, set_global_async_http_client): class MockServerRequestHandler(MyTestHandler): def do_request(self, n): return ( 401, {"Request-Id": "req_1"}, b'{"error": {"message": "Unauthorized"}}', ) pass self.setup_mock_server(MockServerRequestHandler) stripe.api_base = "http://localhost:%s" % self.mock_server_port exception = None try: await stripe.Customer.create_async(description="My test customer") except stripe.AuthenticationError as e: exception = e MockServerRequestHandler.get_requests(1) assert exception is not None assert "Unauthorized" in str(exception.user_message) async def test_async_httpx_stream(self, set_global_async_http_client): class MockServerRequestHandler(MyTestHandler): def do_request(self, n): return (200, None, b"hello") self.setup_mock_server(MockServerRequestHandler) stripe.upload_api_base = "http://localhost:%s" % self.mock_server_port result = await stripe.Quote.pdf_async("qt_123") assert str(await result.read(), "utf-8") == "hello" async def test_async_httpx_stream_error( self, set_global_async_http_client ): class MockServerRequestHandler(MyTestHandler): def do_request(self, n): return (400, None, b'{"error": {"message": "bad request"}}') self.setup_mock_server(MockServerRequestHandler) stripe.upload_api_base = "http://localhost:%s" % self.mock_server_port try: await stripe.Quote.pdf_async("qt_123") except stripe.InvalidRequestError as e: assert "bad request" in str(e.user_message) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/test_multipart_data_generator.py0000644000175100001770000000566414637354563022372 0ustar00runnerdocker# -*- coding: utf-8 -*- import re import io from stripe._multipart_data_generator import MultipartDataGenerator class TestMultipartDataGenerator(object): def run_test_multipart_data_with_file(self, test_file): params = { "key1": b"ASCII value", "key2": "Üñìçôdé value", "key3": test_file, "key4": { "string": "Hello!", "int": 234, "float": 3.14159, "bool": True, "dict": {"foo": "bar"}, }, } generator = MultipartDataGenerator() generator.add_params(params) http_body = generator.get_post_data().decode("utf-8") assert re.search( r"Content-Disposition: form-data; name=\"key1\"", http_body ) assert re.search(r"ASCII value", http_body) assert re.search( r"Content-Disposition: form-data; name=\"key2\"", http_body ) assert re.search(r"Üñìçôdé value", http_body) assert re.search( r"Content-Disposition: form-data; name=\"key3\"; " r"filename=\".+\"", http_body, ) assert re.search(r"Content-Type: application/octet-stream", http_body) assert re.search( r"Content-Disposition: form-data; name=\"key4\[string\]\"", http_body, ) assert re.search(r"Hello!", http_body) assert re.search( r"Content-Disposition: form-data; name=\"key4\[int\]\"", http_body ) assert re.search(r"234", http_body) assert re.search( r"Content-Disposition: form-data; name=\"key4\[float\]\"", http_body, ) assert re.search(r"3.14159", http_body) assert re.search( r"Content-Disposition: form-data; name=\"key4\[bool\]\"", http_body ) assert re.search(r"True", http_body) assert re.search( r"Content-Disposition: form-data; name=\"key4\[dict\]\[foo\]\"", http_body, ) assert re.search(r"bar", http_body) test_file.seek(0) file_contents = test_file.read() if isinstance(file_contents, bytes): file_contents = file_contents.decode("utf-8") assert http_body.find(file_contents) != -1 def test_multipart_data_file_text(self): with open(__file__, mode="r") as test_file: self.run_test_multipart_data_with_file(test_file) def test_multipart_data_file_binary(self): with open(__file__, mode="rb") as test_file: self.run_test_multipart_data_with_file(test_file) def test_multipart_data_stringio(self): string = io.StringIO("foo") self.run_test_multipart_data_with_file(string) def test_multipart_data_unicode_file_name(self): string = io.StringIO("foo") string.name = "паспорт.png" self.run_test_multipart_data_with_file(string) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/test_oauth.py0000644000175100001770000000476314637354563016431 0ustar00runnerdockerfrom urllib.parse import parse_qs, urlparse import stripe class TestOAuth(object): def test_authorize_url(self): url = stripe.OAuth.authorize_url( scope="read_write", state="csrf_token", stripe_user={ "email": "test@example.com", "url": "https://example.com/profile/test", "country": "US", }, ) o = urlparse(url) params = parse_qs(o.query) url_express = stripe.OAuth.authorize_url( express=True, scope="read_write", state="csrf_token" ) o_express = urlparse(url_express) assert o.scheme == "https" assert o.netloc == "connect.stripe.com" assert o.path == "/oauth/authorize" assert o_express.path == "/express/oauth/authorize" assert params["client_id"] == ["ca_123"] assert params["scope"] == ["read_write"] assert params["stripe_user[email]"] == ["test@example.com"] assert params["stripe_user[url]"] == [ "https://example.com/profile/test" ] assert params["stripe_user[country]"] == ["US"] def test_token(self, http_client_mock): http_client_mock.stub_request( "post", path="/oauth/token", rbody='{"access_token":"sk_access_token","scope":"read_only","livemode":"false","token_type":"bearer","refresh_token":"sk_refresh_token","stripe_user_id":"acct_test","stripe_publishable_key":"pk_test"}', ) resp = stripe.OAuth.token( grant_type="authorization_code", code="this_is_an_authorization_code", ) http_client_mock.assert_requested( "post", api_base=stripe.connect_api_base, path="/oauth/token", post_data="grant_type=authorization_code&code=this_is_an_authorization_code", ) assert resp["access_token"] == "sk_access_token" def test_deauthorize(self, http_client_mock): http_client_mock.stub_request( "post", path="/oauth/deauthorize", rbody='{"stripe_user_id":"acct_test_deauth"}', ) resp = stripe.OAuth.deauthorize(stripe_user_id="acct_test_deauth") http_client_mock.assert_requested( "post", api_base=stripe.connect_api_base, path="/oauth/deauthorize", post_data="client_id=ca_123&stripe_user_id=acct_test_deauth", ) assert resp["stripe_user_id"] == "acct_test_deauth" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/test_oauth_error.py0000644000175100001770000000052214637354563017627 0ustar00runnerdocker# -*- coding: utf-8 -*- from stripe import oauth_error class TestOAuthError(object): def test_error_object(self): err = oauth_error.OAuthError( "message", "description", json_body={"error": "some_oauth_error"} ) assert err.error is not None assert err.error.error == "some_oauth_error" ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/test_request_options.py0000644000175100001770000000410714637354563020544 0ustar00runnerdockerfrom stripe._request_options import ( RequestOptions, merge_options, extract_options_from_dict, ) from stripe._requestor_options import RequestorOptions class TestRequestOptions(object): def test_merge(self): options = RequestorOptions( api_key="sk_test_123", stripe_account="acct_123", base_addresses={"api": "https://api.stripe.com"}, ) other: RequestOptions = { "api_key": "sk_test_456", "stripe_version": "2020-01-01", "headers": {"foo": "bar"}, } merged = merge_options(options, other) assert merged.get("api_key") == "sk_test_456" assert merged.get("stripe_version") == "2020-01-01" assert merged.get("stripe_account") == "acct_123" assert merged.get("headers") == {"foo": "bar"} def test_merge_none(self): options = RequestorOptions( api_key="sk_test_123", stripe_account="acct_123", base_addresses={"api": "https://api.stripe.com"}, ) merged = merge_options(options, None) assert merged.get("api_key") == "sk_test_123" assert merged.get("stripe_version") is None assert merged.get("stripe_account") == "acct_123" assert merged.get("headers") is None def test_extract_from_dict(self): options, remaining = extract_options_from_dict( { "api_key": "sk_test_123", "stripe_version": "2020-01-01", "stripe_account": "acct_123", "idempotency_key": "idemp_123", "headers": { "X-Stripe-Header": "Some-Value", }, "foo": "bar", } ) assert options.get("api_key") == "sk_test_123" assert options.get("stripe_version") == "2020-01-01" assert options.get("stripe_account") == "acct_123" assert options.get("idempotency_key") == "idemp_123" assert options.get("headers") == {"X-Stripe-Header": "Some-Value"} assert remaining == {"foo": "bar"} ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/test_requestor_options.py0000644000175100001770000000522214637354563021104 0ustar00runnerdockerimport stripe from stripe._requestor_options import ( RequestorOptions, _GlobalRequestorOptions, ) class TestRequestorOptions(object): def test_to_dict(self): requestor = RequestorOptions( api_key="sk_test_123", stripe_account="acct_123", stripe_version="2019-12-03", base_addresses={ "api": "https://api.example.com", "connect": "https://connect.example.com", "files": "https://files.example.com", }, max_network_retries=3, ) assert requestor.to_dict() == { "api_key": "sk_test_123", "stripe_account": "acct_123", "stripe_version": "2019-12-03", "base_addresses": { "api": "https://api.example.com", "connect": "https://connect.example.com", "files": "https://files.example.com", }, "max_network_retries": 3, } def test_global_options_get_updated( self, ): global_options = _GlobalRequestorOptions() orig_api_key = stripe.api_key orig_api_base = stripe.api_base orig_connect_base = stripe.connect_api_base orig_upload_base = stripe.upload_api_base orig_max_network_retries = stripe.max_network_retries assert global_options.api_key == orig_api_key assert global_options.base_addresses["api"] == orig_api_base assert global_options.base_addresses["connect"] == orig_connect_base assert global_options.base_addresses["files"] == orig_upload_base assert global_options.stripe_account is None stripe.api_key = "sk_test_555555555" stripe.api_base = "https://api.example.com" stripe.connect_api_base = "https://connect.example.com" stripe.upload_api_base = "https://upload.example.com" stripe.max_network_retries = 3 assert global_options.api_key == "sk_test_555555555" assert ( global_options.base_addresses["api"] == "https://api.example.com" ) assert ( global_options.base_addresses["connect"] == "https://connect.example.com" ) assert ( global_options.base_addresses["files"] == "https://upload.example.com" ) assert global_options.stripe_account is None assert global_options.max_network_retries == 3 stripe.api_key = orig_api_key stripe.api_base = orig_api_base stripe.connect_api_base = orig_connect_base stripe.upload_api_base = orig_upload_base stripe.max_network_retries = orig_max_network_retries ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/test_stripe_client.py0000644000175100001770000003106414637354563020147 0ustar00runnerdockerfrom __future__ import absolute_import, division, print_function import stripe import pytest from stripe._http_client import new_default_http_client class TestStripeClient(object): def test_constructor_with_posargs(self): client = stripe.StripeClient("sk_test_456") assert client._requestor.api_key == "sk_test_456" def test_v1_customers_retrieve( self, stripe_mock_stripe_client, http_client_mock ): method = "get" path = "/v1/customers/cus_xxxxxxxxxxxxx" http_client_mock.stub_request( method, path=path, rbody='{"id": "cus_xxxxxxxxxxxxx","object": "customer"}', rcode=200, rheaders={}, ) customer = stripe_mock_stripe_client.customers.retrieve( "cus_xxxxxxxxxxxxx" ) http_client_mock.assert_requested(method, path=path) assert customer.id is not None def test_no_api_key(self): with pytest.raises(stripe.error.AuthenticationError): stripe.StripeClient(None) # type: ignore def test_http_client_and_options_overlap(self): with pytest.raises(ValueError): stripe.StripeClient( api_key="sk_test_123", http_client=new_default_http_client(), proxy="http://localhost:8080", ) with pytest.raises(ValueError): stripe.StripeClient( api_key="sk_test_123", http_client=new_default_http_client(), verify_ssl_certs=False, ) def test_client_level_options(self, http_client_mock): method = "get" path = "/v1/customers/cus_xxxxxxxxxxxxx" http_client_mock.stub_request( method, path=path, rbody='{"id": "cus_xxxxxxxxxxxxx","object": "customer"}', rcode=200, rheaders={}, ) api_base = "https://example.com" api_key = "sk_test_456" stripe_account = "acct_123" stripe_client = stripe.StripeClient( api_key=api_key, http_client=http_client_mock.get_mock_http_client(), base_addresses={"api": api_base}, stripe_account=stripe_account, ) stripe_client.customers.retrieve("cus_xxxxxxxxxxxxx") http_client_mock.assert_requested( method, api_base=api_base, path=path, api_key=api_key, stripe_account=stripe_account, stripe_version=stripe.api_version, ) def test_uses_default_api_base_if_none_specified(self, http_client_mock): http_client_mock.stub_request( "get", "/v1/customers/cus_xxxxxxxxxxxxx", ) stripe.StripeClient( api_key="sk_test_123", http_client=http_client_mock.get_mock_http_client(), ).customers.retrieve("cus_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx", api_key="sk_test_123", api_base=stripe.DEFAULT_API_BASE, ) def test_request_level_options(self, http_client_mock): method = "get" path = "/v1/customers/cus_xxxxxxxxxxxxx" http_client_mock.stub_request( method, path=path, rbody='{"id": "cus_xxxxxxxxxxxxx","object": "customer"}', rcode=200, rheaders={}, ) client_api_base = "https://example.com" client_api_key = "sk_test_456" client_stripe_account = "acct_123" request_api_key = "sk_test_789" request_stripe_account = "acct_456" stripe_client = stripe.StripeClient( api_key=client_api_key, http_client=http_client_mock.get_mock_http_client(), base_addresses={"api": client_api_base}, stripe_account=client_stripe_account, ) stripe_client.customers.retrieve( "cus_xxxxxxxxxxxxx", options={ "api_key": request_api_key, "stripe_account": request_stripe_account, }, ) http_client_mock.assert_requested( method, api_base=client_api_base, path=path, api_key=request_api_key, stripe_account=request_stripe_account, stripe_version=stripe.api_version, ) def test_separate_clients_have_separate_options(self, http_client_mock): method = "get" path = "/v1/customers/cus_xxxxxxxxxxxxx" http_client_mock.stub_request( method, path=path, rbody='{"id": "cus_xxxxxxxxxxxxx","object": "customer"}', rcode=200, rheaders={}, ) stripe_client_1 = stripe.StripeClient( api_key="sk_test_123", base_addresses={"api": "https://example.com"}, http_client=http_client_mock.get_mock_http_client(), ) stripe_client_2 = stripe.StripeClient( api_key="sk_test_456", base_addresses={"api": "https://example2.com"}, http_client=http_client_mock.get_mock_http_client(), ) stripe_client_1.customers.retrieve("cus_xxxxxxxxxxxxx") stripe_client_2.customers.retrieve("cus_xxxxxxxxxxxxx") http_client_mock.assert_requested( method, api_base="https://example.com", path=path, api_key="sk_test_123", stripe_version=stripe.api_version, ) http_client_mock.assert_requested( method, api_base="https://example2.com", path=path, api_key="sk_test_456", stripe_version=stripe.api_version, ) def test_carries_over_requestor_options_to_resource( self, http_client_mock ): client = stripe.StripeClient( api_key="sk_test_123", stripe_account="acct_123", base_addresses={ "api": "https://example.com", }, http_client=http_client_mock.get_mock_http_client(), ) http_client_mock.stub_request( "get", path="/v1/customers/cus_xxxxxxxxxxxxx", rbody='{"id": "cus_xxxxxxxxxxxxx","object": "customer"}', rcode=200, rheaders={}, ) cus = client.customers.retrieve("cus_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx", api_key="sk_test_123", stripe_account="acct_123", api_base="https://example.com", ) http_client_mock.stub_request( "delete", path="/v1/customers/cus_xxxxxxxxxxxxx", rbody='{"id": "cus_xxxxxxxxxxxxx","object": "customer"}', rcode=200, rheaders={}, ) cus.delete() http_client_mock.assert_requested( "delete", path="/v1/customers/cus_xxxxxxxxxxxxx", api_key="sk_test_123", stripe_account="acct_123", api_base="https://example.com", ) def test_user_options_are_not_mutated(self, http_client_mock): client = stripe.StripeClient( http_client=http_client_mock.get_mock_http_client(), api_key="sk_test_abc", ) http_client_mock.stub_request( "get", path="/v1/accounts", rbody='{"data": [{"id": "x"}], "next_page": "page_2"}', rcode=200, rheaders={}, ) my_options: stripe.RequestOptions = {"api_key": "sk_test_xyz"} client.accounts.list(options=my_options) assert my_options == {"api_key": "sk_test_xyz"} def test_carries_over_request_options_to_resource(self, http_client_mock): client = stripe.StripeClient( api_key="sk_test_123", stripe_account="acct_123", stripe_version="2019-12-03", http_client=http_client_mock.get_mock_http_client(), ) http_client_mock.stub_request( "get", path="/v1/customers/cus_xxxxxxxxxxxxx", rbody='{"id": "cus_xxxxxxxxxxxxx","object": "customer"}', rcode=200, rheaders={}, ) cus = client.customers.retrieve( "cus_xxxxxxxxxxxxx", {}, { "api_key": "sk_test_456", "stripe_version": "2023-12-03", "stripe_account": "acct_456", }, ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx", api_key="sk_test_456", stripe_account="acct_456", stripe_version="2023-12-03", ) http_client_mock.stub_request( "delete", path="/v1/customers/cus_xxxxxxxxxxxxx", rbody='{"id": "cus_xxxxxxxxxxxxx","object": "customer"}', rcode=200, rheaders={}, ) cus.delete() assert cus._requestor is not client._requestor http_client_mock.assert_requested( "delete", path="/v1/customers/cus_xxxxxxxxxxxxx", api_key="sk_test_456", stripe_account="acct_456", stripe_version="2023-12-03", ) def test_respects_max_network_retries_in_request_options( self, http_client_mock ): client = stripe.StripeClient( api_key="sk_test_123", http_client=http_client_mock.get_mock_http_client(), ) http_client_mock.stub_request( "get", path="/v1/customers/cus_xxxxxxxxxxxxx", rbody='{"id": "cus_xxxxxxxxxxxxx","object": "customer"}', rcode=200, rheaders={}, ) client.customers.retrieve( "cus_xxxxxxxxxxxxx", {}, { "max_network_retries": 2, }, ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx", api_key="sk_test_123", max_network_retries=2, ) def test_respects_max_network_retries_in_client_options( self, http_client_mock ): client = stripe.StripeClient( api_key="sk_test_123", http_client=http_client_mock.get_mock_http_client(), max_network_retries=2, ) http_client_mock.stub_request( "get", path="/v1/customers/cus_xxxxxxxxxxxxx", rbody='{"id": "cus_xxxxxxxxxxxxx","object": "customer"}', rcode=200, rheaders={}, ) client.customers.retrieve("cus_xxxxxxxxxxxxx") http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx", api_key="sk_test_123", max_network_retries=2, ) def test_prefers_max_network_retries_in_request_options( self, http_client_mock ): client = stripe.StripeClient( api_key="sk_test_123", http_client=http_client_mock.get_mock_http_client(), max_network_retries=2, ) http_client_mock.stub_request( "get", path="/v1/customers/cus_xxxxxxxxxxxxx", rbody='{"id": "cus_xxxxxxxxxxxxx","object": "customer"}', rcode=200, rheaders={}, ) client.customers.retrieve( "cus_xxxxxxxxxxxxx", options={"max_network_retries": 0} ) http_client_mock.assert_requested( "get", path="/v1/customers/cus_xxxxxxxxxxxxx", api_key="sk_test_123", max_network_retries=0, ) def test_stripe_client_sends_usage( self, stripe_mock_stripe_client, http_client_mock ): path = "/v1/customers/cus_xxxxxxxxxxxxx" http_client_mock.stub_request( "get", path=path, rbody='{"id": "cus_xxxxxxxxxxxxx","object": "customer"}', rcode=200, rheaders={}, ) customer = stripe_mock_stripe_client.customers.retrieve( "cus_xxxxxxxxxxxxx" ) http_client_mock.assert_requested( "get", path=path, usage=["stripe_client"] ) http_client_mock.stub_request( "delete", path=path, rbody='{"id": "cus_xxxxxxxxxxxxx","object": "customer", "deleted": true}', rcode=200, rheaders={}, ) customer.delete() http_client_mock.assert_requested("delete", path=path, usage=None) ././@PaxHeader0000000000000000000000000000002600000000000010213 xustar0022 mtime=1719523699.0 stripe-10.1.0/tests/test_stripe_object.py0000644000175100001770000003333214637354563020137 0ustar00runnerdockerimport datetime import json import pickle from copy import copy, deepcopy import pytest import stripe # We use this because it has a map, "restriction.currency_options" from string -> CurrencyOptions nested class. SAMPLE_PROMOTION_CODE = json.loads( """{ "id": "promo_1NzO4FIFdHa3DensTcbAA0mz", "object": "promotion_code", "restrictions": { "currency_options": { "gbp": { "minimum_amount": 10 }, "usd": { "minimum_amount": 5 } } } } """ ) SAMPLE_INVOICE = json.loads( """{ "id": "in_xyz", "object": "invoice", "automatic_tax": { "enabled": false, "status": null }, "created": 1694725031, "lines": { "object": "list", "data": [ { "id": "sli_xyz", "object": "line_item", "period": { "end": 1697316491, "start": 1694724491 }, "plan": { "id": "price_xyz", "object": "plan" }, "price": { "id": "price_xyz", "object": "price", "billing_scheme": "per_unit", "recurring": { "aggregate_usage": null, "interval": "month", "interval_count": 1, "trial_period_days": null, "usage_type": "licensed" } } } ], "has_more": false, "total_count": 1, "url": "/v1/invoices/in_1NqMb5IFdHa3DenshEllwgEX/lines" }, "livemode": false, "next_payment_attempt": null, "shipping_cost": { "taxes": [{"amount": 10, "rate": {"id": "rate_xyz", "object": "tax_rate", "active": false}}] } } """ ) class TestStripeObject(object): def test_initializes_with_parameters(self): obj = stripe.stripe_object.StripeObject( "foo", "bar", myparam=5, yourparam="boo" ) assert obj.id == "foo" assert obj.api_key == "bar" def test_access(self): obj = stripe.stripe_object.StripeObject("myid", "mykey", myparam=5) # Empty with pytest.raises(AttributeError): obj.myattr with pytest.raises(KeyError): obj["myattr"] assert obj.get("myattr", "def") == "def" assert obj.get("myattr") is None # Setters obj.myattr = "myval" obj["myitem"] = "itval" assert obj.setdefault("mydef", "sdef") == "sdef" # Getters assert obj.setdefault("myattr", "sdef") == "myval" assert obj.myattr == "myval" assert obj["myattr"] == "myval" assert obj.get("myattr") == "myval" assert sorted(obj.keys()) == ["id", "myattr", "mydef", "myitem"] assert sorted(obj.values()) == ["itval", "myid", "myval", "sdef"] # Illegal operations with pytest.raises(ValueError): obj.foo = "" def test_refresh_from(self, mocker): obj = stripe.stripe_object.StripeObject.construct_from( {"foo": "bar", "trans": "me"}, "mykey" ) assert obj.api_key == "mykey" assert obj.foo == "bar" assert obj["trans"] == "me" assert obj.stripe_version is stripe.api_version assert obj.stripe_account is None assert obj.last_response is None last_response = mocker.Mock() obj.refresh_from( {"foo": "baz", "johnny": 5}, "key2", stripe_version="2017-08-15", stripe_account="acct_foo", last_response=last_response, ) assert obj.johnny == 5 assert obj.foo == "baz" with pytest.raises(AttributeError): obj.trans assert obj.api_key == "key2" assert obj.stripe_version == "2017-08-15" assert obj.stripe_account == "acct_foo" assert obj.last_response == last_response obj.refresh_from( {"trans": 4, "metadata": {"amount": 42}}, "key2", True ) assert obj.foo == "baz" assert obj.trans == 4 def test_passing_nested_refresh(self): obj = stripe.stripe_object.StripeObject.construct_from( {"foos": {"type": "list", "data": [{"id": "nested"}]}}, "key", stripe_account="acct_foo", ) nested = obj.foos.data[0] assert obj.api_key == "key" assert nested.id == "nested" assert nested.api_key == "key" assert nested.stripe_account == "acct_foo" def test_refresh_from_nested_object(self): obj = stripe.Invoice.construct_from(SAMPLE_INVOICE, "key") assert len(obj.lines) == 1 # Does a list get deserialized to the correct class? assert isinstance(obj.lines, stripe.ListObject) # Do items within a list get deserialized to the correct class? assert isinstance(obj.lines.data[0], stripe.InvoiceLineItem) # Do references to other top-level resources get deserialized to the correct class? assert isinstance(obj.lines.data[0].price, stripe.Price) assert obj.lines.data[0].price.billing_scheme == "per_unit" # Do inner classes on referenced top-level resources get deserialized to the correct inner class. assert isinstance( obj.lines.data[0].price.recurring, stripe.Price.Recurring ) assert isinstance( obj.lines.data[0].price.recurring, stripe.Price.Recurring ) # Test: do nested objects get deserialized to the correct inner class? assert isinstance(obj.automatic_tax, stripe.Invoice.AutomaticTax) assert isinstance(obj.shipping_cost, stripe.Invoice.ShippingCost) # Test: do nested objects inside lists get deserialized to the correct inner class? assert isinstance( obj.shipping_cost.taxes[0], stripe.Invoice.ShippingCost.Tax ) def test_refresh_from_nested_object_can_be_paged(self): obj = stripe.Invoice.construct_from(SAMPLE_INVOICE, "key") assert len(obj.lines) == 1 assert isinstance(obj.lines, stripe.ListObject) seen = [item["id"] for item in obj.lines.auto_paging_iter()] assert seen == ["sli_xyz"] assert isinstance(obj.lines.data[0], stripe.InvoiceLineItem) assert isinstance( obj.lines.data[0].price, stripe.stripe_object.StripeObject ) assert isinstance(obj.lines.data[0].price, stripe.Price) assert obj.lines.data[0].price.billing_scheme == "per_unit" def test_refresh_on_map_to_nested_object(self): obj = stripe.PromotionCode.construct_from(SAMPLE_PROMOTION_CODE, "key") assert isinstance( obj.restrictions.currency_options, dict, ) assert not isinstance( obj.restrictions.currency_options, stripe.stripe_object.StripeObject, ) assert isinstance( obj.restrictions.currency_options["gbp"], stripe.PromotionCode.Restrictions.CurrencyOptions, ) def test_to_json(self): obj = stripe.stripe_object.StripeObject.construct_from( SAMPLE_INVOICE, "key" ) self.check_invoice_data(json.loads(str(obj))) def check_invoice_data(self, data): # Check rough structure assert len(list(data.keys())) == 8 assert len(list(data["lines"]["data"][0].keys())) == 5 assert len(data["lines"]["data"]) == 1 # Check various data types assert data["created"] == 1694725031 assert data["next_payment_attempt"] is None assert data["livemode"] is False assert ( data["lines"]["data"][0]["price"]["billing_scheme"] == "per_unit" ) def test_repr(self): obj = stripe.stripe_object.StripeObject("foo", "bar", myparam=5) obj["object"] = "\u4e00boo\u1f00" obj.date = datetime.datetime.fromtimestamp(1511136000) res = repr(obj) assert "